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-2023 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 | 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, internal field and dictionary
109  (
110  const fvPatch&,
111  const DimensionedField<scalar, volMesh>&,
112  const dictionary&
113  );
114 
115  //- Construct by mapping given
116  // inletOutletTotalTemperatureFvPatchScalarField onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Disallow copy without setting internal field reference
127  (
129  ) = delete;
130 
131  //- Copy constructor setting internal field reference
133  (
136  );
137 
138  //- Construct and return a clone setting internal field reference
140  (
142  ) const
143  {
145  (
147  );
148  }
149 
150 
151  // Member Functions
152 
153  // Access
154 
155  //- Return the total pressure
156  const scalarField& T0() const
157  {
158  return T0_;
159  }
160 
161  //- Return reference to the total pressure to allow adjustment
162  scalarField& T0()
163  {
164  return T0_;
165  }
166 
167 
168  // Mapping functions
169 
170  //- Map the given fvPatchField onto this fvPatchField
171  virtual void map
172  (
174  const fvPatchFieldMapper&
175  );
176 
177  //- Reset the fvPatchField to the given fvPatchField
178  // Used for mesh to mesh mapping
179  virtual void reset(const fvPatchScalarField&);
180 
181 
182  // Evaluation functions
183 
184  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides an outflow condition for total temperature for use with supersonic c...
inletOutletTotalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("inletOutletTotalTemperature")
Runtime type information.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.