supersonicFreestreamFvPatchVectorField.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) 2011-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::supersonicFreestreamFvPatchVectorField
26 
27 Description
28  This boundary condition provides a supersonic free-stream condition.
29 
30  - supersonic outflow is vented according to ???
31  - supersonic inflow is assumed to occur according to the Prandtl-Meyer
32  expansion process.
33  - subsonic outflow is applied via a zero-gradient condition from inside
34  the domain.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  T | Temperature field name | no | T
40  p | Pressure field name | no | p
41  psi | Compressibility field name | no | psi
42  UInf | free-stream velocity | yes |
43  pInf | free-stream pressure | yes |
44  TInf | free-stream temperature | yes |
45  gamma | heat capacity ratio (cp/Cv) | yes |
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type supersonicFreestream;
53  UInf 500;
54  pInf 1e4;
55  TInf 265;
56  gamma 1.4;
57  }
58  \endverbatim
59 
60  Note:
61  This boundary condition is ill-posed if the free-stream flow is normal
62  to the boundary.
63 
64 SourceFiles
65  supersonicFreestreamFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef supersonicFreestreamFvPatchVectorField_H
70 #define supersonicFreestreamFvPatchVectorField_H
71 
72 #include "fvPatchFields.H"
73 #include "mixedFvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class supersonicFreestreamFvPatchVectorField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class supersonicFreestreamFvPatchVectorField
85 :
86  public mixedFvPatchVectorField
87 {
88  // Private Data
89 
90  //- Name of temperature field, default = "T"
91  word TName_;
92 
93  //- Name of pressure field, default = "p"
94  word pName_;
95 
96  //- Name of compressibility field field, default = "psi"
97  word psiName_;
98 
99  //- Velocity of the free stream
100  vector UInf_;
101 
102  //- Pressure of the free stream
103  scalar pInf_;
104 
105  //- Temperature of the free stream
106  scalar TInf_;
107 
108  //- Heat capacity ratio
109  scalar gamma_;
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("supersonicFreestream");
116 
117 
118  // Constructors
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given supersonicFreestreamFvPatchVectorField
129  // onto a new patch
131  (
133  const fvPatch&,
135  const fvPatchFieldMapper&
136  );
137 
138  //- Disallow copy without setting internal field reference
140  (
142  ) = delete;
143 
144  //- Copy constructor setting internal field reference
146  (
149  );
150 
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  );
161  }
162 
163 
164  // Member Functions
165 
166  // Access
167 
168  //- Return the velocity at infinity
169  const vector& UInf() const
170  {
171  return UInf_;
172  }
173 
174  //- Return reference to the velocity at infinity to allow adjustment
175  vector& UInf()
176  {
177  return UInf_;
178  }
179 
180  //- Return the pressure at infinity
181  scalar pInf() const
182  {
183  return pInf_;
184  }
185 
186  //- Return reference to the pressure at infinity to allow adjustment
187  scalar& pInf()
188  {
189  return pInf_;
190  }
191 
192  //- Return the temperature at infinity
193  scalar TInf() const
194  {
195  return TInf_;
196  }
197 
198  //- Return reference to the temperature at infinity
199  // to allow adjustment
200  scalar& TInf()
201  {
202  return TInf_;
203  }
204 
205 
206  // Evaluation functions
207 
208  //- Update the coefficients associated with the patch field
209  virtual void updateCoeffs();
210 
211 
212  //- Write
213  virtual void write(Ostream&) const;
214 };
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************************************************************* //
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:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a supersonic free-stream condition.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
const vector & UInf() const
Return the velocity at infinity.
TypeName("supersonicFreestream")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
scalar pInf() const
Return the pressure at infinity.
scalar TInf() const
Return the temperature at infinity.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49