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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "coupledFvPatchField.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
36 coupledFvPatchField<Type>::coupledFvPatchField
39 const DimensionedField<Type, volMesh>& iF
42 lduInterfaceField(refCast<const lduInterface>(p)),
43 fvPatchField<Type>(p, iF)
48 coupledFvPatchField<Type>::coupledFvPatchField
51 const DimensionedField<Type, volMesh>& iF,
55 lduInterfaceField(refCast<const lduInterface>(p)),
56 fvPatchField<Type>(p, iF, f)
61 coupledFvPatchField<Type>::coupledFvPatchField
63 const coupledFvPatchField<Type>& ptf,
65 const DimensionedField<Type, volMesh>& iF,
66 const fvPatchFieldMapper& mapper
69 lduInterfaceField(refCast<const lduInterface>(p)),
70 fvPatchField<Type>(ptf, p, iF, mapper)
75 coupledFvPatchField<Type>::coupledFvPatchField
78 const DimensionedField<Type, volMesh>& iF,
79 const dictionary& dict
82 lduInterfaceField(refCast<const lduInterface>(p)),
83 fvPatchField<Type>(p, iF, dict)
88 coupledFvPatchField<Type>::coupledFvPatchField
90 const coupledFvPatchField<Type>& ptf
93 lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
94 fvPatchField<Type>(ptf)
99 coupledFvPatchField<Type>::coupledFvPatchField
101 const coupledFvPatchField<Type>& ptf,
102 const DimensionedField<Type, volMesh>& iF
105 lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
106 fvPatchField<Type>(ptf, iF)
110 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
113 tmp<Field<Type> > coupledFvPatchField<Type>::snGrad() const
116 (this->patchNeighbourField() - this->patchInternalField())
117 *this->patch().deltaCoeffs();
122 void coupledFvPatchField<Type>::initEvaluate(const Pstream::commsTypes)
124 if (!this->updated())
126 this->updateCoeffs();
132 void coupledFvPatchField<Type>::evaluate(const Pstream::commsTypes)
134 if (!this->updated())
136 this->updateCoeffs();
139 Field<Type>::operator=
141 this->patch().weights()*this->patchInternalField()
142 + (1.0 - this->patch().weights())*this->patchNeighbourField()
145 fvPatchField<Type>::evaluate();
150 tmp<Field<Type> > coupledFvPatchField<Type>::valueInternalCoeffs
152 const tmp<scalarField>& w
155 return Type(pTraits<Type>::one)*w;
159 tmp<Field<Type> > coupledFvPatchField<Type>::valueBoundaryCoeffs
161 const tmp<scalarField>& w
164 return Type(pTraits<Type>::one)*(1.0 - w);
168 tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs() const
170 return -Type(pTraits<Type>::one)*this->patch().deltaCoeffs();
175 tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs() const
177 return -this->gradientInternalCoeffs();
182 void coupledFvPatchField<Type>::write(Ostream& os) const
184 fvPatchField<Type>::write(os);
185 this->writeEntry("value", os);
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 } // End namespace Foam
193 // ************************************************************************* //