prghTotalHydrostaticPressureFvPatchScalarField.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) 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::prghTotalHydrostaticPressureFvPatchScalarField
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 = ph_rgh - 0.5 \rho |U|^2
38 \f]
39
40 where
41 \vartable
42 p_rgh | Pressure: \f$ \rho g (h - h_{ref}) \f$ [Pa]
43 ph_rgh | Hydrostatic pressure: \f$ \rho g (h - h_{ref}) \f$ [Pa]
44 h | Height in the opposite direction to gravity
45 hRef | Reference height in the opposite direction to gravity
46 \rho | Density
47 g | Acceleration due to gravity [m/s^2]
48 \endtable
49
50Usage
51 \table
52 Property | Description | Required | Default value
53 U | Velocity field name | no | U
54 phi | Flux field name | no | phi
55 rho | Density field name | no | rho
56 ph_rgh | ph_rgh field name | no | ph_rgh
57 value | Patch face values | yes |
58 \endtable
59
60 Example of the boundary condition specification:
61 \verbatim
62 <patchName>
63 {
64 type prghTotalHydrostaticPressure;
65 value uniform 0;
66 }
67 \endverbatim
68
69See also
70 Foam::fixedValueFvPatchScalarField
71 Foam::prghTotalPressureFvPatchScalarField
72
73SourceFiles
74 prghTotalHydrostaticPressureFvPatchScalarField.C
75
76\*---------------------------------------------------------------------------*/
77
78#ifndef prghTotalHydrostaticPressureFvPatchScalarField_H
79#define prghTotalHydrostaticPressureFvPatchScalarField_H
80
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85namespace Foam
86{
87
88/*---------------------------------------------------------------------------*\
89 Class prghTotalHydrostaticPressureFvPatchScalarField Declaration
90\*---------------------------------------------------------------------------*/
91
92class prghTotalHydrostaticPressureFvPatchScalarField
93:
94 public fixedValueFvPatchScalarField
95{
96
97protected:
98
99 // Protected data
100
101 //- Name of the velocity field
102 word UName_;
103
104 //- Name of the flux transporting the field
105 word phiName_;
106
107 //- Name of density field
108 word rhoName_;
109
110 //- Name of hydrostatic pressure field
111 word ph_rghName_;
112
113
114public:
115
116 //- Runtime type information
117 TypeName("prghTotalHydrostaticPressure");
118
119
120 // Constructors
121
122 //- Construct from patch and internal field
124 (
125 const fvPatch&,
126 const DimensionedField<scalar, volMesh>&
127 );
128
129 //- Construct from patch, internal field and dictionary
131 (
132 const fvPatch&,
133 const DimensionedField<scalar, volMesh>&,
134 const dictionary&
135 );
136
137 //- Construct by mapping given
138 // prghTotalHydrostaticPressureFvPatchScalarField onto a new patch
140 (
141 const prghTotalHydrostaticPressureFvPatchScalarField&,
142 const fvPatch&,
143 const DimensionedField<scalar, volMesh>&,
144 const fvPatchFieldMapper&
145 );
146
147 //- Construct as copy
149 (
151 );
152
153 //- Construct and return a clone
154 virtual tmp<fvPatchScalarField> clone() const
157 (
159 );
160 }
162 //- Construct as copy setting internal field reference
167 );
168
169 //- Construct and return a clone setting internal field reference
171 (
173 ) const
174 {
176 (
178 );
179 }
180
181
182 // Member functions
183
184 // Evaluation functions
185
186 //- Update the coefficients associated with the patch field
187 virtual void updateCoeffs();
188
189
190 //- Write
191 virtual void write(Ostream&) const;
192};
193
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197} // End namespace Foam
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201#endif
202
203// ************************************************************************* //
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 tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
prghTotalHydrostaticPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
TypeName("prghTotalHydrostaticPressure")
Runtime type information.
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.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73