prghTotalPressureFvPatchScalarField.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) 2015-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::prghTotalPressureFvPatchScalarField
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 = p - \rho g.(h - hRef)
36  \f]
37 
38  \f[
39  p = p0 - 0.5 \rho |U|^2
40  \f]
41 
42  where
43  \vartable
44  p_rgh | Pseudo hydrostatic pressure [Pa]
45  p | Static pressure [Pa]
46  p0 | Total pressure [Pa]
47  h | Height in the opposite direction to gravity
48  hRef | Reference height in the opposite direction to gravity
49  \rho | Density
50  g | Acceleration due to gravity [m/s^2]
51  \endtable
52 
53 Usage
54  \table
55  Property | Description | Required | Default value
56  U | Velocity field name | no | U
57  phi | Flux field name | no | phi
58  rho | Density field name | no | rho
59  p0 | Total pressure | yes |
60  \endtable
61 
62  Example of the boundary condition specification:
63  \verbatim
64  <patchName>
65  {
66  type prghTotalPressure;
67  p0 uniform 0;
68  }
69  \endverbatim
70 
71 See also
72  Foam::fixedValueFvPatchScalarField
73 
74 SourceFiles
75  prghTotalPressureFvPatchScalarField.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef prghTotalPressureFvPatchScalarField_H
80 #define prghTotalPressureFvPatchScalarField_H
81 
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class prghTotalPressureFvPatchScalarField Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class prghTotalPressureFvPatchScalarField
94 :
95  public fixedValueFvPatchScalarField
96 {
97 
98 protected:
99 
100  // Protected data
101 
102  //- Name of the velocity field
103  word UName_;
104 
105  //- Name of the flux transporting the field
106  word phiName_;
107 
108  //- Name of phase-fraction field
109  word rhoName_;
110 
111  //- Total pressure
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("prghTotalPressure");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
127  const DimensionedField<scalar, volMesh>&
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
134  const DimensionedField<scalar, volMesh>&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given
139  // prghTotalPressureFvPatchScalarField onto a new patch
141  (
143  const fvPatch&,
144  const DimensionedField<scalar, volMesh>&,
146  );
147 
148  //- Construct as copy
150  (
152  );
153 
154  //- Construct and return a clone
156  {
158  (
160  );
161  }
162 
163  //- Construct as copy setting internal field reference
165  (
168  );
169 
170  //- Construct and return a clone setting internal field reference
172  (
174  ) const
175  {
177  (
179  );
180  }
181 
182 
183  // Member functions
184 
185  // Access
186 
187  //- Return the total pressure
188  const scalarField& p0() const
189  {
190  return p0_;
191  }
192 
193  //- Return reference to the total pressure to allow adjustment
194  scalarField& p0()
195  {
196  return p0_;
197  }
198 
199 
200  // Mapping functions
201 
202  //- Map (and resize as needed) from self given a mapping object
203  virtual void autoMap
204  (
205  const fvPatchFieldMapper&
206  );
208  //- Reverse map the given fvPatchField onto this fvPatchField
209  virtual void rmap
210  (
211  const fvPatchScalarField&,
212  const labelList&
213  );
214 
215 
216  // Evaluation functions
217 
218  //- Update the coefficients associated with the patch field
219  virtual void updateCoeffs();
220 
221 
222  //- Write
223  virtual void write(Ostream&) const;
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
const scalarField & p0() const
Return the total pressure.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
This boundary condition provides static pressure condition for p_rgh, calculated as: ...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
prghTotalPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
word phiName_
Name of the flux transporting the field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
TypeName("prghTotalPressure")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Namespace for OpenFOAM.