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-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::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 | thermo: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 = "thermo: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 and internal field
122  (
123  const fvPatch&,
125  );
126 
127  //- Construct from patch, internal field and dictionary
129  (
130  const fvPatch&,
132  const dictionary&
133  );
134 
135  //- Construct by mapping given supersonicFreestreamFvPatchVectorField
136  // onto a new patch
138  (
140  const fvPatch&,
142  const fvPatchFieldMapper&
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  // Access
174 
175  //- Return the velocity at infinity
176  const vector& UInf() const
177  {
178  return UInf_;
179  }
180 
181  //- Return reference to the velocity at infinity to allow adjustment
182  vector& UInf()
183  {
184  return UInf_;
185  }
186 
187  //- Return the pressure at infinity
188  scalar pInf() const
189  {
190  return pInf_;
191  }
192 
193  //- Return reference to the pressure at infinity to allow adjustment
194  scalar& pInf()
195  {
196  return pInf_;
197  }
198 
199  //- Return the temperature at infinity
200  scalar TInf() const
201  {
202  return TInf_;
203  }
204 
205  //- Return reference to the temperature at infinity
206  // to allow adjustment
207  scalar& TInf()
208  {
209  return TInf_;
210  }
211 
212 
213  // Evaluation functions
214 
215  //- Update the coefficients associated with the patch field
216  virtual void updateCoeffs();
217 
218 
219  //- Write
220  virtual void write(Ostream&) const;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const vector & UInf() const
Return the velocity at infinity.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
scalar pInf() const
Return the pressure at infinity.
TypeName("supersonicFreestream")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
This boundary condition provides a supersonic free-stream condition.
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
scalar TInf() const
Return the temperature at infinity.
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.