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 -------------------------------------------------------------------------------
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::prghPressureFvPatchScalarField
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 = 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 
50 Usage
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 
68 See also
69  Foam::fixedValueFvPatchScalarField
70 
71 SourceFiles
72  prghPressureFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef prghPressureFvPatchScalarField_H
77 #define prghPressureFvPatchScalarField_H
78 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class prghPressureFvPatchScalarField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class prghPressureFvPatchScalarField
91 :
92  public fixedValueFvPatchScalarField
93 {
94 
95 protected:
96 
97  // Protected data
98 
99  //- Name of phase-fraction field
100  word rhoName_;
101 
102  //- Static pressure
103  scalarField p_;
104 
105 
106 public:
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  );
128 
129  //- Construct by mapping given
130  // prghPressureFvPatchScalarField onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchScalarField> clone() const
147  {
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 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::prghPressureFvPatchScalarField::rhoName_
word rhoName_
Name of phase-fraction field.
Definition: prghPressureFvPatchScalarField.H:138
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::prghPressureFvPatchScalarField::p
scalarField & p()
Return reference to the static pressure to allow adjustment.
Definition: prghPressureFvPatchScalarField.H:223
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::prghPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: prghPressureFvPatchScalarField.C:143
Foam::prghPressureFvPatchScalarField::TypeName
TypeName("prghPressure")
Runtime type information.
Foam::prghPressureFvPatchScalarField::p
const scalarField & p() const
Return the static pressure.
Definition: prghPressureFvPatchScalarField.H:217
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::prghPressureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: prghPressureFvPatchScalarField.C:119
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::prghPressureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: prghPressureFvPatchScalarField.C:174
Foam::List< label >
fixedValueFvPatchFields.H
Foam::prghPressureFvPatchScalarField::p_
scalarField p_
Static pressure.
Definition: prghPressureFvPatchScalarField.H:141
Foam::prghPressureFvPatchScalarField::prghPressureFvPatchScalarField
prghPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: prghPressureFvPatchScalarField.C:39
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::prghPressureFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: prghPressureFvPatchScalarField.C:129
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::prghPressureFvPatchScalarField
This boundary condition provides static pressure condition for p_rgh, calculated as:
Definition: prghPressureFvPatchScalarField.H:128
Foam::prghPressureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: prghPressureFvPatchScalarField.H:184
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54