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

limitedSurfaceInterpolationScheme.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::limitedSurfaceInterpolationScheme
00026 
00027 Description
00028     Abstract base class for limited surface interpolation schemes.
00029 
00030 SourceFiles
00031     limitedSurfaceInterpolationScheme.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef limitedSurfaceInterpolationScheme_H
00036 #define limitedSurfaceInterpolationScheme_H
00037 
00038 #include <finiteVolume/surfaceInterpolationScheme.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                  Class limitedSurfaceInterpolationScheme Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class Type>
00050 class limitedSurfaceInterpolationScheme
00051 :
00052     public surfaceInterpolationScheme<Type>
00053 {
00054     // Private Member Functions
00055 
00056         //- Disallow copy construct
00057         limitedSurfaceInterpolationScheme
00058         (
00059             const limitedSurfaceInterpolationScheme&
00060         );
00061 
00062         //- Disallow default bitwise assignment
00063         void operator=(const limitedSurfaceInterpolationScheme&);
00064 
00065 
00066 protected:
00067 
00068     // Protected data
00069 
00070         const surfaceScalarField& faceFlux_;
00071 
00072 
00073 public:
00074 
00075     //- Runtime type information
00076     TypeName("limitedSurfaceInterpolationScheme");
00077 
00078 
00079     // Declare run-time constructor selection tables
00080 
00081         declareRunTimeSelectionTable
00082         (
00083             tmp,
00084             limitedSurfaceInterpolationScheme,
00085             Mesh,
00086             (
00087                 const fvMesh& mesh,
00088                 Istream& schemeData
00089             ),
00090             (mesh, schemeData)
00091         );
00092 
00093         declareRunTimeSelectionTable
00094         (
00095             tmp,
00096             limitedSurfaceInterpolationScheme,
00097             MeshFlux,
00098             (
00099                 const fvMesh& mesh,
00100                 const surfaceScalarField& faceFlux,
00101                 Istream& schemeData
00102             ),
00103             (mesh, faceFlux, schemeData)
00104         );
00105 
00106 
00107     // Constructors
00108 
00109         //- Construct from mesh and faceFlux
00110         limitedSurfaceInterpolationScheme
00111         (
00112             const fvMesh& mesh,
00113             const surfaceScalarField& faceFlux
00114         )
00115         :
00116             surfaceInterpolationScheme<Type>(mesh),
00117             faceFlux_(faceFlux)
00118         {}
00119 
00120 
00121         //- Construct from mesh and Istream.
00122         //  The name of the flux field is read from the Istream and looked-up
00123         //  from the mesh objectRegistry
00124         limitedSurfaceInterpolationScheme
00125         (
00126             const fvMesh& mesh,
00127             Istream& is
00128         )
00129         :
00130             surfaceInterpolationScheme<Type>(mesh),
00131             faceFlux_
00132             (
00133                 mesh.lookupObject<surfaceScalarField>
00134                 (
00135                     word(is)
00136                 )
00137             )
00138         {}
00139 
00140 
00141     // Selectors
00142 
00143         //- Return new tmp interpolation scheme
00144         static tmp<limitedSurfaceInterpolationScheme<Type> > New
00145         (
00146             const fvMesh& mesh,
00147             Istream& schemeData
00148         );
00149 
00150         //- Return new tmp interpolation scheme
00151         static tmp<limitedSurfaceInterpolationScheme<Type> > New
00152         (
00153             const fvMesh& mesh,
00154             const surfaceScalarField& faceFlux,
00155             Istream& schemeData
00156         );
00157 
00158 
00159     // Destructor
00160 
00161         virtual ~limitedSurfaceInterpolationScheme();
00162 
00163 
00164     // Member Functions
00165 
00166         //- Return the interpolation weighting factors
00167         virtual tmp<surfaceScalarField> limiter
00168         (
00169             const GeometricField<Type, fvPatchField, volMesh>&
00170         ) const = 0;
00171 
00172         //- Return the interpolation weighting factors for the given field,
00173         //  by limiting the given weights with the given limiter
00174         tmp<surfaceScalarField> weights
00175         (
00176             const GeometricField<Type, fvPatchField, volMesh>&,
00177             const surfaceScalarField& CDweights,
00178             tmp<surfaceScalarField> tLimiter
00179         ) const;
00180 
00181         //- Return the interpolation weighting factors for the given field
00182         virtual tmp<surfaceScalarField> weights
00183         (
00184             const GeometricField<Type, fvPatchField, volMesh>&
00185         ) const;
00186 
00187         //- Return the interpolation weighting factors
00188         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00189         flux
00190         (
00191             const GeometricField<Type, fvPatchField, volMesh>&
00192         ) const;
00193 };
00194 
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 } // End namespace Foam
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 // Add the patch constructor functions to the hash tables
00203 
00204 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type)                    \
00205                                                                                \
00206 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00207                                                                                \
00208 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >         \
00209     add##SS##Type##MeshConstructorToTable_;                                    \
00210                                                                                \
00211 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >     \
00212     add##SS##Type##MeshFluxConstructorToTable_;                                \
00213                                                                                \
00214 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >  \
00215     add##SS##Type##MeshConstructorToLimitedTable_;                             \
00216                                                                                \
00217 limitedSurfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >\
00218     add##SS##Type##MeshFluxConstructorToLimitedTable_;
00219 
00220 #define makelimitedSurfaceInterpolationScheme(SS)                              \
00221                                                                                \
00222 makelimitedSurfaceInterpolationTypeScheme(SS, scalar)                          \
00223 makelimitedSurfaceInterpolationTypeScheme(SS, vector)                          \
00224 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor)                 \
00225 makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor)                      \
00226 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
00227 
00228 
00229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00230 
00231 #ifdef NoRepository
00232 #   include <finiteVolume/limitedSurfaceInterpolationScheme.C>
00233 #endif
00234 
00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00236 
00237 #endif
00238 
00239 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines