1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::mixedFixedValueSlipFvPatchField
28 A mixed boundary type that blends between fixedValue and slip, as opposed
29 to the standard mixed condition that blends between fixedValue and
30 fixedGradient; required to implement maxwellSlipU condition.
33 mixedFixedValueSlipFvPatchField.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef mixedFixedValueSlipFvPatchField_H
38 #define mixedFixedValueSlipFvPatchField_H
40 #include "transformFvPatchField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class mixedFixedValueSlipFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
52 class mixedFixedValueSlipFvPatchField
54 public transformFvPatchField<Type>
58 //- Value field used for boundary condition
59 Field<Type> refValue_;
61 //- Fraction (0-1) of value used for boundary condition
62 scalarField valueFraction_;
66 //- Runtime type information
67 TypeName("mixedFixedValueSlip");
72 //- Construct from patch and internal field
73 mixedFixedValueSlipFvPatchField
76 const DimensionedField<Type, volMesh>&
79 //- Construct from patch, internal field and dictionary
80 mixedFixedValueSlipFvPatchField
83 const DimensionedField<Type, volMesh>&,
87 //- Construct by mapping given mixedFixedValueSlipFvPatchField
89 mixedFixedValueSlipFvPatchField
91 const mixedFixedValueSlipFvPatchField<Type>&,
93 const DimensionedField<Type, volMesh>&,
94 const fvPatchFieldMapper&
98 mixedFixedValueSlipFvPatchField
100 const mixedFixedValueSlipFvPatchField<Type>&
103 //- Construct and return a clone
104 virtual tmp<fvPatchField<Type> > clone() const
106 return tmp<fvPatchField<Type> >
108 new mixedFixedValueSlipFvPatchField<Type>(*this)
112 //- Construct as copy setting internal field reference
113 mixedFixedValueSlipFvPatchField
115 const mixedFixedValueSlipFvPatchField<Type>&,
116 const DimensionedField<Type, volMesh>&
119 //- Construct and return a clone setting internal field reference
120 virtual tmp<fvPatchField<Type> > clone
122 const DimensionedField<Type, volMesh>& iF
125 return tmp<fvPatchField<Type> >
127 new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
135 //- Map (and resize as needed) from self given a mapping object
138 const fvPatchFieldMapper&
141 //- Reverse map the given fvPatchField onto this fvPatchField
144 const fvPatchField<Type>&,
148 // Return defining fields
150 virtual Field<Type>& refValue()
155 virtual const Field<Type>& refValue() const
160 virtual scalarField& valueFraction()
162 return valueFraction_;
165 virtual const scalarField& valueFraction() const
167 return valueFraction_;
170 // Evaluation functions
172 //- Return gradient at boundary
173 virtual tmp<Field<Type> > snGrad() const;
175 //- Evaluate the patch field
176 virtual void evaluate
178 const Pstream::commsTypes commsType=Pstream::blocking
181 //- Return face-gradient transform diagonal
182 virtual tmp<Field<Type> > snGradTransformDiag() const;
186 virtual void write(Ostream&) const;
191 virtual void operator=(const UList<Type>&) {}
193 virtual void operator=(const fvPatchField<Type>&) {}
194 virtual void operator+=(const fvPatchField<Type>&) {}
195 virtual void operator-=(const fvPatchField<Type>&) {}
196 virtual void operator*=(const fvPatchField<scalar>&) {}
197 virtual void operator/=(const fvPatchField<scalar>&) {}
199 virtual void operator+=(const Field<Type>&) {}
200 virtual void operator-=(const Field<Type>&) {}
202 virtual void operator*=(const Field<scalar>&) {}
203 virtual void operator/=(const Field<scalar>&) {}
205 virtual void operator=(const Type&) {}
206 virtual void operator+=(const Type&) {}
207 virtual void operator-=(const Type&) {}
208 virtual void operator*=(const scalar) {}
209 virtual void operator/=(const scalar) {}
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 } // End namespace Foam
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 # include "mixedFixedValueSlipFvPatchField.C"
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 // ************************************************************************* //