totalTemperatureFvPatchScalarField.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-2022 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::totalTemperatureFvPatchScalarField
26 
27 Description
28  This boundary condition provides a total temperature condition.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  U | Velocity field name | no | U
34  phi | Flux field name | no | phi
35  psi | Compressibility field name | no | thermo:psi
36  gamma | ratio of specific heats (Cp/Cv) | yes |
37  T0 | reference temperature | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type totalTemperature;
45  T0 uniform 300;
46  }
47  \endverbatim
48 
49 SourceFiles
50  totalTemperatureFvPatchScalarField.C
51 
52 See also
53  Foam::fixedValueFvPatchField
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef totalTemperatureFvPatchScalarField_H
58 #define totalTemperatureFvPatchScalarField_H
59 
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class totalTemperatureFvPatchScalarField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class totalTemperatureFvPatchScalarField
72 :
73  public fixedValueFvPatchScalarField
74 {
75  // Private Data
76 
77  //- Name of the velocity field
78  word UName_;
79 
80  //- Name of the flux transporting the field
81  word phiName_;
82 
83  //- Name of the compressibility field used to calculate the wave speed
84  word psiName_;
85 
86  //- Heat capacity ratio
87  scalar gamma_;
88 
89  //- Reference temperature
90  scalarField T0_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("totalTemperature");
97 
98 
99  // Constructors
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping given totalTemperatureFvPatchScalarField
117  // onto a new patch
119  (
121  const fvPatch&,
123  const fvPatchFieldMapper&
124  );
125 
126  //- Disallow copy without setting internal field reference
128  (
130  ) = delete;
131 
132  //- Copy constructor setting internal field reference
134  (
137  );
138 
139  //- Construct and return a clone setting internal field reference
141  (
143  ) const
144  {
146  (
148  );
149  }
150 
151 
152  // Member Functions
153 
154  // Access
155 
156  //- Return the reference temperature
157  const scalarField& T0() const
158  {
159  return T0_;
160  }
161 
162  //- Return reference to the temperature to allow adjustment
163  scalarField& T0()
164  {
165  return T0_;
166  }
167 
168 
169  // Mapping functions
171  //- Map (and resize as needed) from self given a mapping object
172  // Used to update fields following mesh topology change
173  virtual void autoMap(const fvPatchFieldMapper&);
174 
175  //- Reverse map the given fvPatchField onto this fvPatchField
176  // Used to reconstruct fields
177  virtual void rmap(const fvPatchScalarField&, const labelList&);
178 
179  //- Reset the fvPatchField to the given fvPatchField
180  // Used for mesh to mesh mapping
181  virtual void reset(const fvPatchScalarField&);
182 
183 
184  // Evaluation functions
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
TypeName("totalTemperature")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
This boundary condition provides a total temperature condition.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
totalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const scalarField & T0() const
Return the reference temperature.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
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
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Namespace for OpenFOAM.