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

PhiScheme.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::PhiScheme
00026 
00027 Description
00028     Class to create the weighting-factors based on the face-flux.
00029 
00030     The particular differencing scheme class is supplied as a template
00031     argument, the weight function of which is called by the weight function
00032     of this class for the internal faces as well as faces of coupled
00033     patches (e.g. processor-processor patches). The weight function is
00034     supplied with the central-differencing weighting factor, the face-flux,
00035     the face neighbour cell values and the face area.
00036 
00037     This code organisation is both neat and efficient, allowing for
00038     convenient implementation of new schemes to run on parallelised cases.
00039 
00040 SourceFiles
00041     PhiScheme.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef PhiScheme_H
00046 #define PhiScheme_H
00047 
00048 #include <finiteVolume/limitedSurfaceInterpolationScheme.H>
00049 
00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00051 
00052 namespace Foam
00053 {
00054 
00055 /*---------------------------------------------------------------------------*\
00056                            Class PhiScheme Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 template<class Type, class PhiLimiter>
00060 class PhiScheme
00061 :
00062     public limitedSurfaceInterpolationScheme<Type>,
00063     public PhiLimiter
00064 {
00065     // Private Member Functions
00066 
00067         //- Disallow default bitwise copy construct
00068         PhiScheme(const PhiScheme&);
00069 
00070         //- Disallow default bitwise assignment
00071         void operator=(const PhiScheme&);
00072 
00073 
00074 public:
00075 
00076     //- Runtime type information
00077     TypeName("PhiScheme");
00078 
00079 
00080     // Constructors
00081 
00082         //- Construct from mesh, faceFlux and blendingFactor
00083         PhiScheme
00084         (
00085             const fvMesh& mesh,
00086             const surfaceScalarField& faceFlux,
00087             const PhiLimiter& weight
00088         )
00089         :
00090             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
00091             PhiLimiter(weight)
00092         {}
00093 
00094         //- Construct from mesh and Istream. 
00095         //  The name of the flux field is read from the Istream and looked-up
00096         //  from the mesh objectRegistry
00097         PhiScheme
00098         (
00099             const fvMesh& mesh,
00100             Istream& is
00101         )
00102         :
00103             limitedSurfaceInterpolationScheme<Type>(mesh, is),
00104             PhiLimiter(is)
00105         {}
00106 
00107         //- Construct from mesh, faceFlux and Istream
00108         PhiScheme
00109         (
00110             const fvMesh& mesh,
00111             const surfaceScalarField& faceFlux,
00112             Istream& is
00113         )
00114         :
00115             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
00116             PhiLimiter(is)
00117         {}
00118 
00119 
00120     // Member Functions
00121 
00122         //- Return the interpolation weighting factors
00123         virtual tmp<surfaceScalarField> limiter
00124         (
00125             const GeometricField<Type, fvPatchField, volMesh>&
00126         ) const;
00127 };
00128 
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 } // End namespace Foam
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 // Add the patch constructor functions to the hash tables
00137 
00138 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE)                    \
00139                                                                                \
00140 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_;                            \
00141 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0);            \
00142                                                                                \
00143 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable                    \
00144 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToTable_;             \
00145                                                                                \
00146 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable                \
00147 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToTable_;         \
00148                                                                                \
00149 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable             \
00150 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToLimitedTable_;      \
00151                                                                                \
00152 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable         \
00153 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #ifdef NoRepository
00158 #   include <finiteVolume/PhiScheme.C>
00159 #endif
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #endif
00164 
00165 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines