OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

coupledFvPatchField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     coupledFvPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     coupledFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef coupledFvPatchField_H
00036 #define coupledFvPatchField_H
00037 
00038 #include "lduInterfaceField.H"
00039 #include "fvPatchField.H"
00040 #include "coupledFvPatch.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class coupledFvPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class coupledFvPatchField
00053 :
00054     public lduInterfaceField,
00055     public fvPatchField<Type>
00056 {
00057 
00058 public:
00059 
00060     //- Runtime type information
00061     TypeName(coupledFvPatch::typeName_());
00062 
00063 
00064     // Constructors
00065 
00066         //- Construct from patch and internal field
00067         coupledFvPatchField
00068         (
00069             const fvPatch&,
00070             const DimensionedField<Type, volMesh>&
00071         );
00072 
00073         //- Construct from patch and internal field and patch field
00074         coupledFvPatchField
00075         (
00076             const fvPatch&,
00077             const DimensionedField<Type, volMesh>&,
00078             const Field<Type>&
00079         );
00080 
00081         //- Construct from patch, internal field and dictionary
00082         coupledFvPatchField
00083         (
00084             const fvPatch&,
00085             const DimensionedField<Type, volMesh>&,
00086             const dictionary&
00087         );
00088 
00089         //- Construct by mapping the given coupledFvPatchField onto a new patch
00090         coupledFvPatchField
00091         (
00092             const coupledFvPatchField<Type>&,
00093             const fvPatch&,
00094             const DimensionedField<Type, volMesh>&,
00095             const fvPatchFieldMapper&
00096         );
00097 
00098         //- Construct as copy
00099         coupledFvPatchField
00100         (
00101             const coupledFvPatchField<Type>&
00102         );
00103 
00104         //- Construct and return a clone
00105         virtual tmp<fvPatchField<Type> > clone() const = 0;
00106 
00107         //- Construct as copy setting internal field reference
00108         coupledFvPatchField
00109         (
00110             const coupledFvPatchField<Type>&,
00111             const DimensionedField<Type, volMesh>&
00112         );
00113 
00114         //- Construct and return a clone
00115         virtual tmp<fvPatchField<Type> > clone
00116         (
00117             const DimensionedField<Type, volMesh>&
00118         ) const = 0;
00119 
00120 
00121     // Member functions
00122 
00123         // Access
00124 
00125             //- Return true if this patch field is derived from
00126             //  coupledFvPatchField<Type>.
00127             virtual bool coupled() const
00128             {
00129                 return true;
00130             }
00131 
00132             //- Return neighbour field of internal field
00133             virtual tmp<Field<Type> > patchNeighbourField() const = 0;
00134 
00135 
00136         // Evaluation functions
00137 
00138             //- Return patch-normal gradient
00139             virtual tmp<Field<Type> > snGrad() const;
00140 
00141             //- Initialise the evaluation of the patch field
00142             virtual void initEvaluate(const bool bufferdTransfer);
00143 
00144             //- Evaluate the patch field
00145             virtual void evaluate();
00146 
00147             //- Return the matrix diagonal coefficients corresponding to the
00148             //  evaluation of the value of this patchField with given weights
00149             virtual tmp<Field<Type> > valueInternalCoeffs
00150             (
00151                 const tmp<scalarField>&
00152             ) const;
00153 
00154             //- Return the matrix source coefficients corresponding to the
00155             //  evaluation of the value of this patchField with given weights
00156             virtual tmp<Field<Type> > valueBoundaryCoeffs
00157             (
00158                 const tmp<scalarField>&
00159             ) const;
00160 
00161             //- Return the matrix diagonal coefficients corresponding to the
00162             //  evaluation of the gradient of this patchField
00163             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00164 
00165             //- Return the matrix source coefficients corresponding to the
00166             //  evaluation of the gradient of this patchField
00167             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00168 
00169 
00170         // Coupled interface functionality
00171 
00172             //- Update result field based on interface functionality
00173             virtual void updateInterfaceMatrix
00174             (
00175                 const scalarField& psiInternal,
00176                 scalarField& result,
00177                 const lduMatrix&,
00178                 const scalarField& coeffs,
00179                 const direction
00180             ) const = 0;
00181 
00182         //- Write
00183         virtual void write(Ostream&) const;
00184 };
00185 
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 } // End namespace Foam
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 #ifdef NoRepository
00194 #   include "coupledFvPatchField.C"
00195 #endif
00196 
00197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00198 
00199 #endif
00200 
00201 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd