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
26 Foam::fv::faceMDLimitedGrad
29 faceMDLimitedGrad gradient scheme applied to a runTime selected
32 The scalar limiter based on limiting the extrapolated face values
33 between the face-neighbour cell values and is applied to the gradient
34 in each face direction separately.
39 \*---------------------------------------------------------------------------*/
41 #ifndef faceMDLimitedGrad_H
42 #define faceMDLimitedGrad_H
44 #include "gradScheme.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class faceMDLimitedGrad Declaration
58 \*---------------------------------------------------------------------------*/
61 class faceMDLimitedGrad
63 public fv::gradScheme<Type>
67 tmp<fv::gradScheme<Type> > basicGradScheme_;
69 //- Limiter coefficient
73 // Private Member Functions
78 const scalar maxDelta,
79 const scalar minDelta,
80 const scalar extrapolate
84 //- Disallow default bitwise copy construct
85 faceMDLimitedGrad(const faceMDLimitedGrad&);
87 //- Disallow default bitwise assignment
88 void operator=(const faceMDLimitedGrad&);
93 //- RunTime type information
94 TypeName("faceMDLimited");
99 //- Construct from mesh and schemeData
100 faceMDLimitedGrad(const fvMesh& mesh, Istream& schemeData)
102 gradScheme<Type>(mesh),
103 basicGradScheme_(fv::gradScheme<Type>::New(mesh, schemeData)),
104 k_(readScalar(schemeData))
106 if (k_ < 0 || k_ > 1)
110 "faceMDLimitedGrad(const fvMesh&, Istream& schemeData)",
112 ) << "coefficient = " << k_
113 << " should be >= 0 and <= 1"
114 << exit(FatalIOError);
124 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
127 const GeometricField<Type, fvPatchField, volMesh>&
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 } // End namespace fv
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 } // End namespace Foam
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 // ************************************************************************* //