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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::prghTotalHydrostaticPressureFvPatchScalarField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
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 
50 Usage
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 
69 See also
70  Foam::fixedValueFvPatchScalarField
71  Foam::prghTotalPressureFvPatchScalarField
72 
73 SourceFiles
74  prghTotalHydrostaticPressureFvPatchScalarField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef prghTotalHydrostaticPressureFvPatchScalarField_H
79 #define prghTotalHydrostaticPressureFvPatchScalarField_H
80 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class prghTotalHydrostaticPressureFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class prghTotalHydrostaticPressureFvPatchScalarField
93 :
94  public fixedValueFvPatchScalarField
95 {
96 
97 protected:
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 
114 public:
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  (
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
155  {
157  (
159  );
160  }
161 
162  //- Construct as copy setting internal field reference
164  (
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 // ************************************************************************* //
Foam::prghTotalHydrostaticPressureFvPatchScalarField::ph_rghName_
word ph_rghName_
Name of hydrostatic pressure field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:164
Foam::prghTotalHydrostaticPressureFvPatchScalarField::rhoName_
word rhoName_
Name of density field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:161
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::prghTotalHydrostaticPressureFvPatchScalarField::prghTotalHydrostaticPressureFvPatchScalarField
prghTotalHydrostaticPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.C:40
Foam::prghTotalHydrostaticPressureFvPatchScalarField
This boundary condition provides static pressure condition for p_rgh, calculated as:
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:145
Foam::prghTotalHydrostaticPressureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.C:147
Foam::prghTotalHydrostaticPressureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:207
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::prghTotalHydrostaticPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.C:117
Foam::prghTotalHydrostaticPressureFvPatchScalarField::UName_
word UName_
Name of the velocity field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:155
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::prghTotalHydrostaticPressureFvPatchScalarField::TypeName
TypeName("prghTotalHydrostaticPressure")
Runtime type information.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::prghTotalHydrostaticPressureFvPatchScalarField::phiName_
word phiName_
Name of the flux transporting the field.
Definition: prghTotalHydrostaticPressureFvPatchScalarField.H:158
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54