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-2020 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  //- Disallow copy without setting internal field reference
134  (
136  ) = delete;
137 
138  //- Copy constructor setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  );
155  }
156 
157 
158  // Member Functions
159 
160  // Access
161 
162  //- Return the total pressure
163  const scalarField& T0() const
164  {
165  return T0_;
166  }
167 
168  //- Return reference to the total pressure to allow adjustment
169  scalarField& T0()
170  {
171  return T0_;
172  }
173 
174 
175  // Mapping functions
176 
177  //- Map (and resize as needed) from self given a mapping object
178  // Used to update fields following mesh topology change
179  virtual void autoMap(const fvPatchFieldMapper&);
180 
181  //- Reverse map the given fvPatchField onto this fvPatchField
182  // Used to reconstruct fields
183  virtual void rmap(const fvPatchScalarField&, const labelList&);
184 
185 
186  // Evaluation functions
187 
188  //- Update the coefficients associated with the patch field
189  virtual void updateCoeffs();
190 
191 
192  //- Write
193  virtual void write(Ostream&) const;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
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:156
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
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:54
inletOutletTotalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.