totalTemperatureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::totalTemperatureFvPatchScalarField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides a total temperature condition.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  U | Velocity field name | no | U
39  phi | Flux field name | no | phi
40  psi | Compressibility field name | no | thermo:psi
41  gamma | ratio of specific heats (Cp/Cv) | yes |
42  T0 | total temperature | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type totalTemperature;
50  gamma 1.4;
51  T0 uniform 800;
52  }
53  \endverbatim
54 
55 SourceFiles
56  totalTemperatureFvPatchScalarField.C
57 
58 See also
59  Foam::fixedValueFvPatchField
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef totalTemperatureFvPatchScalarField_H
64 #define totalTemperatureFvPatchScalarField_H
65 
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class totalTemperatureFvPatchScalarField Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class totalTemperatureFvPatchScalarField
78 :
79  public fixedValueFvPatchScalarField
80 {
81  // Private data
82 
83  //- Name of the velocity field
84  word UName_;
85 
86  //- Name of the flux transporting the field
87  word phiName_;
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 temperature
96  scalarField T0_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("totalTemperature");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given totalTemperatureFvPatchScalarField
123  // 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
totalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: totalTemperatureFvPatchScalarField.C:38
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::totalTemperatureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: totalTemperatureFvPatchScalarField.H:168
Foam::totalTemperatureFvPatchScalarField::TypeName
TypeName("totalTemperature")
Runtime type information.
Foam::totalTemperatureFvPatchScalarField::T0
const scalarField & T0() const
Return the total pressure.
Definition: totalTemperatureFvPatchScalarField.H:201
Foam::totalTemperatureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: totalTemperatureFvPatchScalarField.C:129
Foam::Field< scalar >
Foam::totalTemperatureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: totalTemperatureFvPatchScalarField.C:180
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::totalTemperatureFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: totalTemperatureFvPatchScalarField.C:139
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
fixedValueFvPatchFields.H
Foam::totalTemperatureFvPatchScalarField::T0
scalarField & T0()
Return reference to the total pressure to allow adjustment.
Definition: totalTemperatureFvPatchScalarField.H:207
Foam::totalTemperatureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: totalTemperatureFvPatchScalarField.C:153
Foam::totalTemperatureFvPatchScalarField
This boundary condition provides a total temperature condition.
Definition: totalTemperatureFvPatchScalarField.H:106
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54