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-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::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  //- Total pressure
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  //- Construct as copy
128  (
130  );
131 
132  //- Construct and return a clone
133  virtual tmp<fvPatchScalarField> clone() const
134  {
136  (
138  );
139  }
140 
141  //- Construct as copy setting internal field reference
143  (
146  );
147 
148  //- Construct and return a clone setting internal field reference
150  (
152  ) const
153  {
155  (
157  );
158  }
159 
160 
161  // Member functions
163  // Access
164 
165  //- Return the total pressure
166  const scalarField& T0() const
167  {
168  return T0_;
169  }
170 
171  //- Return reference to the total pressure to allow adjustment
172  scalarField& T0()
173  {
174  return T0_;
175  }
176 
177 
178  // Mapping functions
180  //- Map (and resize as needed) from self given a mapping object
181  virtual void autoMap
182  (
183  const fvPatchFieldMapper&
184  );
185 
186  //- Reverse map the given fvPatchField onto this fvPatchField
187  virtual void rmap
188  (
189  const fvPatchScalarField&,
190  const labelList&
191  );
192 
193 
194  // Evaluation functions
196  //- Update the coefficients associated with the patch field
197  virtual void updateCoeffs();
198 
199 
200  //- Write
201  virtual void write(Ostream&) const;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
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:137
This boundary condition provides a total temperature condition.
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
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:53
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
totalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const scalarField & T0() const
Return the total pressure.
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
Namespace for OpenFOAM.