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 | Copyright (C) 2013-2015 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::prghPressureFvPatchScalarField
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  where
39  \vartable
40  p_rgh | Pseudo hydrostatic pressure [Pa]
41  p | Static pressure [Pa]
42  h | Height in the opposite direction to gravity
43  hRef | Reference height in the opposite direction to gravity
44  \rho | density
45  g | acceleration due to gravity [m/s^2]
46  \endtable
47 
48  \heading Patch usage
49 
50  \table
51  Property | Description | Required | Default value
52  rhoName | rho field name | no | rho
53  p | static pressure | yes |
54  \endtable
55 
56  Example of the boundary condition specification:
57  \verbatim
58  myPatch
59  {
60  type prghPressure;
61  rhoName rho;
62  p uniform 0;
63  value uniform 0; // optional initial value
64  }
65  \endverbatim
66 
67 SeeAlso
68  Foam::fixedValueFvPatchScalarField
69 
70 SourceFiles
71  prghPressureFvPatchScalarField.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef prghPressureFvPatchScalarField_H
76 #define prghPressureFvPatchScalarField_H
77 
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class prghPressureFvPatchScalarField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class prghPressureFvPatchScalarField
90 :
91  public fixedValueFvPatchScalarField
92 {
93 
94 protected:
95 
96  // Protected data
97 
98  //- Name of phase-fraction field
99  word rhoName_;
100 
101  //- Static pressure
102  scalarField p_;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("prghPressure");
109 
110 
111  // Constructors
112 
113  //- Construct from patch and internal field
115  (
116  const fvPatch&,
117  const DimensionedField<scalar, volMesh>&
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
124  const DimensionedField<scalar, volMesh>&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given
129  // prghPressureFvPatchScalarField onto a new patch
131  (
133  const fvPatch&,
135  const fvPatchFieldMapper&
136  );
137 
138  //- Construct as copy
140  (
142  );
143 
144  //- Construct and return a clone
145  virtual tmp<fvPatchScalarField> clone() const
146  {
148  (
150  );
151  }
152 
153  //- Construct as copy setting internal field reference
155  (
158  );
159 
160  //- Construct and return a clone setting internal field reference
162  (
164  ) const
165  {
167  (
168  new prghPressureFvPatchScalarField(*this, iF)
169  );
170  }
171 
172 
173  // Member functions
174 
175  // Access
176 
177  //- Return the rhoName
178  const word& rhoName() const
179  {
180  return rhoName_;
181  }
182 
183  //- Return reference to the rhoName to allow adjustment
184  word& rhoName()
185  {
186  return rhoName_;
187  }
188 
189  //- Return the static pressure
190  const scalarField& p() const
191  {
192  return p_;
193  }
194 
195  //- Return reference to the static pressure to allow adjustment
196  scalarField& p()
197  {
198  return p_;
199  }
200 
201 
202  // Mapping functions
203 
204  //- Map (and resize as needed) from self given a mapping object
205  virtual void autoMap
206  (
207  const fvPatchFieldMapper&
208  );
209 
210  //- Reverse map the given fvPatchField onto this fvPatchField
211  virtual void rmap
212  (
213  const fvPatchScalarField&,
214  const labelList&
215  );
216 
217 
218  // Evaluation functions
219 
220  //- Update the coefficients associated with the patch field
221  virtual void updateCoeffs();
222 
223 
224  //- Write
225  virtual void write(Ostream&) const;
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::prghPressureFvPatchScalarField::rhoName
word & rhoName()
Return reference to the rhoName to allow adjustment.
Definition: prghPressureFvPatchScalarField.H:222
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:48
Foam::prghPressureFvPatchScalarField::rhoName_
word rhoName_
Name of phase-fraction field.
Definition: prghPressureFvPatchScalarField.H:137
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::prghPressureFvPatchScalarField::p
scalarField & p()
Return reference to the static pressure to allow adjustment.
Definition: prghPressureFvPatchScalarField.H:234
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::prghPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: prghPressureFvPatchScalarField.C:140
Foam::prghPressureFvPatchScalarField::TypeName
TypeName("prghPressure")
Runtime type information.
Foam::prghPressureFvPatchScalarField::p
const scalarField & p() const
Return the static pressure.
Definition: prghPressureFvPatchScalarField.H:228
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::prghPressureFvPatchScalarField::rhoName
const word & rhoName() const
Return the rhoName.
Definition: prghPressureFvPatchScalarField.H:216
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::prghPressureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: prghPressureFvPatchScalarField.C:116
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::prghPressureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: prghPressureFvPatchScalarField.C:171
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
fixedValueFvPatchFields.H
Foam::prghPressureFvPatchScalarField::p_
scalarField p_
Static pressure.
Definition: prghPressureFvPatchScalarField.H:140
Foam::prghPressureFvPatchScalarField::prghPressureFvPatchScalarField
prghPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: prghPressureFvPatchScalarField.C:36
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::prghPressureFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: prghPressureFvPatchScalarField.C:126
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::prghPressureFvPatchScalarField
This boundary condition provides static pressure condition for p_rgh, calculated as:
Definition: prghPressureFvPatchScalarField.H:127
Foam::prghPressureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: prghPressureFvPatchScalarField.H:183
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51