upwind.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-2017 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::upwind
28 
29 Group
30  grpFvLimitedSurfaceInterpolationSchemes
31 
32 Description
33  Upwind differencing scheme class.
34 
35 SourceFiles
36  upwind.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef upwind_H
41 #define upwind_H
42 
44 #include "volFields.H"
45 #include "surfaceFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class upwind Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Type>
57 class upwind
58 :
60 {
61  // Private Member Functions
62 
63  //- No copy assignment
64  void operator=(const upwind&) = delete;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("upwind");
71 
72 
73  // Constructors
74 
75  //- Construct from faceFlux
76  upwind
77  (
78  const fvMesh& mesh,
79  const surfaceScalarField& faceFlux
80  )
81  :
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
88  upwind
89  (
90  const fvMesh& mesh,
91  Istream& is
92  )
93  :
95  {}
96 
97  //- Construct from faceFlux and Istream
98  upwind
99  (
100  const fvMesh& mesh,
101  const surfaceScalarField& faceFlux,
102  Istream&
103  )
104  :
106  {}
107 
108 
109  // Member Functions
110 
111  //- Return the interpolation limiter
113  (
115  ) const
116  {
118  (
119  IOobject
120  (
121  "upwindLimiter",
122  this->mesh().time().timeName(),
123  this->mesh().time().timeName(),
124  this->mesh().thisDb(),
128  ),
129  this->mesh(),
131  );
132  }
133 
134  //- Return the interpolation weighting factors
136  {
137  return pos0(this->faceFlux_);
138  }
139 
140  //- Return the interpolation weighting factors
141  virtual tmp<surfaceScalarField> weights
142  (
143  const GeometricField<Type, fvPatchField, volMesh>&
144  ) const
145  {
146  return weights();
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::surfaceFields.
tmp< surfaceScalarField > weights() const
Return the interpolation weighting factors.
Definition: upwind.H:145
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const fvMesh & mesh() const
Return mesh reference.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation limiter.
Definition: upwind.H:121
word timeName
Definition: getTimeIndex.H:3
TypeName("upwind")
Runtime type information.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
dimensionedScalar pos0(const dimensionedScalar &ds)
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: upwind.H:78
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Upwind differencing scheme class.
Definition: upwind.H:52
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Nothing to be read.
Abstract base class for limited surface interpolation schemes.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Do not request registration (bool: false)
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127