www.mooseframework.org
SimpleFluidProperties.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "SimpleFluidProperties.h"
11 
12 registerMooseObject("FluidPropertiesApp", SimpleFluidProperties);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<SinglePhaseFluidProperties>();
19  params.addParam<Real>("molar_mass", 1.8E-2, "Constant molar mass of the fluid (kg/mol)");
20  params.addParam<Real>(
21  "thermal_expansion", 2.14E-4, "Constant coefficient of thermal expansion (1/K)");
22  params.addParam<Real>(
23  "cv", 4186.0, "Constant specific heat capacity at constant volume (J/kg/K)");
24  params.addParam<Real>(
25  "cp", 4194.0, "Constant specific heat capacity at constant pressure (J/kg/K)");
26  params.addRangeCheckedParam<Real>(
27  "bulk_modulus", 2.0E9, "bulk_modulus>0", "Constant bulk modulus (Pa)");
28  params.addParam<Real>("thermal_conductivity", 0.6, "Constant thermal conductivity (W/m/K)");
29  params.addParam<Real>("specific_entropy", 300.0, "Constant specific entropy (J/kg/K)");
30  params.addParam<Real>("viscosity", 1.0E-3, "Constant dynamic viscosity (Pa.s)");
31  params.addParam<Real>("density0", 1000.0, "Density at zero pressure and zero temperature");
32  params.addParam<Real>("porepressure_coefficient",
33  1.0,
34  "The enthalpy is internal_energy + P / density * "
35  "porepressure_coefficient. Physically this should be 1.0, "
36  "but analytic solutions are simplified when it is zero");
37  params.addClassDescription("Fluid properties for a simple fluid with a constant bulk density");
38  return params;
39 }
40 
41 SimpleFluidProperties::SimpleFluidProperties(const InputParameters & parameters)
42  : SinglePhaseFluidProperties(parameters),
43  _molar_mass(getParam<Real>("molar_mass")),
44  _thermal_expansion(getParam<Real>("thermal_expansion")),
45  _cv(getParam<Real>("cv")),
46  _cp(getParam<Real>("cp")),
47  _bulk_modulus(getParam<Real>("bulk_modulus")),
48  _thermal_conductivity(getParam<Real>("thermal_conductivity")),
49  _specific_entropy(getParam<Real>("specific_entropy")),
50  _viscosity(getParam<Real>("viscosity")),
51  _density0(getParam<Real>("density0")),
52  _pp_coeff(getParam<Real>("porepressure_coefficient"))
53 {
54 }
55 
57 
58 std::string
60 {
61  return "simple_fluid";
62 }
63 
64 Real
66 {
67  return _molar_mass;
68 }
69 
70 Real SimpleFluidProperties::beta_from_p_T(Real /*pressure*/, Real /*temperature*/) const
71 {
72  return _thermal_expansion;
73 }
74 
75 void
77  Real pressure, Real temperature, Real & beta, Real & dbeta_dp, Real & dbeta_dT) const
78 {
80  dbeta_dp = 0.0;
81  dbeta_dT = 0.0;
82 }
83 
84 Real SimpleFluidProperties::cp_from_p_T(Real /*pressure*/, Real /*temperature*/) const
85 {
86  return _cp;
87 }
88 
89 void
91  Real pressure, Real temperature, Real & cp, Real & dcp_dp, Real & dcp_dT) const
92 {
94  dcp_dp = 0.0;
95  dcp_dT = 0.0;
96 }
97 
98 Real SimpleFluidProperties::cv_from_p_T(Real /*pressure*/, Real /*temperature*/) const
99 {
100  return _cv;
101 }
102 
103 Real
105 {
106  return std::sqrt(_bulk_modulus / rho_from_p_T(pressure, temperature));
107 }
108 
109 Real SimpleFluidProperties::k_from_p_T(Real /*pressure*/, Real /*temperature*/) const
110 {
111  return _thermal_conductivity;
112 }
113 
114 void
116  Real /*pressure*/, Real /*temperature*/, Real & k, Real & dk_dp, Real & dk_dT) const
117 {
119  dk_dp = 0;
120  dk_dT = 0;
121 }
122 
123 Real SimpleFluidProperties::s_from_p_T(Real /*pressure*/, Real /*temperature*/) const
124 {
125  return _specific_entropy;
126 }
127 
128 void
129 SimpleFluidProperties::s_from_p_T(Real p, Real T, Real & s, Real & ds_dp, Real & ds_dT) const
130 {
131  SinglePhaseFluidProperties::s_from_p_T(p, T, s, ds_dp, ds_dT);
132 }
133 
134 Real
136 {
138 }
139 
140 void
142  Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const
143 {
144  rho = this->rho_from_p_T(pressure, temperature);
145  drho_dp = rho / _bulk_modulus;
146  drho_dT = -_thermal_expansion * rho;
147 }
148 
149 Real
150 SimpleFluidProperties::e_from_p_T(Real /*pressure*/, Real temperature) const
151 {
152  return _cv * temperature;
153 }
154 
155 void
157  Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT) const
158 {
159  e = this->e_from_p_T(pressure, temperature);
160  de_dp = 0.0;
161  de_dT = _cv;
162 }
163 
164 Real SimpleFluidProperties::mu_from_p_T(Real /*pressure*/, Real /*temperature*/) const
165 {
166  return _viscosity;
167 }
168 
169 void
171  Real pressure, Real temperature, Real & mu, Real & dmu_dp, Real & dmu_dT) const
172 {
173  mu = this->mu_from_p_T(pressure, temperature);
174  dmu_dp = 0.0;
175  dmu_dT = 0.0;
176 }
177 
178 Real
180 {
181  return e_from_p_T(pressure, temperature) +
183 }
184 
185 void
187  Real pressure, Real temperature, Real & h, Real & dh_dp, Real & dh_dT) const
188 {
189  h = this->h_from_p_T(pressure, temperature);
190 
191  Real density, ddensity_dp, ddensity_dT;
192  rho_from_p_T(pressure, temperature, density, ddensity_dp, ddensity_dT);
193 
194  dh_dp = _pp_coeff / density - _pp_coeff * pressure * ddensity_dp / density / density;
195  dh_dT = _cv - _pp_coeff * pressure * ddensity_dT / density / density;
196 }
SimpleFluidProperties::cv_from_p_T
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:98
SimpleFluidProperties::_thermal_expansion
const Real _thermal_expansion
thermal expansion coefficient
Definition: SimpleFluidProperties.h:96
SimpleFluidProperties::s_from_p_T
virtual Real s_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:123
SimpleFluidProperties::_cp
const Real _cp
specific heat at constant pressure
Definition: SimpleFluidProperties.h:102
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
validParams< SimpleFluidProperties >
InputParameters validParams< SimpleFluidProperties >()
Definition: SimpleFluidProperties.C:16
SimpleFluidProperties::_bulk_modulus
const Real _bulk_modulus
bulk modulus
Definition: SimpleFluidProperties.h:105
SimpleFluidProperties
Fluid properties of a simple, idealised fluid density=density0 * exp(P / bulk_modulus - thermal_expan...
Definition: SimpleFluidProperties.h:36
SimpleFluidProperties::mu_from_p_T
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:164
SimpleFluidProperties::_molar_mass
const Real _molar_mass
molar mass
Definition: SimpleFluidProperties.h:93
SimpleFluidProperties::SimpleFluidProperties
SimpleFluidProperties(const InputParameters &parameters)
Definition: SimpleFluidProperties.C:41
SimpleFluidProperties::k_from_p_T
virtual Real k_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:109
SimpleFluidProperties::beta_from_p_T
virtual Real beta_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:70
SimpleFluidProperties.h
SimpleFluidProperties::molarMass
virtual Real molarMass() const override
Fluid name.
Definition: SimpleFluidProperties.C:65
SimpleFluidProperties::h_from_p_T
virtual Real h_from_p_T(Real p, Real T) const override
Definition: SimpleFluidProperties.C:179
NS::density
const std::string density
Definition: NS.h:16
SimpleFluidProperties::rho_from_p_T
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:135
SinglePhaseFluidProperties::T
e e e e p h T T T T T T
Definition: SinglePhaseFluidProperties.h:177
SimpleFluidProperties::cp_from_p_T
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:84
SinglePhaseFluidProperties::rho
e e e e p h T rho
Definition: SinglePhaseFluidProperties.h:169
SimpleFluidProperties::_specific_entropy
const Real _specific_entropy
specific entropy
Definition: SimpleFluidProperties.h:111
SimpleFluidProperties::_viscosity
const Real _viscosity
viscosity
Definition: SimpleFluidProperties.h:114
SimpleFluidProperties::~SimpleFluidProperties
virtual ~SimpleFluidProperties()
Definition: SimpleFluidProperties.C:56
SimpleFluidProperties::_cv
const Real _cv
specific heat at constant volume
Definition: SimpleFluidProperties.h:99
SimpleFluidProperties::c_from_p_T
virtual Real c_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:104
SimpleFluidProperties::_pp_coeff
const Real _pp_coeff
Porepressure coefficient: enthalpy = internal_energy + porepressure / density * _pp_coeff.
Definition: SimpleFluidProperties.h:120
NS::temperature
const std::string temperature
Definition: NS.h:26
registerMooseObject
registerMooseObject("FluidPropertiesApp", SimpleFluidProperties)
SimpleFluidProperties::_density0
const Real _density0
density at zero pressure and temperature
Definition: SimpleFluidProperties.h:117
SimpleFluidProperties::fluidName
virtual std::string fluidName() const override
Definition: SimpleFluidProperties.C:59
SinglePhaseFluidProperties::p
e e e e p h p
Definition: SinglePhaseFluidProperties.h:167
validParams< SinglePhaseFluidProperties >
InputParameters validParams< SinglePhaseFluidProperties >()
Definition: SinglePhaseFluidProperties.C:14
SimpleFluidProperties::e_from_p_T
virtual Real e_from_p_T(Real pressure, Real temperature) const override
Definition: SimpleFluidProperties.C:150
SimpleFluidProperties::_thermal_conductivity
const Real _thermal_conductivity
thermal conductivity
Definition: SimpleFluidProperties.h:108
NS::pressure
const std::string pressure
Definition: NS.h:25
SinglePhaseFluidProperties::h
e e e e h
Definition: SinglePhaseFluidProperties.h:163