10 Eigen::Array<double, 7, 1> aim, bim;
16 PCSAFTPureGrossSadowski2001(
const nlohmann::json&j) :
coeff((Eigen::Array<double, 7, 6>() << 0.9105631445,-0.3084016918,-0.0906148351,0.7240946941,-0.5755498075,0.0976883116 ,
17 0.6361281449,0.1860531159,0.4527842806,2.2382791861,0.6995095521,-0.2557574982 ,
18 2.6861347891,-2.5030047259,0.5962700728,-4.0025849485,3.8925673390,-9.1558561530 ,
19 -26.547362491,21.419793629,-1.7241829131,-21.003576815,-17.215471648,20.642075974 ,
20 97.759208784,-65.255885330,-4.1302112531,26.855641363,192.67226447,-38.804430052 ,
21 -159.59154087,83.318680481,13.776631870,206.55133841,-161.82646165,93.626774077 ,
22 91.297774084,-33.746922930,-8.6728470368,-355.60235612,-165.20769346,-29.666905585).finished()),
23 m(j.at(
"m")),
sigma_A(j.at(
"sigma / A")),
eps_k(j.at(
"epsilon_over_k")) {
24 auto mfac1 = (
m-1.0)/
m;
25 auto mfac2 = (
m-2.0)/
m*mfac1;
38 auto alphar(
const TTYPE& T,
const RhoType& rhomolar,
const VecType& )
const {
40 auto rhoN_A3 =
forceeval(rhomolar*N_A/1e30);
43 Eigen::Array<
decltype(d), 4, 1> dpowers; dpowers(0) = 1.0;
for (
auto i = 1U; i <= 3; ++i){ dpowers(i) = d*dpowers(i-1); }
44 auto D =
pi/6.0*
m*dpowers;
45 auto zeta = rhoN_A3*D.template cast<std::common_type_t<TTYPE, RhoType>>();
47 auto zeta2_to2 = zeta[2]*zeta[2];
48 auto zeta2_to3 = zeta2_to2*zeta[2];
49 auto zeta3_to2 = zeta[3]*zeta[3];
51 auto onemineta_to2 = onemineta*onemineta;
52 auto onemineta_to3 = onemineta*onemineta_to2;
53 auto onemineta_to4 = onemineta*onemineta_to3;
55 std::decay_t<
decltype(zeta[0])> alpha_hs =
forceeval((3.0*zeta[1]*zeta[2]/onemineta
56 + zeta2_to3/(zeta[3]*onemineta_to2)
57 + (zeta2_to3/zeta3_to2-zeta[0])*log(1.0-zeta[3]))/zeta[0]);
59 auto Upsilon = 1.0-zeta[3];
61 3.0*D[1]/D[0]*zeta[2]/Upsilon
62 + D[2]*D[2]*zeta[2]/(D[3]*D[0]*Upsilon*Upsilon)
64 + (D[2]*D[2]*D[2])/(D[3]*D[3]*D[0])*log(Upsilon)
68 auto fac_g_hs = d/2.0;
69 auto gii = (1.0/onemineta
70 + fac_g_hs*3.0*zeta[2]/onemineta_to2
71 + (fac_g_hs*fac_g_hs)*2.0*zeta2_to2/onemineta_to3);
72 auto alpha_hc =
m*alpha_hs - (
m-1)*log(gii);
77 auto eta4 = eta2*eta2;
78 auto C1 = 1.0+
m*(8.0*eta-2.0*eta2)/onemineta_to4+(1.0-
m)*(20.0*eta-27.0*eta2+12.0*eta3-2.0*eta4)/onemineta_to2/((2.0-eta)*(2.0-eta));
80 Eigen::Array<
decltype(eta), 7, 1> etapowers; etapowers(0) = 1.0;
for (
auto i = 1U; i <= 6; ++i){ etapowers(i) = eta*etapowers(i-1); }
81 auto I1 = (aim.array().template cast<decltype(eta)>()*etapowers).sum();
82 auto I2 = (bim.array().template cast<decltype(eta)>()*etapowers).sum();
84 auto alpha_disp = -
kappa1*rhoN_A3*I1/T -
kappa2*rhoN_A3*I2/C1/(T*T);