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-2016 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 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 | psi
41  gamma | heat capacity ration (Cp/Cv) | yes |
42  inletValue | reverse flow (inlet) value | yes |
43  T0 | static temperature [K] | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type inletOutletTotalTemperature;
51  U U;
52  phi phi;
53  psi psi;
54  gamma gamma;
55  inletValue uniform 0;
56  T0 uniform 0;
57  value uniform 0;
58  }
59  \endverbatim
60 
61 See also
62  Foam::inletOutletFvPatchField
63 
64 SourceFiles
65  inletOutletTotalTemperatureFvPatchScalarField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef inletOutletTotalTemperatureFvPatchScalarField_H
70 #define inletOutletTotalTemperatureFvPatchScalarField_H
71 
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class inletOutletTotalTemperatureFvPatchScalarField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class inletOutletTotalTemperatureFvPatchScalarField
84 :
85  public inletOutletFvPatchScalarField
86 {
87  // Private data
88 
89  //- Name of the velocity field
90  word UName_;
91 
92  //- Name of the compressibility field used to calculate the wave speed
93  word psiName_;
94 
95  //- Heat capacity ratio
96  scalar gamma_;
97 
98  //- Total pressure
99  scalarField T0_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("inletOutletTotalTemperature");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
114  const DimensionedField<scalar, volMesh>&
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // inletOutletTotalTemperatureFvPatchScalarField onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Construct as copy
137  (
139  );
140 
141  //- Construct and return a clone
142  virtual tmp<fvPatchScalarField> clone() const
143  {
145  (
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
164  (
166  );
167  }
168 
169 
170  // Member functions
171 
172  // Access
173 
174  //- Return the total pressure
175  const scalarField& T0() const
176  {
177  return T0_;
178  }
179 
180  //- Return reference to the total pressure to allow adjustment
181  scalarField& T0()
182  {
183  return T0_;
184  }
185 
186 
187  // Mapping functions
188 
189  //- Map (and resize as needed) from self given a mapping object
190  virtual void autoMap
191  (
192  const fvPatchFieldMapper&
193  );
194 
195  //- Reverse map the given fvPatchField onto this fvPatchField
196  virtual void rmap
197  (
198  const fvPatchScalarField&,
199  const labelList&
200  );
201 
202 
203  // Evaluation functions
204 
205  //- Update the coefficients associated with the patch field
206  virtual void updateCoeffs();
207 
208 
209  //- Write
210  virtual void write(Ostream&) const;
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #endif
221 
222 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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:65
TypeName("inletOutletTotalTemperature")
Runtime type information.
This boundary condition provides an outflow condition for total temperature for use with supersonic c...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
inletOutletTotalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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:54
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.