prghPressureFvPatchScalarField.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) 2013-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::prghPressureFvPatchScalarField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides static pressure condition for p_rgh,
34 calculated as:
35
36 \f[
37 p_rgh = p - \rho g (h - hRef)
38 \f]
39
40 where
41 \vartable
42 p_rgh | Pseudo hydrostatic pressure [Pa]
43 p | Static 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
50Usage
51 \table
52 Property | Description | Required | Default value
53 rho | rho field name | no | rho
54 p | static pressure | yes |
55 \endtable
56
57 Example of the boundary condition specification:
58 \verbatim
59 <patchName>
60 {
61 type prghPressure;
62 rho rho;
63 p uniform 0;
64 value uniform 0; // optional initial value
65 }
66 \endverbatim
67
68See also
69 Foam::fixedValueFvPatchScalarField
70
71SourceFiles
72 prghPressureFvPatchScalarField.C
73
74\*---------------------------------------------------------------------------*/
75
76#ifndef prghPressureFvPatchScalarField_H
77#define prghPressureFvPatchScalarField_H
78
80
81// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82
83namespace Foam
84{
85
86/*---------------------------------------------------------------------------*\
87 Class prghPressureFvPatchScalarField Declaration
88\*---------------------------------------------------------------------------*/
89
90class prghPressureFvPatchScalarField
91:
92 public fixedValueFvPatchScalarField
93{
94
95protected:
96
97 // Protected data
98
99 //- Name of phase-fraction field
100 word rhoName_;
101
102 //- Static pressure
104
105
106public:
107
108 //- Runtime type information
109 TypeName("prghPressure");
110
111
112 // Constructors
113
114 //- Construct from patch and internal field
116 (
117 const fvPatch&,
118 const DimensionedField<scalar, volMesh>&
119 );
120
121 //- Construct from patch, internal field and dictionary
123 (
124 const fvPatch&,
125 const DimensionedField<scalar, volMesh>&,
126 const dictionary&
127 );
129 //- Construct by mapping given
130 // prghPressureFvPatchScalarField onto a new patch
132 (
134 const fvPatch&,
136 const fvPatchFieldMapper&
137 );
139 //- Construct as copy
143 );
144
145 //- Construct and return a clone
146 virtual tmp<fvPatchScalarField> clone() const
149 (
151 );
152 }
153
154 //- Construct as copy setting internal field reference
156 (
159 );
160
161 //- Construct and return a clone setting internal field reference
163 (
165 ) const
166 {
168 (
169 new prghPressureFvPatchScalarField(*this, iF)
170 );
171 }
172
173
174 // Member functions
175
176 // Access
177
178 //- Return the static pressure
179 const scalarField& p() const
180 {
181 return p_;
182 }
183
184 //- Return reference to the static pressure to allow adjustment
185 scalarField& p()
186 {
187 return p_;
188 }
189
190
191 // Mapping functions
192
193 //- Map (and resize as needed) from self given a mapping object
194 virtual void autoMap
195 (
196 const fvPatchFieldMapper&
197 );
198
199 //- Reverse map the given fvPatchField onto this fvPatchField
200 virtual void rmap
201 (
202 const fvPatchScalarField&,
203 const labelList&
204 );
205
206
207 // Evaluation functions
208
209 //- Update the coefficients associated with the patch field
210 virtual void updateCoeffs();
211
212
213 //- Write
214 virtual void write(Ostream&) const;
215};
216
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220} // End namespace Foam
221
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224#endif
225
226// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides static pressure condition for p_rgh, calculated as:
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
const scalarField & p() const
Return the static pressure.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
TypeName("prghPressure")
Runtime type information.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
prghPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
scalarField & p()
Return reference to the static pressure to allow adjustment.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73