twoPhaseMixtureThermo.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) 2013-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::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 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class twoPhaseMixtureThermo Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public psiThermo,
55  public twoPhaseMixture
56 {
57  // Private data
58 
59  //- Thermo-package of phase 1
60  autoPtr<rhoThermo> thermo1_;
61 
62  //- Thermo-package of phase 2
63  autoPtr<rhoThermo> thermo2_;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("twoPhaseMixtureThermo");
70 
71 
72  // Constructors
73 
74  //- Construct from mesh
76  (
77  const fvMesh& mesh
78  );
79 
80 
81  //- Destructor
82  virtual ~twoPhaseMixtureThermo();
83 
84 
85  // Member Functions
86 
87  const rhoThermo& thermo1() const
88  {
89  return thermo1_();
90  }
91 
92  const rhoThermo& thermo2() const
93  {
94  return thermo2_();
95  }
96 
98  {
99  return thermo1_();
100  }
102  rhoThermo& thermo2()
103  {
104  return thermo2_();
105  }
106 
107  //- Update properties
108  virtual void correct();
109 
110  //- Return true if the equation of state is incompressible
111  // i.e. rho != f(p)
112  virtual bool incompressible() const;
113 
114  //- Return true if the equation of state is isochoric
115  // i.e. rho = const
116  virtual bool isochoric() const;
117 
118 
119  // Access to thermodynamic state variables
120 
121  //- Enthalpy/Internal energy [J/kg]
122  // Non-const access allowed for transport equations
123  virtual volScalarField& he()
124  {
126  return thermo1_->he();
127  }
128 
129  //- Enthalpy/Internal energy [J/kg]
130  virtual const volScalarField& he() const
131  {
133  return thermo1_->he();
134  }
135 
136  //- Enthalpy/Internal energy
137  // for given pressure and temperature [J/kg]
138  virtual tmp<volScalarField> he
139  (
140  const volScalarField& p,
141  const volScalarField& T
142  ) const;
143 
144  //- Enthalpy/Internal energy for cell-set [J/kg]
145  virtual tmp<scalarField> he
146  (
147  const scalarField& p,
148  const scalarField& T,
149  const labelList& cells
150  ) const;
151 
152  //- Enthalpy/Internal energy for patch [J/kg]
153  virtual tmp<scalarField> he
154  (
155  const scalarField& p,
156  const scalarField& T,
157  const label patchi
158  ) const;
159 
160  //- Chemical enthalpy [J/kg]
161  virtual tmp<volScalarField> hc() const;
162 
163  //- Temperature from enthalpy/internal energy for cell-set
164  virtual tmp<scalarField> THE
165  (
166  const scalarField& h,
167  const scalarField& p,
168  const scalarField& T0, // starting temperature
169  const labelList& cells
170  ) const;
171 
172  //- Temperature from enthalpy/internal energy for patch
173  virtual tmp<scalarField> THE
174  (
175  const scalarField& h,
176  const scalarField& p,
177  const scalarField& T0, // starting temperature
178  const label patchi
179  ) const;
180 
181 
182  // Fields derived from thermodynamic state variables
183 
184  //- Heat capacity at constant pressure [J/kg/K]
185  virtual tmp<volScalarField> Cp() const;
186 
187  //- Heat capacity at constant pressure for patch [J/kg/K]
188  virtual tmp<scalarField> Cp
189  (
190  const scalarField& p,
191  const scalarField& T,
192  const label patchi
193  ) const;
194 
195  //- Heat capacity at constant volume [J/kg/K]
196  virtual tmp<volScalarField> Cv() const;
197 
198  //- Heat capacity at constant volume for patch [J/kg/K]
199  virtual tmp<scalarField> Cv
200  (
201  const scalarField& p,
202  const scalarField& T,
203  const label patchi
204  ) const;
205 
206  //- Gamma = Cp/Cv []
207  virtual tmp<volScalarField> gamma() const;
208 
209  //- Gamma = Cp/Cv for patch []
210  virtual tmp<scalarField> gamma
211  (
212  const scalarField& p,
213  const scalarField& T,
214  const label patchi
215  ) const;
216 
217  //- Heat capacity at constant pressure/volume [J/kg/K]
218  virtual tmp<volScalarField> Cpv() const;
219 
220  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
221  virtual tmp<scalarField> Cpv
222  (
223  const scalarField& p,
224  const scalarField& T,
225  const label patchi
226  ) const;
227 
228  //- Heat capacity ratio []
229  virtual tmp<volScalarField> CpByCpv() const;
230 
231  //- Heat capacity ratio for patch []
232  virtual tmp<scalarField> CpByCpv
233  (
234  const scalarField& p,
235  const scalarField& T,
236  const label patchi
237  ) const;
238 
239 
240  // Fields derived from transport state variables
241 
242  //- Kinematic viscosity of mixture [m^2/s]
243  virtual tmp<volScalarField> nu() const;
244 
245  //- Kinematic viscosity of mixture for patch [m^2/s]
246  virtual tmp<scalarField> nu(const label patchi) const;
247 
248  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
249  virtual tmp<volScalarField> kappa() const;
250 
251  //- Thermal diffusivity of mixture for patch [J/m/s/K]
252  virtual tmp<scalarField> kappa
253  (
254  const label patchi
255  ) const;
256 
257  //- Effective thermal diffusivity of mixture [J/m/s/K]
259  (
260  const volScalarField& alphat
261  ) const;
262 
263  //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
264  virtual tmp<scalarField> kappaEff
265  (
266  const scalarField& alphat,
267  const label patchi
268  ) const;
269 
270  //- Effective thermal diffusivity of mixture [J/m/s/K]
272  (
273  const volScalarField& alphat
274  ) const;
275 
276  //- Effective thermal diffusivity of mixture for patch [J/m/s/K]
277  virtual tmp<scalarField> alphaEff
278  (
279  const scalarField& alphat,
280  const label patchi
281  ) const;
282 };
283 
284 
285 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
286 
287 } // End namespace Foam
288 
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 
291 #endif
292 
293 // ************************************************************************* //
virtual bool isochoric() const
Return true if the equation of state is isochoric.
virtual bool incompressible() const
Return true if the equation of state is incompressible.
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
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
virtual volScalarField & p()
Pressure [Pa].
Definition: basicThermo.C:466
dynamicFvMesh & mesh
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
const cellShapeList & cells
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
virtual ~twoPhaseMixtureThermo()
Destructor.
const rhoThermo & thermo2() const
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:478
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 volScalarField & he()
Enthalpy/Internal energy [J/kg].
const dimensionedScalar h
Planck constant.
Definition: createFields.H:6
label patchi
virtual void correct()
Update properties.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
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:53
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
A class for managing temporary objects.
Definition: PtrList.H:54
TypeName("twoPhaseMixtureThermo")
Runtime type information.
const rhoThermo & thermo1() 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
twoPhaseMixtureThermo(const fvMesh &mesh)
Construct from mesh.
Namespace for OpenFOAM.
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].