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 | Copyright (C) 2011-2012 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 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This boundary condition provides a total temperature condition.
32 
33  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  U | Velocity field name | no | U
38  phi | Flux field name | no | phi
39  psi | Compressibility field name | no | thermo:psi
40  gamma | ratio of specific heats (Cp/Cv) | yes |
41  T0 | reference temperature | yes |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  myPatch
47  {
48  type totalTemperature;
49  T0 uniform 300;
50  }
51  \endverbatim
52 
53 SourceFiles
54  totalTemperatureFvPatchScalarField.C
55 
56 SeeAlso
57  Foam::fixedValueFvPatchField
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef totalTemperatureFvPatchScalarField_H
62 #define totalTemperatureFvPatchScalarField_H
63 
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class totalTemperatureFvPatchScalarField Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class totalTemperatureFvPatchScalarField
76 :
77  public fixedValueFvPatchScalarField
78 {
79  // Private data
80 
81  //- Name of the velocity field
82  word UName_;
83 
84  //- Name of the flux transporting the field
85  word phiName_;
86 
87  //- Name of the compressibility field used to calculate the wave speed
88  word psiName_;
89 
90  //- Heat capacity ratio
91  scalar gamma_;
92 
93  //- Total pressure
94  scalarField T0_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("totalTemperature");
101 
102 
103  // Constructors
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given totalTemperatureFvPatchScalarField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchScalarField> clone() const
138  {
140  (
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  );
162  }
163 
164 
165  // Member functions
167  // Access
168 
169  //- Return the total pressure
170  const scalarField& T0() const
171  {
172  return T0_;
173  }
174 
175  //- Return reference to the total pressure to allow adjustment
176  scalarField& T0()
177  {
178  return T0_;
179  }
180 
181 
182  // Mapping functions
184  //- Map (and resize as needed) from self given a mapping object
185  virtual void autoMap
186  (
187  const fvPatchFieldMapper&
188  );
189 
190  //- Reverse map the given fvPatchField onto this fvPatchField
191  virtual void rmap
192  (
193  const fvPatchScalarField&,
194  const labelList&
195  );
196 
197 
198  // Evaluation functions
200  //- Update the coefficients associated with the patch field
201  virtual void updateCoeffs();
202 
203 
204  //- Write
205  virtual void write(Ostream&) const;
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
This boundary condition provides a total temperature condition.
TypeName("totalTemperature")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const scalarField & T0() const
Return the total pressure.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
totalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
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.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
A class for managing temporary objects.
Definition: PtrList.H:118
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.