prghTotalPressureFvPatchScalarField.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) 2015-2016 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::prghTotalPressureFvPatchScalarField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides static pressure condition for p_rgh,
34 calculated as:
35
36 \f[
37 p_rgh = p - \rho g.(h - hRef)
38 \f]
39
40 \f[
41 p = p0 - 0.5 \rho |U|^2
42 \f]
43
44 where
45 \vartable
46 p_rgh | Pseudo hydrostatic pressure [Pa]
47 p | Static pressure [Pa]
48 p0 | Total pressure [Pa]
49 h | Height in the opposite direction to gravity
50 hRef | Reference height in the opposite direction to gravity
51 \rho | Density
52 g | Acceleration due to gravity [m/s^2]
53 \endtable
54
55Usage
56 \table
57 Property | Description | Required | Default value
58 U | Velocity field name | no | U
59 phi | Flux field name | no | phi
60 rho | Density field name | no | rho
61 p0 | Total pressure | yes |
62 \endtable
63
64 Example of the boundary condition specification:
65 \verbatim
66 <patchName>
67 {
68 type prghTotalPressure;
69 p0 uniform 0;
70 }
71 \endverbatim
72
73See also
74 Foam::fixedValueFvPatchScalarField
75
76SourceFiles
77 prghTotalPressureFvPatchScalarField.C
78
79\*---------------------------------------------------------------------------*/
80
81#ifndef prghTotalPressureFvPatchScalarField_H
82#define prghTotalPressureFvPatchScalarField_H
83
85
86// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88namespace Foam
89{
90
91/*---------------------------------------------------------------------------*\
92 Class prghTotalPressureFvPatchScalarField Declaration
93\*---------------------------------------------------------------------------*/
94
95class prghTotalPressureFvPatchScalarField
96:
97 public fixedValueFvPatchScalarField
98{
99
100protected:
101
102 // Protected data
103
104 //- Name of the velocity field
105 word UName_;
106
107 //- Name of the flux transporting the field
108 word phiName_;
109
110 //- Name of phase-fraction field
111 word rhoName_;
112
113 //- Total pressure
115
116
117public:
118
119 //- Runtime type information
120 TypeName("prghTotalPressure");
121
122
123 // Constructors
124
125 //- Construct from patch and internal field
127 (
128 const fvPatch&,
129 const DimensionedField<scalar, volMesh>&
130 );
131
132 //- Construct from patch, internal field and dictionary
134 (
135 const fvPatch&,
136 const DimensionedField<scalar, volMesh>&,
137 const dictionary&
138 );
139
140 //- Construct by mapping given
141 // prghTotalPressureFvPatchScalarField onto a new patch
143 (
144 const prghTotalPressureFvPatchScalarField&,
145 const fvPatch&,
146 const DimensionedField<scalar, volMesh>&,
148 );
149
150 //- Construct as copy
152 (
154 );
155
156 //- Construct and return a clone
158 {
162 );
164
165 //- Construct as copy setting internal field reference
167 (
170 );
171
172 //- Construct and return a clone setting internal field reference
174 (
176 ) const
177 {
179 (
181 );
182 }
183
184
185 // Member functions
186
187 // Access
188
189 //- Return the total pressure
190 const scalarField& p0() const
191 {
192 return p0_;
193 }
194
195 //- Return reference to the total pressure to allow adjustment
196 scalarField& p0()
197 {
198 return p0_;
199 }
200
201
202 // Mapping functions
203
204 //- Map (and resize as needed) from self given a mapping object
205 virtual void autoMap
206 (
207 const fvPatchFieldMapper&
208 );
210 //- Reverse map the given fvPatchField onto this fvPatchField
211 virtual void rmap
212 (
213 const fvPatchScalarField&,
214 const labelList&
215 );
216
217
218 // Evaluation functions
219
220 //- Update the coefficients associated with the patch field
221 virtual void updateCoeffs();
222
223
224 //- Write
225 virtual void write(Ostream&) const;
226};
227
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace Foam
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235#endif
236
237// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides static pressure condition for p_rgh, calculated as:
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
const scalarField & p0() const
Return the total pressure.
prghTotalPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
word phiName_
Name of the flux transporting the field.
TypeName("prghTotalPressure")
Runtime type information.
scalarField & p0()
Return reference to the total pressure to allow adjustment.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73