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

gaussLaplacianScheme.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::fv::gaussLaplacianScheme
00026 
00027 Description
00028     Basic second-order laplacian using face-gradients and Gauss' theorem.
00029 
00030 SourceFiles
00031     gaussLaplacianScheme.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef gaussLaplacianScheme_H
00036 #define gaussLaplacianScheme_H
00037 
00038 #include <finiteVolume/laplacianScheme.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace fv
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                        Class gaussLaplacianScheme Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class Type, class GType>
00055 class gaussLaplacianScheme
00056 :
00057     public fv::laplacianScheme<Type, GType>
00058 {
00059     // Private Member Functions
00060 
00061         tmp<fvMatrix<Type> > fvmLaplacianUncorrected
00062         (
00063             const surfaceScalarField& gammaMagSf,
00064             GeometricField<Type, fvPatchField, volMesh>&
00065         );
00066 
00067         tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > gammaSnGradCorr
00068         (
00069             const surfaceVectorField& SfGammaCorr,
00070             const GeometricField<Type, fvPatchField, volMesh>&
00071         );
00072 
00073         //- Disallow default bitwise copy construct
00074         gaussLaplacianScheme(const gaussLaplacianScheme&);
00075 
00076         //- Disallow default bitwise assignment
00077         void operator=(const gaussLaplacianScheme&);
00078 
00079 
00080 public:
00081 
00082     //- Runtime type information
00083     TypeName("Gauss");
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct null
00089         gaussLaplacianScheme(const fvMesh& mesh)
00090         :
00091             laplacianScheme<Type, GType>(mesh)
00092         {}
00093 
00094         //- Construct from Istream
00095         gaussLaplacianScheme(const fvMesh& mesh, Istream& is)
00096         :
00097             laplacianScheme<Type, GType>(mesh, is)
00098         {}
00099 
00100         //- Construct from mesh, interpolation and snGradScheme schemes
00101         gaussLaplacianScheme
00102         (
00103             const fvMesh& mesh,
00104             const tmp<surfaceInterpolationScheme<GType> >& igs,
00105             const tmp<snGradScheme<Type> >& sngs
00106         )
00107         :
00108             laplacianScheme<Type, GType>(mesh, igs, sngs)
00109         {}
00110 
00111 
00112     // Destructor
00113 
00114         virtual ~gaussLaplacianScheme()
00115         {}
00116 
00117 
00118     // Member Functions
00119 
00120         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00121         (
00122             const GeometricField<Type, fvPatchField, volMesh>&
00123         );
00124 
00125         tmp<fvMatrix<Type> > fvmLaplacian
00126         (
00127             const GeometricField<GType, fvsPatchField, surfaceMesh>&,
00128             GeometricField<Type, fvPatchField, volMesh>&
00129         );
00130 
00131         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00132         (
00133             const GeometricField<GType, fvsPatchField, surfaceMesh>&,
00134             const GeometricField<Type, fvPatchField, volMesh>&
00135         );
00136 };
00137 
00138 
00139 // Use macros to emulate partial-specialisation of the the Laplacian functions
00140 // for scalar diffusivity gamma
00141 
00142 #define defineFvmLaplacianScalarGamma(Type)                                 \
00143                                                                             \
00144 template<>                                                                  \
00145 tmp<fvMatrix<Type> > gaussLaplacianScheme<Type, scalar>::fvmLaplacian       \
00146 (                                                                           \
00147     const GeometricField<scalar, fvsPatchField, surfaceMesh>&,              \
00148     GeometricField<Type, fvPatchField, volMesh>&                            \
00149 );                                                                          \
00150                                                                             \
00151 template<>                                                                  \
00152 tmp<GeometricField<Type, fvPatchField, volMesh> >                           \
00153 gaussLaplacianScheme<Type, scalar>::fvcLaplacian                            \
00154 (                                                                           \
00155     const GeometricField<scalar, fvsPatchField, surfaceMesh>&,              \
00156     const GeometricField<Type, fvPatchField, volMesh>&                      \
00157 );
00158 
00159 
00160 defineFvmLaplacianScalarGamma(scalar);
00161 defineFvmLaplacianScalarGamma(vector);
00162 defineFvmLaplacianScalarGamma(sphericalTensor);
00163 defineFvmLaplacianScalarGamma(symmTensor);
00164 defineFvmLaplacianScalarGamma(tensor);
00165 
00166 
00167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00168 
00169 } // End namespace fv
00170 
00171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00172 
00173 } // End namespace Foam
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 #ifdef NoRepository
00178 #   include <finiteVolume/gaussLaplacianScheme.C>
00179 #endif
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines