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
25 \*---------------------------------------------------------------------------*/
27 #include "coupledFvPatchField.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 coupledFvPatchField<Type>::coupledFvPatchField
40 const DimensionedField<Type, volMesh>& iF
43 lduInterfaceField(refCast<const lduInterface>(p)),
44 fvPatchField<Type>(p, iF)
49 coupledFvPatchField<Type>::coupledFvPatchField
52 const DimensionedField<Type, volMesh>& iF,
56 lduInterfaceField(refCast<const lduInterface>(p)),
57 fvPatchField<Type>(p, iF, f)
62 coupledFvPatchField<Type>::coupledFvPatchField
64 const coupledFvPatchField<Type>& ptf,
66 const DimensionedField<Type, volMesh>& iF,
67 const fvPatchFieldMapper& mapper
70 lduInterfaceField(refCast<const lduInterface>(p)),
71 fvPatchField<Type>(ptf, p, iF, mapper)
76 coupledFvPatchField<Type>::coupledFvPatchField
79 const DimensionedField<Type, volMesh>& iF,
80 const dictionary& dict
83 lduInterfaceField(refCast<const lduInterface>(p)),
84 fvPatchField<Type>(p, iF, dict)
89 coupledFvPatchField<Type>::coupledFvPatchField
91 const coupledFvPatchField<Type>& ptf
94 lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
95 fvPatchField<Type>(ptf)
100 coupledFvPatchField<Type>::coupledFvPatchField
102 const coupledFvPatchField<Type>& ptf,
103 const DimensionedField<Type, volMesh>& iF
106 lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
107 fvPatchField<Type>(ptf, iF)
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 tmp<Field<Type> > coupledFvPatchField<Type>::snGrad() const
117 (this->patchNeighbourField() - this->patchInternalField())
118 *this->patch().deltaCoeffs();
123 void coupledFvPatchField<Type>::initEvaluate(const Pstream::commsTypes)
125 if (!this->updated())
127 this->updateCoeffs();
133 void coupledFvPatchField<Type>::evaluate(const Pstream::commsTypes)
135 if (!this->updated())
137 this->updateCoeffs();
140 Field<Type>::operator=
142 this->patch().weights()*this->patchInternalField()
143 + (1.0 - this->patch().weights())*this->patchNeighbourField()
146 fvPatchField<Type>::evaluate();
151 tmp<Field<Type> > coupledFvPatchField<Type>::valueInternalCoeffs
153 const tmp<scalarField>& w
156 return Type(pTraits<Type>::one)*w;
160 tmp<Field<Type> > coupledFvPatchField<Type>::valueBoundaryCoeffs
162 const tmp<scalarField>& w
165 return Type(pTraits<Type>::one)*(1.0 - w);
169 tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs() const
171 return -Type(pTraits<Type>::one)*this->patch().deltaCoeffs();
176 tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs() const
178 return -this->gradientInternalCoeffs();
183 void coupledFvPatchField<Type>::write(Ostream& os) const
185 fvPatchField<Type>::write(os);
186 this->writeEntry("value", os);
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // ************************************************************************* //