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