All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linearUpwind.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::linearUpwind
26 
27 Description
28  linearUpwind interpolation scheme class derived from upwind and returns
29  upwind weighting factors and also applies a gradient-based explicit
30  correction.
31 
32 SourceFiles
33  linearUpwind.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef linearUpwind_H
38 #define linearUpwind_H
39 
40 #include "upwind.H"
41 #include "gaussGrad.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class linearUpwind Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
53 class linearUpwind
54 :
55  public upwind<Type>
56 {
57  // Private Data
58 
59  word gradSchemeName_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("linearUpwind");
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  {}
80 
81  //- Construct from Istream.
82  // The name of the flux field is read from the Istream and looked-up
83  // from the mesh objectRegistry
85  (
86  const fvMesh& mesh,
87  Istream& schemeData
88  )
89  :
90  upwind<Type>(mesh, schemeData),
91  gradSchemeName_(schemeData)
92  {}
93 
94  //- Construct from faceFlux and Istream
96  (
97  const fvMesh& mesh,
98  const surfaceScalarField& faceFlux,
99  Istream& schemeData
100  )
101  :
102  upwind<Type>(mesh, faceFlux, schemeData),
103  gradSchemeName_(schemeData)
104  {}
105 
106  //- Disallow default bitwise copy construction
107  linearUpwind(const linearUpwind&) = delete;
108 
109 
110  // Member Functions
111 
112  //- Return true if this scheme uses an explicit correction
113  virtual bool corrected() const
114  {
115  return true;
116  }
117 
118  //- Return the explicit correction to the face-interpolate
120  correction
121  (
123  ) const;
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const linearUpwind&) = delete;
130 };
131 
132 
133 // Specialize for volVectorField to support cached gradients
134 template<>
136 (
137  const volVectorField& vf
138 ) const;
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: linearUpwind.H:112
A class for handling words, derived from string.
Definition: word.H:59
void operator=(const linearUpwind &)=delete
Disallow default bitwise assignment.
Upwind differencing scheme class.
Definition: upwind.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
linearUpwind interpolation scheme class derived from upwind and returns upwind weighting factors and ...
Definition: linearUpwind.H:52
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the explicit correction to the face-interpolate.
Definition: linearUpwind.C:34
A class for managing temporary objects.
Definition: PtrList.H:53
linearUpwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: linearUpwind.H:71
TypeName("linearUpwind")
Runtime type information.
Namespace for OpenFOAM.