41 double xMass[nel], aIon[nel], zIon[nel];
44 xMass[0] = 0.75; aIon[0] = 1.0; zIon[0] = 1.0;
45 xMass[1] = 0.23; aIon[1] = 4.0; zIon[1] = 2.0;
46 xMass[2] = 0.02; aIon[2] = 12.0; zIon[2] = 6.0;
53 for (
int i=0; i<nel; i++) {
54 aSum += xMass[i]/aIon[i];
55 zSum += xMass[i]*zIon[i]/aIon[i];
61 auto& eos = std::get<std::unique_ptr<serif::eos::EOSio>>(rm.
getResource(
"eos:helm"));
62 auto& table = eos->getTable();
63 auto& helmTable = *std::get<std::unique_ptr<serif::eos::helmholtz::HELMTable>>(table);
66 constexpr double absErr = 1e-12;
69 EXPECT_NEAR( helmEos.ye, 8.75e-01, absErr);
72 EXPECT_NEAR( helmEos.etaele, 2.3043348231021554e+01, absErr);
73 EXPECT_NEAR( helmEos.etot, 1.1586558190936826e+17, 1e3);
74 EXPECT_NEAR(helmEos.denerdd, 6.1893000468285858e+10, 1e-2);
75 EXPECT_NEAR(helmEos.denerdt, 1.2129708972542575e+08, 1e-7);
76 EXPECT_NEAR( helmEos.ptot, 6.9610135220017030e+22, 1e10);
77 EXPECT_NEAR(helmEos.dpresdd, 1.0296440482849070e+17, 1e3);
78 EXPECT_NEAR(helmEos.dpresdt, 7.7171347517311625e+13, 1.0);
79 EXPECT_NEAR( helmEos.stot, 6.0647461970567346e+08, 1e-7);
80 EXPECT_NEAR(helmEos.dentrdd,-7.7171347517311645e+01, absErr);
81 EXPECT_NEAR(helmEos.dentrdt, 1.2129708972542577e+00, absErr);
84 EXPECT_NEAR( helmEos.dse, 0, absErr);
85 EXPECT_NEAR( helmEos.dpe, 0, absErr);
86 EXPECT_NEAR( helmEos.dsp, 0, absErr);
91 composition.registerSymbol({
102 composition.setMassFraction(
"H-1", 0.75);
103 composition.setMassFraction(
"He-4", 0.23);
104 composition.setMassFraction(
"C-12", 0.0044);
105 composition.setMassFraction(
"O-16", 0.0096);
106 composition.setMassFraction(
"Ne-20", 0.002);
107 composition.setMassFraction(
"Fe-56", 0.0018);
108 composition.setMassFraction(
"N-14", 0.001);
109 composition.setMassFraction(
"Si-28", 0.0008);
110 composition.setMassFraction(
"Mg-24", 0.0004);
111 composition.finalize();
114 auto& EOSio = std::get<std::unique_ptr<serif::eos::EOSio>>(rm.
getResource(
"eos:helm"));
124 EXPECT_NO_THROW(eosOutput =
EOS.get(eosInput));
125 eosOutput =
EOS.get(eosInput);
127 const double pressureFraction = eosOutput.
pressure.
total / 6.9548533046915791E+22;
128 constexpr double relError = 1e-6;
129 EXPECT_NEAR(pressureFraction, 1.0, relError);