inletOutletTotalTemperatureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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::inletOutletTotalTemperatureFvPatchScalarField
26 
27 Description
28  This boundary condition provides an outflow condition for total
29  temperature for use with supersonic cases, where a user-specified
30  value is applied in the case of reverse flow.
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  U | velocity field name | no | U
36  phi | flux field name | no | phi
37  psi | compressibility field name | no | thermo:psi
38  gamma | heat capacity ration (Cp/Cv) | yes |
39  inletValue | reverse flow (inlet) value | yes |
40  T0 | static temperature [K] | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type inletOutletTotalTemperature;
48  U U;
49  phi phi;
50  psi psi;
51  gamma gamma;
52  inletValue uniform 0;
53  T0 uniform 0;
54  value uniform 0;
55  }
56  \endverbatim
57 
58 See also
59  Foam::inletOutletFvPatchField
60 
61 SourceFiles
62  inletOutletTotalTemperatureFvPatchScalarField.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef inletOutletTotalTemperatureFvPatchScalarField_H
67 #define inletOutletTotalTemperatureFvPatchScalarField_H
68 
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class inletOutletTotalTemperatureFvPatchScalarField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class inletOutletTotalTemperatureFvPatchScalarField
81 :
82  public inletOutletFvPatchScalarField
83 {
84  // Private data
85 
86  //- Name of the velocity field
87  word UName_;
88 
89  //- Name of the compressibility field used to calculate the wave speed
90  word psiName_;
91 
92  //- Heat capacity ratio
93  scalar gamma_;
94 
95  //- Total pressure
96  scalarField T0_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("inletOutletTotalTemperature");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
111  const DimensionedField<scalar, volMesh>&
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given
123  // inletOutletTotalTemperatureFvPatchScalarField onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct and return a clone
139  virtual tmp<fvPatchScalarField> clone() const
140  {
142  (
144  );
145  }
146 
147  //- Construct as copy setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
161  (
163  );
164  }
165 
166 
167  // Member functions
168 
169  // Access
170 
171  //- Return the total pressure
172  const scalarField& T0() const
173  {
174  return T0_;
175  }
176 
177  //- Return reference to the total pressure to allow adjustment
178  scalarField& T0()
179  {
180  return T0_;
181  }
182 
183 
184  // Mapping functions
185 
186  //- Map (and resize as needed) from self given a mapping object
187  virtual void autoMap
188  (
189  const fvPatchFieldMapper&
190  );
191 
192  //- Reverse map the given fvPatchField onto this fvPatchField
193  virtual void rmap
194  (
195  const fvPatchScalarField&,
196  const labelList&
197  );
198 
199 
200  // Evaluation functions
201 
202  //- Update the coefficients associated with the patch field
203  virtual void updateCoeffs();
204 
205 
206  //- Write
207  virtual void write(Ostream&) const;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
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 any number of values (e...
Definition: dictionary.H:137
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
TypeName("inletOutletTotalTemperature")
Runtime type information.
This boundary condition provides an outflow condition for total temperature for use with supersonic c...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.