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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::supersonicFreestreamFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
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 
41 Usage
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 
65 Note
66  This boundary condition is ill-posed if the free-stream flow is normal
67  to the boundary.
68 
69 SourceFiles
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 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class supersonicFreestreamFvPatchVectorField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class 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 
117 public:
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  }
212 
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;
235 };
236 
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 } // End namespace Foam
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
Foam::supersonicFreestreamFvPatchVectorField::pInf
scalar & pInf()
Return reference to the pressure at infinity to allow adjustment.
Definition: supersonicFreestreamFvPatchVectorField.H:247
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::supersonicFreestreamFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: supersonicFreestreamFvPatchVectorField.C:298
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::supersonicFreestreamFvPatchVectorField
This boundary condition provides a supersonic free-stream condition.
Definition: supersonicFreestreamFvPatchVectorField.H:128
Foam::supersonicFreestreamFvPatchVectorField::TInf
scalar TInf() const
Return the temperature at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:253
Foam::supersonicFreestreamFvPatchVectorField::TypeName
TypeName("supersonicFreestream")
Runtime type information.
Foam::supersonicFreestreamFvPatchVectorField::UInf
const vector & UInf() const
Return the velocity at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:229
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
mixedFvPatchFields.H
Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: supersonicFreestreamFvPatchVectorField.C:162
Foam::supersonicFreestreamFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: supersonicFreestreamFvPatchVectorField.H:196
Foam::supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: supersonicFreestreamFvPatchVectorField.C:38
fvPatchFields.H
Foam::Vector< scalar >
Foam::supersonicFreestreamFvPatchVectorField::UInf
vector & UInf()
Return reference to the velocity at infinity to allow adjustment.
Definition: supersonicFreestreamFvPatchVectorField.H:235
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::supersonicFreestreamFvPatchVectorField::pInf
scalar pInf() const
Return the pressure at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:241
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54