supersonicFreestreamFvPatchVectorField.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::supersonicFreestreamFvPatchVectorField
28
29Group
30 grpInletBoundaryConditions grpOutletBoundaryConditions
31
32Description
33 This boundary condition provides a supersonic free-stream condition.
34
35 - supersonic outflow is vented according to ???
36 - supersonic inflow is assumed to occur according to the Prandtl-Meyer
37 expansion process.
38 - subsonic outflow is applied via a zero-gradient condition from inside
39 the domain.
40
41Usage
42 \table
43 Property | Description | Required | Default value
44 T | Temperature field name | no | T
45 p | Pressure field name | no | p
46 psi | Compressibility field name | no | thermo:psi
47 UInf | free-stream velocity | yes |
48 pInf | free-stream pressure | yes |
49 TInf | free-stream temperature | yes |
50 gamma | heat capacity ratio (cp/Cv) | yes |
51 \endtable
52
53 Example of the boundary condition specification:
54 \verbatim
55 <patchName>
56 {
57 type supersonicFreestream;
58 UInf 500;
59 pInf 1e4;
60 TInf 265;
61 gamma 1.4;
62 }
63 \endverbatim
64
65Note
66 This boundary condition is ill-posed if the free-stream flow is normal
67 to the boundary.
68
69SourceFiles
70 supersonicFreestreamFvPatchVectorField.C
71
72\*---------------------------------------------------------------------------*/
73
74#ifndef supersonicFreestreamFvPatchVectorField_H
75#define supersonicFreestreamFvPatchVectorField_H
76
77#include "fvPatchFields.H"
78#include "mixedFvPatchFields.H"
79
80// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81
82namespace Foam
83{
84
85/*---------------------------------------------------------------------------*\
86 Class supersonicFreestreamFvPatchVectorField Declaration
87\*---------------------------------------------------------------------------*/
88
89class supersonicFreestreamFvPatchVectorField
90:
91 public mixedFvPatchVectorField
92{
93 // Private data
94
95 //- Name of temperature field, default = "T"
96 word TName_;
97
98 //- Name of pressure field, default = "p"
99 word pName_;
100
101 //- Name of compressibility field field, default = "thermo:psi"
102 word psiName_;
103
104 //- Velocity of the free stream
105 vector UInf_;
106
107 //- Pressure of the free stream
108 scalar pInf_;
109
110 //- Temperature of the free stream
111 scalar TInf_;
112
113 //- Heat capacity ratio
114 scalar gamma_;
115
116
117public:
118
119 //- Runtime type information
120 TypeName("supersonicFreestream");
121
122
123 // Constructors
124
125 //- Construct from patch and internal field
127 (
128 const fvPatch&,
130 );
131
132 //- Construct from patch, internal field and dictionary
134 (
135 const fvPatch&,
137 const dictionary&
138 );
139
140 //- Construct by mapping given supersonicFreestreamFvPatchVectorField
141 // onto a new patch
143 (
145 const fvPatch&,
147 const fvPatchFieldMapper&
148 );
149
150 //- Construct as copy
152 (
154 );
155
156 //- Construct and return a clone
157 virtual tmp<fvPatchVectorField> clone() const
158 {
160 (
162 );
163 }
164
165 //- Construct as copy setting internal field reference
167 (
170 );
171
172 //- Construct and return a clone setting internal field reference
174 (
176 ) const
177 {
179 (
181 );
182 }
183
184
185 // Member functions
186
187 // Access
188
189 //- Return the velocity at infinity
190 const vector& UInf() const
191 {
192 return UInf_;
193 }
194
195 //- Return reference to the velocity at infinity to allow adjustment
197 {
198 return UInf_;
199 }
200
201 //- Return the pressure at infinity
202 scalar pInf() const
203 {
204 return pInf_;
205 }
206
207 //- Return reference to the pressure at infinity to allow adjustment
208 scalar& pInf()
209 {
210 return pInf_;
211 }
213 //- Return the temperature at infinity
214 scalar TInf() const
215 {
216 return TInf_;
217 }
218
219 //- Return reference to the temperature at infinity
220 // to allow adjustment
221 scalar& TInf()
222 {
223 return TInf_;
224 }
225
226
227 // Evaluation functions
228
229 //- Update the coefficients associated with the patch field
230 virtual void updateCoeffs();
231
232
233 //- Write
234 virtual void write(Ostream&) const;
236
237
238// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239
240} // End namespace Foam
242// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243
244#endif
245
246// ************************************************************************* //
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:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a supersonic free-stream condition.
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("supersonicFreestream")
Runtime type information.
vector & UInf()
Return reference to the velocity at infinity to allow adjustment.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalar pInf() const
Return the pressure at infinity.
scalar TInf() const
Return the temperature at infinity.
scalar & pInf()
Return reference to the pressure at infinity to allow adjustment.
const vector & UInf() const
Return the velocity at infinity.
A class for managing temporary objects.
Definition: tmp.H:65
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73