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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::linearUpwind
28 
29 Group
30  grpFvSurfaceInterpolationSchemes
31 
32 Description
33  linearUpwind interpolation scheme class derived from upwind and returns
34  upwind weighting factors and also applies a gradient-based explicit
35  correction.
36 
37 SourceFiles
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 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class linearUpwind Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Type>
58 class 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 
76 public:
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
131  correction
132  (
134  ) const;
135 };
136 
137 
138 // Specialize for volVectorField to support cached gradients
139 template<>
140 tmp<surfaceVectorField> linearUpwind<vector>::correction
141 (
142  const volVectorField& vf
143 ) const;
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::upwind
Upwind differencing scheme class.
Definition: upwind.H:56
Foam::linearUpwind
linearUpwind interpolation scheme class derived from upwind and returns upwind weighting factors and ...
Definition: linearUpwind.H:57
gaussGrad.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::linearUpwind::correction
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
upwind.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::linearUpwind::TypeName
TypeName("linearUpwind")
Runtime type information.
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::linearUpwind::corrected
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: linearUpwind.H:123