1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2011 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 linearUpwind interpolation scheme class derived from upwind and returns
29 upwind weighting factors and also applies a gradient-based explicit
35 \*---------------------------------------------------------------------------*/
37 #ifndef linearUpwind_H
38 #define linearUpwind_H
41 #include "gaussGrad.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class linearUpwind Declaration
50 \*---------------------------------------------------------------------------*/
60 tmp<fv::gradScheme<Type> > gradScheme_;
63 // Private Member Functions
65 //- Disallow default bitwise copy construct
66 linearUpwind(const linearUpwind&);
68 //- Disallow default bitwise assignment
69 void operator=(const linearUpwind&);
74 //- Runtime type information
75 TypeName("linearUpwind");
80 //- Construct from faceFlux
84 const surfaceScalarField& faceFlux
87 upwind<Type>(mesh, faceFlux),
88 gradSchemeName_("grad"),
91 new fv::gaussGrad<Type>(mesh)
95 //- Construct from Istream.
96 // The name of the flux field is read from the Istream and looked-up
97 // from the mesh objectRegistry
104 upwind<Type>(mesh, schemeData),
105 gradSchemeName_(schemeData),
108 fv::gradScheme<Type>::New
111 mesh.gradScheme(gradSchemeName_)
115 if (!schemeData.eof())
117 IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData)
118 << "unexpected additional entries in stream." << nl
119 << " Only the name of the gradient scheme in the"
120 " 'gradSchemes' dictionary should be specified."
125 //- Construct from faceFlux and Istream
129 const surfaceScalarField& faceFlux,
133 upwind<Type>(mesh, faceFlux, schemeData),
134 gradSchemeName_(schemeData),
137 fv::gradScheme<Type>::New
140 mesh.gradScheme(gradSchemeName_)
144 if (!schemeData.eof())
146 IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData)
147 << "unexpected additional entries in stream." << nl
148 << " Only the name of the gradient scheme in the"
149 " 'gradSchemes' dictionary should be specified."
157 //- Return true if this scheme uses an explicit correction
158 virtual bool corrected() const
163 //- Return the explicit correction to the face-interpolate
164 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
167 const GeometricField<Type, fvPatchField, volMesh>&
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //