22 static const double Hi[4] = {1.67752, 2.20462, 0.6366564, -0.241605};
23 static const double Hij[6][7] = {
24 {0.520094, 0.222531, -0.281378, 0.161913, -0.0325372, 0, 0},
25 {0.0850895, 0.999115, -0.906851, 0.257399, 0, 0, 0},
26 {-1.08374, 1.88797, -0.772479, 0, 0, 0, 0},
27 {-0.289555, 1.26613, -0.489837, 0, 0.0698452, 0, -0.00435673},
28 {0, 0, -0.25704, 0, 0, 0.00872102, 0},
29 {0, 0.120573, 0, 0, 0, 0, -0.000593264}};
36 const std::array<double, 6>& series_factorT,
37 const std::array<double, 7>& series_factorRho);
46 const double bar_rho =
53 const double mu1 = std::exp(
64 const double bar_rho =
82 for (
double value :
Hi)
84 sum_val += (value / barT_i);
92 std::array<double, 6> series_factorT;
93 series_factorT[0] = 1.;
94 const double barT_fac = 1 / barT - 1.0;
95 for (
int i = 1; i < 6; i++)
97 series_factorT[i] = series_factorT[i - 1] * barT_fac;
100 return series_factorT;
105 std::array<double, 7> series_factorRho;
106 series_factorRho[0] = 1.;
107 for (
int i = 1; i < 7; i++)
109 series_factorRho[i] = series_factorRho[i - 1] * (bar_rho - 1.0);
112 return series_factorRho;
116 const std::array<double, 7>& series_factorRho)
119 for (
int i = 0; i < 6; i++)
121 double sum_val_j = 0;
122 for (
int j = 0; j < 7; j++)
124 sum_val_j +=
Hij[i][j] * series_factorRho[j];
126 sum_val += series_factorT[i] * sum_val_j;
135 const double sqrt_barT = std::sqrt(barT);
137 double dmu0_factor_dbarT = 0.0;
138 double barT_i = barT * barT;
139 for (
int i = 1; i < 4; i++)
141 dmu0_factor_dbarT -=
static_cast<double>(i) * (
Hi[i] / barT_i);
145 const double dbar_mu0_dbarT =
146 50. / (mu0_factor * sqrt_barT) -
147 100. * sqrt_barT * dmu0_factor_dbarT / (mu0_factor * mu0_factor);
152 double dmu1_factor_dbarT = 0.0;
153 for (
int i = 1; i < 6; i++)
155 double sum_val_j = 0;
156 for (
int j = 0; j < 7; j++)
158 sum_val_j +=
Hij[i][j] * series_factorRho[j];
160 dmu1_factor_dbarT -=
static_cast<double>(i) * series_factorT[i - 1] *
161 sum_val_j / (barT * barT);
164 const double mu1_factor =
166 const double dbar_mu1_dbarT =
167 bar_rho * std::exp(bar_rho * mu1_factor) * dmu1_factor_dbarT;
169 return dbar_mu0_dbarT * std::exp(bar_rho * mu1_factor) +
170 dbar_mu1_dbarT * 100. * sqrt_barT / mu0_factor;
178 double dmu1_factor_dbar_rho = 0.0;
179 for (
int i = 0; i < 6; i++)
181 double sum_val_j = 0;
182 for (
int j = 1; j < 7; j++)
185 static_cast<double>(j) *
Hij[i][j] * series_factorRho[j - 1];
187 dmu1_factor_dbar_rho += series_factorT[i] * sum_val_j;
192 const double mu1_factor =
194 return mu0 * std::exp(bar_rho * mu1_factor) *
195 (mu1_factor + bar_rho * dmu1_factor_dbar_rho);
Viscosity model according to Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Wate...
std::array< double, PropertyVariableNumber > ArrayType
double getValue(const ArrayType &var_vals) const override
const double _ref_mu
reference viscosity in Pa.s
double getdValue(const ArrayType &var_vals, const PropertyVariableType var_type) const override
const double _ref_rho
reference density in kg/m^3
const double _ref_T
reference temperature in K
static const double Hij[6][7]
PropertyVariableType
Variable that determine the property.
@ rho
density. For some models, rho substitutes p
static double computeBarMu0Factor(const double barT)
static double computedBarMu_dbarRho(const double barT, double bar_rho)
static double computedBarMu_dbarT(const double barT, double bar_rho)
static std::array< double, 7 > computeSeriesFactorRhoForMu1(const double bar_rho)
static double computeBarMu1Factor(const std::array< double, 6 > &series_factorT, const std::array< double, 7 > &series_factorRho)
static std::array< double, 6 > computeSeriesFactorTForMu1(const double barT)
static const double Hi[4]