prghTotalHydrostaticPressureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::prghTotalHydrostaticPressureFvPatchScalarField
26 
27 Description
28  This boundary condition provides static pressure condition for p_rgh,
29  calculated as:
30 
31  \f[
32  p_rgh = ph_rgh - 0.5 \rho |U|^2
33  \f]
34 
35  where
36  \vartable
37  p_rgh | Pressure - \rho g.(h - hRef) [Pa]
38  ph_rgh | Hydrostatic pressure - \rho g.(h - hRef) [Pa]
39  h | Height in the opposite direction to gravity
40  hRef | Reference height in the opposite direction to gravity
41  \rho | Density
42  g | Acceleration due to gravity [m/s^2]
43  \endtable
44 
45 Usage
46  \table
47  Property | Description | Required | Default value
48  U | Velocity field name | no | U
49  phi | Flux field name | no | phi
50  rho | Density field name | no | rho
51  ph_rgh | ph_rgh field name | no | ph_rgh
52  value | Patch face values | yes |
53  \endtable
54 
55  Example of the boundary condition specification:
56  \verbatim
57  <patchName>
58  {
59  type prghTotalHydrostaticPressure;
60  value uniform 0;
61  }
62  \endverbatim
63 
64 See also
65  Foam::fixedValueFvPatchScalarField
66  Foam::prghTotalPressureFvPatchScalarField
67 
68 SourceFiles
69  prghTotalHydrostaticPressureFvPatchScalarField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef prghTotalHydrostaticPressureFvPatchScalarField_H
74 #define prghTotalHydrostaticPressureFvPatchScalarField_H
75 
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class prghTotalHydrostaticPressureFvPatchScalarField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class prghTotalHydrostaticPressureFvPatchScalarField
88 :
89  public fixedValueFvPatchScalarField
90 {
91 
92 protected:
93 
94  // Protected data
95 
96  //- Name of the velocity field
97  word UName_;
98 
99  //- Name of the flux transporting the field
100  word phiName_;
101 
102  //- Name of density field
103  word rhoName_;
104 
105  //- Name of hydrostatic pressure field
106  word ph_rghName_;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("prghTotalHydrostaticPressure");
113 
114 
115  // Constructors
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
121  const DimensionedField<scalar, volMesh>&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // prghTotalHydrostaticPressureFvPatchScalarField onto a new patch
128  (
130  const fvPatch&,
131  const DimensionedField<scalar, volMesh>&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Disallow copy without setting internal field reference
137  (
139  ) = delete;
140 
141  //- Copy constructor setting internal field reference
143  (
146  );
147 
148  //- Construct and return a clone setting internal field reference
150  (
152  ) const
153  {
155  (
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Evaluation functions
164 
165  //- Update the coefficients associated with the patch field
166  virtual void updateCoeffs();
167 
168 
169  //- Write
170  virtual void write(Ostream&) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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:57
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 void updateCoeffs()
Update the coefficients associated with the patch field.
prghTotalHydrostaticPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("prghTotalHydrostaticPressure")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.