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
26 regionCoupleFvPatchField
29 Region couple patch field
32 Hrvoje Jasak, Wikki Ltd. All rights reserved
35 regionCoupleFvPatchField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef regionCoupleFvPatchField_H
40 #define regionCoupleFvPatchField_H
42 #include "coupledFvPatchField.H"
43 #include "regionCoupleLduInterfaceField.H"
44 #include "regionCoupleFvPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class regionCoupleFvPatchField Declaration
53 \*---------------------------------------------------------------------------*/
56 class regionCoupleFvPatchField
58 public regionCoupleLduInterfaceField,
59 public coupledFvPatchField<Type>
63 //- Local reference cast into the regionCouple patch
64 const regionCoupleFvPatch& regionCouplePatch_;
66 //- Name of remote field to couple to
67 word remoteFieldName_;
69 //- Matrix update buffer
70 mutable scalarField matrixUpdateBuffer_;
75 //- Return contents of a matrix update buffer
76 const scalarField& matrixUpdateBuffer() const
78 return matrixUpdateBuffer_;
84 //- Runtime type information
85 // TypeName(regionCoupleFvPatch::typeName_());
86 TypeName("regionCoupling");
91 //- Construct from patch and internal field
92 regionCoupleFvPatchField
95 const DimensionedField<Type, volMesh>&
98 //- Construct from patch, internal field and dictionary
99 regionCoupleFvPatchField
102 const DimensionedField<Type, volMesh>&,
106 //- Construct by mapping given regionCoupleFvPatchField onto a new patch
107 regionCoupleFvPatchField
109 const regionCoupleFvPatchField<Type>&,
111 const DimensionedField<Type, volMesh>&,
112 const fvPatchFieldMapper&
115 //- Construct as copy setting internal field reference
116 regionCoupleFvPatchField
118 const regionCoupleFvPatchField<Type>&,
119 const DimensionedField<Type, volMesh>&
122 //- Construct and return a clone
123 virtual tmp<fvPatchField<Type> > clone() const
125 return tmp<fvPatchField<Type> >
127 new regionCoupleFvPatchField<Type>(*this)
131 //- Construct and return a clone setting internal field reference
132 virtual tmp<fvPatchField<Type> > clone
134 const DimensionedField<Type, volMesh>& iF
137 return tmp<fvPatchField<Type> >
139 new regionCoupleFvPatchField<Type>(*this, iF)
146 // Evaluation functions
148 //- Return remote field name
149 const word& remoteFieldName() const
151 return remoteFieldName_;
154 //- Return shadow patch field
155 const regionCoupleFvPatchField<Type>& shadowPatchField() const;
157 //- Return neighbour field given internal cell data
158 virtual tmp<Field<Type> > patchNeighbourField() const;
160 //- Evaluate the patch field
161 virtual void evaluate
163 const Pstream::commsTypes commsType
166 //- Initialise neighbour matrix update
167 virtual void initInterfaceMatrixUpdate
169 const scalarField& psiInternal,
172 const scalarField& coeffs,
173 const direction cmpt,
174 const Pstream::commsTypes commsType
177 //- Update result field based on interface functionality
178 virtual void updateInterfaceMatrix
180 const scalarField& psiInternal,
183 const scalarField& coeffs,
184 const direction cmpt,
185 const Pstream::commsTypes commsType
190 virtual void write(Ostream&) const;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "regionCoupleFvPatchField.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //