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-2022 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  //- Disallow copy without setting internal field reference
120 
121  //- Copy constructor setting internal field reference
123  (
126  );
127 
128  //- Construct and return a clone setting internal field reference
130  (
132  ) const
133  {
135  (
136  new pressureFvPatchScalarField(*this, iF)
137  );
138  }
140 
141  // Member Functions
142 
143  // Access
144 
145  //- Return the static pressure
146  const scalarField& p() const
147  {
148  return p_;
149  }
150 
151  //- Return reference to the static pressure to allow adjustment
152  scalarField& p()
153  {
154  return p_;
155  }
156 
157 
158  // Mapping functions
159 
160  //- Map (and resize as needed) from self given a mapping object
161  // Used to update fields following mesh topology change
162  virtual void autoMap(const fvPatchFieldMapper&);
163 
164  //- Reverse map the given fvPatchField onto this fvPatchField
165  // Used to reconstruct fields
166  virtual void rmap(const fvPatchScalarField&, const labelList&);
167 
168  //- Reset the fvPatchField to the given fvPatchField
169  // Used for mesh to mesh mapping
170  virtual void reset(const fvPatchScalarField&);
171 
172 
173  // Evaluation functions
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178 
179  //- Write
180  virtual void write(Ostream&) const;
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
TypeName("pressure")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const scalarField & p() const
Return the static pressure.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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.