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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::upwind
28
29Group
30 grpFvLimitedSurfaceInterpolationSchemes
31
32Description
33 Upwind differencing scheme class.
34
35SourceFiles
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
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class upwind Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class Type>
57class upwind
58:
60{
61 // Private Member Functions
62
63 //- No copy assignment
64 void operator=(const upwind&) = delete;
65
66
67public:
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 (
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// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for limited surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition: tmp.H:65
Upwind differencing scheme class.
Definition: upwind.H:59
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: upwind.H:140
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &)
Construct from faceFlux and Istream.
Definition: upwind.H:98
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: upwind.H:76
tmp< surfaceScalarField > weights() const
Return the interpolation weighting factors.
Definition: upwind.H:133
TypeName("upwind")
Runtime type information.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation limiter.
Definition: upwind.H:112
word timeName
Definition: getTimeIndex.H:3
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::surfaceFields.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73