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 "lduInterfaceField.H"
40 #include "fvPatchField.H"
41 #include "coupledFvPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class coupledFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
53 class coupledFvPatchField
55 public lduInterfaceField,
56 public fvPatchField<Type>
61 //- Runtime type information
62 TypeName(coupledFvPatch::typeName_());
67 //- Construct from patch and internal field
71 const DimensionedField<Type, volMesh>&
74 //- Construct from patch and internal field and patch field
78 const DimensionedField<Type, volMesh>&,
82 //- Construct from patch, internal field and dictionary
86 const DimensionedField<Type, volMesh>&,
88 const bool valueRequired = false
91 //- Construct by mapping the given coupledFvPatchField onto a new patch
94 const coupledFvPatchField<Type>&,
96 const DimensionedField<Type, volMesh>&,
97 const fvPatchFieldMapper&
100 //- Construct as copy
103 const coupledFvPatchField<Type>&
106 //- Construct and return a clone
107 virtual tmp<fvPatchField<Type> > clone() const = 0;
109 //- Construct as copy setting internal field reference
112 const coupledFvPatchField<Type>&,
113 const DimensionedField<Type, volMesh>&
116 //- Construct and return a clone
117 virtual tmp<fvPatchField<Type> > clone
119 const DimensionedField<Type, volMesh>&
127 //- Return true if this patch field is derived from
128 // coupledFvPatchField<Type>.
129 virtual bool coupled() const
134 //- Return neighbour field of internal field
135 virtual tmp<Field<Type> > patchNeighbourField() const = 0;
138 // Evaluation functions
140 //- Return patch-normal gradient
141 virtual tmp<Field<Type> > snGrad() const;
143 //- Initialise the evaluation of the patch field
144 virtual void initEvaluate
146 const Pstream::commsTypes commsType
149 //- Evaluate the patch field
150 virtual void evaluate
152 const Pstream::commsTypes commsType
155 //- Return the matrix diagonal coefficients corresponding to the
156 // evaluation of the value of this patchField with given weights
157 virtual tmp<Field<Type> > valueInternalCoeffs
159 const tmp<scalarField>&
162 //- Return the matrix source coefficients corresponding to the
163 // evaluation of the value of this patchField with given weights
164 virtual tmp<Field<Type> > valueBoundaryCoeffs
166 const tmp<scalarField>&
169 //- Return the matrix diagonal coefficients corresponding to the
170 // evaluation of the gradient of this patchField
171 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
173 //- Return the matrix source coefficients corresponding to the
174 // evaluation of the gradient of this patchField
175 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
178 // Coupled interface functionality
180 //- Update result field based on interface functionality
181 virtual void updateInterfaceMatrix
183 const scalarField& psiInternal,
186 const scalarField& coeffs,
188 const Pstream::commsTypes commsType
192 virtual void write(Ostream&) const;
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 # include "coupledFvPatchField.C"
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 // ************************************************************************* //