All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linearUpwindV.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::linearUpwindV
26 
27 Description
28  linearUpwindV interpolation scheme class derived from upwind and returns
29  upwind weighting factors but also applies an explicit correction.
30 
31 SourceFiles
32  linearUpwindV.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef linearUpwindV_H
37 #define linearUpwindV_H
38 
39 #include "upwind.H"
40 #include "gaussGrad.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class linearUpwindV Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
52 class linearUpwindV
53 :
54  public upwind<Type>
55 {
56  // Private Data
57 
58  word gradSchemeName_;
59  tmp<fv::gradScheme<Type>> gradScheme_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("linearUpwindV");
66 
67 
68  // Constructors
69 
70  //- Construct from faceFlux
72  (
73  const fvMesh& mesh,
74  const surfaceScalarField& faceFlux
75  )
76  :
77  upwind<Type>(mesh, faceFlux),
78  gradSchemeName_("grad"),
79  gradScheme_
80  (
81  new fv::gaussGrad<Type>(mesh)
82  )
83  {}
84 
85  //- Construct from Istream.
86  // The name of the flux field is read from the Istream and looked-up
87  // from the mesh objectRegistry
89  (
90  const fvMesh& mesh,
91  Istream& schemeData
92  )
93  :
94  upwind<Type>(mesh, schemeData),
95  gradSchemeName_(schemeData),
96  gradScheme_
97  (
98  fv::gradScheme<Type>::New
99  (
100  mesh,
101  mesh.gradScheme(gradSchemeName_)
102  )
103  )
104  {}
105 
106  //- Construct from faceFlux and Istream
108  (
109  const fvMesh& mesh,
110  const surfaceScalarField& faceFlux,
111  Istream& schemeData
112  )
113  :
114  upwind<Type>(mesh, faceFlux, schemeData),
115  gradSchemeName_(schemeData),
116  gradScheme_
117  (
118  fv::gradScheme<Type>::New
119  (
120  mesh,
121  mesh.gradScheme(gradSchemeName_)
122  )
123  )
124  {}
125 
126  //- Disallow default bitwise copy construction
127  linearUpwindV(const linearUpwindV&) = delete;
128 
129 
130  // Member Functions
131 
132  //- Return true if this scheme uses an explicit correction
133  virtual bool corrected() const
134  {
135  return true;
136  }
137 
138  //- Return the explicit correction to the face-interpolate
140  correction
141  (
143  ) const;
144 
145 
146  // Member Operators
147 
148  //- Disallow default bitwise assignment
149  void operator=(const linearUpwindV&) = delete;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
void operator=(const linearUpwindV &)=delete
Disallow default bitwise assignment.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
linearUpwindV(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: linearUpwindV.H:71
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the explicit correction to the face-interpolate.
Definition: linearUpwindV.C:36
TypeName("linearUpwindV")
Runtime type information.
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
Upwind differencing scheme class.
Definition: upwind.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
A class for managing temporary objects.
Definition: PtrList.H:53
linearUpwindV interpolation scheme class derived from upwind and returns upwind weighting factors but...
Definition: linearUpwindV.H:51
Namespace for OpenFOAM.