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-2020 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 and internal field
119  (
120  const fvPatch&,
121  const DimensionedField<scalar, volMesh>&
122  );
123 
124  //- Construct from patch, internal field and dictionary
126  (
127  const fvPatch&,
128  const DimensionedField<scalar, volMesh>&,
129  const dictionary&
130  );
131 
132  //- Construct by mapping given
133  // prghTotalHydrostaticPressureFvPatchScalarField onto a new patch
135  (
137  const fvPatch&,
138  const DimensionedField<scalar, volMesh>&,
139  const fvPatchFieldMapper&
140  );
141 
142  //- Disallow copy without setting internal field reference
144  (
146  ) = delete;
147 
148  //- Copy constructor setting internal field reference
150  (
153  );
154 
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
162  (
164  );
165  }
166 
167 
168  // Member Functions
169 
170  // Evaluation functions
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
This boundary condition provides static pressure condition for p_rgh, calculated as: ...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
TypeName("prghTotalHydrostaticPressure")
Runtime type information.
prghTotalHydrostaticPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Namespace for OpenFOAM.