Loading...
Searching...
No Matches
linearUpwindV.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::linearUpwindV
28
29Description
30 linearUpwindV interpolation scheme class derived from upwind and returns
31 upwind weighting factors but also applies an explicit correction.
32
33SourceFiles
34 linearUpwindV.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef linearUpwindV_H
39#define linearUpwindV_H
40
41#include "upwind.H"
42#include "gaussGrad.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class linearUpwindV Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class Type>
54class linearUpwindV
55:
56 public upwind<Type>
57{
58 // Private Data
59
60 word gradSchemeName_;
61 tmp<fv::gradScheme<Type>> gradScheme_;
62
63
64 // Private Member Functions
65
66 //- No copy construct
67 linearUpwindV(const linearUpwindV&) = delete;
68
69 //- No copy assignment
70 void operator=(const linearUpwindV&) = delete;
71
72
73public:
74
75 //- Runtime type information
76 TypeName("linearUpwindV");
78
79 // Constructors
80
81 //- Construct from faceFlux
82 linearUpwindV
83 (
84 const fvMesh& mesh,
85 const surfaceScalarField& faceFlux
86 )
87 :
88 upwind<Type>(mesh, faceFlux),
89 gradSchemeName_("grad"),
90 gradScheme_
91 (
92 new fv::gaussGrad<Type>(mesh)
93 )
94 {}
95
96 //- Construct from Istream.
97 // The name of the flux field is read from the Istream and looked-up
98 // from the mesh objectRegistry
100 (
101 const fvMesh& mesh,
102 Istream& schemeData
103 )
104 :
105 upwind<Type>(mesh, schemeData),
106 gradSchemeName_(schemeData),
107 gradScheme_
108 (
109 fv::gradScheme<Type>::New
110 (
111 mesh,
112 mesh.gradScheme(gradSchemeName_)
113 )
114 )
115 {}
116
117 //- Construct from faceFlux and Istream
119 (
120 const fvMesh& mesh,
121 const surfaceScalarField& faceFlux,
122 Istream& schemeData
123 )
124 :
125 upwind<Type>(mesh, faceFlux, schemeData),
126 gradSchemeName_(schemeData),
127 gradScheme_
128 (
129 fv::gradScheme<Type>::New
130 (
131 mesh,
132 mesh.gradScheme(gradSchemeName_)
133 )
134 )
135 {}
136
137
138 // Member Functions
139
140 //- Return true if this scheme uses an explicit correction
141 virtual bool corrected() const
142 {
143 return true;
144 }
145
146 //- Return the explicit correction to the face-interpolate
147 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
149 (
150 const GeometricField<Type, fvPatchField, volMesh>&
151 ) const;
152
153};
154
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158} // End namespace Foam
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#endif
163
164// ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
linearUpwindV interpolation scheme class derived from upwind and returns upwind weighting factors but...
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
linearUpwindV(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
TypeName("linearUpwindV")
Runtime type information.
linearUpwindV(const fvMesh &mesh, Istream &schemeData)
Construct from Istream.
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the explicit correction to the face-interpolate.
linearUpwindV(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Construct from faceFlux and Istream.
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition tmp.H:75
Upwind differencing scheme class.
Definition upwind.H:55
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition upwind.H:78
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for finite-volume.
Namespace for OpenFOAM.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68