1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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
26 Simple central-difference snGrad scheme with non-orthogonal correction.
28 \*---------------------------------------------------------------------------*/
30 #include "correctedSnGrad.H"
31 #include "volFields.H"
32 #include "surfaceFields.H"
35 #include "gaussGrad.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
50 correctedSnGrad<Type>::~correctedSnGrad()
54 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
57 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
58 correctedSnGrad<Type>::correction
60 const GeometricField<Type, fvPatchField, volMesh>& vf
63 const fvMesh& mesh = this->mesh();
65 // construct GeometricField<Type, fvsPatchField, surfaceMesh>
66 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tssf
68 new GeometricField<Type, fvsPatchField, surfaceMesh>
72 "snGradCorr("+vf.name()+')',
79 vf.dimensions()*mesh.deltaCoeffs().dimensions()
82 GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf();
84 for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
89 mesh.correctionVectors()
93 outerProduct<vector, typename pTraits<Type>::cmptType>::type
96 gradScheme<typename pTraits<Type>::cmptType>::New
99 mesh.gradScheme(ssf.name())
101 //gaussGrad<typename pTraits<Type>::cmptType>(mesh)
102 .grad(vf.component(cmpt))
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 } // End namespace fv
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 } // End namespace Foam
119 // ************************************************************************* //