OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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