entrainmentPressureFvPatchScalarField.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) 2020-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::entrainmentPressureFvPatchScalarField
26 
27 Description
28  This is a boundary condition for pressure suitable for boundaries at which
29  the flow direction is uncertain but both inflow and/or outflow can occur.
30  The condition switches based on the direction of flow. For outflow, the
31  patch pressure is simply set to the reference pressure. For inflow, the
32  patch pressure is reduced by the dynamic pressure calculated using the
33  inflow velocity normal to the patch.
34 
35  For incompressible flow, with pressure expressed in kinematic units, the
36  pressure with inflow is calculated as:
37 
38  \f[
39  p_p = p_0 - 0.5 |Un|^2
40  \f]
41  where
42  \vartable
43  p_p | pressure at patch [m^2/s^2]
44  p_0 | reference pressure [m^2/s^2]
45  Un | patch normal velocity [m/s]
46  \endvartable
47 
48  The condition is similar to the totalPressure condition and includes
49  further calculations of pressure for compressible flow under subsonic,
50  transonic and supersonic regimes.
51 
52  Like totalPressure, entrainmentPressure is usually applied in conjunction
53  with the pressureInletOutletVelocity condition for velocity. The
54  entrainmentPressure condition calculates the pressure using a normal
55  velocity, based on the fluxes at the boundary. The totalPressure condition
56  calculates the pressure using the inflow velocity itself.
57 
58  With the pressureInletOutletVelocity condition, using the default
59  tangentialVelocity of zero, any inflow velocity is constrained to be
60  normal to the boundary, making the two pressure boundary conditions
61  very similar. The entrainmentPressure condition is, however, more robust
62  because it couples with the flux rather than velocity. The condition
63  performs particularly well at boundaries where the flow direction tends
64  to switch frequently between in and out of the domain.
65 
66 Usage
67  \table
68  Property | Description | Required | Default value
69  phi | Flux field name | no | phi
70  rho | Density field name | no | rho
71  psi | Compressibility field name | no | none
72  gamma | (Cp/Cv) | no | 1
73  p0 | Reference pressure | yes |
74  \endtable
75 
76  Example of the boundary condition specification:
77  \verbatim
78  <patchName>
79  {
80  type entrainmentPressure;
81  p0 uniform 1e5;
82  }
83  \endverbatim
84 
85 See also
86  Foam::dynamicPressureFvPatchScalarField
87  Foam::totalPressureFvPatchScalarField
88  Foam::fixedValueFvPatchField
89 
90 SourceFiles
91  entrainmentPressureFvPatchScalarField.C
92 
93 \*---------------------------------------------------------------------------*/
94 
95 #ifndef entrainmentPressureFvPatchScalarField_H
96 #define entrainmentPressureFvPatchScalarField_H
97 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class entrainmentPressureFvPatchScalarField Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class entrainmentPressureFvPatchScalarField
110 :
111  public dynamicPressureFvPatchScalarField
112 {
113  // Private Data
114 
115  //- Name of the flux field
116  const word phiName_;
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("entrainmentPressure");
123 
124 
125  // Constructors
126 
127  //- Construct from patch, internal field and dictionary
129  (
130  const fvPatch&,
131  const DimensionedField<scalar, volMesh>&,
132  const dictionary&
133  );
134 
135  //- Construct by mapping given entrainmentPressureFvPatchScalarField
136  // onto a new patch
138  (
140  const fvPatch&,
141  const DimensionedField<scalar, volMesh>&,
142  const fieldMapper&
143  );
144 
145  //- Disallow copy without setting internal field reference
147  (
149  ) = delete;
150 
151  //- Copy constructor setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member Functions
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 // ************************************************************************* //
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
This is a boundary condition for pressure suitable for boundaries at which the flow direction is unce...
entrainmentPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("entrainmentPressure")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.