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