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