inletOutletTotalTemperatureFvPatchScalarField.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::inletOutletTotalTemperatureFvPatchScalarField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides an outflow condition for total
34  temperature for use with supersonic cases, where a user-specified
35  value is applied in the case of reverse flow.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  U | velocity field name | no | U
41  phi | flux field name | no | phi
42  psi | compressibility field name | no | thermo:psi
43  gamma | heat capacity ration (Cp/Cv) | yes |
44  inletValue | reverse flow (inlet) value | yes |
45  T0 | static temperature [K] | yes |
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type inletOutletTotalTemperature;
53  U U;
54  phi phi;
55  psi psi;
56  gamma gamma;
57  inletValue uniform 0;
58  T0 uniform 0;
59  value uniform 0;
60  }
61  \endverbatim
62 
63 See also
64  Foam::inletOutletFvPatchField
65 
66 SourceFiles
67  inletOutletTotalTemperatureFvPatchScalarField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef inletOutletTotalTemperatureFvPatchScalarField_H
72 #define inletOutletTotalTemperatureFvPatchScalarField_H
73 
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class inletOutletTotalTemperatureFvPatchScalarField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class inletOutletTotalTemperatureFvPatchScalarField
86 :
87  public inletOutletFvPatchScalarField
88 {
89  // Private data
90 
91  //- Name of the velocity field
92  word UName_;
93 
94  //- Name of the compressibility field used to calculate the wave speed
95  word psiName_;
96 
97  //- Heat capacity ratio
98  scalar gamma_;
99 
100  //- Total pressure
101  scalarField T0_;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("inletOutletTotalTemperature");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
116  const DimensionedField<scalar, volMesh>&
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // inletOutletTotalTemperatureFvPatchScalarField onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchScalarField> clone() const
145  {
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
173 
174  // Access
175 
176  //- Return the total pressure
177  const scalarField& T0() const
178  {
179  return T0_;
180  }
181 
182  //- Return reference to the total pressure to allow adjustment
183  scalarField& T0()
184  {
185  return T0_;
186  }
187 
188 
189  // Mapping functions
190 
191  //- Map (and resize as needed) from self given a mapping object
192  virtual void autoMap
193  (
194  const fvPatchFieldMapper&
195  );
196 
197  //- Reverse map the given fvPatchField onto this fvPatchField
198  virtual void rmap
199  (
200  const fvPatchScalarField&,
201  const labelList&
202  );
203 
204 
205  // Evaluation functions
206 
207  //- Update the coefficients associated with the patch field
208  virtual void updateCoeffs();
209 
210 
211  //- Write
212  virtual void write(Ostream&) const;
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::inletOutletTotalTemperatureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: inletOutletTotalTemperatureFvPatchScalarField.H:178
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:65
Foam::inletOutletTotalTemperatureFvPatchScalarField
This boundary condition provides an outflow condition for total temperature for use with supersonic c...
Definition: inletOutletTotalTemperatureFvPatchScalarField.H:119
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::inletOutletTotalTemperatureFvPatchScalarField::TypeName
TypeName("inletOutletTotalTemperature")
Runtime type information.
Foam::inletOutletTotalTemperatureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: inletOutletTotalTemperatureFvPatchScalarField.C:141
Foam::inletOutletTotalTemperatureFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: inletOutletTotalTemperatureFvPatchScalarField.C:151
Foam::inletOutletTotalTemperatureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: inletOutletTotalTemperatureFvPatchScalarField.C:191
Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: inletOutletTotalTemperatureFvPatchScalarField.C:165
Foam::Field< scalar >
Foam::inletOutletTotalTemperatureFvPatchScalarField::inletOutletTotalTemperatureFvPatchScalarField
inletOutletTotalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: inletOutletTotalTemperatureFvPatchScalarField.C:39
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::inletOutletTotalTemperatureFvPatchScalarField::T0
const scalarField & T0() const
Return the total pressure.
Definition: inletOutletTotalTemperatureFvPatchScalarField.H:211
Foam::inletOutletTotalTemperatureFvPatchScalarField::T0
scalarField & T0()
Return reference to the total pressure to allow adjustment.
Definition: inletOutletTotalTemperatureFvPatchScalarField.H:217
Foam::List< label >
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
inletOutletFvPatchFields.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54