twoPhaseMixtureThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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::twoPhaseMixtureThermo
26 
27 Description
28 
29 SourceFiles
30  twoPhaseMixtureThermoI.H
31  twoPhaseMixtureThermo.C
32  twoPhaseMixtureThermoIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef twoPhaseMixtureThermo_H
37 #define twoPhaseMixtureThermo_H
38 
39 #include "rhoThermo.H"
40 #include "psiThermo.H"
41 #include "twoPhaseMixture.H"
42 #include "interfaceProperties.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class twoPhaseMixtureThermo Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public psiThermo,
56  public twoPhaseMixture,
57  public interfaceProperties
58 {
59  // Private data
60 
61  //- Thermo-package of phase 1
62  autoPtr<rhoThermo> thermo1_;
63 
64  //- Thermo-package of phase 2
65  autoPtr<rhoThermo> thermo2_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("twoPhaseMixtureThermo");
72 
73 
74  // Constructors
75 
76  //- Construct from components
78  (
79  const volVectorField& U,
80  const surfaceScalarField& phi
81  );
82 
83 
84  //- Destructor
85  virtual ~twoPhaseMixtureThermo();
86 
87 
88  // Member Functions
89 
90  const rhoThermo& thermo1() const
91  {
92  return thermo1_();
93  }
94 
95  const rhoThermo& thermo2() const
96  {
97  return thermo2_();
98  }
99 
100  rhoThermo& thermo1()
101  {
102  return thermo1_();
103  }
105  rhoThermo& thermo2()
106  {
107  return thermo2_();
108  }
109 
110  //- Correct the thermodynamics of each phase
111  virtual void correctThermo();
112 
113  //- Update mixture properties
114  virtual void correct();
115 
116  //- Return the name of the thermo physics
117  virtual word thermoName() const;
118 
119  //- Return true if the equation of state is incompressible
120  // i.e. rho != f(p)
121  virtual bool incompressible() const;
122 
123  //- Return true if the equation of state is isochoric
124  // i.e. rho = const
125  virtual bool isochoric() const;
126 
127 
128  // Access to thermodynamic state variables
129 
130  //- Enthalpy/Internal energy [J/kg]
131  // Non-const access allowed for transport equations
132  virtual volScalarField& he()
133  {
135  return thermo1_->he();
136  }
137 
138  //- Enthalpy/Internal energy [J/kg]
139  virtual const volScalarField& he() const
140  {
142  return thermo1_->he();
143  }
144 
145  //- Enthalpy/Internal energy
146  // for given pressure and temperature [J/kg]
147  virtual tmp<volScalarField> he
148  (
149  const volScalarField& p,
150  const volScalarField& T
151  ) const;
152 
153  //- Enthalpy/Internal energy for cell-set [J/kg]
154  virtual tmp<scalarField> he
155  (
156  const scalarField& p,
157  const scalarField& T,
158  const labelList& cells
159  ) const;
160 
161  //- Enthalpy/Internal energy for patch [J/kg]
162  virtual tmp<scalarField> he
163  (
164  const scalarField& p,
165  const scalarField& T,
166  const label patchi
167  ) const;
168 
169  //- Chemical enthalpy [J/kg]
170  virtual tmp<volScalarField> hc() const;
171 
172  //- Temperature from enthalpy/internal energy for cell-set
173  virtual tmp<scalarField> THE
174  (
175  const scalarField& h,
176  const scalarField& p,
177  const scalarField& T0, // starting temperature
178  const labelList& cells
179  ) const;
180 
181  //- Temperature from enthalpy/internal energy for patch
182  virtual tmp<scalarField> THE
183  (
184  const scalarField& h,
185  const scalarField& p,
186  const scalarField& T0, // starting temperature
187  const label patchi
188  ) const;
189 
190 
191  // Fields derived from thermodynamic state variables
192 
193  //- Heat capacity at constant pressure [J/kg/K]
194  virtual tmp<volScalarField> Cp() const;
195 
196  //- Heat capacity at constant pressure for patch [J/kg/K]
197  virtual tmp<scalarField> Cp
198  (
199  const scalarField& p,
200  const scalarField& T,
201  const label patchi
202  ) const;
203 
204  //- Heat capacity at constant volume [J/kg/K]
205  virtual tmp<volScalarField> Cv() const;
206 
207  //- Heat capacity at constant volume for patch [J/kg/K]
208  virtual tmp<scalarField> Cv
209  (
210  const scalarField& p,
211  const scalarField& T,
212  const label patchi
213  ) const;
214 
215  //- Gamma = Cp/Cv []
216  virtual tmp<volScalarField> gamma() const;
217 
218  //- Gamma = Cp/Cv for patch []
219  virtual tmp<scalarField> gamma
220  (
221  const scalarField& p,
222  const scalarField& T,
223  const label patchi
224  ) const;
225 
226  //- Heat capacity at constant pressure/volume [J/kg/K]
227  virtual tmp<volScalarField> Cpv() const;
228 
229  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
230  virtual tmp<scalarField> Cpv
231  (
232  const scalarField& p,
233  const scalarField& T,
234  const label patchi
235  ) const;
236 
237  //- Heat capacity ratio []
238  virtual tmp<volScalarField> CpByCpv() const;
239 
240  //- Heat capacity ratio for patch []
241  virtual tmp<scalarField> CpByCpv
242  (
243  const scalarField& p,
244  const scalarField& T,
245  const label patchi
246  ) const;
247 
248  //- Molecular weight [kg/kmol]
249  virtual tmp<volScalarField> W() const;
250 
251 
252  // Fields derived from transport state variables
253 
254  //- Kinematic viscosity of mixture [m^2/s]
255  virtual tmp<volScalarField> nu() const;
256 
257  //- Kinematic viscosity of mixture for patch [m^2/s]
258  virtual tmp<scalarField> nu(const label patchi) const;
259 
260  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
261  virtual tmp<volScalarField> kappa() const;
262 
263  //- Thermal diffusivity of mixture for patch [J/m/s/K]
264  virtual tmp<scalarField> kappa
265  (
266  const label patchi
267  ) const;
268 
269  //- Thermal diffusivity for energy of mixture [kg/m/s]
270  virtual tmp<volScalarField> alphahe() const;
271 
272  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
273  virtual tmp<scalarField> alphahe(const label patchi) const;
274 
275  //- Effective thermal diffusivity of mixture [J/m/s/K]
277  (
278  const volScalarField& alphat
279  ) const;
280 
281  //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
282  virtual tmp<scalarField> kappaEff
283  (
284  const scalarField& alphat,
285  const label patchi
286  ) const;
287 
288  //- Effective thermal diffusivity of mixture [J/m/s/K]
290  (
291  const volScalarField& alphat
292  ) const;
293 
294  //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
295  virtual tmp<scalarField> alphaEff
296  (
297  const scalarField& alphat,
298  const label patchi
299  ) const;
300 
301 
302  // IO
303 
304  //- Read base transportProperties dictionary
305  virtual bool read();
306 };
307 
308 
309 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
310 
311 } // End namespace Foam
312 
313 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
314 
315 #endif
316 
317 // ************************************************************************* //
virtual tmp< scalarField > THE(const scalarField &h, const scalarField &p, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
twoPhaseMixtureThermo(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
surfaceScalarField & phi
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:499
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual void correctThermo()
Correct the thermodynamics of each phase.
virtual bool read()
Read base transportProperties dictionary.
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
virtual volScalarField & p()
Pressure [Pa].
Definition: basicThermo.C:487
virtual bool isochoric() const
Return true if the equation of state is isochoric.
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
const cellShapeList & cells
A class for handling words, derived from string.
Definition: word.H:59
Contains the interface properties.
virtual tmp< volScalarField > W() const
Molecular weight [kg/kmol].
virtual ~twoPhaseMixtureThermo()
Destructor.
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
virtual volScalarField & he()
Enthalpy/Internal energy [J/kg].
virtual word thermoName() const
Return the name of the thermo physics.
label patchi
U
Definition: pEqn.H:72
volScalarField & h
Planck constant.
virtual void correct()
Update mixture properties.
virtual bool incompressible() const
Return true if the equation of state is incompressible.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
A two-phase mixture model.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
TypeName("twoPhaseMixtureThermo")
Runtime type information.
const rhoThermo & thermo2() const
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Basic thermodynamic properties based on compressibility.
Definition: psiThermo.H:49
const rhoThermo & thermo1() const
Namespace for OpenFOAM.