transonicEntrainmentPressureFvPatchScalarField.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) 2021-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::transonicEntrainmentPressureFvPatchScalarField
26 
27 Description
28  This boundary condition provides an entrainment condition for pressure
29  including support for supersonic jets exiting the domain.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  rho | Density field name | no | rho
35  psi | Compressibility field name | no | thermo:psi
36  gamma | Heat capacity ratio (cp/Cv) | yes |
37  Mb | Blending Mach No | no | 0.5
38  phi | Flux field name | no | phi
39  p0 | Reference pressure | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type transonicEntrainmentPressure;
47  gamma 1.4;
48  p0 uniform 1e5;
49  }
50  \endverbatim
51 
52 See also
53  Foam::entrainmentPressureFvPatchScalarField
54  Foam::mixedFvPatchField
55 
56 SourceFiles
57  transonicEntrainmentPressureFvPatchScalarField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef transonicEntrainmentPressureFvPatchScalarField_H
62 #define transonicEntrainmentPressureFvPatchScalarField_H
63 
64 #include "fvPatchFields.H"
65 #include "mixedFvPatchFields.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class transonicEntrainmentPressureFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class transonicEntrainmentPressureFvPatchScalarField
77 :
78  public mixedFvPatchScalarField
79 {
80  // Private Data
81 
82  //- Name of density field field, default = "rho"
83  const word rhoName_;
84 
85  //- Name of compressibility field, default = "thermo:psi"
86  const word psiName_;
87 
88  //- Name of the flux field
89  const word phiName_;
90 
91  //- Heat capacity ratio
92  const scalar gamma_;
93 
94  //-
95  const scalar Mb_;
96 
97  //- Reference pressure
98  scalarField p0_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("transonicEntrainmentPressure");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // transonicEntrainmentPressureFvPatchScalarField onto a new patch
127  (
129  const fvPatch&,
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  // Mapping functions
163 
164  //- Map (and resize as needed) from self given a mapping object
165  // Used to update fields following mesh topology change
166  virtual void autoMap(const fvPatchFieldMapper&);
167 
168  //- Reverse map the given fvPatchField onto this fvPatchField
169  // Used to reconstruct fields
170  virtual void rmap(const fvPatchScalarField&, const labelList&);
171 
172  //- Reset the fvPatchField to the given fvPatchField
173  // Used for mesh to mesh mapping
174  virtual void reset(const fvPatchScalarField&);
175 
176 
177  // Evaluation functions
178 
179  //- Update the coefficients associated with the patch field
180  virtual void updateCoeffs();
181 
182 
183  //- Write
184  virtual void write(Ostream&) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName("transonicEntrainmentPressure")
Runtime type information.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
This boundary condition provides an entrainment condition for pressure including support for superson...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
transonicEntrainmentPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.