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 Foam::coupledFvPatchField
29 Foam::coupledFvPatchField
34 \*---------------------------------------------------------------------------*/
36 #ifndef coupledFvPatchField_H
37 #define coupledFvPatchField_H
39 #include "BlockLduInterfaceField.H"
40 #include "CoeffField.H"
41 #include "fvPatchField.H"
42 #include "coupledFvPatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class coupledFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
54 class coupledFvPatchField
56 public BlockLduInterfaceField<Type>,
57 public fvPatchField<Type>
62 //- Runtime type information
63 TypeName(coupledFvPatch::typeName_());
68 //- Construct from patch and internal field
72 const DimensionedField<Type, volMesh>&
75 //- Construct from patch and internal field and patch field
79 const DimensionedField<Type, volMesh>&,
83 //- Construct from patch, internal field and dictionary
87 const DimensionedField<Type, volMesh>&,
89 const bool valueRequired = false
92 //- Construct by mapping the given coupledFvPatchField onto a new patch
95 const coupledFvPatchField<Type>&,
97 const DimensionedField<Type, volMesh>&,
98 const fvPatchFieldMapper&
101 //- Construct as copy
104 const coupledFvPatchField<Type>&
107 //- Construct and return a clone
108 virtual tmp<fvPatchField<Type> > clone() const = 0;
110 //- Construct as copy setting internal field reference
113 const coupledFvPatchField<Type>&,
114 const DimensionedField<Type, volMesh>&
117 //- Construct and return a clone
118 virtual tmp<fvPatchField<Type> > clone
120 const DimensionedField<Type, volMesh>&
128 //- Return true if this patch field is derived from
129 // coupledFvPatchField<Type>.
130 virtual bool coupled() const
135 //- Return neighbour field of internal field
136 virtual tmp<Field<Type> > patchNeighbourField() const = 0;
139 // Evaluation functions
141 //- Return patch-normal gradient
142 virtual tmp<Field<Type> > snGrad() const;
144 //- Initialise the evaluation of the patch field
145 virtual void initEvaluate
147 const Pstream::commsTypes commsType
150 //- Evaluate the patch field
151 virtual void evaluate
153 const Pstream::commsTypes commsType
156 //- Return the matrix diagonal coefficients corresponding to the
157 // evaluation of the value of this patchField with given weights
158 virtual tmp<Field<Type> > valueInternalCoeffs
160 const tmp<scalarField>&
163 //- Return the matrix source coefficients corresponding to the
164 // evaluation of the value of this patchField with given weights
165 virtual tmp<Field<Type> > valueBoundaryCoeffs
167 const tmp<scalarField>&
170 //- Return the matrix diagonal coefficients corresponding to the
171 // evaluation of the gradient of this patchField
172 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
174 //- Return the matrix source coefficients corresponding to the
175 // evaluation of the gradient of this patchField
176 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
179 // Coupled interface functionality
181 //- Update result field based on interface functionality
182 virtual void updateInterfaceMatrix
184 const scalarField& psiInternal,
187 const scalarField& coeffs,
189 const Pstream::commsTypes commsType
192 // Block coupled interface functionality
194 //- Initialise neighbour matrix update
195 virtual void initInterfaceMatrixUpdate
199 const BlockLduMatrix<Type>&,
200 const CoeffField<Type>&,
201 const Pstream::commsTypes commsType
205 //- Update result field based on interface functionality
206 virtual void updateInterfaceMatrix
210 const BlockLduMatrix<Type>&,
211 const CoeffField<Type>&,
212 const Pstream::commsTypes commsType
215 notImplemented("coupledFvPatchField<Type>::updateInterfaceMatrix for block matrices")
219 virtual void write(Ostream&) const;
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 } // End namespace Foam
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 # include "coupledFvPatchField.C"
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 // ************************************************************************* //