1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Basic second-order gradient scheme using face-interpolation
34 \*---------------------------------------------------------------------------*/
39 #include "gradScheme.H"
40 #include "surfaceInterpolationScheme.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class gaussGrad Declaration
55 \*---------------------------------------------------------------------------*/
60 public fv::gradScheme<Type>
64 tmp<surfaceInterpolationScheme<Type> > tinterpScheme_;
67 // Private Member Functions
69 //- Disallow default bitwise copy construct
70 gaussGrad(const gaussGrad&);
72 //- Disallow default bitwise assignment
73 void operator=(const gaussGrad&);
78 //- Runtime type information
84 //- Construct from mesh
85 gaussGrad(const fvMesh& mesh)
87 gradScheme<Type>(mesh),
88 tinterpScheme_(new linear<Type>(mesh))
91 //- Construct from mesh and Istream
92 gaussGrad(const fvMesh& mesh, Istream& is)
94 gradScheme<Type>(mesh),
100 tmp<surfaceInterpolationScheme<Type> >
102 new linear<Type>(mesh)
108 tmp<surfaceInterpolationScheme<Type> >
110 surfaceInterpolationScheme<Type>::New(mesh, is)
118 //- Return the gradient of the given field
119 // calculated using Gauss' theorem on the given surface field
124 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
127 const GeometricField<Type, fvsPatchField, surfaceMesh>&,
131 //- Return the gradient of the given field to the gradScheme::grad
132 // for optional caching
136 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
139 const GeometricField<Type, fvPatchField, volMesh>& vsf,
143 //- Correct the boundary values of the gradient using the patchField
145 static void correctBoundaryConditions
147 const GeometricField<Type, fvPatchField, volMesh>&,
149 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>&
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace fv
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 # include "gaussGrad.C"
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 // ************************************************************************* //