FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::coupledFvPatchField
00026 
00027 Description
00028     Foam::coupledFvPatchField
00029 
00030 SourceFiles
00031     coupledFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef coupledFvPatchField_H
00036 #define coupledFvPatchField_H
00037 
00038 #include <OpenFOAM/lduInterfaceField.H>
00039 #include <finiteVolume/fvPatchField.H>
00040 #include <finiteVolume/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
00143             (
00144                 const Pstream::commsTypes commsType
00145             );
00146 
00147             //- Evaluate the patch field
00148             virtual void evaluate
00149             (
00150                 const Pstream::commsTypes commsType
00151             );
00152 
00153             //- Return the matrix diagonal coefficients corresponding to the
00154             //  evaluation of the value of this patchField with given weights
00155             virtual tmp<Field<Type> > valueInternalCoeffs
00156             (
00157                 const tmp<scalarField>&
00158             ) const;
00159 
00160             //- Return the matrix source coefficients corresponding to the
00161             //  evaluation of the value of this patchField with given weights
00162             virtual tmp<Field<Type> > valueBoundaryCoeffs
00163             (
00164                 const tmp<scalarField>&
00165             ) const;
00166 
00167             //- Return the matrix diagonal coefficients corresponding to the
00168             //  evaluation of the gradient of this patchField
00169             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00170 
00171             //- Return the matrix source coefficients corresponding to the
00172             //  evaluation of the gradient of this patchField
00173             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00174 
00175 
00176         // Coupled interface functionality
00177 
00178             //- Update result field based on interface functionality
00179             virtual void updateInterfaceMatrix
00180             (
00181                 const scalarField& psiInternal,
00182                 scalarField& result,
00183                 const lduMatrix&,
00184                 const scalarField& coeffs,
00185                 const direction,
00186                 const Pstream::commsTypes commsType
00187             ) const = 0;
00188 
00189         //- Write
00190         virtual void write(Ostream&) const;
00191 };
00192 
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 } // End namespace Foam
00197 
00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00199 
00200 #ifdef NoRepository
00201 #   include <finiteVolume/coupledFvPatchField.C>
00202 #endif
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #endif
00207 
00208 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines