inletOutletTotalTemperatureFvPatchScalarField.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::inletOutletTotalTemperatureFvPatchScalarField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides an outflow condition for total
34  temperature for use with supersonic cases, where a user-specified
35  value is applied in the case of reverse flow.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  U | velocity field name | no | U
41  phi | flux field name | no | phi
42  psi | compressibility field name | no | thermo:psi
43  gamma | heat capacity ration (Cp/Cv) | yes |
44  inletValue | reverse flow (inlet) value | yes |
45  T0 | static temperature [K] | yes |
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type inletOutletTotalTemperature;
53  U U;
54  phi phi;
55  psi psi;
56  gamma gamma;
57  inletValue uniform 0;
58  T0 uniform 0;
59  value uniform 0;
60  }
61  \endverbatim
62 
63 See also
64  Foam::inletOutletFvPatchField
65 
66 SourceFiles
67  inletOutletTotalTemperatureFvPatchScalarField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef inletOutletTotalTemperatureFvPatchScalarField_H
72 #define inletOutletTotalTemperatureFvPatchScalarField_H
73 
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class inletOutletTotalTemperatureFvPatchScalarField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class inletOutletTotalTemperatureFvPatchScalarField
86 :
87  public inletOutletFvPatchScalarField
88 {
89  // Private data
90 
91  //- Name of the velocity field
92  word UName_;
93 
94  //- Name of the compressibility field used to calculate the wave speed
95  word psiName_;
96 
97  //- Heat capacity ratio
98  scalar gamma_;
99 
100  //- Total pressure
101  scalarField T0_;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("inletOutletTotalTemperature");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // inletOutletTotalTemperatureFvPatchScalarField onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct as copy setting internal field reference
145  (
148  );
149 
150  //- Return a clone
151  virtual tmp<fvPatchField<scalar>> clone() const
152  {
153  return fvPatchField<scalar>::Clone(*this);
154  }
155 
156  //- Clone with an internal field reference
158  (
160  ) const
161  {
162  return fvPatchField<scalar>::Clone(*this, iF);
163  }
164 
165 
166  // Member functions
167 
168  // Access
169 
170  //- Return the total pressure
171  const scalarField& T0() const
172  {
173  return T0_;
174  }
175 
176  //- Return reference to the total pressure to allow adjustment
177  scalarField& T0()
178  {
179  return T0_;
180  }
181 
182 
183  // Mapping functions
184 
185  //- Map (and resize as needed) from self given a mapping object
186  virtual void autoMap
187  (
188  const fvPatchFieldMapper&
189  );
190 
191  //- Reverse map the given fvPatchField onto this fvPatchField
192  virtual void rmap
193  (
194  const fvPatchScalarField&,
195  const labelList&
196  );
197 
198 
199  // Evaluation functions
200 
201  //- Update the coefficients associated with the patch field
202  virtual void updateCoeffs();
203 
205  //- Write
206  virtual void write(Ostream&) const;
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
TypeName("inletOutletTotalTemperature")
Runtime type information.
This boundary condition provides an outflow condition for total temperature for use with supersonic c...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
inletOutletTotalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.