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
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>&,
90 //- Construct by mapping the given coupledFvPatchField onto a new patch
93 const coupledFvPatchField<Type>&,
95 const DimensionedField<Type, volMesh>&,
96 const fvPatchFieldMapper&
102 const coupledFvPatchField<Type>&
105 //- Construct and return a clone
106 virtual tmp<fvPatchField<Type> > clone() const = 0;
108 //- Construct as copy setting internal field reference
111 const coupledFvPatchField<Type>&,
112 const DimensionedField<Type, volMesh>&
115 //- Construct and return a clone
116 virtual tmp<fvPatchField<Type> > clone
118 const DimensionedField<Type, volMesh>&
126 //- Return true if this patch field is derived from
127 // coupledFvPatchField<Type>.
128 virtual bool coupled() const
133 //- Return neighbour field of internal field
134 virtual tmp<Field<Type> > patchNeighbourField() const = 0;
137 // Evaluation functions
139 //- Return patch-normal gradient
140 virtual tmp<Field<Type> > snGrad() const;
142 //- Initialise the evaluation of the patch field
143 virtual void initEvaluate
145 const Pstream::commsTypes commsType
148 //- Evaluate the patch field
149 virtual void evaluate
151 const Pstream::commsTypes commsType
154 //- Return the matrix diagonal coefficients corresponding to the
155 // evaluation of the value of this patchField with given weights
156 virtual tmp<Field<Type> > valueInternalCoeffs
158 const tmp<scalarField>&
161 //- Return the matrix source coefficients corresponding to the
162 // evaluation of the value of this patchField with given weights
163 virtual tmp<Field<Type> > valueBoundaryCoeffs
165 const tmp<scalarField>&
168 //- Return the matrix diagonal coefficients corresponding to the
169 // evaluation of the gradient of this patchField
170 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
172 //- Return the matrix source coefficients corresponding to the
173 // evaluation of the gradient of this patchField
174 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
177 // Coupled interface functionality
179 //- Update result field based on interface functionality
180 virtual void updateInterfaceMatrix
182 const scalarField& psiInternal,
185 const scalarField& coeffs,
187 const Pstream::commsTypes commsType
191 virtual void write(Ostream&) const;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "coupledFvPatchField.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //