45 if (not jj.contains(
"tr_coeffs")) {
49 if (not jj.contains(
"dr_coeffs")) {
53 auto json_tr_coeffs = jj.at(
"tr_coeffs");
54 auto json_dr_coeffs = jj.at(
"dr_coeffs");
56 auto rows_tr = json_tr_coeffs.size();
57 auto cols_tr = json_tr_coeffs[0].size();
58 tr_coeffs.resize(rows_tr, cols_tr);
60 auto rows_dr = json_dr_coeffs.size();
61 auto cols_dr = json_dr_coeffs[0].size();
62 dr_coeffs.resize(rows_dr, cols_dr);
65 for (
auto i = 0; i < rows_tr; ++i) {
66 for (
auto j = 0; j < cols_tr; ++j) {
67 tr_coeffs(i, j) = json_tr_coeffs[i][j];
71 for (
auto i = 0; i < rows_dr; ++i) {
72 for (
auto j = 0; j < cols_dr; ++j) {
73 dr_coeffs(i, j) = json_dr_coeffs[i][j];
83 auto get_tr(
const TTYPE& temperature,
const RHOTYPE& density,
const MoleFractions& molefraction)
const {
85 auto p00 = tr_coeffs(0, 0) + molefraction[0] * tr_coeffs(0, 1) + molefraction[0] * molefraction[0] * tr_coeffs(0, 2);
86 auto p10 = tr_coeffs(1, 0) + molefraction[0] * tr_coeffs(1, 1) + molefraction[0] * molefraction[0] * tr_coeffs(1, 2);
87 auto p01 = tr_coeffs(2, 0) + molefraction[0] * tr_coeffs(2, 1) + molefraction[0] * molefraction[0] * tr_coeffs(2, 2);
88 auto p20 = tr_coeffs(3, 0) + molefraction[0] * tr_coeffs(3, 1) + molefraction[0] * molefraction[0] * tr_coeffs(3, 2);
89 auto p11 = tr_coeffs(4, 0) + molefraction[0] * tr_coeffs(4, 1) + molefraction[0] * molefraction[0] * tr_coeffs(4, 2);
90 auto p02 = tr_coeffs(5, 0) + molefraction[0] * tr_coeffs(5, 1) + molefraction[0] * molefraction[0] * tr_coeffs(5, 2);
91 auto dc_scale = 1.0/(0.125*
pow(
pow(
vc[0],1.0/3.0) +
pow(
vc[1],1.0/3.0),3.0));
92 auto tc_scale = sqrt(
Tc[0] *
Tc[1]);
93 auto tau = tc_scale / temperature;
94 auto delta = density / dc_scale;
96 auto tc_func =
pow(molefraction[0], 2.0) *
Tc[0] +
pow(molefraction[1], 2.0) *
Tc[1] + 2.0 * molefraction[0] * molefraction[1] * \
97 (p00 + p10 * delta + p01 * tau + p20 * delta * delta + p02 * tau * tau + p11 * delta * tau) * tc_scale;
106 auto get_dr(
const TTYPE& temperature,
const RHOTYPE& density,
const MoleFractions& molefraction)
const {
108 auto p00 = dr_coeffs(0, 0) + molefraction[0] * dr_coeffs(0, 1) + molefraction[0] * molefraction[0] * dr_coeffs(0, 2);
109 auto p10 = dr_coeffs(1, 0) + molefraction[0] * dr_coeffs(1, 1) + molefraction[0] * molefraction[0] * dr_coeffs(1, 2);
110 auto p01 = dr_coeffs(2, 0) + molefraction[0] * dr_coeffs(2, 1) + molefraction[0] * molefraction[0] * dr_coeffs(2, 2);
111 auto p20 = dr_coeffs(3, 0) + molefraction[0] * dr_coeffs(3, 1) + molefraction[0] * molefraction[0] * dr_coeffs(3, 2);
112 auto p11 = dr_coeffs(4, 0) + molefraction[0] * dr_coeffs(4, 1) + molefraction[0] * molefraction[0] * dr_coeffs(4, 2);
113 auto p02 = dr_coeffs(5, 0) + molefraction[0] * dr_coeffs(5, 1) + molefraction[0] * molefraction[0] * dr_coeffs(5, 2);
114 auto dc_scale = 1.0/(0.125*
pow(
pow(
vc[0],1.0/3.0) +
pow(
vc[1],1.0/3.0),3.0));
115 auto vc_scale = 1.0/dc_scale;
116 auto tc_scale = sqrt(
Tc[0] *
Tc[1]);
117 auto tau = tc_scale / temperature;
118 auto delta = density / dc_scale;
120 auto vc_ =
pow(molefraction[0], 2.0) *
vc[0] +
pow(molefraction[1], 2.0) *
vc[1] + 2.0 * molefraction[0] * molefraction[1] * \
121 (p00 + p10 * delta + p01 * tau + p20 * delta * delta + p02 * tau * tau + p11 * delta * tau) * vc_scale;
122 auto dc_func = (1.0 / vc_);