www.mooseframework.org
IdealGasFluidPropertiesPT.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<SinglePhaseFluidPropertiesPT>();
15  params.addParam<Real>("molar_mass", 29.0e-3, "Constant molar mass of the fluid (kg/mol)");
16  params.addParam<Real>(
17  "thermal_expansion", 3.43e-3, "Constant coefficient of thermal expansion (1/K)");
18  params.addParam<Real>(
19  "cv", 0.718e3, "Constant specific heat capacity at constant volume (J/kg/K)");
20  params.addParam<Real>(
21  "cp", 1.005e3, "Constant specific heat capacity at constant pressure (J/kg/K)");
22  params.addParam<Real>("thermal_conductivity", 25.68e-3, "Constant thermal conductivity (W/m/K)");
23  params.addParam<Real>("specific_entropy", 6.85e3, "Constant specific entropy (J/kg/K)");
24  params.addParam<Real>("viscosity", 18.23e-6, "Constant dynamic viscosity (Pa.s)");
25  params.addParam<Real>("henry_constant", 0.0, "Henry constant for dissolution in water");
26  params.addClassDescription("Fluid properties for an ideal gas");
27  return params;
28 }
29 
30 IdealGasFluidPropertiesPT::IdealGasFluidPropertiesPT(const InputParameters & parameters)
31  : SinglePhaseFluidPropertiesPT(parameters),
32  _molar_mass(getParam<Real>("molar_mass")),
33  _thermal_expansion(getParam<Real>("thermal_expansion")),
34  _cv(getParam<Real>("cv")),
35  _cp(getParam<Real>("cp")),
36  _thermal_conductivity(getParam<Real>("thermal_conductivity")),
37  _specific_entropy(getParam<Real>("specific_entropy")),
38  _viscosity(getParam<Real>("viscosity")),
39  _henry_constant(getParam<Real>("henry_constant"))
40 {
41 }
42 
44 
45 std::string
47 {
48  return "ideal_gas";
49 }
50 
51 Real
53 {
54  return _molar_mass;
55 }
56 
57 Real IdealGasFluidPropertiesPT::beta(Real /*pressure*/, Real /*temperature*/) const
58 {
59  return _thermal_expansion;
60 }
61 
62 Real IdealGasFluidPropertiesPT::cp(Real /*pressure*/, Real /*temperature*/) const { return _cp; }
63 
64 Real IdealGasFluidPropertiesPT::cv(Real /*pressure*/, Real /*temperature*/) const { return _cv; }
65 
66 Real
67 IdealGasFluidPropertiesPT::c(Real /*pressure*/, Real temperature) const
68 {
69  return std::sqrt(_cp * _R * temperature / (_cv * _molar_mass));
70 }
71 
72 Real IdealGasFluidPropertiesPT::k(Real /*pressure*/, Real /*temperature*/) const
73 {
74  return _thermal_conductivity;
75 }
76 
77 void
79  Real pressure, Real temperature, Real & k, Real & dk_dp, Real & dk_dT) const
80 {
81  k = this->k(pressure, temperature);
82  dk_dp = 0;
83  dk_dT = 0;
84 }
85 
86 Real IdealGasFluidPropertiesPT::k_from_rho_T(Real /*density*/, Real /*temperature*/) const
87 {
88  return _thermal_conductivity;
89 }
90 
91 Real IdealGasFluidPropertiesPT::s(Real /*pressure*/, Real /*temperature*/) const
92 {
93  return _specific_entropy;
94 }
95 
96 Real
98 {
99  return pressure * _molar_mass / (_R * temperature);
100 }
101 
102 void
104  Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const
105 {
106  rho = this->rho(pressure, temperature);
107  drho_dp = _molar_mass / (_R * temperature);
108  drho_dT = -pressure * _molar_mass / (_R * temperature * temperature);
109 }
110 
111 Real
112 IdealGasFluidPropertiesPT::e(Real /*pressure*/, Real temperature) const
113 {
114  return _cv * temperature;
115 }
116 
117 void
119  Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT) const
120 {
121  e = this->e(pressure, temperature);
122  de_dp = 0.0;
123  de_dT = _cv;
124 }
125 
126 void
128  Real temperature,
129  Real & rho,
130  Real & drho_dp,
131  Real & drho_dT,
132  Real & e,
133  Real & de_dp,
134  Real & de_dT) const
135 {
136  Real density, ddensity_dp, ddensity_dT;
137  rho_dpT(pressure, temperature, density, ddensity_dp, ddensity_dT);
138  rho = density;
139  drho_dp = ddensity_dp;
140  drho_dT = ddensity_dT;
141 
142  Real energy, denergy_dp, denergy_dT;
143  e_dpT(pressure, temperature, energy, denergy_dp, denergy_dT);
144  e = energy;
145  de_dp = denergy_dp;
146  de_dT = denergy_dT;
147 }
148 
149 Real IdealGasFluidPropertiesPT::mu(Real /*pressure*/, Real /*temperature*/) const
150 {
151  return _viscosity;
152 }
153 
154 void
156  Real pressure, Real temperature, Real & mu, Real & dmu_dp, Real & dmu_dT) const
157 {
158  mu = this->mu(pressure, temperature);
159  dmu_dp = 0.0;
160  dmu_dT = 0.0;
161 }
162 
163 Real IdealGasFluidPropertiesPT::mu_from_rho_T(Real /*density*/, Real /*temperature*/) const
164 {
165  return _viscosity;
166 }
167 
168 void
170  Real temperature,
171  Real /*ddensity_dT*/,
172  Real & mu,
173  Real & dmu_drho,
174  Real & dmu_dT) const
175 {
176  mu = this->mu_from_rho_T(density, temperature);
177  dmu_drho = 0.0;
178  dmu_dT = 0.0;
179 }
180 
181 Real
182 IdealGasFluidPropertiesPT::h(Real /*pressure*/, Real temperature) const
183 {
184  return _cp * temperature;
185 }
186 
187 void
189  Real pressure, Real temperature, Real & h, Real & dh_dp, Real & dh_dT) const
190 {
191  h = this->h(pressure, temperature);
192  dh_dp = 0.0;
193  dh_dT = _cp;
194 }
195 
196 Real IdealGasFluidPropertiesPT::henryConstant(Real /*temperature*/) const
197 {
198  return _henry_constant;
199 }
200 
201 void
202 IdealGasFluidPropertiesPT::henryConstant_dT(Real /*temperature*/, Real & Kh, Real & dKh_dT) const
203 {
204  Kh = _henry_constant;
205  dKh_dT = 0.0;
206 }
const Real _henry_constant
Henry constant.
const Real _thermal_conductivity
thermal conductivity
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
IdealGasFluidPropertiesPT(const InputParameters &parameters)
virtual Real mu_from_rho_T(Real density, Real temperature) const override
const std::string density
Definition: NS.h:15
virtual Real cp(Real pressure, Real temperature) const override
Isobaric specific heat capacity.
virtual void rho_e_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const override
Density and internal energy and their derivatives wrt pressure and temperature.
virtual Real mu(Real pressure, Real temperature) const override
const std::string temperature
Definition: NS.h:25
virtual Real cv(Real pressure, Real temperature) const override
Isochoric specific heat.
Common class for single phase fluid properties using a pressure and temperature formulation.
virtual void mu_drhoT_from_rho_T(Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const override
Dynamic viscosity and its derivatives wrt density and temperature.
virtual Real h(Real p, Real T) const override
Specific enthalpy.
InputParameters validParams< SinglePhaseFluidPropertiesPT >()
virtual void e_dpT(Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
Internal energy and its derivatives wrt pressure and temperature.
InputParameters validParams< IdealGasFluidPropertiesPT >()
virtual Real rho(Real pressure, Real temperature) const override
Density.
virtual Real molarMass() const override
Molar mass.
const Real _thermal_expansion
thermal expansion coefficient
virtual Real k_from_rho_T(Real density, Real temperature) const override
Thermal conductivity as a function of density and temperature.
virtual Real k(Real pressure, Real temperature) const override
Thermal conductivity.
virtual Real beta(Real pressure, Real temperature) const override
Thermal expansion coefficient.
virtual Real c(Real pressure, Real temperature) const override
Speed of sound.
virtual void k_dpT(Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
Thermal conductivity and its derivatives wrt pressure and temperature.
virtual std::string fluidName() const override
Fluid name.
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
Density and its derivatives wrt pressure and temperature.
const std::string pressure
Definition: NS.h:24
const Real _specific_entropy
specific entropy
virtual void mu_dpT(Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
const Real _cv
specific heat at constant volume
virtual Real s(Real pressure, Real temperature) const override
Specific entropy.
virtual Real henryConstant(Real temperature) const override
Henry&#39;s law constant for dissolution in water.
virtual void h_dpT(Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
Enthalpy and its derivatives wrt pressure and temperature.
const Real _cp
specific heat at constant pressure
const Real _R
Universal gas constant (J/mol/K)
virtual void henryConstant_dT(Real temperature, Real &Kh, Real &dKh_dT) const override
Henry&#39;s law constant for dissolution in water and derivative wrt temperature.