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  p = p0 - 0.5 \rho |U|^2
37  \f]
38 
39  where
40  \vartable
41  p_rgh | Pseudo hydrostatic pressure [Pa]
42  p | Static pressure [Pa]
43  p0 | Total pressure [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  p0 | Total pressure | yes |
57  \endtable
58 
59  Example of the boundary condition specification:
60  \verbatim
61  <patchName>
62  {
63  type prghTotalPressure;
64  p0 uniform 0;
65  }
66  \endverbatim
67 
68 See also
69  Foam::fixedValueFvPatchScalarField
70 
71 SourceFiles
72  prghTotalPressureFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef prghTotalPressureFvPatchScalarField_H
77 #define prghTotalPressureFvPatchScalarField_H
78 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class prghTotalPressureFvPatchScalarField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class prghTotalPressureFvPatchScalarField
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 phase-fraction field
106  word rhoName_;
107 
108  //- Total pressure
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("prghTotalPressure");
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  // prghTotalPressureFvPatchScalarField onto a new patch
138  (
140  const fvPatch&,
141  const DimensionedField<scalar, volMesh>&,
143  );
144 
145  //- Construct as copy
147  (
149  );
150 
151  //- Construct and return a clone
153  {
155  (
157  );
158  }
159 
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  // Access
183 
184  //- Return the total pressure
185  const scalarField& p0() const
186  {
187  return p0_;
188  }
189 
190  //- Return reference to the total pressure to allow adjustment
191  scalarField& p0()
192  {
193  return p0_;
194  }
195 
196 
197  // Mapping functions
198 
199  //- Map (and resize as needed) from self given a mapping object
200  virtual void autoMap
201  (
202  const fvPatchFieldMapper&
203  );
205  //- Reverse map the given fvPatchField onto this fvPatchField
206  virtual void rmap
207  (
208  const fvPatchScalarField&,
209  const labelList&
210  );
211 
212 
213  // Evaluation functions
214 
215  //- Update the coefficients associated with the patch field
216  virtual void updateCoeffs();
217 
218 
219  //- Write
220  virtual void write(Ostream&) const;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
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:65
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:54
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Namespace for OpenFOAM.
const scalarField & p0() const
Return the total pressure.