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-2023 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, internal field and dictionary
95  (
96  const fvPatch&,
98  const dictionary&
99  );
100 
101  //- Construct by mapping given
102  // pressureFvPatchScalarField onto a new patch
104  (
106  const fvPatch&,
108  const fieldMapper&
109  );
110 
111  //- Disallow copy without setting internal field reference
113 
114  //- Copy constructor setting internal field reference
116  (
119  );
120 
121  //- Construct and return a clone setting internal field reference
123  (
125  ) const
126  {
128  (
129  new pressureFvPatchScalarField(*this, iF)
130  );
131  }
132 
133 
134  // Member Functions
135 
136  // Access
137 
138  //- Return the static pressure
139  const scalarField& p() const
140  {
141  return p_;
142  }
143 
144  //- Return reference to the static pressure to allow adjustment
145  scalarField& p()
146  {
147  return p_;
148  }
149 
150 
151  // Mapping functions
152 
153  //- Map the given fvPatchField onto this fvPatchField
154  virtual void map(const fvPatchScalarField&, const fieldMapper&);
155 
156  //- Reset the fvPatchField to the given fvPatchField
157  // Used for mesh to mesh mapping
158  virtual void reset(const fvPatchScalarField&);
159 
160 
161  // Evaluation functions
162 
163  //- Update the coefficients associated with the patch field
164  virtual void updateCoeffs();
165 
166 
167  //- Write
168  virtual void write(Ostream&) const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
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:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Static pressure boundary condition.
virtual void write(Ostream &) const
Write.
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.
const scalarField & p() const
Return the static pressure.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
pressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("pressure")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.