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
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
89  (
90  const fvMesh& mesh,
91  Istream& is
92  )
93  :
95  {}
96 
97  //- Construct from faceFlux and Istream
99  (
100  const fvMesh& mesh,
101  const surfaceScalarField& faceFlux,
102  Istream&
103  )
104  :
105  limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux)
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(),
126  false
127  ),
128  this->mesh(),
130  );
131  }
132 
133  //- Return the interpolation weighting factors
135  {
136  return pos0(this->faceFlux_);
137  }
138 
139  //- Return the interpolation weighting factors
141  (
143  ) const
144  {
145  return weights();
146  }
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
volFields.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::upwind
Upwind differencing scheme class.
Definition: upwind.H:56
Foam::upwind::weights
tmp< surfaceScalarField > weights() const
Return the interpolation weighting factors.
Definition: upwind.H:133
surfaceFields.H
Foam::surfaceFields.
Foam::pos0
dimensionedScalar pos0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:188
Foam::upwind::limiter
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation limiter.
Definition: upwind.H:112
Foam::upwind::TypeName
TypeName("upwind")
Runtime type information.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::limitedSurfaceInterpolationScheme::faceFlux_
const surfaceScalarField & faceFlux_
Definition: limitedSurfaceInterpolationScheme.H:74
Foam::upwind::upwind
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: upwind.H:76
Foam::limitedSurfaceInterpolationScheme
Abstract base class for limited surface interpolation schemes.
Definition: limitedSurfaceInterpolationScheme.H:54
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
limitedSurfaceInterpolationScheme.H
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189