pressureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018 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::pressureFvPatchScalarField
26 
27 Description
28  Static pressure boundary condition
29 
30  Used as the base-class for static pressure boundary conditions force
31  alternative pressure variables, e.g. p_rgh.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  p | static pressure | yes |
37  \endtable
38 
39  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  type pressure;
44  p uniform 0;
45  value uniform 0; // optional initial value
46  }
47  \endverbatim
48 
49 See also
50  Foam::fixedValueFvPatchScalarField
51  Foam::PrghPressureFvPatchScalarField
52 
53 SourceFiles
54  pressureFvPatchScalarField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef pressureFvPatchScalarField_H
59 #define pressureFvPatchScalarField_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class pressureFvPatchScalarField Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class pressureFvPatchScalarField
73 :
74  public fixedValueFvPatchScalarField
75 {
76 
77 protected:
78 
79  // Protected data
80 
81  //- Static pressure
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("pressure");
89 
90 
91  // Constructors
92 
93  //- Construct from patch and internal field
95  (
96  const fvPatch&,
98  );
99 
100  //- Construct from patch, internal field and dictionary
102  (
103  const fvPatch&,
105  const dictionary&
106  );
107 
108  //- Construct by mapping given
109  // pressureFvPatchScalarField onto a new patch
111  (
113  const fvPatch&,
115  const fvPatchFieldMapper&
116  );
117 
118  //- Construct as copy
120  (
122  );
123 
124  //- Construct and return a clone
125  virtual tmp<fvPatchScalarField> clone() const
126  {
128  (
129  new pressureFvPatchScalarField(*this)
130  );
131  }
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140  //- Construct and return a clone setting internal field reference
142  (
144  ) const
145  {
147  (
148  new pressureFvPatchScalarField(*this, iF)
149  );
150  }
152 
153  // Member functions
154 
155  // Access
156 
157  //- Return the static pressure
158  const scalarField& p() const
159  {
160  return p_;
161  }
162 
163  //- Return reference to the static pressure to allow adjustment
164  scalarField& p()
165  {
166  return p_;
167  }
168 
169 
170  // Mapping functions
171 
172  //- Map (and resize as needed) from self given a mapping object
173  virtual void autoMap
174  (
175  const fvPatchFieldMapper&
176  );
177 
178  //- Reverse map the given fvPatchField onto this fvPatchField
179  virtual void rmap
180  (
181  const fvPatchScalarField&,
182  const labelList&
183  );
184 
185 
186  // Evaluation functions
187 
188  //- Update the coefficients associated with the patch field
189  virtual void updateCoeffs();
190 
191 
192  //- Write
193  virtual void write(Ostream&) const;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
TypeName("pressure")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const scalarField & p() const
Return the static pressure.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
pressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Static pressure boundary condition.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.