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 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 boundary condition provides an entrainment pressure condition. The
29  condition is the same as totalPressure condition except that where the
30  total pressure uses the square of the velocity magnitude, this uses the
31  signed square of the normal velocity. In the incompressible case, that
32  means the formulation is as follows:
33 
34  \f[
35  p_p = p_0 + 0.5 Un |Un|
36  \f]
37  where
38  \vartable
39  p_p | pressure at patch [m^2/s^2]
40  p_0 | reference pressure [m^2/s^2]
41  U | patch normal velocity [m/s]
42  \endvartable
43 
44  This condition is particularly suitable for boundaries on which the flow
45  direction changes frequently and/or when the inlet/outlet direction is not
46  well defined.
47 
48 Usage
49  \table
50  Property | Description | Required | Default value
51  phi | Flux field name | no | phi
52  rho | Density field name | no | rho
53  psi | Compressibility field name | no | none
54  gamma | (Cp/Cv) | no | 1
55  p0 | Reference pressure | yes |
56  \endtable
57 
58  Example of the boundary condition specification:
59  \verbatim
60  <patchName>
61  {
62  type entrainmentPressure;
63  p0 uniform 1e5;
64  }
65  \endverbatim
66 
67 See also
68  Foam::dynamicPressureFvPatchScalarField
69  Foam::totalPressureFvPatchScalarField
70  Foam::fixedValueFvPatchField
71 
72 SourceFiles
73  entrainmentPressureFvPatchScalarField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef entrainmentPressureFvPatchScalarField_H
78 #define entrainmentPressureFvPatchScalarField_H
79 
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class entrainmentPressureFvPatchScalarField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class entrainmentPressureFvPatchScalarField
92 :
93  public dynamicPressureFvPatchScalarField
94 {
95  // Private Data
96 
97  //- Name of the flux field
98  const word phiName_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("entrainmentPressure");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
113  const DimensionedField<scalar, volMesh>&
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
120  const DimensionedField<scalar, volMesh>&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given entrainmentPressureFvPatchScalarField
125  // onto a new patch
127  (
129  const fvPatch&,
130  const DimensionedField<scalar, volMesh>&,
131  const fvPatchFieldMapper&
132  );
133 
134  //- Disallow copy without setting internal field reference
136  (
138  ) = delete;
139 
140  //- Copy constructor setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
156  );
157  }
158 
159 
160  // Member Functions
161 
162  // Evaluation functions
163 
164  //- Update the coefficients associated with the patch field
165  virtual void updateCoeffs();
166 
167 
168  //- Write
169  virtual void write(Ostream&) const;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
entrainmentPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
TypeName("entrainmentPressure")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition provides an entrainment pressure condition. The condition is the same as tota...
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Namespace for OpenFOAM.