OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide 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-2009 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     Foam::coupledFvPatchField
00027 
00028 Description
00029     Foam::coupledFvPatchField
00030 
00031 SourceFiles
00032     coupledFvPatchField.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef coupledFvPatchField_H
00037 #define coupledFvPatchField_H
00038 
00039 #include "lduInterfaceField.H"
00040 #include "fvPatchField.H"
00041 #include "coupledFvPatch.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class coupledFvPatch Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class Type>
00053 class coupledFvPatchField
00054 :
00055     public lduInterfaceField,
00056     public fvPatchField<Type>
00057 {
00058 
00059 public:
00060 
00061     //- Runtime type information
00062     TypeName(coupledFvPatch::typeName_());
00063 
00064 
00065     // Constructors
00066 
00067         //- Construct from patch and internal field
00068         coupledFvPatchField
00069         (
00070             const fvPatch&,
00071             const DimensionedField<Type, volMesh>&
00072         );
00073 
00074         //- Construct from patch and internal field and patch field
00075         coupledFvPatchField
00076         (
00077             const fvPatch&,
00078             const DimensionedField<Type, volMesh>&,
00079             const Field<Type>&
00080         );
00081 
00082         //- Construct from patch, internal field and dictionary
00083         coupledFvPatchField
00084         (
00085             const fvPatch&,
00086             const DimensionedField<Type, volMesh>&,
00087             const dictionary&
00088         );
00089 
00090         //- Construct by mapping the given coupledFvPatchField onto a new patch
00091         coupledFvPatchField
00092         (
00093             const coupledFvPatchField<Type>&,
00094             const fvPatch&,
00095             const DimensionedField<Type, volMesh>&,
00096             const fvPatchFieldMapper&
00097         );
00098 
00099         //- Construct as copy
00100         coupledFvPatchField
00101         (
00102             const coupledFvPatchField<Type>&
00103         );
00104 
00105         //- Construct and return a clone
00106         virtual tmp<fvPatchField<Type> > clone() const = 0;
00107 
00108         //- Construct as copy setting internal field reference
00109         coupledFvPatchField
00110         (
00111             const coupledFvPatchField<Type>&,
00112             const DimensionedField<Type, volMesh>&
00113         );
00114 
00115         //- Construct and return a clone
00116         virtual tmp<fvPatchField<Type> > clone
00117         (
00118             const DimensionedField<Type, volMesh>&
00119         ) const = 0;
00120 
00121 
00122     // Member functions
00123 
00124         // Access
00125 
00126             //- Return true if this patch field is derived from
00127             //  coupledFvPatchField<Type>.
00128             virtual bool coupled() const
00129             {
00130                 return true;
00131             }
00132 
00133             //- Return neighbour field of internal field
00134             virtual tmp<Field<Type> > patchNeighbourField() const = 0;
00135 
00136 
00137         // Evaluation functions
00138 
00139             //- Return patch-normal gradient
00140             virtual tmp<Field<Type> > snGrad() const;
00141 
00142             //- Initialise the evaluation of the patch field
00143             virtual void initEvaluate
00144             (
00145                 const Pstream::commsTypes commsType
00146             );
00147 
00148             //- Evaluate the patch field
00149             virtual void evaluate
00150             (
00151                 const Pstream::commsTypes commsType
00152             );
00153 
00154             //- Return the matrix diagonal coefficients corresponding to the
00155             //  evaluation of the value of this patchField with given weights
00156             virtual tmp<Field<Type> > valueInternalCoeffs
00157             (
00158                 const tmp<scalarField>&
00159             ) const;
00160 
00161             //- Return the matrix source coefficients corresponding to the
00162             //  evaluation of the value of this patchField with given weights
00163             virtual tmp<Field<Type> > valueBoundaryCoeffs
00164             (
00165                 const tmp<scalarField>&
00166             ) const;
00167 
00168             //- Return the matrix diagonal coefficients corresponding to the
00169             //  evaluation of the gradient of this patchField
00170             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00171 
00172             //- Return the matrix source coefficients corresponding to the
00173             //  evaluation of the gradient of this patchField
00174             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00175 
00176 
00177         // Coupled interface functionality
00178 
00179             //- Update result field based on interface functionality
00180             virtual void updateInterfaceMatrix
00181             (
00182                 const scalarField& psiInternal,
00183                 scalarField& result,
00184                 const lduMatrix&,
00185                 const scalarField& coeffs,
00186                 const direction,
00187                 const Pstream::commsTypes commsType
00188             ) const = 0;
00189 
00190         //- Write
00191         virtual void write(Ostream&) const;
00192 };
00193 
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 } // End namespace Foam
00198 
00199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00200 
00201 #ifdef NoRepository
00202 #   include "coupledFvPatchField.C"
00203 #endif
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 #endif
00208 
00209 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd