1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "gaussLaplacianScheme.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 makeFvLaplacianScheme(gaussLaplacianScheme)
40 #define declareFvmLaplacianScalarGamma(Type) \
43 Foam::tmp<Foam::fvMatrix<Foam::Type> > \
44 Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvmLaplacian \
46 const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
47 GeometricField<Type, fvPatchField, volMesh>& vf \
50 const fvMesh& mesh = this->mesh(); \
52 GeometricField<scalar, fvsPatchField, surfaceMesh> gammaMagSf \
57 tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(gammaMagSf, vf); \
58 fvMatrix<Type>& fvm = tfvm(); \
60 if (this->tsnGradScheme_().corrected()) \
62 if (mesh.fluxRequired(vf.name())) \
64 fvm.faceFluxCorrectionPtr() = new \
65 GeometricField<Type, fvsPatchField, surfaceMesh> \
67 gammaMagSf*this->tsnGradScheme_().correction(vf) \
74 *fvm.faceFluxCorrectionPtr() \
75 )().internalField(); \
83 gammaMagSf*this->tsnGradScheme_().correction(vf) \
84 )().internalField(); \
93 Foam::tmp<Foam::GeometricField<Foam::Type, Foam::fvPatchField, Foam::volMesh> >\
94 Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvcLaplacian \
96 const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
97 const GeometricField<Type, fvPatchField, volMesh>& vf \
100 const fvMesh& mesh = this->mesh(); \
102 tmp<GeometricField<Type, fvPatchField, volMesh> > tLaplacian \
104 fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \
107 tLaplacian().rename("laplacian(" + gamma.name() + ',' + vf.name() + ')');\
113 declareFvmLaplacianScalarGamma(scalar);
114 declareFvmLaplacianScalarGamma(vector);
115 declareFvmLaplacianScalarGamma(sphericalTensor);
116 declareFvmLaplacianScalarGamma(symmTensor);
117 declareFvmLaplacianScalarGamma(tensor);
120 // ************************************************************************* //