13static const double Hi[4] = {1.67752, 2.20462, 0.6366564, -0.241605};
14static const double Hij[6][7] = {
15 {0.520094, 0.222531, -0.281378, 0.161913, -0.0325372, 0, 0},
16 {0.0850895, 0.999115, -0.906851, 0.257399, 0, 0, 0},
17 {-1.08374, 1.88797, -0.772479, 0, 0, 0, 0},
18 {-0.289555, 1.26613, -0.489837, 0, 0.0698452, 0, -0.00435673},
19 {0, 0, -0.25704, 0, 0, 0.00872102, 0},
20 {0, 0.120573, 0, 0, 0, 0, -0.000593264}};
27 const std::array<double, 6>& series_factorT,
28 const std::array<double, 7>& series_factorRho);
45 const double mu1 = std::exp(
67 "WaterViscosityIAPWS::dValue is implemented for "
68 "derivatives with respect to temperature and liquid density "
77 for (
double value :
Hi)
79 sum_val += (value / barT_i);
87 std::array<double, 6> series_factorT;
88 series_factorT[0] = 1.;
89 const double barT_fac = 1 / barT - 1.0;
90 for (
int i = 1; i < 6; i++)
92 series_factorT[i] = series_factorT[i - 1] * barT_fac;
95 return series_factorT;
100 std::array<double, 7> series_factorRho;
101 series_factorRho[0] = 1.;
102 for (
int i = 1; i < 7; i++)
104 series_factorRho[i] = series_factorRho[i - 1] * (bar_rho - 1.0);
107 return series_factorRho;
111 const std::array<double, 7>& series_factorRho)
114 for (
int i = 0; i < 6; i++)
116 double sum_val_j = 0;
117 for (
int j = 0; j < 7; j++)
119 sum_val_j +=
Hij[i][j] * series_factorRho[j];
121 sum_val += series_factorT[i] * sum_val_j;
130 const double sqrt_barT = std::sqrt(barT);
132 double dmu0_factor_dbarT = 0.0;
133 double barT_i = barT * barT;
134 for (
int i = 1; i < 4; i++)
136 dmu0_factor_dbarT -=
static_cast<double>(i) * (
Hi[i] / barT_i);
140 const double dbar_mu0_dbarT =
141 50. / (mu0_factor * sqrt_barT) -
142 100. * sqrt_barT * dmu0_factor_dbarT / (mu0_factor * mu0_factor);
147 double dmu1_factor_dbarT = 0.0;
148 for (
int i = 1; i < 6; i++)
150 double sum_val_j = 0;
151 for (
int j = 0; j < 7; j++)
153 sum_val_j +=
Hij[i][j] * series_factorRho[j];
155 dmu1_factor_dbarT -=
static_cast<double>(i) * series_factorT[i - 1] *
156 sum_val_j / (barT * barT);
159 const double mu1_factor =
161 const double dbar_mu1_dbarT =
162 bar_rho * std::exp(bar_rho * mu1_factor) * dmu1_factor_dbarT;
164 return dbar_mu0_dbarT * std::exp(bar_rho * mu1_factor) +
165 dbar_mu1_dbarT * 100. * sqrt_barT / mu0_factor;
173 double dmu1_factor_dbar_rho = 0.0;
174 for (
int i = 0; i < 6; i++)
176 double sum_val_j = 0;
177 for (
int j = 1; j < 7; j++)
180 static_cast<double>(j) *
Hij[i][j] * series_factorRho[j - 1];
182 dmu1_factor_dbar_rho += series_factorT[i] * sum_val_j;
187 const double mu1_factor =
189 return mu0 * std::exp(bar_rho * mu1_factor) *
190 (mu1_factor + bar_rho * dmu1_factor_dbar_rho);
virtual PropertyDataType value() const
static constexpr double ref_mu_
reference viscosity in Pa.s
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
static constexpr double ref_T_
reference temperature in K
static constexpr double ref_rho_
reference density in kg/m^3
static double computeBarMu0Factor(const double barT)
static const double Hi[4]
static double computedBarMu_dbarT(const double barT, double bar_rho)
static std::array< double, 7 > computeSeriesFactorRhoForMu1(const double bar_rho)
static const double Hij[6][7]
static double computeBarMu1Factor(const std::array< double, 6 > &series_factorT, const std::array< double, 7 > &series_factorRho)
static double computedBarMu_dbarRho(const double barT, double bar_rho)
static std::array< double, 6 > computeSeriesFactorTForMu1(const double barT)
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType