1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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
25 \*---------------------------------------------------------------------------*/
27 #include "wedgeFvPatch.H"
28 #include "wedgeFvPatchField.H"
29 #include "transformField.H"
30 #include "symmTransform.H"
31 #include "diagTensor.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 wedgeFvPatchField<Type>::wedgeFvPatchField
44 const DimensionedField<Type, volMesh>& iF
47 transformFvPatchField<Type>(p, iF)
52 wedgeFvPatchField<Type>::wedgeFvPatchField
54 const wedgeFvPatchField<Type>& ptf,
56 const DimensionedField<Type, volMesh>& iF,
57 const fvPatchFieldMapper& mapper
60 transformFvPatchField<Type>(ptf, p, iF, mapper)
62 if (!isType<wedgeFvPatch>(this->patch()))
66 "wedgeFvPatchField<Type>::wedgeFvPatchField\n"
68 " const wedgeFvPatchField<Type>& ptf,\n"
69 " const fvPatch& p,\n"
70 " const DimensionedField<Type, volMesh>& iF,\n"
71 " const fvPatchFieldMapper& mapper\n"
73 ) << "\n patch type '" << p.type()
74 << "' not constraint type '" << typeName << "'"
75 << "\n for patch " << p.name()
76 << " of field " << this->dimensionedInternalField().name()
77 << " in file " << this->dimensionedInternalField().objectPath()
78 << exit(FatalIOError);
84 wedgeFvPatchField<Type>::wedgeFvPatchField
87 const DimensionedField<Type, volMesh>& iF,
88 const dictionary& dict
91 transformFvPatchField<Type>(p, iF, dict)
93 if (!isType<wedgeFvPatch>(p))
97 "wedgeFvPatchField<Type>::wedgeFvPatchField\n"
99 " const fvPatch& p,\n"
100 " const Field<Type>& field,\n"
101 " dictionary& dict\n"
104 ) << "\n patch type '" << p.type()
105 << "' not constraint type '" << typeName << "'"
106 << "\n for patch " << p.name()
107 << " of field " << this->dimensionedInternalField().name()
108 << " in file " << this->dimensionedInternalField().objectPath()
109 << exit(FatalIOError);
117 wedgeFvPatchField<Type>::wedgeFvPatchField
119 const wedgeFvPatchField<Type>& ptf
122 transformFvPatchField<Type>(ptf)
127 wedgeFvPatchField<Type>::wedgeFvPatchField
129 const wedgeFvPatchField<Type>& ptf,
130 const DimensionedField<Type, volMesh>& iF
133 transformFvPatchField<Type>(ptf, iF)
137 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
140 tmp<Field<Type> > wedgeFvPatchField<Type>::snGrad() const
142 Field<Type> pif = this->patchInternalField();
145 transform(refCast<const wedgeFvPatch>(this->patch()).cellT(), pif) - pif
146 )*(0.5*this->patch().deltaCoeffs());
151 void wedgeFvPatchField<Type>::evaluate(const Pstream::commsTypes)
153 if (!this->updated())
155 this->updateCoeffs();
158 fvPatchField<Type>::operator==
162 refCast<const wedgeFvPatch>(this->patch()).faceT(),
163 this->patchInternalField()
170 tmp<Field<Type> > wedgeFvPatchField<Type>::snGradTransformDiag() const
173 0.5*diag(I - refCast<const wedgeFvPatch>(this->patch()).cellT());
175 return tmp<Field<Type> >
184 reinterpret_cast<const vector&>(diagT),
185 pTraits<typename powProduct<vector, pTraits<Type>::rank>
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 } // End namespace Foam
198 // ************************************************************************* //