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-2015 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  \heading Patch usage
40 
41  \table
42  Property | Description | Required | Default value
43  TName | Temperature field name | no | T
44  pName | Pressure field name | no | p
45  psiName | Compressibility field name | no | thermo:psi
46  UInf | free-stream velocity | yes |
47  pInf | free-stream pressure | yes |
48  TInf | free-stream temperature | yes |
49  gamma | heat capacity ratio (cp/Cv) | yes |
50  \endtable
51 
52  Example of the boundary condition specification:
53  \verbatim
54  myPatch
55  {
56  type supersonicFreestream;
57  UInf 500;
58  pInf 1e4;
59  TInf 265;
60  gamma 1.4;
61  }
62  \endverbatim
63 
64 Note
65  This boundary condition is ill-posed if the free-stream flow is normal
66  to the boundary.
67 
68 SourceFiles
69  supersonicFreestreamFvPatchVectorField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef supersonicFreestreamFvPatchVectorFields_H
74 #define supersonicFreestreamFvPatchVectorFields_H
75 
76 #include "fvPatchFields.H"
77 #include "mixedFvPatchFields.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class supersonicFreestreamFvPatchVectorField Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class supersonicFreestreamFvPatchVectorField
89 :
90  public mixedFvPatchVectorField
91 {
92  // Private data
93 
94  //- Name of temperature field, default = "T"
95  word TName_;
96 
97  //- Name of pressure field, default = "p"
98  word pName_;
99 
100  //- Name of compressibility field field, default = "thermo:psi"
101  word psiName_;
102 
103  //- Velocity of the free stream
104  vector UInf_;
105 
106  //- Pressure of the free stream
107  scalar pInf_;
108 
109  //- Temperature of the free stream
110  scalar TInf_;
111 
112  //- Heat capacity ratio
113  scalar gamma_;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("supersonicFreestream");
120 
121 
122  // Constructors
123 
124  //- Construct from patch and internal field
126  (
127  const fvPatch&,
129  );
130 
131  //- Construct from patch, internal field and dictionary
133  (
134  const fvPatch&,
136  const dictionary&
137  );
138 
139  //- Construct by mapping given supersonicFreestreamFvPatchVectorField
140  // onto a new patch
142  (
144  const fvPatch&,
147  );
148 
149  //- Construct as copy
151  (
153  );
154 
155  //- Construct and return a clone
156  virtual tmp<fvPatchVectorField> clone() const
157  {
159  (
161  );
162  }
163 
164  //- Construct as copy setting internal field reference
166  (
169  );
170 
171  //- Construct and return a clone setting internal field reference
173  (
175  ) const
176  {
178  (
180  );
181  }
182 
183 
184  // Member functions
185 
186  // Access
187 
188  //- Return the velocity at infinity
189  const vector& UInf() const
190  {
191  return UInf_;
192  }
193 
194  //- Return reference to the velocity at infinity to allow adjustment
196  {
197  return UInf_;
198  }
199 
200  //- Return the pressure at infinity
201  scalar pInf() const
202  {
203  return pInf_;
204  }
205 
206  //- Return reference to the pressure at infinity to allow adjustment
207  scalar& pInf()
208  {
209  return pInf_;
210  }
211 
212  //- Return the temperature at infinity
213  scalar TInf() const
214  {
215  return TInf_;
216  }
217 
218  //- Return reference to the temperature at infinity
219  // to allow adjustment
220  scalar& TInf()
221  {
222  return TInf_;
223  }
224 
225 
226  // Evaluation functions
227 
228  //- Update the coefficients associated with the patch field
229  virtual void updateCoeffs();
230 
231 
232  //- Write
233  virtual void write(Ostream&) const;
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
Foam::supersonicFreestreamFvPatchVectorField::psiName_
word psiName_
Name of compressibility field field, default = "thermo:psi".
Definition: supersonicFreestreamFvPatchVectorField.H:140
Foam::supersonicFreestreamFvPatchVectorField::pInf
scalar & pInf()
Return reference to the pressure at infinity to allow adjustment.
Definition: supersonicFreestreamFvPatchVectorField.H:246
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::supersonicFreestreamFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: supersonicFreestreamFvPatchVectorField.C:295
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::supersonicFreestreamFvPatchVectorField
This boundary condition provides a supersonic free-stream condition.
Definition: supersonicFreestreamFvPatchVectorField.H:127
Foam::supersonicFreestreamFvPatchVectorField::pInf_
scalar pInf_
Pressure of the free stream.
Definition: supersonicFreestreamFvPatchVectorField.H:146
Foam::supersonicFreestreamFvPatchVectorField::TInf
scalar TInf() const
Return the temperature at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:252
Foam::supersonicFreestreamFvPatchVectorField::TypeName
TypeName("supersonicFreestream")
Runtime type information.
Foam::supersonicFreestreamFvPatchVectorField::TInf_
scalar TInf_
Temperature of the free stream.
Definition: supersonicFreestreamFvPatchVectorField.H:149
Foam::supersonicFreestreamFvPatchVectorField::gamma_
scalar gamma_
Heat capacity ratio.
Definition: supersonicFreestreamFvPatchVectorField.H:152
Foam::supersonicFreestreamFvPatchVectorField::pName_
word pName_
Name of pressure field, default = "p".
Definition: supersonicFreestreamFvPatchVectorField.H:137
Foam::supersonicFreestreamFvPatchVectorField::UInf
const vector & UInf() const
Return the velocity at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:228
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::supersonicFreestreamFvPatchVectorField::TName_
word TName_
Name of temperature field, default = "T".
Definition: supersonicFreestreamFvPatchVectorField.H:134
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
mixedFvPatchFields.H
Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: supersonicFreestreamFvPatchVectorField.C:159
Foam::supersonicFreestreamFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: supersonicFreestreamFvPatchVectorField.H:195
Foam::supersonicFreestreamFvPatchVectorField::UInf_
vector UInf_
Velocity of the free stream.
Definition: supersonicFreestreamFvPatchVectorField.H:143
Foam::supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: supersonicFreestreamFvPatchVectorField.C:35
fvPatchFields.H
Foam::Vector< scalar >
Foam::supersonicFreestreamFvPatchVectorField::UInf
vector & UInf()
Return reference to the velocity at infinity to allow adjustment.
Definition: supersonicFreestreamFvPatchVectorField.H:234
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::supersonicFreestreamFvPatchVectorField::pInf
scalar pInf() const
Return the pressure at infinity.
Definition: supersonicFreestreamFvPatchVectorField.H:240
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51