1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::mixedFixedValueSlipFvPatchField
29 A mixed boundary type that blends between fixedValue and slip, as opposed
30 to the standard mixed condition that blends between fixedValue and
31 fixedGradient; required to implement maxwellSlipU condition.
34 mixedFixedValueSlipFvPatchField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef mixedFixedValueSlipFvPatchField_H
39 #define mixedFixedValueSlipFvPatchField_H
41 #include "transformFvPatchField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class mixedFixedValueSlipFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
53 class mixedFixedValueSlipFvPatchField
55 public transformFvPatchField<Type>
59 //- Value field used for boundary condition
60 Field<Type> refValue_;
62 //- Fraction (0-1) of value used for boundary condition
63 scalarField valueFraction_;
67 //- Runtime type information
68 TypeName("mixedFixedValueSlip");
73 //- Construct from patch and internal field
74 mixedFixedValueSlipFvPatchField
77 const DimensionedField<Type, volMesh>&
80 //- Construct from patch, internal field and dictionary
81 mixedFixedValueSlipFvPatchField
84 const DimensionedField<Type, volMesh>&,
88 //- Construct by mapping given mixedFixedValueSlipFvPatchField
90 mixedFixedValueSlipFvPatchField
92 const mixedFixedValueSlipFvPatchField<Type>&,
94 const DimensionedField<Type, volMesh>&,
95 const fvPatchFieldMapper&
99 mixedFixedValueSlipFvPatchField
101 const mixedFixedValueSlipFvPatchField<Type>&
104 //- Construct and return a clone
105 virtual tmp<fvPatchField<Type> > clone() const
107 return tmp<fvPatchField<Type> >
109 new mixedFixedValueSlipFvPatchField<Type>(*this)
113 //- Construct as copy setting internal field reference
114 mixedFixedValueSlipFvPatchField
116 const mixedFixedValueSlipFvPatchField<Type>&,
117 const DimensionedField<Type, volMesh>&
120 //- Construct and return a clone setting internal field reference
121 virtual tmp<fvPatchField<Type> > clone
123 const DimensionedField<Type, volMesh>& iF
126 return tmp<fvPatchField<Type> >
128 new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
136 //- Map (and resize as needed) from self given a mapping object
139 const fvPatchFieldMapper&
142 //- Reverse map the given fvPatchField onto this fvPatchField
145 const fvPatchField<Type>&,
149 // Return defining fields
151 virtual Field<Type>& refValue()
156 virtual const Field<Type>& refValue() const
161 virtual scalarField& valueFraction()
163 return valueFraction_;
166 virtual const scalarField& valueFraction() const
168 return valueFraction_;
171 // Evaluation functions
173 //- Return gradient at boundary
174 virtual tmp<Field<Type> > snGrad() const;
176 //- Evaluate the patch field
177 virtual void evaluate
179 const Pstream::commsTypes commsType=Pstream::blocking
182 //- Return face-gradient transform diagonal
183 virtual tmp<Field<Type> > snGradTransformDiag() const;
187 virtual void write(Ostream&) const;
192 virtual void operator=(const UList<Type>&) {}
194 virtual void operator=(const fvPatchField<Type>&) {}
195 virtual void operator+=(const fvPatchField<Type>&) {}
196 virtual void operator-=(const fvPatchField<Type>&) {}
197 virtual void operator*=(const fvPatchField<scalar>&) {}
198 virtual void operator/=(const fvPatchField<scalar>&) {}
200 virtual void operator+=(const Field<Type>&) {}
201 virtual void operator-=(const Field<Type>&) {}
203 virtual void operator*=(const Field<scalar>&) {}
204 virtual void operator/=(const Field<scalar>&) {}
206 virtual void operator=(const Type&) {}
207 virtual void operator+=(const Type&) {}
208 virtual void operator-=(const Type&) {}
209 virtual void operator*=(const scalar) {}
210 virtual void operator/=(const scalar) {}
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 # include "mixedFixedValueSlipFvPatchField.C"
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //