linearUpwind.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::linearUpwind
28
29Group
30 grpFvSurfaceInterpolationSchemes
31
32Description
33 linearUpwind interpolation scheme class derived from upwind and returns
34 upwind weighting factors and also applies a gradient-based explicit
35 correction.
36
37SourceFiles
38 linearUpwind.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef linearUpwind_H
43#define linearUpwind_H
44
45#include "upwind.H"
46#include "gaussGrad.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class linearUpwind Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type>
58class linearUpwind
59:
60 public upwind<Type>
61{
62 // Private Data
63
64 word gradSchemeName_;
65
66
67 // Private Member Functions
68
69 //- No copy construct
70 linearUpwind(const linearUpwind&) = delete;
71
72 //- No copy assignment
73 void operator=(const linearUpwind&) = delete;
74
75
76public:
77
78 //- Runtime type information
79 TypeName("linearUpwind");
80
81
82 // Constructors
83
84 //- Construct from faceFlux
86 (
87 const fvMesh& mesh,
88 const surfaceScalarField& faceFlux
89 )
90 :
91 upwind<Type>(mesh, faceFlux),
92 gradSchemeName_("grad")
93 {}
94
95 //- Construct from Istream.
96 // The name of the flux field is read from the Istream and looked-up
97 // from the mesh objectRegistry
99 (
100 const fvMesh& mesh,
101 Istream& schemeData
102 )
103 :
104 upwind<Type>(mesh, schemeData),
105 gradSchemeName_(schemeData)
106 {}
107
108 //- Construct from faceFlux and Istream
110 (
111 const fvMesh& mesh,
112 const surfaceScalarField& faceFlux,
113 Istream& schemeData
114 )
115 :
116 upwind<Type>(mesh, faceFlux, schemeData),
117 gradSchemeName_(schemeData)
118 {}
119
120
121 // Member Functions
122
123 //- Return true if this scheme uses an explicit correction
124 virtual bool corrected() const
125 {
126 return true;
127 }
128
129 //- Return the explicit correction to the face-interpolate
132 (
134 ) const;
135};
136
137
138// Specialize for volVectorField to support cached gradients
139template<>
141(
142 const volVectorField& vf
143) const;
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#endif
153
154// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
linearUpwind interpolation scheme class derived from upwind and returns upwind weighting factors and ...
Definition: linearUpwind.H:60
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: linearUpwind.H:123
TypeName("linearUpwind")
Runtime type information.
linearUpwind(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Construct from faceFlux and Istream.
Definition: linearUpwind.H:109
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the explicit correction to the face-interpolate.
Definition: linearUpwind.C:36
linearUpwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: linearUpwind.H:85
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition: tmp.H:65
Upwind differencing scheme class.
Definition: upwind.H:59
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73