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
29 Basic second-order gradient scheme using face-interpolation
35 \*---------------------------------------------------------------------------*/
40 #include "gradScheme.H"
41 #include "surfaceInterpolationScheme.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class gaussGrad Declaration
56 \*---------------------------------------------------------------------------*/
61 public fv::gradScheme<Type>
65 tmp<surfaceInterpolationScheme<Type> > tinterpScheme_;
68 // Private Member Functions
70 //- Disallow default bitwise copy construct
71 gaussGrad(const gaussGrad&);
73 //- Disallow default bitwise assignment
74 void operator=(const gaussGrad&);
79 //- Runtime type information
85 //- Construct from mesh
86 gaussGrad(const fvMesh& mesh)
88 gradScheme<Type>(mesh),
89 tinterpScheme_(new linear<Type>(mesh))
92 //- Construct from Istream
93 gaussGrad(const fvMesh& mesh, Istream& is)
95 gradScheme<Type>(mesh),
101 tmp<surfaceInterpolationScheme<Type> >
103 new linear<Type>(mesh)
109 tmp<surfaceInterpolationScheme<Type> >
111 surfaceInterpolationScheme<Type>::New(mesh, is)
119 //- Return the gradient of the given field
120 // calculated using Gauss' theorem on the given surface field
125 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
128 const GeometricField<Type, fvsPatchField, surfaceMesh>&
132 //- Return the gradient of the given field calculated
133 // using Gauss' theorem on the interpolated field
137 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
140 const GeometricField<Type, fvPatchField, volMesh>&
144 //- Correct the boundary values of the gradient using the patchField
146 static void correctBoundaryConditions
148 const GeometricField<Type, fvPatchField, volMesh>&,
150 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>&
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace fv
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 # include "gaussGrad.C"
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 // ************************************************************************* //