Loading...
Searching...
No Matches
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:
59 public limitedSurfaceInterpolationScheme<Type>
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 :
82 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux)
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 :
94 limitedSurfaceInterpolationScheme<Type>(mesh, is)
95 {}
96
97 //- Construct from faceFlux and Istream
98 upwind
99 (
100 const fvMesh& mesh,
101 const surfaceScalarField& faceFlux,
102 Istream&
103 )
105 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux)
106 {}
107
108
109 // Member Functions
110
111 //- Return the interpolation limiter
113 (
115 ) const
116 {
118 (
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
146 return weights();
147 }
148};
149
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153} // End namespace Foam
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157#endif
158
159// ************************************************************************* //
Generic GeometricField class.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition tmp.H:75
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition tmp.H:215
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition upwind.H:154
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &)
Construct from faceFlux and Istream.
Definition upwind.H:105
upwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition upwind.H:78
tmp< surfaceScalarField > weights() const
Return the interpolation weighting factors.
Definition upwind.H:145
TypeName("upwind")
Runtime type information.
upwind(const fvMesh &mesh, Istream &is)
Construct from Istream.
Definition upwind.H:93
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation limiter.
Definition upwind.H:121
dynamicFvMesh & mesh
word timeName
Definition getTimeIndex.H:3
Namespace for OpenFOAM.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Foam::surfaceFields.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68