Loading...
Searching...
No Matches
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
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
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 as copy setting internal field reference
158 (
161 );
162
163 //- Return a clone
164 virtual tmp<fvPatchField<vector>> clone() const
165 {
166 return fvPatchField<vector>::Clone(*this);
167 }
168
169 //- Clone with an internal field reference
173 ) const
174 {
175 return fvPatchField<vector>::Clone(*this, iF);
176 }
177
178
179 // Member functions
180
181 // Access
182
183 //- Return the velocity at infinity
184 const vector& UInf() const
185 {
186 return UInf_;
187 }
188
189 //- Return reference to the velocity at infinity to allow adjustment
190 vector& UInf()
191 {
192 return UInf_;
193 }
194
195 //- Return the pressure at infinity
196 scalar pInf() const
197 {
198 return pInf_;
199 }
200
201 //- Return reference to the pressure at infinity to allow adjustment
202 scalar& pInf()
203 {
204 return pInf_;
205 }
206
207 //- Return the temperature at infinity
208 scalar TInf() const
209 {
210 return TInf_;
211 }
212
213 //- Return reference to the temperature at infinity
214 // to allow adjustment
215 scalar& TInf()
216 {
217 return TInf_;
218 }
219
220
221 // Evaluation functions
222
223 //- Update the coefficients associated with the patch field
224 virtual void updateCoeffs();
225
226
227 //- Write
228 virtual void write(Ostream&) const;
229};
230
231
232// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233
234} // End namespace Foam
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238#endif
239
240// ************************************************************************* //
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:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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.
TypeName("supersonicFreestream")
Runtime type information.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
vector & UInf()
Return reference to the velocity at infinity to allow adjustment.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
scalar & TInf()
Return reference to the temperature 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:75
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:66
Namespace for OpenFOAM.
Vector< scalar > vector
Definition vector.H:57
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68