diff --git a/.dependencies/python.devenv.yml b/.dependencies/python.devenv.yml index 6f2dd7d35..4eed593d9 100644 --- a/.dependencies/python.devenv.yml +++ b/.dependencies/python.devenv.yml @@ -3,6 +3,7 @@ dependencies: - numpy - pandas + - matplotlib - pip - tabulate - colorama diff --git a/Reaktoro/Core/ChemicalProperties.cpp b/Reaktoro/Core/ChemicalProperties.cpp index c66daebc1..109fda23d 100644 --- a/Reaktoro/Core/ChemicalProperties.cpp +++ b/Reaktoro/Core/ChemicalProperties.cpp @@ -321,6 +321,13 @@ auto ChemicalProperties::phaseSpecificVolumes() const -> ChemicalVector return phaseAmounts()/phaseMasses() % phaseMolarVolumes(); } +auto ChemicalProperties::phaseCompressibilityFactors() const -> ChemicalVector +{ + const auto& R = universalGasConstant; + const auto& v = phaseMolarVolumes(); + return P * v / (R * T); +} + auto ChemicalProperties::phaseSpecificEntropies() const -> ChemicalVector { return phaseAmounts()/phaseMasses() % phaseMolarEntropies(); diff --git a/Reaktoro/Core/ChemicalProperties.hpp b/Reaktoro/Core/ChemicalProperties.hpp index 8d692a7bf..31c9ad683 100644 --- a/Reaktoro/Core/ChemicalProperties.hpp +++ b/Reaktoro/Core/ChemicalProperties.hpp @@ -151,6 +151,9 @@ class ChemicalProperties /// Return the specific volumes of the phases (in units of m3/kg). auto phaseSpecificVolumes() const -> ChemicalVector; + /// Return the compressibility factor of the phases. + auto phaseCompressibilityFactors() const -> ChemicalVector; + /// Return the specific entropies of the phases (in units of J/(kg*K)). auto phaseSpecificEntropies() const -> ChemicalVector; diff --git a/Reaktoro/Thermodynamics/EOS/CubicEOS.cpp b/Reaktoro/Thermodynamics/EOS/CubicEOS.cpp index 20b5771b9..0ee247bdc 100644 --- a/Reaktoro/Thermodynamics/EOS/CubicEOS.cpp +++ b/Reaktoro/Thermodynamics/EOS/CubicEOS.cpp @@ -156,6 +156,131 @@ auto Psi(CubicEOS::Model type) -> double } // namespace internal +auto computeSpeciesFugacity( + const ThermoScalar& P, + const ThermoScalar& T, + const ChemicalScalar& xi, + const ChemicalScalar& ai, + const double& bi, + const ChemicalScalar& aiT, + const ChemicalScalar& amix, + const ChemicalScalar& amixT, + const ChemicalScalar& bmix, + const ChemicalScalar& A, + const ChemicalScalar& B, + const ChemicalScalar& C, + const ChemicalScalar& Z, + const double epsilon, + const double sigma) -> ChemicalScalar +{ + const double R = universalGasConstant; + + const double almost_zero = 1e-20; + + const ChemicalScalar q = amix/(bmix*R*T); + const ChemicalScalar qT = q*(amixT/amix - 1.0/T); + + const ChemicalScalar beta = P*bmix/(R*T); + const ThermoScalar betai = P*bi/(R*T); + + const ChemicalScalar qi = q*(1 + ai/amix - bi/bmix); + const ChemicalScalar qiT = qi*qT/q + q*(aiT - ai*amixT/amix)/amix; + + const ThermoScalar Ai = (epsilon + sigma - 1.0)*betai - 1.0; + const ChemicalScalar Bi = (epsilon*sigma - epsilon - sigma)*(2*beta*betai - beta*beta) - (epsilon + sigma - q)*(betai - beta) - (epsilon + sigma - qi)*beta; + const ChemicalScalar Ci = -3*sigma*epsilon*beta*beta*betai + 2*epsilon*sigma*beta*beta*beta - (epsilon*sigma + qi)*beta*beta - 2*(epsilon*sigma + q)*(beta*betai - beta*beta); + const ChemicalScalar Zi = -(Ai*Z*Z + (Bi + B)*Z + Ci + 2*C)/(3*Z*Z + 2*A*Z + B); + + // Calculate the integration factor I + ChemicalScalar I; + if(std::abs(epsilon - sigma) > almost_zero) I = log((Z + sigma*beta)/(Z + epsilon*beta))/(sigma - epsilon); + else I = beta/(Z + epsilon*beta); + + // Calculate the integration factor I for each component + ChemicalScalar Ii; + if(std::abs(epsilon - sigma) > almost_zero) Ii = I + ((Zi + sigma*betai)/(Z + sigma*beta) - (Zi + epsilon*betai)/(Z + epsilon*beta))/(sigma - epsilon); + else Ii = I * (1 + betai/beta - (Zi + epsilon*betai)/(Z + epsilon*beta)); + + auto Gi_res = R*T*(Zi - (Zi - betai)/(Z - beta) - log(Z - beta) - qi*I - q*Ii + q*I); + auto ln_fi = Gi_res/(R*T) + log(xi * P); + auto fi = exp(ln_fi); + return fi; +} + +auto calculateNormalizedPhaseGibbsEnergy( + const unsigned& nspecies, + const ThermoScalar& P, + const ThermoScalar& T, + const ChemicalVector& x, + const ChemicalVector& abar, + const Vector& bbar, + const ChemicalVector& abarT, + const ChemicalScalar& amix, + const ChemicalScalar& amixT, + const ChemicalScalar& bmix, + const ChemicalScalar& A, + const ChemicalScalar& B, + const ChemicalScalar& C, + const ChemicalScalar& Z, + const double epsilon, + const double sigma) -> ChemicalScalar +{ + ChemicalScalar G_normalized; + for(unsigned i = 0; i < nspecies; ++i) + { + auto xi = x[i]; + auto fi = computeSpeciesFugacity(P, T, xi, abar[i], bbar[i], abarT[i], amix, amixT, bmix, A, B, C, Z, epsilon, sigma); + G_normalized += xi * log(fi); + } + return G_normalized; +} + +auto selectCompressibilityFactorByGibbsEnergy( + const unsigned& nspecies, + std::vector Zs, + const ThermoScalar& P, + const ThermoScalar& T, + const ChemicalVector& x, + const ChemicalVector& abar, + const Vector& bbar, + const ChemicalVector& abarT, + const ChemicalScalar& amix, + const ChemicalScalar& amixT, + const ChemicalScalar& bmix, + const ChemicalScalar& A, + const ChemicalScalar& B, + const ChemicalScalar& C, + const double epsilon, + const double sigma) -> ChemicalScalar +{ + ChemicalScalar Z(nspecies); + if (Zs.size() == 1) + { + Z = Zs[0]; + return Z; + } + + if (Zs.size() != 2) { + Exception exception; + exception.error << "selectCompressibilityByGibbsEnergy received invalid input"; + exception.reason << "Zs should have size 1 or 2 in selectCompressibilityByGibbsEnergy, " + << "but has a size of " << Zs.size(); + RaiseError(exception); + } + + std::vector normalized_Gs; + normalized_Gs.push_back( + calculateNormalizedPhaseGibbsEnergy(nspecies, P, T, x, abar, bbar, abarT, amix, amixT, bmix, A, B, C, Zs[0], epsilon, sigma) + ); + normalized_Gs.push_back( + calculateNormalizedPhaseGibbsEnergy(nspecies, P, T, x, abar, bbar, abarT, amix, amixT, bmix, A, B, C, Zs[1], epsilon, sigma) + ); + + Z = normalized_Gs[0] < normalized_Gs[1] ? Zs[0] : Zs[1]; + + return Z; +} + struct CubicEOS::Impl { /// The number of species in the phase. @@ -340,11 +465,15 @@ struct CubicEOS::Impl const auto cubic_size = cubicEOS_roots.size(); std::vector Zs; - if (cubic_size == 1 || cubic_size == 2) + if (cubic_size == 1) { - //even if cubicEOS_roots has 2 roots, assume that the smallest does not have physical meaning Zs.push_back(ChemicalScalar(nspecies, cubicEOS_roots[0])); } + else if (cubic_size == 2) + { + Zs.push_back(ChemicalScalar(nspecies, cubicEOS_roots[0])); + Zs.push_back(ChemicalScalar(nspecies, cubicEOS_roots[1])); + } else { if (cubic_size != 3) { @@ -357,16 +486,18 @@ struct CubicEOS::Impl Zs.push_back(ChemicalScalar(nspecies, cubicEOS_roots[2])); // Z_min } - // Selecting compressibility factor - Z_liq < Z_gas ChemicalScalar Z(nspecies); + + // Selecting compressibility factor - Z_liq < Z_gas + //TODO: study the possibilty to use selectCompressibilityFactorByGibbsEnergy for Z selection if (isvapor) Z.val = *std::max_element(cubicEOS_roots.begin(), cubicEOS_roots.end()); else Z.val = *std::min_element(cubicEOS_roots.begin(), cubicEOS_roots.end()); auto input_phase_type = isvapor ? PhaseType::Gas : PhaseType::Liquid; - auto identified_phase_type = input_phase_type; + auto identified_phase_type = input_phase_type; switch (phase_identification_method) { case PhaseIdentificationMethod::None: @@ -390,8 +521,7 @@ struct CubicEOS::Impl throw std::logic_error("CubicEOS received an unexpected phaseIdentificationMethod"); } - if (identified_phase_type != input_phase_type) - { + if (identified_phase_type != input_phase_type) { // Since the phase is identified as different than the expect input phase type, it is // deemed inappropriate. Artificially high values are configured for fugacities, so that // this condition is "removed" by the optimizer. @@ -403,7 +533,7 @@ struct CubicEOS::Impl result.partial_molar_volumes.fill(0.0); result.residual_partial_molar_gibbs_energies.fill(0.0); result.residual_partial_molar_enthalpies.fill(0.0); - result.ln_fugacity_coefficients.fill(100.0); + result.ln_fugacity_coefficients.fill(0.0); return result; } @@ -493,7 +623,7 @@ CubicEOS::Result::Result(unsigned nspecies) {} /// Sanity check free function to verify if BIPs matrices have proper dimensions. Considering that the phase has -/// n species, the BIP matricies k, kT and kTT should have (n, n) as dimensions. +/// n species, the BIP matrices k, kT and kTT should have (n, n) as dimensions. /// @see CubicEOS::setInteractionParamsFunction auto sanityCheckInteractionParamsFunction(const unsigned& nspecies, const CubicEOS::InteractionParamsFunction& func) -> void { diff --git a/Reaktoro/Thermodynamics/EOS/CubicEOS.hpp b/Reaktoro/Thermodynamics/EOS/CubicEOS.hpp index 35ac57246..4ae1ad220 100644 --- a/Reaktoro/Thermodynamics/EOS/CubicEOS.hpp +++ b/Reaktoro/Thermodynamics/EOS/CubicEOS.hpp @@ -50,10 +50,13 @@ class CubicEOS /// Note that the BIPs can depend on the temperature, thus kT and kTT should be also provided. struct InteractionParamsResult { + /// The BIPs matrix. The size must be (n, n), where n is the number of species MatrixXd k; + /// The derivative of each k entry w.r.t T. MatrixXd kT; + /// The derivative of each kT entry w.r.t T. MatrixXd kTT; }; diff --git a/Reaktoro/Thermodynamics/EOS/PhaseIdentification.cpp b/Reaktoro/Thermodynamics/EOS/PhaseIdentification.cpp index 785775efa..746b2b7fb 100644 --- a/Reaktoro/Thermodynamics/EOS/PhaseIdentification.cpp +++ b/Reaktoro/Thermodynamics/EOS/PhaseIdentification.cpp @@ -107,6 +107,38 @@ auto pressureComparison(const ThermoScalar& Pressure, const ThermoScalar& Temper RaiseError(exception); } +auto computeGibbsResidualEnergy( + const ThermoScalar& pressure, + const ThermoScalar& temperature, + const ChemicalScalar& amix, + const ChemicalScalar& bmix, + const ChemicalScalar& A, + const ChemicalScalar& B, + const ChemicalScalar& Z, + const double epsilon, + const double sigma) -> ChemicalScalar +{ + auto const almost_zero = 1e-20; + auto constexpr R = universalGasConstant; + auto const& T = temperature; + + // Computing the values of residual Gibbs energy for all Zs + ChemicalScalar Gs; + const double factor = -1.0 / (3 * Z.val*Z.val + 2 * A.val*Z.val + B.val); + const ChemicalScalar beta = pressure * bmix / (R * T); + const ChemicalScalar q = amix / (bmix * R * T); + + // Calculate the integration factor I + ChemicalScalar I; + if (std::abs(epsilon - sigma) > almost_zero) + I = log((Z + sigma * beta) / (Z + epsilon * beta)) / (sigma - epsilon); + else + I = beta / (Z + epsilon * beta); + + Gs = R * temperature*(Z - 1 - log(Z - beta) - q * I); + + return Gs; +} auto gibbsResidualEnergyComparison( const ThermoScalar& pressure, @@ -127,24 +159,24 @@ auto gibbsResidualEnergyComparison( std::vector Gs; for (const auto Z : {Z_max, Z_min}) { - const double factor = -1.0 / (3 * Z.val*Z.val + 2 * A.val*Z.val + B.val); - const ChemicalScalar beta = pressure * bmix / (R * T); - const ChemicalScalar q = amix / (bmix * R * T); - - // Calculate the integration factor I and its temperature derivative IT - ChemicalScalar I; - if (epsilon != sigma) - I = log((Z + sigma * beta) / (Z + epsilon * beta)) / (sigma - epsilon); - else - I = beta / (Z + epsilon * beta); - - Gs.push_back(R * temperature*(Z - 1 - log(Z - beta) - q * I)); + auto current_G = computeGibbsResidualEnergy( + pressure, + temperature, + amix, + bmix, + A, + B, + Z, + epsilon, + sigma + ); + + Gs.push_back(current_G); } return (Gs[0].val < Gs[1].val) ? PhaseType::Gas : PhaseType::Liquid; } - auto identifyPhaseUsingGibbsEnergyAndEos( const ThermoScalar& pressure, const ThermoScalar& temperature, diff --git a/Reaktoro/Thermodynamics/EOS/PhaseIdentification.hpp b/Reaktoro/Thermodynamics/EOS/PhaseIdentification.hpp index 79417f324..9b01d91af 100644 --- a/Reaktoro/Thermodynamics/EOS/PhaseIdentification.hpp +++ b/Reaktoro/Thermodynamics/EOS/PhaseIdentification.hpp @@ -65,7 +65,7 @@ auto identifyPhaseUsingIsothermalCompressibility( /// @param temperature Phase temperature /// @param amix attractive parameter /// @param Zs Z-roots, as calculated by the cubic EOS. Must have size 1 or 2 here. -/// If size(Z) == 2, the values od Gibbs residual energy are compared. It is a liquid phase if +/// If size(Z) == 2, the values of Gibbs residual energy are compared. It is a liquid phase if /// Gibbs residual energy of Z_min is the smallest and gaseous if Gibbs residual energy of Z_max /// is the smallest. /// If size(Z) == 1, the pressue is compared with the local P_min and local P_max of the EoS. diff --git a/python/PyReaktoro/Core/PyChemicalProperties.cpp b/python/PyReaktoro/Core/PyChemicalProperties.cpp index fce7c427a..34a270ee8 100644 --- a/python/PyReaktoro/Core/PyChemicalProperties.cpp +++ b/python/PyReaktoro/Core/PyChemicalProperties.cpp @@ -67,6 +67,7 @@ void exportChemicalProperties(py::module& m) .def("phaseSpecificGibbsEnergies", &ChemicalProperties::phaseSpecificGibbsEnergies) .def("phaseSpecificEnthalpies", &ChemicalProperties::phaseSpecificEnthalpies) .def("phaseSpecificVolumes", &ChemicalProperties::phaseSpecificVolumes) + .def("phaseCompressibilityFactors", &ChemicalProperties::phaseCompressibilityFactors) .def("phaseSpecificEntropies", &ChemicalProperties::phaseSpecificEntropies) .def("phaseSpecificInternalEnergies", &ChemicalProperties::phaseSpecificInternalEnergies) .def("phaseSpecificHelmholtzEnergies", &ChemicalProperties::phaseSpecificHelmholtzEnergies) diff --git a/python/reaktoro/CMakeLists.txt b/python/reaktoro/CMakeLists.txt index 3e3cfb207..88e8b724a 100644 --- a/python/reaktoro/CMakeLists.txt +++ b/python/reaktoro/CMakeLists.txt @@ -21,7 +21,7 @@ add_custom_target(reaktoro ALL COMMAND ${PYTHON_EXECUTABLE} -m pip install reaktoro --prefix=${CMAKE_BINARY_DIR} --find-links=${CMAKE_CURRENT_BINARY_DIR}/dist - --no-index --no-deps --no-cache-dir + --no-index --no-deps --no-cache-dir --force-reinstall WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # Set dependencies of reaktoro target @@ -66,7 +66,7 @@ install(CODE COMMAND ${PYTHON_EXECUTABLE} -m pip install reaktoro --prefix=\${REAKTORO_PYTHON_INSTALL_PREFIX_NATIVE} --find-links=\${REAKTORO_PYTHON_DIST_DIR_NATIVE} - --no-index --no-deps --no-cache-dir + --no-index --no-deps --no-cache-dir --force-reinstall WORKING_DIRECTORY ${REAKTORO_PYTHON_INSTALL_PREFIX}) " ) diff --git a/tests/data/pvtlib-pedersen63-phase-compositions.csv b/tests/data/pvtlib-pedersen63-phase-compositions.csv new file mode 100644 index 000000000..dd7e5dc34 --- /dev/null +++ b/tests/data/pvtlib-pedersen63-phase-compositions.csv @@ -0,0 +1,360 @@ +Pressure [Pa],Temperature [K],Phase,Molar Fraction,C1,CO2 +1000000,231.15,1,1,0.4,0.6 +1032663.31658291,231.15,1,1,0.4,0.6 +1065326.63316583,231.15,1,1,0.4,0.6 +1097989.94974874,231.15,1,1,0.4,0.6 +1130653.26633166,231.15,1,1,0.4,0.6 +1163316.58291457,231.15,1,1,0.4,0.6 +1195979.89949749,231.15,1,1,0.4,0.6 +1228643.2160804,231.15,1,1,0.4,0.6 +1261306.53266332,231.15,1,1,0.4,0.6 +1293969.84924623,231.15,1,1,0.4,0.6 +1326633.16582915,231.15,1,1,0.4,0.6 +1359296.48241206,231.15,1,1,0.4,0.6 +1391959.79899497,231.15,1,1,0.4,0.6 +1424623.11557789,231.15,1,1,0.4,0.6 +1457286.4321608,231.15,1,1,0.4,0.6 +1489949.74874372,231.15,1,1,0.4,0.6 +1522613.06532663,231.15,1,1,0.4,0.6 +1555276.38190955,231.15,1,1,0.4,0.6 +1587939.69849246,231.15,1,1,0.4,0.6 +1620603.01507538,231.15,1,1,0.4,0.6 +1653266.33165829,231.15,1,1,0.4,0.6 +1685929.64824121,231.15,1,0.979337665274671,0.407826220692121,0.592173779307879 +1685929.64824121,231.15,2,0.020662334725329,0.029058729207836,0.970941270792164 +1718592.96482412,231.15,1,0.954904665755866,0.417455642050386,0.582544357949614 +1718592.96482412,231.15,2,0.045095334244134,0.030372535938211,0.969627464061789 +1751256.28140704,231.15,1,0.93234917397839,0.426724311897606,0.573275688102394 +1751256.28140704,231.15,2,0.06765082602161,0.031691265456021,0.968308734543979 +1783919.59798995,231.15,1,0.911454498115478,0.435651668141407,0.564348331858593 +1783919.59798995,231.15,2,0.088545501884522,0.033014974208576,0.966985025791424 +1816582.91457286,231.15,1,0.892035935164381,0.444255770850104,0.555744229149896 +1816582.91457286,231.15,2,0.107964064835619,0.034343723563948,0.965656276436052 +1849246.23115578,231.15,1,0.873935085212038,0.452553421869146,0.547446578130854 +1849246.23115578,231.15,2,0.126064914787962,0.035677545202433,0.964322454797567 +1881909.54773869,231.15,1,0.857015315161127,0.460560273232412,0.539439726767588 +1881909.54773869,231.15,2,0.142984684838873,0.037016497892719,0.962983502107281 +1914572.86432161,231.15,1,0.841158148421434,0.468290923277026,0.531709076722974 +1914572.86432161,231.15,2,0.158841851578566,0.038360633505453,0.961639366494547 +1947236.18090452,231.15,1,0.826260342304988,0.475759003844618,0.524240996155382 +1947236.18090452,231.15,2,0.173739657695012,0.039710004728895,0.960289995271105 +1979899.49748744,231.15,1,0.812231513590909,0.482977258858188,0.517022741141812 +1979899.49748744,231.15,2,0.187768486409091,0.041064665083505,0.958935334916495 +2012562.81407035,231.15,1,0.79899219471285,0.489957615352834,0.510042384647166 +2012562.81407035,231.15,2,0.20100780528715,0.042424668936524,0.957575331063476 +2045226.13065327,231.15,1,0.786472224131595,0.496711247838341,0.503288752161659 +2045226.13065327,231.15,2,0.213527775868405,0.043790088307587,0.956209911692413 +2077889.44723618,231.15,1,0.774609447560366,0.50324863645783,0.49675136354217 +2077889.44723618,231.15,2,0.225390552439634,0.045160951147759,0.954839048852241 +2110552.7638191,231.15,1,0.7633485712263,0.509579620219851,0.490420379780149 +2110552.7638191,231.15,2,0.2366514287737,0.046537327225129,0.953462672774871 +2143216.08040201,231.15,1,0.752640258495265,0.515713445046203,0.484286554953797 +2143216.08040201,231.15,2,0.247359741504735,0.047919274732567,0.952080725267433 +2175879.39698492,231.15,1,0.742440342492543,0.521658807726118,0.478341192273882 +2175879.39698492,231.15,2,0.257559657507457,0.049306852829628,0.950693147170372 +2208542.71356784,231.15,1,0.732709164408522,0.527423895984993,0.472576104015007 +2208542.71356784,231.15,2,0.267290835591478,0.050700121662459,0.949299878337542 +2241206.03015075,231.15,1,0.723411010843191,0.533016425092346,0.466983574907654 +2241206.03015075,231.15,2,0.276588989156809,0.05209914238398,0.94790085761602 +2273869.34673367,231.15,1,0.714513623281989,0.538443671361184,0.461556328638816 +2273869.34673367,231.15,2,0.285486376718011,0.05350399419427,0.94649600580573 +2306532.66331658,231.15,1,0.705987823216245,0.543712502795145,0.456287497204855 +2306532.66331658,231.15,2,0.294012176783755,0.054914710923943,0.945085289076057 +2339195.9798995,231.15,1,0.697807105600179,0.548829407273199,0.451170592726801 +2339195.9798995,231.15,2,0.302192894399821,0.05633137031973,0.94366862968027 +2371859.29648241,231.15,1,0.689947364929418,0.553800518360861,0.446199481639139 +2371859.29648241,231.15,2,0.310052635070582,0.057754037975848,0.942245962024152 +2404522.61306533,231.15,1,0.682386621986929,0.558631639075339,0.441368360924661 +2404522.61306533,231.15,2,0.317613378013071,0.05918278063081,0.94081721936919 +2437185.92964824,231.15,1,0.675104792803683,0.563328263754472,0.436671736245528 +2437185.92964824,231.15,2,0.324895207196317,0.060617666193144,0.939382333806856 +2469849.24623116,231.15,1,0.668083487050649,0.567895598209169,0.432104401790831 +2469849.24623116,231.15,2,0.331916512949351,0.062058763767643,0.937941236232357 +2502512.56281407,231.15,1,0.661305831576851,0.572338578314538,0.427661421685462 +2502512.56281407,231.15,2,0.338694168423149,0.063506143682165,0.936493856317835 +2535175.87939698,231.15,1,0.654756301470267,0.576661887180737,0.423338112819263 +2535175.87939698,231.15,2,0.345243698529733,0.064959898315841,0.935040101684159 +2567839.1959799,231.15,1,0.648420636246614,0.580869971018147,0.419130028981853 +2567839.1959799,231.15,2,0.351579363753386,0.066420063926849,0.933579936073151 +2600502.51256281,231.15,1,0.642285645278334,0.584967053835232,0.415032946164768 +2600502.51256281,231.15,2,0.357714354721666,0.067886731522885,0.932113268477115 +2633165.82914573,231.15,1,0.63633914808777,0.588957151037727,0.411042848962273 +2633165.82914573,231.15,2,0.36366085191223,0.069359976791068,0.930640023208932 +2665829.14572864,231.15,1,0.63056986876376,0.592844082045036,0.407155917954964 +2665829.14572864,231.15,2,0.36943013123624,0.070839876812199,0.9291601231878 +2698492.46231156,231.15,1,0.624967351952152,0.596631481997523,0.403368518002477 +2698492.46231156,231.15,2,0.375032648047848,0.072326510094288,0.927673489905712 +2731155.77889447,231.15,1,0.619521887983648,0.600322812631406,0.399677187368594 +2731155.77889447,231.15,2,0.380478112016352,0.07381995660694,0.92618004339306 +2763819.09547739,231.15,1,0.614224445998035,0.603921372389329,0.396078627610671 +2763819.09547739,231.15,2,0.385775554001965,0.075320297816599,0.924679702183401 +2796482.4120603,231.15,1,0.609066595350917,0.607430305828859,0.392569694171141 +2796482.4120603,231.15,2,0.390933404649083,0.076827642147416,0.923172357852584 +2829145.72864322,231.15,1,0.604040522503129,0.610852612382712,0.389147387617288 +2829145.72864322,231.15,2,0.395959477496871,0.078342028937016,0.921657971062984 +2861809.04522613,231.15,1,0.599138882526871,0.614191154527613,0.385808845472387 +2861809.04522613,231.15,2,0.400861117473129,0.079863565267298,0.920136434732702 +2894472.36180905,231.15,1,0.594354819163541,0.617448665400741,0.382551334599259 +2894472.36180905,231.15,2,0.405645180836459,0.08139233914943,0.91860766085057 +2927135.67839196,231.15,1,0.589681910485442,0.620627755911653,0.379372244088347 +2927135.67839196,231.15,2,0.410318089514558,0.082928440308301,0.917071559691699 +2959798.99497487,231.15,1,0.585114133467337,0.623730921386297,0.376269078613703 +2959798.99497487,231.15,2,0.414885866532663,0.084471960226473,0.915528039773527 +2992462.31155779,231.15,1,0.580645831910839,0.626760547778758,0.373239452221242 +2992462.31155779,231.15,2,0.419354168089161,0.086022992189361,0.913977007810639 +3025125.6281407,231.15,1,0.576271687354628,0.629718917483064,0.370281082516936 +3025125.6281407,231.15,2,0.423728312645372,0.087581631331687,0.912418368668313 +3057788.94472362,231.15,1,0.571986667297784,0.632608214774824,0.367391785225177 +3057788.94472362,231.15,2,0.428013332702216,0.089148006873643,0.910851993126357 +3090452.26130653,231.15,1,0.5677860970686,0.635430530908822,0.364569469091178 +3090452.26130653,231.15,2,0.4322139029314,0.090722160095056,0.909277839904944 +3123115.57788945,231.15,1,0.563665501208533,0.63818786889965,0.36181213110035 +3123115.57788945,231.15,2,0.436334498791467,0.092304218719871,0.907695781280129 +3155778.89447236,231.15,1,0.559620670354534,0.640882148005386,0.359117851994614 +3155778.89447236,231.15,2,0.440379329645466,0.09389428597446,0.90610571402554 +3188442.21105528,231.15,1,0.555647622183178,0.643515207937261,0.356484792062739 +3188442.21105528,231.15,2,0.444352377816822,0.095492467215827,0.904507532784173 +3221105.52763819,231.15,1,0.551742584667564,0.646088812813814,0.353911187186186 +3221105.52763819,231.15,2,0.448257415332436,0.097098869989755,0.902901130010245 +3253768.84422111,231.15,1,0.547901980725511,0.648604654877399,0.351395345122601 +3253768.84422111,231.15,2,0.452098019274489,0.098713604090778,0.901286395909223 +3286432.16080402,231.15,1,0.544122384640388,0.651064357989424,0.348935642010576 +3286432.16080402,231.15,2,0.455877615359612,0.100336817240629,0.899663182759371 +3319095.47738693,231.15,1,0.540400620874677,0.653469480918975,0.346530519081025 +3319095.47738693,231.15,2,0.459599379125323,0.101968559831222,0.898031440168778 +3351758.79396985,231.15,1,0.536733592536381,0.655821520439668,0.344178479560332 +3351758.79396985,231.15,2,0.463266407463619,0.103608978545492,0.896391021454508 +3384422.11055276,231.15,1,0.533118371968286,0.658121914246318,0.341878085753682 +3384422.11055276,231.15,2,0.466881628031714,0.105258193018923,0.894741806981077 +3417085.42713568,231.15,1,0.529552166257927,0.660372043704117,0.339627956295883 +3417085.42713568,231.15,2,0.470447833742073,0.106916325493991,0.893083674506009 +3449748.74371859,231.15,1,0.526032307832349,0.662573236441008,0.337426763558992 +3449748.74371859,231.15,2,0.473967692167651,0.108583500895634,0.891416499104366 +3482412.06030151,231.15,1,0.522556169375736,0.664726768793346,0.335273231206654 +3482412.06030151,231.15,2,0.477443830624264,0.110259935601236,0.889740064398764 +3515075.37688442,231.15,1,0.519121444309122,0.666833868114192,0.333166131885808 +3515075.37688442,231.15,2,0.480878555690878,0.111945601718467,0.888054398281533 +3547738.69346734,231.15,1,0.515725728361867,0.668895714953153,0.331104285046847 +3547738.69346734,231.15,2,0.484274271638133,0.113640706167385,0.886359293832615 +3580402.01005025,231.15,1,0.512366810149626,0.670913445115561,0.329086554884438 +3580402.01005025,231.15,2,0.487633189850374,0.115345344431749,0.884654655568251 +3613065.32663317,231.15,1,0.509042463929019,0.672888151608386,0.327111848391614 +3613065.32663317,231.15,2,0.490957536070981,0.117059731512737,0.882940268487263 +3645728.64321608,231.15,1,0.505750640808468,0.67482088648037,0.32517911351963 +3645728.64321608,231.15,2,0.494249359191532,0.118783976427704,0.881216023572296 +3678391.95979899,231.15,1,0.502489332782264,0.676712662562069,0.323287337437931 +3678391.95979899,231.15,2,0.497510667217736,0.120518231376203,0.879481768623797 +3711055.27638191,231.15,1,0.499256621488504,0.678564455112328,0.321435544887672 +3711055.27638191,231.15,2,0.500743378511496,0.12226263053227,0.87773736946773 +3743718.59296482,231.15,1,0.496050658657544,0.680377203376505,0.319622796623495 +3743718.59296482,231.15,2,0.503949341342456,0.124017306904339,0.875982693095661 +3776381.90954774,231.15,1,0.492869585335574,0.68215181206165,0.31784818793835 +3776381.90954774,231.15,2,0.507130414664426,0.125782476082554,0.874217523917445 +3809045.22613065,231.15,1,0.489711670698715,0.683889152733583,0.316110847266417 +3809045.22613065,231.15,2,0.510288329301285,0.127558277751002,0.872441722248998 +3841708.54271357,231.15,1,0.486575228025275,0.685590065140128,0.314409934859873 +3841708.54271357,231.15,2,0.513424771974725,0.129344864812734,0.870655135187266 +3874371.85929648,231.15,1,0.483458594810468,0.687255358464819,0.312744641535181 +3874371.85929648,231.15,2,0.516541405189533,0.131142420414059,0.868857579585941 +3907035.1758794,231.15,1,0.480360179424754,0.688885812514951,0.311114187485049 +3907035.1758794,231.15,2,0.519639820575246,0.132951103363616,0.867048896636384 +3939698.49246231,231.15,1,0.477278452629049,0.690482178847567,0.309517821152433 +3939698.49246231,231.15,2,0.522721547370951,0.134771054428536,0.865228945571464 +3972361.80904523,231.15,1,0.474211807185724,0.692045181836646,0.307954818163354 +3972361.80904523,231.15,2,0.525788192814276,0.136602541952557,0.863397458047443 +4005025.12562814,231.15,1,0.471158791874417,0.69357551968501,0.30642448031499 +4005025.12562814,231.15,2,0.528841208125583,0.138445709121354,0.861554290878646 +4037688.44221106,231.15,1,0.468117944049153,0.695073865383342,0.304926134616658 +4037688.44221106,231.15,2,0.531882055950847,0.14030074964843,0.85969925035157 +4070351.75879397,231.15,1,0.465087873929469,0.696540867619505,0.303459132380495 +4070351.75879397,231.15,2,0.534912126070531,0.14216781610935,0.85783218389065 +4103015.07537688,231.15,1,0.462067097436033,0.69797715164036,0.30202284835964 +4103015.07537688,231.15,2,0.537932902563967,0.144047190821637,0.855952809178363 +4135678.3919598,231.15,1,0.459054265857571,0.699383320068836,0.300616679931164 +4135678.3919598,231.15,2,0.540945734142429,0.145939044288653,0.854060955711347 +4168341.70854271,231.15,1,0.456048015204266,0.700759953678073,0.299240046321927 +4168341.70854271,231.15,2,0.543951984795733,0.147843589578371,0.852156410421628 +4201005.02512563,231.15,1,0.453046999083375,0.702107612124917,0.297892387875083 +4201005.02512563,231.15,2,0.546953000916625,0.149761045566873,0.850238954433128 +4233668.34170854,231.15,1,0.450049934823965,0.703426834644712,0.296573165355288 +4233668.34170854,231.15,2,0.549950065176035,0.151691588377239,0.84830841162276 +4266331.65829146,231.15,1,0.447055416687969,0.704718140708906,0.295281859291094 +4266331.65829146,231.15,2,0.552944583312031,0.153635536944703,0.846364463055297 +4298994.97487437,231.15,1,0.44406217673651,0.70598203064757,0.29401796935243 +4298994.97487437,231.15,2,0.55593782326349,0.155593088137091,0.844406911862909 +4331658.29145729,231.15,1,0.441068914832633,0.707218986237907,0.292781013762093 +4331658.29145729,231.15,2,0.558931085167367,0.157564486084435,0.842435513915565 +4364321.6080402,231.15,1,0.438074336457419,0.708429471260473,0.291570528739528 +4364321.6080402,231.15,2,0.561925663542581,0.159549981905915,0.840450018094084 +4396984.92462311,231.15,1,0.435077208599352,0.709613932024305,0.290386067975695 +4396984.92462311,231.15,2,0.564922791400648,0.161549777528678,0.838450222471322 +4429648.24120603,231.15,1,0.432076136847722,0.710772797862115,0.289227202137885 +4429648.24120603,231.15,2,0.567923863152278,0.163564240473522,0.836435759526478 +4462311.55778894,231.15,1,0.429069878116696,0.711906481596963,0.288093518403038 +4462311.55778894,231.15,2,0.570930121883304,0.165593597336995,0.834406402663005 +4494974.87437186,231.15,1,0.426057137757619,0.713015379980958,0.286984620019042 +4494974.87437186,231.15,2,0.573942862242381,0.167638129782194,0.832361870217806 +4527638.19095477,231.15,1,0.423036675820557,0.714099874107393,0.285900125892607 +4527638.19095477,231.15,2,0.576963324179443,0.169698070831412,0.830301929168588 +4560301.50753769,231.15,1,0.420007075352658,0.715160329796702,0.284839670203298 +4560301.50753769,231.15,2,0.579992924647342,0.171773822127955,0.828226177872045 +4592964.8241206,231.15,1,0.416967067351464,0.71619709795755,0.283802902042451 +4592964.8241206,231.15,2,0.583032932648536,0.173865644190152,0.826134355809848 +4625628.14070352,231.15,1,0.413915320022706,0.717210514923218,0.282789485076782 +4625628.14070352,231.15,2,0.586084679977294,0.175973854487891,0.824026145512109 +4658291.45728643,231.15,1,0.410850552229552,0.718200902764181,0.281799097235819 +4658291.45728643,231.15,2,0.589149447770448,0.178098719916744,0.821901280083256 +4690954.77386935,231.15,1,0.407771280881879,0.719168569577245,0.280831430422755 +4690954.77386935,231.15,2,0.592228719118121,0.180240687031268,0.819759312968732 +4723618.09045226,231.15,1,0.404676175032177,0.720113809751984,0.279886190248016 +4723618.09045226,231.15,2,0.595323824967823,0.182400054100955,0.817599945899045 +4756281.40703518,231.15,1,0.401563826260897,0.721036904214426,0.278963095785574 +4756281.40703518,231.15,2,0.598436173739103,0.184577180851535,0.815422819148465 +4788944.72361809,231.15,1,0.398432875605997,0.72193812064862,0.27806187935138 +4788944.72361809,231.15,2,0.601567124394003,0.186772371734184,0.813227628265816 +4821608.040201,231.15,1,0.395281725275312,0.722817713696055,0.277182286303945 +4821608.040201,231.15,2,0.604718274724688,0.188986130975944,0.811013869024056 +4854271.35678392,231.15,1,0.392108942498066,0.723675925133414,0.276324074866586 +4854271.35678392,231.15,2,0.607891057501934,0.191218799569621,0.808781200430379 +4886934.67336683,231.15,1,0.388913071319557,0.724512984028328,0.275487015971672 +4886934.67336683,231.15,2,0.611086928680443,0.193470723430366,0.806529276569634 +4919597.98994975,231.15,1,0.385692412677085,0.725329106873252,0.274670893126748 +4919597.98994975,231.15,2,0.614307587322915,0.19574244119165,0.80425755880835 +4952261.30653266,231.15,1,0.382445417601194,0.726124497697622,0.273875502302379 +4952261.30653266,231.15,2,0.617554582398806,0.198034338556002,0.801965661443998 +4984924.62311558,231.15,1,0.379170506198802,0.726899348157658,0.273100651842342 +4984924.62311558,231.15,2,0.620829493801198,0.200346806080239,0.799653193919761 +5017587.93969849,231.15,1,0.375865841966736,0.727653837603745,0.272346162396255 +5017587.93969849,231.15,2,0.624134158033264,0.202680427021268,0.797319572978732 +5050251.25628141,231.15,1,0.372529729099856,0.728388133125197,0.271611866874803 +5050251.25628141,231.15,2,0.627470270900144,0.205035636035407,0.794964363964593 +5082914.57286432,231.15,1,0.369160431772085,0.729102389571532,0.270897610428468 +5082914.57286432,231.15,2,0.630839568227915,0.207412872701164,0.792587127298836 +5115577.88944724,231.15,1,0.365755934260445,0.729796749549911,0.270203250450089 +5115577.88944724,231.15,2,0.634244065739555,0.209812775927148,0.790187224072852 +5148241.20603015,231.15,1,0.362314357104503,0.730471343398088,0.269528656601912 +5148241.20603015,231.15,2,0.637685642895496,0.212235834915352,0.787764165084648 +5180904.52261307,231.15,1,0.358833770065708,0.731126289131845,0.268873710868155 +5180904.52261307,231.15,2,0.641166229934292,0.21468254385571,0.78531745614429 +5213567.83919598,231.15,1,0.355311928371358,0.731761692365966,0.268238307634034 +5213567.83919598,231.15,2,0.644688071628642,0.217153609843431,0.782846390156569 +5246231.15577889,231.15,1,0.351746724075866,0.732377646207952,0.267622353792048 +5246231.15577889,231.15,2,0.648253275924134,0.21964958365536,0.78035041634464 +5278894.47236181,231.15,1,0.348135985629516,0.732974231122743,0.267025768877257 +5278894.47236181,231.15,2,0.651864014370484,0.222171020971157,0.777828979028843 +5311557.78894472,231.15,1,0.344477178215236,0.733551514767227,0.266448485232773 +5311557.78894472,231.15,2,0.655522821784764,0.224718711877039,0.775281288122961 +5344221.10552764,231.15,1,0.340768000113695,0.734109551793122,0.265890448206878 +5344221.10552764,231.15,2,0.659231999886305,0.227293208152728,0.772706791847272 +5376884.42211055,231.15,1,0.33700571045095,0.734648383615837,0.265351616384163 +5376884.42211055,231.15,2,0.66299428954905,0.229895342917017,0.770104657082983 +5409547.73869347,231.15,1,0.333187678148392,0.735168038147874,0.264831961852126 +5409547.73869347,231.15,2,0.666812321851608,0.232525799598386,0.767474200401614 +5442211.05527638,231.15,1,0.329311176138707,0.73566852949392,0.26433147050608 +5442211.05527638,231.15,2,0.670688823861293,0.235185268774877,0.764814731225123 +5474874.3718593,231.15,1,0.325373038829284,0.736149857605199,0.263850142394801 +5474874.3718593,231.15,2,0.674626961170716,0.237874696734278,0.762125303265722 +5507537.68844221,231.15,1,0.321370330855597,0.736612007890405,0.263387992109595 +5507537.68844221,231.15,2,0.678629669144403,0.240594779061027,0.759405220938973 +5540201.00502513,231.15,1,0.317299572732451,0.737054950779324,0.262945049220676 +5540201.00502513,231.15,2,0.682700427267549,0.243346528582552,0.756653471417448 +5572864.32160804,231.15,1,0.313157486793702,0.737478641236215,0.262521358763785 +5572864.32160804,231.15,2,0.686842513206298,0.246130719773393,0.753869280226607 +5605527.63819095,231.15,1,0.308940222140482,0.737883018218021,0.262116981781979 +5605527.63819095,231.15,2,0.691059777859518,0.248948444041853,0.751051555958147 +5638190.95477387,231.15,1,0.304644105392048,0.738268004073556,0.261731995926444 +5638190.95477387,231.15,2,0.695355894607952,0.251800561003594,0.748199438996406 +5670854.27135678,231.15,1,0.3002648463553,0.73863350387773,0.26136649612227 +5670854.27135678,231.15,2,0.6997351536447,0.254688253858641,0.745311746141359 +5703517.5879397,231.15,1,0.295798311150975,0.738979404695649,0.261020595304351 +5703517.5879397,231.15,2,0.704201688849025,0.257612475215985,0.742387524784015 +5736180.90452261,231.15,1,0.291239689205037,0.739305574769372,0.260694425230628 +5736180.90452261,231.15,2,0.708760310794963,0.260574514915303,0.739425485084697 +5768844.22110553,231.15,1,0.286584307420746,0.739611862620569,0.260388137379432 +5768844.22110553,231.15,2,0.713415692579254,0.263575428108245,0.736424571891756 +5801507.53768844,231.15,1,0.281826736952981,0.739898096060071,0.260101903939928 +5801507.53768844,231.15,2,0.718173263047019,0.266616628273351,0.733383371726649 +5834170.85427136,231.15,1,0.276961669458454,0.740164081095635,0.259835918904365 +5834170.85427136,231.15,2,0.723038330541546,0.26969928451859,0.73030071548141 +5866834.17085427,231.15,1,0.271982938498741,0.740409600726421,0.259590399273579 +5866834.17085427,231.15,2,0.728017061501259,0.272824953706672,0.727175046293328 +5899497.48743719,231.15,1,0.266884482700518,0.740634413613086,0.259365586386914 +5899497.48743719,231.15,2,0.733115517299482,0.275994932419381,0.724005067580619 +5932160.8040201,231.15,1,0.26165939346863,0.74083825260877,0.25916174739123 +5932160.8040201,231.15,2,0.73834060653137,0.279210855180387,0.720789144819613 +5964824.12060301,231.15,1,0.256300284285162,0.741020823136258,0.258979176863742 +5964824.12060301,231.15,2,0.743699715714838,0.282474428764611,0.717525571235389 +5997487.43718593,231.15,1,0.250799630392922,0.741181801393185,0.258818198606815 +5997487.43718593,231.15,2,0.749200369607078,0.285787203053465,0.714212796946535 +6030150.75376884,231.15,1,0.245148905879105,0.741320832364708,0.258679167635292 +6030150.75376884,231.15,2,0.754851094120895,0.289151079915435,0.710848920084565 +6062814.07035176,231.15,1,0.239338932908729,0.741437527620988,0.258562472379012 +6062814.07035176,231.15,2,0.760661067091271,0.292568060794419,0.707431939205581 +6095477.38693467,231.15,1,0.233360254180667,0.741531462872491,0.258468537127509 +6095477.38693467,231.15,2,0.766639745819333,0.296039998680943,0.703960001319057 +6128140.70351759,231.15,1,0.227202169758943,0.741602175252035,0.258397824747965 +6128140.70351759,231.15,2,0.772797830241057,0.299569133899577,0.700430866100423 +6160804.0201005,231.15,1,0.220853252497199,0.741649160288786,0.258350839711214 +6160804.0201005,231.15,2,0.779146747502801,0.303157744668062,0.696842255331938 +6193467.33668342,231.15,1,0.214301096708673,0.741671868532526,0.258328131467474 +6193467.33668342,231.15,2,0.785698903291327,0.306808249528799,0.693191750471201 +6226130.65326633,231.15,1,0.207532046257376,0.741669701780607,0.258330298219393 +6226130.65326633,231.15,2,0.792467953742624,0.310523306311884,0.689476693688116 +6258793.96984925,231.15,1,0.200531712195578,0.741642008852183,0.258357991147817 +6258793.96984925,231.15,2,0.799468287804422,0.314305472727112,0.685694527272888 +6291457.28643216,231.15,1,0.193283857183104,0.741588080843952,0.258411919156048 +6291457.28643216,231.15,2,0.806716142816896,0.318157752982664,0.681842247017336 +6324120.60301508,231.15,1,0.185770879823891,0.741507145791829,0.258492854208171 +6324120.60301508,231.15,2,0.814229120176109,0.322083254740175,0.677916745259825 +6356783.91959799,231.15,1,0.177973459204882,0.741398362647897,0.258601637352103 +6356783.91959799,231.15,2,0.822026540795118,0.326085297065277,0.673914702934723 +6389447.2361809,231.15,1,0.169870333651023,0.74126081446634,0.25873918553366 +6389447.2361809,231.15,2,0.830129666348977,0.330167429541005,0.669832570458995 +6422110.55276382,231.15,1,0.161438044225792,0.741093500671857,0.258906499328143 +6422110.55276382,231.15,2,0.838561955774208,0.334333453518346,0.665666546481654 +6454773.86934673,231.15,1,0.152650636223275,0.740895328259489,0.259104671740511 +6454773.86934673,231.15,2,0.847349363776725,0.338587445782204,0.661412554217796 +6487437.18592965,231.15,1,0.143479310375348,0.740665101744885,0.259334898255115 +6487437.18592965,231.15,2,0.856520689624652,0.342933784951857,0.657066215048143 +6520100.50251256,231.15,1,0.133892013578553,0.740401511647001,0.259598488352999 +6520100.50251256,231.15,2,0.866107986421447,0.347377180981885,0.652622819018115 +6552763.81909548,231.15,1,0.123852956512057,0.740103121239069,0.259896878760931 +6552763.81909548,231.15,2,0.876147043487943,0.351922708182925,0.648077291817075 +6585427.13567839,231.15,1,0.113322042411386,0.739768351246257,0.260231648753743 +6585427.13567839,231.15,2,0.886677957588614,0.356575842243009,0.643424157756991 +6618090.45226131,231.15,1,0.102254187270462,0.739395462096061,0.260604537903939 +6618090.45226131,231.15,2,0.897745812729538,0.361342501799704,0.638657498200296 +6650753.76884422,231.15,1,0.09059850657798,0.738982533235789,0.261017466764211 +6650753.76884422,231.15,2,0.90940149342202,0.366229095191368,0.633770904808632 +6683417.08542714,231.15,1,0.078297336956795,0.738527438914507,0.261472561085493 +6683417.08542714,231.15,2,0.921702663043205,0.371242573102377,0.628757426897623 +6716080.40201005,231.15,1,0.065285052220442,0.738027819676227,0.261972180323773 +6716080.40201005,231.15,2,0.934714947779558,0.376390487910835,0.623609512089165 +6748743.71859297,231.15,1,0.051486621623068,0.737481048615894,0.262518951384106 +6748743.71859297,231.15,2,0.948513378376932,0.381681060645897,0.618318939354104 +6781407.03517588,231.15,1,0.036815321132148,0.73688419119364,0.26311580880636 +6781407.03517588,231.15,2,0.963184678867852,0.387123445840401,0.612876554159599 +6814070.35175879,231.15,1,0.021172288352335,0.736233957065314,0.263766042934686 +6814070.35175879,231.15,2,0.978827711647665,0.392727175366899,0.607272824633101 +6846733.66834171,231.15,1,0.004441283612821,0.735526641932907,0.264473358067093 +6846733.66834171,231.15,2,0.995558716387179,0.398503183235752,0.601496816764248 +6879396.98492462,231.15,2,1,0.4,0.6 +6912060.30150754,231.15,2,1,0.4,0.6 +6944723.61809045,231.15,2,1,0.4,0.6 +6977386.93467337,231.15,2,1,0.4,0.6 +7010050.25125628,231.15,2,1,0.4,0.6 +7042713.5678392,231.15,2,1,0.4,0.6 +7075376.88442211,231.15,2,1,0.4,0.6 +7108040.20100502,231.15,2,1,0.4,0.6 +7140703.51758794,231.15,2,1,0.4,0.6 +7173366.83417085,231.15,2,1,0.4,0.6 +7206030.15075377,231.15,2,1,0.4,0.6 +7238693.46733668,231.15,2,1,0.4,0.6 +7271356.7839196,231.15,2,1,0.4,0.6 +7304020.10050251,231.15,2,1,0.4,0.6 +7336683.41708543,231.15,2,1,0.4,0.6 +7369346.73366834,231.15,2,1,0.4,0.6 +7402010.05025126,231.15,2,1,0.4,0.6 +7434673.36683417,231.15,2,1,0.4,0.6 +7467336.68341709,231.15,2,1,0.4,0.6 +7500000,231.15,2,1,0.4,0.6 diff --git a/tests/data/pvtlib-pedersen63-phase-fugacities.csv b/tests/data/pvtlib-pedersen63-phase-fugacities.csv new file mode 100644 index 000000000..92192f8b9 --- /dev/null +++ b/tests/data/pvtlib-pedersen63-phase-fugacities.csv @@ -0,0 +1,360 @@ +Pressure [Pa],Temperature [K],Phase,C1,CO2 +1000000,231.15,1,388766.581637265,539492.517547129 +1032663.31658291,231.15,1,401112.350363816,555094.27816529 +1065326.63316583,231.15,1,413437.835424973,570569.240998988 +1097989.94974874,231.15,1,425743.260163989,585917.451301885 +1130653.26633166,231.15,1,438028.853565208,601138.947891376 +1163316.58291457,231.15,1,450294.85048278,616233.762945604 +1195979.89949749,231.15,1,462541.491881024,631201.921791038 +1228643.2160804,231.15,1,474769.025087153,646043.442680098 +1261306.53266332,231.15,1,486977.704057144,660758.336558241 +1293969.84924623,231.15,1,499167.789655588,675346.606819862 +1326633.16582915,231.15,1,511339.54995041,689808.249052353 +1359296.48241206,231.15,1,523493.260523433,704143.250767609 +1391959.79899497,231.15,1,535629.204797822,718351.591120182 +1424623.11557789,231.15,1,547747.674383527,732433.240611283 +1457286.4321608,231.15,1,559848.969441934,746388.160777723 +1489949.74874372,231.15,1,571933.39907104,760216.303864824 +1522613.06532663,231.15,1,584001.28171255,773917.612482302 +1555276.38190955,231.15,1,596052.945582424,787492.019241955 +1587939.69849246,231.15,1,608088.729126544,800939.446376006 +1620603.01507538,231.15,1,620108.981503269,814259.805334754 +1653266.33165829,231.15,1,632114.06309484,827452.996362169 +1685929.64824121,231.15,1,656245.14518547,829950.647019191 +1685929.64824121,231.15,2,656244.966828785,829950.653134631 +1718592.96482412,231.15,1,683620.639761679,829541.30616406 +1718592.96482412,231.15,2,683620.588657309,829541.308044871 +1751256.28140704,231.15,1,710909.231906357,829131.751413719 +1751256.28140704,231.15,2,710909.130992662,829131.75515334 +1783919.59798995,231.15,1,738110.996175568,828721.97897003 +1783919.59798995,231.15,2,738110.824217046,828721.985384637 +1816582.91457286,231.15,1,765226.006180326,828311.985370292 +1816582.91457286,231.15,2,765225.974936749,828311.986562656 +1849246.23115578,231.15,1,792254.334233618,827901.7677838 +1849246.23115578,231.15,2,792254.285919889,827901.769636889 +1881909.54773869,231.15,1,819196.052820352,827491.322733131 +1881909.54773869,231.15,2,819195.980975512,827491.325502459 +1914572.86432161,231.15,1,846051.233694849,827080.64687069 +1914572.86432161,231.15,2,846051.130031027,827080.650886141 +1947236.18090452,231.15,1,872819.9480811,826669.736799524 +1947236.18090452,231.15,2,872819.802096512,826669.742481777 +1979899.49748744,231.15,1,899502.266667359,826258.589072283 +1979899.49748744,231.15,2,899502.065200264,826258.596951927 +2012562.81407035,231.15,1,926098.259600515,825847.200190272 +2012562.81407035,231.15,2,926097.986318224,825847.210929894 +2045226.13065327,231.15,1,952607.996564167,825435.56653076 +2045226.13065327,231.15,2,952607.943280761,825435.568641792 +2077889.44723618,231.15,1,979031.54645813,825023.684615236 +2077889.44723618,231.15,2,979031.474095385,825023.687495157 +2110552.7638191,231.15,1,1005368.97783848,824611.550726538 +2110552.7638191,231.15,2,1005368.8807956,824611.554606214 +2143216.08040201,231.15,1,1031620.35862992,824199.161148923 +2143216.08040201,231.15,2,1031620.22996424,824199.166316233 +2175879.39698492,231.15,1,1057785.7561866,823786.512109553 +2175879.39698492,231.15,2,1057785.58735579,823786.518920798 +2208542.71356784,231.15,1,1083865.237286,823373.599777227 +2208542.71356784,231.15,2,1083865.01785211,823373.608670394 +2241206.03015075,231.15,1,1109858.86812252,822960.420261176 +2241206.03015075,231.15,2,1109858.58541344,822960.431771143 +2273869.34673367,231.15,1,1135766.71431788,822546.969595546 +2273869.34673367,231.15,2,1135766.65057022,822546.972204577 +2306532.66331658,231.15,1,1161588.84085089,822133.243791902 +2306532.66331658,231.15,2,1161588.757994,822133.247198498 +2339195.9798995,231.15,1,1187325.31214177,821719.23876089 +2339195.9798995,231.15,2,1187325.20526766,821719.243175055 +2371859.29648241,231.15,1,1212976.19198736,821304.950359869 +2371859.29648241,231.15,2,1212976.05512003,821304.956038817 +2404522.61306533,231.15,1,1238541.543568,820890.374379754 +2404522.61306533,231.15,2,1238541.36947011,820890.381636828 +2437185.92964824,231.15,1,1264021.42944054,820475.506543432 +2437185.92964824,231.15,2,1264021.20939181,820475.515758433 +2469849.24623116,231.15,1,1289415.91153109,820060.342504285 +2469849.24623116,231.15,2,1289415.6350752,820060.35413536 +2502512.56281407,231.15,1,1314725.05112755,819644.877844632 +2502512.56281407,231.15,2,1314724.70578417,819644.892441863 +2535175.87939698,231.15,1,1339948.90887621,819229.10807073 +2535175.87939698,231.15,2,1339948.81806474,819229.111927734 +2567839.1959799,231.15,1,1365087.54475894,818813.028623674 +2567839.1959799,231.15,2,1365087.43016876,818813.033513557 +2600502.51256281,231.15,1,1390141.01810692,818396.634859732 +2600502.51256281,231.15,2,1390140.87427832,818396.641026343 +2633165.82914573,231.15,1,1415109.38757896,817979.922059992 +2633165.82914573,231.15,2,1415109.20796565,817979.929797461 +2665829.14572864,231.15,1,1439992.7111566,817562.8854258 +2665829.14572864,231.15,2,1439992.48794151,817562.895087493 +2698492.46231156,231.15,1,1464791.04613583,817145.520076894 +2698492.46231156,231.15,2,1464790.77002074,817145.532085659 +2731155.77889447,231.15,1,1489504.44911863,816727.821049417 +2731155.77889447,231.15,2,1489504.1090851,816727.8359094 +2763819.09547739,231.15,1,1514132.97600432,816309.783293928 +2763819.09547739,231.15,2,1514132.55904263,816309.801604054 +2796482.4120603,231.15,1,1538676.68198169,815891.401672559 +2796482.4120603,231.15,2,1538676.55612466,815891.407226384 +2829145.72864322,231.15,1,1563135.62151623,815472.670959933 +2829145.72864322,231.15,2,1563135.46566069,815472.677871175 +2861809.04522613,231.15,1,1587509.84834636,815053.585836581 +2861809.04522613,231.15,2,1587509.65613156,815053.594402004 +2894472.36180905,231.15,1,1611799.4154706,814634.140889448 +2894472.36180905,231.15,2,1611799.17934921,814634.151463361 +2927135.67839196,231.15,1,1636004.37513877,814214.330608932 +2927135.67839196,231.15,2,1636004.08618526,814214.343612977 +2959798.99497487,231.15,1,1660124.77884224,813794.149386452 +2959798.99497487,231.15,2,1660124.42653479,813794.165320723 +2992462.31155779,231.15,1,1684160.67730392,813373.591511967 +2992462.31155779,231.15,2,1684160.24927782,813373.610967885 +3025125.6281407,231.15,1,1708112.12046805,812952.651171415 +3025125.6281407,231.15,2,1708111.60223651,812952.67484626 +3057788.94472362,231.15,1,1731979.15749019,812531.322443715 +3057788.94472362,231.15,2,1731978.98050325,812531.330570167 +3090452.26130653,231.15,1,1755761.83672512,812109.599299255 +3090452.26130653,231.15,2,1755761.62045106,812109.609280153 +3123115.57788945,231.15,1,1779460.20571798,811687.475595376 +3123115.57788945,231.15,2,1779459.94232177,811687.487813094 +3155778.89447236,231.15,1,1803074.31119194,811264.94507449 +3155778.89447236,231.15,2,1803073.99145012,811264.959982079 +3188442.21105528,231.15,1,1826604.19903713,810842.001360819 +3188442.21105528,231.15,2,1826603.81212274,810842.019493499 +3221105.52763819,231.15,1,1850049.91429901,810418.63795729 +3221105.52763819,231.15,2,1850049.4475383,810418.659945638 +3253768.84422111,231.15,1,1873411.50116659,809994.848242292 +3253768.84422111,231.15,2,1873410.93976447,809994.874827222 +3286432.16080402,231.15,1,1896689.00296049,809570.625466195 +3286432.16080402,231.15,2,1896688.79110149,809570.635551419 +3319095.47738693,231.15,1,1919882.46211989,809145.962748465 +3319095.47738693,231.15,2,1919882.20510608,809145.975047836 +3351758.79396985,231.15,1,1942991.92019082,808720.853073284 +3351758.79396985,231.15,2,1942991.60931776,808720.8680291 +3384422.11055276,231.15,1,1966017.41781273,808295.289286361 +3384422.11055276,231.15,2,1966017.04287614,808295.307420539 +3417085.42713568,231.15,1,1988958.9947053,807869.264091017 +3417085.42713568,231.15,2,1988958.54377553,807869.286017812 +3449748.74371859,231.15,1,2011816.6896551,807442.77004417 +3449748.74371859,231.15,2,2011816.14882171,807442.796484637 +3482412.06030151,231.15,1,2034590.54050169,807015.799552225 +3482412.06030151,231.15,2,2034590.97041826,807015.778420049 +3515075.37688442,231.15,1,2057280.58412343,806588.344866982 +3515075.37688442,231.15,2,2057281.10505997,806588.319120887 +3547738.69346734,231.15,1,2079886.85642326,806160.398081012 +3547738.69346734,231.15,2,2079887.48609492,806160.366789915 +3580402.01005025,231.15,1,2102409.39231398,805731.951123093 +3580402.01005025,231.15,2,2102409.66245975,805731.937624201 +3613065.32663317,231.15,1,2124848.22570271,805302.995753837 +3613065.32663317,231.15,2,2124848.5548883,805302.979213331 +3645728.64321608,231.15,1,2147203.38947611,804873.523560283 +3645728.64321608,231.15,2,2147203.78962745,804873.503341515 +3678391.95979899,231.15,1,2169474.91548417,804443.525951109 +3678391.95979899,231.15,2,2169475.46183464,804443.498189888 +3711055.27638191,231.15,1,2191662.83452428,804012.994151245 +3711055.27638191,231.15,2,2191663.42162406,804012.964150581 +3743718.59296482,231.15,1,2213767.17632465,803581.9191964 +3743718.59296482,231.15,2,2213767.47371815,803581.903913105 +3776381.90954774,231.15,1,2235787.96952736,803150.291927468 +3776381.90954774,231.15,2,2235788.29687073,803150.27500862 +3809045.22613065,231.15,1,2257725.24167126,802718.102984425 +3809045.22613065,231.15,2,2257725.67528306,802718.080443819 +3841708.54271357,231.15,1,2279579.01917424,802285.342800284 +3841708.54271357,231.15,2,2279579.50240406,802285.317534571 +3874371.85929648,231.15,1,2301349.3273151,801852.001594698 +3874371.85929648,231.15,2,2301349.95350263,801851.968663226 +3907035.1758794,231.15,1,2323036.19021516,801418.069367301 +3907035.1758794,231.15,2,2323036.8973095,801418.031962321 +3939698.49246231,231.15,1,2344639.63081934,800983.535890745 +3939698.49246231,231.15,2,2344639.97762305,800983.517436463 +3972361.80904523,231.15,1,2366159.67087653,800548.390703758 +3972361.80904523,231.15,2,2366160.11035689,800548.367178661 +4005025.12562814,231.15,1,2387596.33092024,800112.623103281 +4005025.12562814,231.15,2,2387596.85967206,800112.594629883 +4037688.44221106,231.15,1,2408949.63024803,799676.222136947 +4037688.44221106,231.15,2,2408950.26497673,799676.18775041 +4070351.75879397,231.15,1,2430219.58690092,799239.176594825 +4070351.75879397,231.15,2,2430219.9103817,799239.158963748 +4103015.07537688,231.15,1,2451406.21764192,798801.475001173 +4103015.07537688,231.15,2,2451406.60853305,798801.453565631 +4135678.3919598,231.15,1,2472509.53793461,798363.105605386 +4135678.3919598,231.15,2,2472510.00922916,798363.079601522 +4168341.70854271,231.15,1,2493529.56192083,797924.056372931 +4168341.70854271,231.15,2,2493530.12890997,797924.02489507 +4201005.02512563,231.15,1,2514466.30239777,797484.314975804 +4201005.02512563,231.15,2,2514466.98303918,797484.276952225 +4233668.34170854,231.15,1,2535319.77079505,797043.868782376 +4233668.34170854,231.15,2,2535320.13693221,797043.848199726 +4266331.65829146,231.15,1,2556089.97715038,796602.704847275 +4266331.65829146,231.15,2,2556090.4194461,796602.679825802 +4298994.97487437,231.15,1,2576776.93008569,796160.809900169 +4298994.97487437,231.15,2,2576777.46323183,796160.779546658 +4331658.29145729,231.15,1,2597380.63678196,795718.170334552 +4331658.29145729,231.15,2,2597381.27807795,795718.133589046 +4364321.6080402,231.15,1,2617901.10295374,795274.772195818 +4364321.6080402,231.15,2,2617901.87272749,795274.727803044 +4396984.92462311,231.15,1,2638338.33282313,794830.601168808 +4396984.92462311,231.15,2,2638338.76881109,794830.575861387 +4429648.24120603,231.15,1,2658692.32909274,794385.642565021 +4429648.24120603,231.15,2,2658692.85555486,794385.611805008 +4462311.55778894,231.15,1,2678963.09291887,793939.881308657 +4462311.55778894,231.15,2,2678963.7273041,793939.843997383 +4494974.87437186,231.15,1,2699150.62388319,793493.301922667 +4494974.87437186,231.15,2,2699151.38674224,793493.256755652 +4527638.19095477,231.15,1,2719254.91996448,793045.88851362 +4527638.19095477,231.15,2,2719255.37036575,793045.861667037 +4560301.50753769,231.15,1,2739275.9775089,792597.62475643 +4560301.50753769,231.15,2,2739276.52221182,792597.592068692 +4592964.8241206,231.15,1,2759213.79120067,792148.493877599 +4592964.8241206,231.15,2,2759214.4485928,792148.454157611 +4625628.14070352,231.15,1,2779068.35403127,791698.47863821 +4625628.14070352,231.15,2,2779069.14581131,791698.430468666 +4658291.45728643,231.15,1,2798839.65726828,791247.561315892 +4658291.45728643,231.15,2,2798840.14384959,791247.531508013 +4690954.77386935,231.15,1,2818527.69042329,790795.723686076 +4690954.77386935,231.15,2,2818528.27965952,790795.687336604 +4723618.09045226,231.15,1,2838132.44121969,790342.947001807 +4723618.09045226,231.15,2,2838133.15331171,790342.902762997 +4756281.40703518,231.15,1,2857653.89555917,789889.21197309 +4756281.40703518,231.15,2,2857654.75438379,789889.158238187 +4788944.72361809,231.15,1,2877092.03748791,789434.498744839 +4788944.72361809,231.15,2,2877092.58606819,789434.46417453 +4821608.040201,231.15,1,2896446.8491616,788978.786874003 +4821608.040201,231.15,2,2896447.51420501,788978.744660481 +4854271.35678392,231.15,1,2915718.31081061,788522.05530496 +4854271.35678392,231.15,2,2915719.115404,788522.003859799 +4886934.67336683,231.15,1,2934906.40070372,788064.282344048 +4886934.67336683,231.15,2,2934906.93048625,788064.248220023 +4919597.98994975,231.15,1,2954011.0951112,787605.445632818 +4919597.98994975,231.15,2,2954011.73923197,787605.403834964 +4952261.30653266,231.15,1,2973032.3682679,787145.522119242 +4952261.30653266,231.15,2,2973033.14980005,787145.471023203 +4984924.62311558,231.15,1,2991970.19233501,786684.4880279 +4984924.62311558,231.15,2,2991970.72236023,786684.453112202 +5017587.93969849,231.15,1,3010824.53736117,786222.31882849 +5017587.93969849,231.15,2,3010825.18349368,786222.275937994 +5050251.25628141,231.15,1,3029595.37124367,785758.989202074 +5050251.25628141,231.15,2,3029596.15728856,785758.936620455 +5082914.57286432,231.15,1,3048282.65968831,785294.473005916 +5082914.57286432,231.15,2,3048283.20831819,785294.436019212 +5115577.88944724,231.15,1,3066886.36616894,784828.743236192 +5115577.88944724,231.15,2,3066887.03659695,784828.697681671 +5148241.20603015,231.15,1,3085406.45188684,784361.771988235 +5148241.20603015,231.15,2,3085407.26943526,784361.715994397 +5180904.52261307,231.15,1,3103842.87572926,783893.530414728 +5180904.52261307,231.15,2,3103843.46252901,783893.489901309 +5213567.83919598,231.15,1,3122195.59422737,783423.988681522 +5213567.83919598,231.15,2,3122196.31284367,783423.938663729 +5246231.15577889,231.15,1,3140464.56151478,782953.115920216 +5246231.15577889,231.15,2,3140465.43968165,782953.054294799 +5278894.47236181,231.15,1,3158649.72928494,782480.880178376 +5278894.47236181,231.15,2,3158650.37697041,782480.834349422 +5311557.78894472,231.15,1,3176751.04674854,782007.248366659 +5311557.78894472,231.15,2,3176751.84141391,782007.191665485 +5344221.10552764,231.15,1,3194768.46059164,781532.186202039 +5344221.10552764,231.15,2,3194769.05879657,781532.143156382 +5376884.42211055,231.15,1,3212701.91493271,781055.658148246 +5376884.42211055,231.15,2,3212702.65168499,781055.604677821 +5409547.73869347,231.15,1,3230551.35128123,780577.627351578 +5409547.73869347,231.15,2,3230552.25664142,780577.561073724 +5442211.05527638,231.15,1,3248316.70849584,780098.055572998 +5442211.05527638,231.15,2,3248317.40788548,780098.003923746 +5474874.3718593,231.15,1,3265997.92274321,779616.903115813 +5474874.3718593,231.15,2,3265998.78522916,779616.838856004 +5507537.68844221,231.15,1,3283594.92745869,779134.128747851 +5507537.68844221,231.15,2,3283595.60682351,779134.077676367 +5540201.00502513,231.15,1,3301107.65330676,778649.689619254 +5540201.00502513,231.15,2,3301108.49386822,778649.625854567 +5572864.32160804,231.15,1,3318536.02814446,778163.541173614 +5572864.32160804,231.15,2,3318536.70296933,778163.489509931 +5605527.63819095,231.15,1,3335879.97698525,777675.637053872 +5605527.63819095,231.15,2,3335880.81448626,777675.572337632 +5638190.95477387,231.15,1,3353139.42196653,777185.929000543 +5638190.95477387,231.15,2,3353140.10696596,777185.875568343 +5670854.27135678,231.15,1,3370314.28231857,776694.36674353 +5670854.27135678,231.15,2,3370315.13482623,776694.299608499 +5703517.5879397,231.15,1,3387404.47433806,776200.897885161 +5703517.5879397,231.15,2,3387405.18439336,776200.841425841 +5736180.90452261,231.15,1,3404409.91136427,775705.467775343 +5736180.90452261,231.15,2,3404410.79727369,775705.396640557 +5768844.22110553,231.15,1,3421330.50376117,775208.019376505 +5768844.22110553,231.15,2,3421331.25481009,775207.958469355 +5801507.53768844,231.15,1,3438166.15890371,774708.493119027 +5801507.53768844,231.15,2,3438167.0980128,774708.416191128 +5834170.85427136,231.15,1,3454916.78117193,774206.8267445 +5834170.85427136,231.15,2,3454917.59113038,774206.759715861 +5866834.17085427,231.15,1,3471582.27195093,773702.955137658 +5866834.17085427,231.15,2,3471583.28657487,773702.870298326 +5899497.48743719,231.15,1,3488162.52964145,773196.810143644 +5899497.48743719,231.15,2,3488163.41942522,773196.73495756 +5932160.8040201,231.15,1,3504657.44967877,772688.320371566 +5932160.8040201,231.15,2,3504658.23926428,772688.252937065 +5964824.12060301,231.15,1,3521066.92456467,772177.410980921 +5964824.12060301,231.15,2,3521067.91927187,772177.325103292 +5997487.43718593,231.15,1,3537390.84391313,771664.003450082 +5997487.43718593,231.15,2,3537391.74056991,771663.925181629 +6030150.75376884,231.15,1,3553629.09451074,771148.015325663 +6030150.75376884,231.15,2,3553629.91192428,771147.943172533 +6062814.07035176,231.15,1,3569781.56039664,770629.359949289 +6062814.07035176,231.15,2,3569782.59465889,770629.267612017 +6095477.38693467,231.15,1,3585848.12296383,770107.946160206 +6095477.38693467,231.15,2,3585849.07963302,770107.859758149 +6128140.70351759,231.15,1,3601828.66108375,769583.677971831 +6128140.70351759,231.15,2,3601829.55536566,769583.596249781 +6160804.0201005,231.15,1,3617723.05126091,769056.454217751 +6160804.0201005,231.15,2,3617723.89585036,769056.376108418 +6193467.33668342,231.15,1,3633531.16781957,768526.168165168 +6193467.33668342,231.15,2,3633531.97345967,768526.092745492 +6226130.65326633,231.15,1,3649252.88312868,767992.707091653 +6226130.65326633,231.15,2,3649253.91067244,767992.609698534 +6258793.96984925,231.15,1,3664888.06787159,767455.951820462 +6258793.96984925,231.15,2,3664889.05963591,767455.856623588 +6291457.28643216,231.15,1,3680436.59136555,766915.776211066 +6291457.28643216,231.15,2,3680437.55710242,766915.682310987 +6324120.60301508,231.15,1,3695898.32194181,766372.046597677 +6324120.60301508,231.15,2,3695899.27023342,766371.953174734 +6356783.91959799,231.15,1,3711273.12739375,765824.621170923 +6356783.91959799,231.15,2,3711274.06585679,765824.527468668 +6389447.2361809,231.15,1,3726560.87550488,765273.349295194 +6389447.2361809,231.15,2,3726561.81092029,765273.254610217 +6422110.55276382,231.15,1,3741761.43466962,764718.070753585 +6422110.55276382,231.15,2,3741762.37303759,764717.97443241 +6454773.86934673,231.15,1,3756874.67462182,764158.614911464 +6454773.86934673,231.15,2,3756875.62113333,764158.516355858 +6487437.18592965,231.15,1,3771900.46728877,763594.79978813 +6487437.18592965,231.15,2,3771901.42619649,763594.698471462 +6520100.50251256,231.15,1,3786838.68779174,763026.431024463 +6520100.50251256,231.15,2,3786839.6621506,763026.32652334 +6552763.81909548,231.15,1,3801689.21561722,762453.300732903 +6552763.81909548,231.15,2,3801690.20684866,762453.192780468 +6585427.13567839,231.15,1,3816451.93598787,761875.18621388 +6585427.13567839,231.15,2,3816452.9431998,761875.074784504 +6618090.45226131,231.15,1,3831126.74146714,761291.848520429 +6618090.45226131,231.15,2,3831127.76042899,761291.733960198 +6650753.76884422,231.15,1,3845713.53383773,760703.030850018 +6650753.76884422,231.15,2,3845714.55546585,760702.914074477 +6683417.08542714,231.15,1,3860212.22630132,760108.456739366 +6683417.08542714,231.15,2,3860213.23444466,760108.339530195 +6716080.40201005,231.15,1,3874622.74605554,759507.828034435 +6716080.40201005,231.15,2,3874623.71427921,759507.713481904 +6748743.71859297,231.15,1,3888945.03731483,758900.822603391 +6748743.71859297,231.15,2,3888945.9242467,758900.715763899 +6781407.03517588,231.15,1,3903179.06485321,758287.091755806 +6781407.03517588,231.15,2,3903180.09755983,758286.965028871 +6814070.35175879,231.15,1,3917324.81816397,757666.257324608 +6814070.35175879,231.15,2,3917325.76761044,757666.138565684 +6846733.66834171,231.15,1,3931382.31634163,757037.908364582 +6846733.66834171,231.15,2,3931383.22137043,757037.792904061 +6879396.98492462,231.15,2,3939325.22572452,757179.984050259 +6912060.30150754,231.15,2,3945200.40083701,757587.240851416 +6944723.61809045,231.15,2,3951073.53373815,757995.438751849 +6977386.93467337,231.15,2,3956944.67465555,758404.571292576 +7010050.25125628,231.15,2,3962813.8731587,758814.632115486 +7042713.5678392,231.15,2,3968681.17817163,759225.614961345 +7075376.88442211,231.15,2,3974546.63798493,759637.513667836 +7108040.20100502,231.15,2,3980410.30026742,760050.322167638 +7140703.51758794,231.15,2,3986272.21207785,760464.034486569 +7173366.83417085,231.15,2,3992132.419876,760878.64474177 +7206030.15075377,231.15,2,3997990.96953398,761294.147139939 +7238693.46733668,231.15,2,4003847.90634643,761710.535975565 +7271356.7839196,231.15,2,4009703.27504165,762127.80562929 +7304020.10050251,231.15,2,4015557.1197913,762545.950566218 +7336683.41708543,231.15,2,4021409.48422072,762964.965334323 +7369346.73366834,231.15,2,4027260.4114187,763384.84456288 +7402010.05025126,231.15,2,4033109.94394688,763805.582960924 +7434673.36683417,231.15,2,4038958.12384921,764227.175315749 +7467336.68341709,231.15,2,4044804.9926612,764649.616491465 +7500000,231.15,2,4050650.59141856,765072.901427535 diff --git a/tests/data/pvtlib_table_whitson18_fixed_T.csv b/tests/data/pvtlib_table_whitson18_fixed_T.csv new file mode 100644 index 000000000..8ea5860b6 --- /dev/null +++ b/tests/data/pvtlib_table_whitson18_fixed_T.csv @@ -0,0 +1,99 @@ +,P,T,is_valid,Z,Π,F,x0,x1,x2,fugacity_0,fugacity_1,fugacity_2,phase_id +0,50.0,410.9277777777778,True,0.979011067209462,0.9338727133070045,1.0,0.5,0.42,0.08,1.7128202260195953,1.3785860685478413,0.24234857858560405,1 +1,89.79591836734694,410.9277777777778,True,0.9652285804742622,0.890305949578547,0.9802953940854611,0.5097946801155473,0.42604670574770653,0.06415861413674617,3.1481598299707305,2.4428496760964133,0.32016467815824906,1 +2,89.79591836734694,410.9277777777778,True,0.03971676370501995,9.969999342811857,0.01970460591453893,0.012719013744552655,0.11917907419334901,0.8681019120620976,3.1481598216285502,2.442849528424581,0.3201646088609842,0 +3,129.59183673469389,410.9277777777778,True,0.9547289103838076,0.8570454784029107,0.9554738816095054,0.5224180885845089,0.4317038367718635,0.04587807464362752,4.664253609000824,3.479681212437404,0.30554749945426884,1 +4,129.59183673469389,410.9277777777778,True,0.05564301877410159,9.696481020741652,0.044526118390494585,0.01893632563580564,0.1688505453795897,0.8122131289846046,4.6642535677718735,3.4796811669879175,0.30554748909952195,0 +5,169.38775510204087,410.9277777777778,True,0.944310796561663,0.8245154051344292,0.9395430153416667,0.5305447110704402,0.43321781827920436,0.03623747065035545,6.203424601972518,4.446413030400636,0.2917915278640651,1 +6,169.38775510204087,410.9277777777778,True,0.07069559390983562,9.438853419928206,0.06045698465833327,0.025314236162360598,0.21458603646104774,0.7600997273765917,6.203424251477626,4.4464128177482936,0.29179150183120506,0 +7,209.1836734693878,410.9277777777778,True,0.9340617970610486,0.7930104607564594,0.9270679435250585,0.5368280647265469,0.43285941393943816,0.030312521334014953,7.767061502627048,5.345310924545677,0.2788866742476348,1 +8,209.1836734693878,410.9277777777778,True,0.08497529382101843,9.196347377773114,0.0729320564749415,0.031864040584426434,0.25653895129272164,0.7115970081228522,7.767061419963319,5.345310889002514,0.2788866718597042,0 +9,248.9795918367347,410.9277777777778,True,0.9240259707729195,0.762709199838836,0.9161637932563412,0.5422221025787844,0.43145104875271706,0.02632684866849852,9.356426777629729,6.178739005234882,0.2668209700090763,1 +10,248.9795918367347,410.9277777777778,True,0.0985762496083567,8.968184552062143,0.08383620674365877,0.03859599377970003,0.2948627034840633,0.6665413027362364,9.356426427226516,6.178738880166293,0.26682096484124773,0 +11,288.7755102040817,410.9277777777778,True,0.914232978311548,0.7337547756312804,0.9060071207359457,0.5471497184937459,0.4293668089841831,0.023483472522071037,10.972608822723215,6.949179073807747,0.25557982556575637,1 +12,288.7755102040817,410.9277777777778,True,0.1115857997114213,8.75357298530985,0.09399287926405431,0.0455189687718641,0.3297123558221629,0.6247686754059729,10.972607602501574,6.94917868898329,0.25557981485657427,0 +13,328.5714285714286,410.9277777777778,True,0.9047055464955148,0.7062747619648888,0.8961859500431206,0.5518221037815493,0.42680606098578205,0.021371835232668623,12.616473521464082,7.659245130838281,0.2451457347861394,1 +14,328.5714285714286,410.9277777777778,True,0.12408434270446912,8.551704927207165,0.10381404995687937,0.05264011634271678,0.3612459466408641,0.5861139370164197,12.616473226827548,7.659245048888346,0.2451457333697972,0 +15,368.3673469387756,410.9277777777778,True,0.8954616573996137,0.6803858921231262,0.8864773841686596,0.556351103766081,0.4238897865557946,0.01975910967812451,14.288619005265117,8.31169117392339,0.2354980632523976,1 +16,368.3673469387756,410.9277777777778,True,0.13614520247715897,8.361757282250494,0.11352261583134038,0.05996451723955778,0.3896253668425134,0.5504101159179283,14.28861808932503,8.311690935881124,0.23549806000352075,0 +17,408.1632653061225,410.9277777777778,True,0.8865151316795847,0.6561942769148087,0.8767567686937726,0.5607960123989737,0.4207004427578066,0.018503544843219775,15.989338934698218,8.909409881863471,0.22661271325887775,1 +18,408.1632653061225,410.9277777777778,True,0.1478345084171616,8.182892524668514,0.12324323130622739,0.06749498682044643,0.4150170250935441,0.5174879880860098,15.989336369006997,8.90940925033596,0.22661270582040496,0 +19,447.95918367346945,410.9277777777778,True,0.8778756714455431,0.6337939812616239,0.8669554648805323,0.5651856663865975,0.41730033424790514,0.01751399936549744,17.718597344591938,9.455421092066135,0.21846214008113093,1 +20,447.95918367346945,410.9277777777778,True,0.1592111608775861,8.014263157618444,0.13304453511946768,0.0752319352689393,0.43759177838479296,0.4871762863462676,17.718596558844965,9.45542091086247,0.2184621383518908,0 +21,487.7551020408164,410.9277777777778,True,0.8695487672844252,0.6132654670890673,0.8570390323966207,0.5695300339694718,0.41374067647023255,0.0167292895602956,19.476017600972238,9.952850306087559,0.2110156428546871,1 +22,487.7551020408164,410.9277777777778,True,0.17032692494589405,7.855019418343423,0.14296096760337929,0.08317326725835796,0.45752412054381264,0.4593026121978295,19.47601549924497,9.95284983864128,0.2110156384193983,0 +23,527.5510204081634,410.9277777777778,True,0.8615357113609797,0.5946745822713042,0.8469945746722191,0.5738270215648487,0.4100661155086703,0.016106862926481023,21.260890121665412,10.404896771663616,0.20423953978074347,1 +24,527.5510204081634,410.9277777777778,True,0.1812266070788477,7.7043157714951755,0.15300542532778094,0.09131457857996568,0.4749911629051826,0.43369425851485177,21.260884909225904,10.404895645554957,0.20423952870065704,0 +25,567.3469387755104,410.9277777777778,True,0.8538337349915462,0.5780721665058585,0.8368228392253693,0.5780667954702217,0.4063169518499428,0.015616252679835478,23.07219600454778,10.814794492319788,0.19809770666913842,1 +26,567.3469387755104,410.9277777777778,True,0.19194839366266642,7.561320249145601,0.16317716077463074,0.09964938031466417,0.4901708936951208,0.41017972599021496,23.072193997177777,10.814794074483693,0.19809770261315204,0 +27,607.1428571428573,410.9277777777778,True,0.8464362552759356,0.563494483196353,0.82653305507727,0.5822346782897918,0.40253019070499046,0.015235131005217546,24.908642425490807,11.185770321547562,0.19255243933458815,1 +28,607.1428571428573,410.9277777777778,True,0.2025243567613634,7.425226220684822,0.17346694492272996,0.10816926873050685,0.5032399213271062,0.3885908099423871,24.908637590223197,11.185769332334202,0.1925524289222332,0 +29,646.9387755102042,410.9277777777778,True,0.8393333991979185,0.5509649482390846,0.8161387624956635,0.5863134521452354,0.39873976761040275,0.01494678024436167,26.768715524632402,11.520998008490013,0.18756481261755995,1 +30,646.9387755102042,410.9277777777778,True,0.212980959868185,7.295257349542098,0.18386123750433647,0.11686457147401845,0.5143717119950685,0.36876371653091317,26.768713330150867,11.520997569633572,0.18756480780039905,0 +31,686.7346938775512,410.9277777777778,True,0.8325124589923873,0.5404957493329381,0.8056553419494732,0.5902848136065811,0.39497667907994316,0.014738507313475618,28.65073082541663,11.823559100261416,0.1830957875735651,1 +32,686.7346938775512,410.9277777777778,True,0.22333976784167683,7.1706788172005975,0.1943446580505268,0.12572450867086007,0.5237341204784668,0.3505413708506732,28.650725684867936,11.823558079412352,0.18309577534308027,0 +33,726.5306122448982,410.9277777777778,True,0.8259585991945209,0.5320908009191214,0.7950975527351357,0.5941307118947162,0.3912687596428805,0.014600528462403256,30.552895246760748,12.096404341924314,0.17910654806449883,1 +34,726.5306122448982,410.9277777777778,True,0.2336180576252233,7.050799530732614,0.20490244726486428,0.13473789764960634,0.5314878772797744,0.33377422507061916,30.552892552100325,12.09640381287147,0.17910654135838044,0 +35,766.326530612245,410.9277777777778,True,0.8196553506164945,0.5257480273900219,0.7844784583545832,0.5978340049704168,0.38764072794425974,0.014525267085323468,32.47335552658683,12.342327620141482,0.17555947101150435,1 +36,766.326530612245,410.9277777777778,True,0.24382955914583326,6.934979135457255,0.21552154164541681,0.1438932794935338,0.5377847544238901,0.3183219660825761,32.47334951020102,12.342326436948223,0.17555945478701176,0 +37,806.1224489795919,410.9277777777778,True,0.8135853453559534,0.521462591370976,0.7738078529294219,0.6013792274357542,0.3841139770908241,0.014506795473421664,34.41025517538919,12.563941271413212,0.1724181991218745,1 +38,806.1224489795919,410.9277777777778,True,0.25398502256174793,6.822625324509159,0.2261921470705781,0.15317963806574328,0.5427668011341736,0.304053560800083,34.41025994680503,12.563942111329792,0.17241820833921323,0 +39,845.9183673469388,410.9277777777778,True,0.8077305546143155,0.5192288504131229,0.7630925100925217,0.6047525247394453,0.3807069370980177,0.014540538162537031,36.36176202962369,12.76366959988437,0.16964864115309028,1 +40,845.9183673469388,410.9277777777778,True,0.2640929213820674,6.713200070278283,0.23690748990747834,0.1625861551563001,0.5465651922225299,0.29084865262117005,36.36176531781016,12.763670192993317,0.16964864870962074,0 +41,885.7142857142858,410.9277777777778,True,0.8020730249798023,0.5190432776768702,0.752334759692488,0.6079421918924784,0.3774348762267257,0.01462293188079577,38.3261170446785,12.943735988739569,0.16721851874412597,1 +42,885.7142857142858,410.9277777777778,True,0.27415985173698143,6.6062100825149646,0.24766524030751202,0.17210310620385802,0.5493004303934047,0.2785964634027373,38.32612537540363,12.94373747620166,0.16721853849750282,0 +43,925.5102040816328,410.9277777777778,True,0.7965949098722186,0.5209061009325302,0.7415332892533344,0.6109382505133562,0.3743104461673983,0.014751303319245521,40.301643605165914,13.106170503155697,0.16509810879826214,1 +44,925.5102040816328,410.9277777777778,True,0.28419109572723794,6.501210538454926,0.2584667107466656,0.18172146591128974,0.5510819681193453,0.2671965659693651,40.30164960643383,13.106171603646818,0.16509812503543053,0 +45,965.3061224489797,410.9277777777778,True,0.7912789118734957,0.5248232261944886,0.7306824199399264,0.613732579810754,0.3713437371857727,0.0149236830034733,42.28677452314177,13.2528108206714,0.1632599003404199,1 +46,965.3061224489797,410.9277777777778,True,0.2941909397587885,6.397796546755857,0.26931758006007356,0.1914334495965845,0.5520087454016275,0.2565578050017881,42.28677829248925,13.252811532231823,0.16325991179841873,0 +47,1005.1020408163267,410.9277777777778,True,0.7861082494114494,0.5308074706184245,0.7197726982686321,0.6163184838653396,0.3685427748144044,0.0151387413202559,44.28005273493447,13.385315460790855,0.16167886811549195,1 +48,1005.1020408163267,410.9277777777778,True,0.30416304741379524,6.295602169929052,0.2802273017313679,0.20123229081179794,0.5521695123509334,0.24659819683726872,44.280045522719846,13.38531398413364,0.16167884093378798,0 +49,1044.8979591836737,410.9277777777778,True,0.7810671085773442,0.5388802649964552,0.7087898156653366,0.6186908715981418,0.36591348777976357,0.015395640622094598,46.28015338442302,13.505168135372216,0.1603318716110218,1 +50,1044.8979591836737,410.9277777777778,True,0.3141106657814849,6.194289920043886,0.2912101843346634,0.2111128472604339,0.5516436412213732,0.23724351151819298,46.28015860733191,13.505169155131401,0.16033188981253435,0 +51,1084.6938775510207,410.9277777777778,True,0.7761399138515698,0.5490718779948723,0.6977167728987858,0.620845140416694,0.36346073044336924,0.01569412913993662,48.28584866526283,13.61370510238017,0.15919854029794556,1 +52,1084.6938775510207,410.9277777777778,True,0.3240369702892381,6.0935573727703485,0.30228322710121425,0.22107059263395776,0.5505014409016427,0.22842796646439953,48.285856748160846,13.613706700930592,0.15919856990752126,0 +53,1124.4897959183677,410.9277777777778,True,0.7713119859793741,0.5614232461398538,0.6865317600831522,0.6227776891842829,0.36118793958231765,0.016034371233399496,50.29603766147709,13.71211522199845,0.1582601716168788,1 +54,1124.4897959183677,410.9277777777778,True,0.33394513887259725,5.993121504889366,0.3134682399168478,0.2311026371380165,0.5488052255736613,0.2200921372883222,50.29604347646449,13.712116411196542,0.15826019482243572,0 +55,1164.2857142857147,410.9277777777778,True,0.7665691431706464,0.57598681287667,0.6752088957358489,0.6244852735003994,0.3590977329961078,0.01641699350349269,52.30972596925763,13.801459601550214,0.15750001305055847,1 +56,1164.2857142857147,410.9277777777778,True,0.3438385693804342,5.892718862146663,0.32479110426415114,0.24120730847597524,0.5466098483352047,0.2121828431888201,52.30972126212643,13.801458565705438,0.1574999912496235,0 +57,1204.0816326530617,410.9277777777778,True,0.7618978745688888,0.592827885254802,0.6637170855358755,0.6259650245567634,0.357191945669277,0.01684302977395954,54.32603153378905,13.882679995076453,0.15690281203092646,1 +58,1204.0816326530617,410.9277777777778,True,0.35372101425222846,5.792097450739389,0.3362829144641245,0.2513845176716844,0.5439634158488109,0.2046520664795047,54.32602359745205,13.882678225176832,0.15690277394906654,0 +59,1243.8775510204082,410.9277777777778,True,0.7572848263761467,0.6120256069215625,0.6520205397014914,0.6272137826517435,0.3554722165080021,0.017314000840254334,56.344160611875324,13.95661733199255,0.15645504696089912,1 +60,1243.8775510204082,410.9277777777778,True,0.3635967511237868,5.691016880431666,0.34797946029850857,0.2616353587338053,0.5409078265197073,0.1974568147464875,56.34415424522947,13.95661588453183,0.1564550150532354,0 +61,1283.6734693877552,410.9277777777778,True,0.7527168995039601,0.6336749588649535,0.6400772401697502,0.6282280973286014,0.35394001031275446,0.017831892358644214,58.363411703535164,14.024018744112471,0.15614451144769467,1 +62,1283.6734693877552,410.9277777777778,True,0.37347071696817824,5.589240441917569,0.3599227598302498,0.27196249915115495,0.5374793611401414,0.19055813970870372,58.363416620930856,14.024019895313188,0.1561445375473073,0 +63,1323.4693877551022,410.9277777777778,True,0.7481805495456373,0.6578889030274415,0.6278392590080447,0.6290034508497508,0.3525972616888476,0.018399287461401594,60.38314752642616,14.085554863591481,0.15596055959535066,1 +64,1323.4693877551022,410.9277777777778,True,0.38334866124409733,5.486536066571489,0.3721607409919553,0.28236976104704437,0.5337091600892471,0.1839210788637085,60.38315327582772,14.085556263205127,0.15596059231222556,0 +65,1363.2653061224491,410.9277777777778,True,0.7436623384064309,0.6848012569471049,0.6152490601640507,0.6295347221030003,0.351445987097478,0.01901929079952171,62.40281986639548,14.141818030368857,0.15589334775294386,1 +66,1363.2653061224491,410.9277777777778,True,0.39323733872481903,5.382661857714391,0.3847509398359493,0.2928631023839387,0.529623623081297,0.1775132745347644,62.40282386991823,14.141819064230841,0.15589337282114776,0 +67,1403.0612244897961,410.9277777777778,True,0.7391480349978042,0.7145703317130434,0.6022391958090275,0.6298152318304188,0.35048904056917546,0.019695727600405756,64.42193724173916,14.19333935542926,0.1559341980486109,1 +68,1403.0612244897961,410.9277777777778,True,0.40314472474909935,5.277368026633453,0.3977608041909725,0.30345016402426056,0.5252447196064971,0.17130511636924237,64.4219309901039,14.193338099874987,0.15593417113373656,0 +69,1442.8571428571431,410.9277777777778,True,0.7346230054973613,0.7473830649587595,0.5887273849619967,0.6298370224603306,0.34972984299129223,0.02043313454837708,66.44008563543875,14.240587453529864,0.15607503310463194,1 +70,1442.8571428571431,410.9277777777778,True,0.41308034602162275,5.170381966150788,0.4112726150380033,0.3141412583542445,0.5205901299136648,0.16526861173209062,66.44007619594889,14.240586197553537,0.1560750141592709,0 +71,1482.6530612244899,410.9277777777778,True,0.7300710992852709,0.7834616420911945,0.5746143492302811,0.6295897118032945,0.34917323820101465,0.0212370499956908,68.45689604159622,14.28398344870828,0.1563087747683416,1 +72,1482.6530612244899,410.9277777777778,True,0.42305562341601843,5.061407276389636,0.4253856507697189,0.3249491778106529,0.5156733579648737,0.15937746422447333,68.45690054356169,14.283984867101463,0.15630881250331155,0 +73,1522.4489795918369,410.9277777777778,True,0.7254734530901489,0.8230735687942622,0.5597807155343738,0.6290592670384133,0.34882638649538256,0.022114346466204006,70.47201625206402,14.323913669192347,0.15662939995840863,1 +74,1522.4489795918369,410.9277777777778,True,0.43308420090561184,4.950124252606965,0.4402192844656262,0.3358888594878309,0.510504023110084,0.15360711740208496,70.47201244460038,14.323914714780953,0.15662944546778265,0 +75,1562.2448979591836,410.9277777777778,True,0.7208099113991037,0.8665397714499962,0.544071698621689,0.6282291520478169,0.34869767177471195,0.023073176177471084,72.48518278880672,14.360710701408571,0.1570309874722004,1 +76,1562.2448979591836,410.9277777777778,True,0.4431829374246723,4.836147586213075,0.455928301378311,0.34698064946491286,0.505087016348705,0.14793233418638205,72.48518657375614,14.360712186582333,0.1570310296657136,0 +77,1602.0408163265306,410.9277777777778,True,0.7160559059105822,0.9142543215099292,0.5272928176695709,0.6270771936916297,0.3487990406924195,0.024123765615950775,74.49613710282951,14.394683030941012,0.15750848761107145,1 +78,1602.0408163265306,410.9277777777778,True,0.4533724353117041,4.7190411418283755,0.4727071823304291,0.3582486282673774,0.4994228559612343,0.14232851577138833,74.49613761577626,14.394684231770992,0.15750852779735672,0 +79,1641.8367346938776,410.9277777777778,True,0.7111825648663064,0.9667047300636017,0.5091859782166254,0.625575363673348,0.3491458414159185,0.02527879491073349,76.50467449230399,14.426102133210334,0.15805720367365728,1 +80,1641.8367346938776,410.9277777777778,True,0.46367866036612726,4.598270410923938,0.49081402178337463,0.36972414895647937,0.4935063434379118,0.13676950760560885,76.50467511424576,14.426103311932147,0.1580572428612641,0 +81,1681.6326530612246,410.9277777777778,True,0.7061539712955952,1.0245073557423627,0.48940365988246165,0.623686752368925,0.3497588095440802,0.02655443808699482,78.51061200606566,14.455214996564003,0.1586729486066004,1 +82,1681.6326530612246,410.9277777777778,True,0.47413466527277603,4.473181186664733,0.5105963401175384,0.38144695813057905,0.4873257776891131,0.13122726418030783,78.5106124467031,14.455216379940637,0.15867299528098286,0 +83,1721.4285714285716,410.9277777777778,True,0.7009243341927696,1.0884590549591069,0.467460171888918,0.6213622261879281,0.35066603229326426,0.027971741518807602,80.51379203502256,14.482244700347538,0.15935196839373328,1 +84,1721.4285714285716,410.9277777777778,True,0.4847835738042263,4.342943384310441,0.532539828111082,0.3934689874448284,0.4808609286124057,0.1256700839427659,80.51379205094112,14.482245903771817,0.1593520098336304,0 +85,1761.2244897959185,410.9277777777778,True,0.6954335815620192,1.1596179880116624,0.4426468977448834,0.6185351627552997,0.3519060563107486,0.029558780933951586,82.51408650212583,14.507391528682026,0.16009079827755107,1 +86,1761.2244897959185,410.9277777777778,True,0.4956833133729578,4.206466257651619,0.5573531022551166,0.4058599981680884,0.4740798513676618,0.12006015046424984,82.51408662028719,14.507392708878928,0.16009083874977256,0 +87,1801.0204081632655,410.9277777777778,True,0.6895990415399653,1.23944303805723,0.4138767642234679,0.6151118268213339,0.353533689693945,0.03135448348472099,84.5113843730445,14.530837804403692,0.160886333240114,1 +88,1801.0204081632655,410.9277777777778,True,0.5069144356681496,4.062263850551791,0.586123235776532,0.4187165641956734,0.4669335794253192,0.11434985637900737,84.51138316240466,14.530838994776765,0.1608863768661387,0 +89,1840.8163265306125,410.9277777777778,True,0.6833013968250797,1.3300405308648953,0.37936295283209776,0.6109548919360768,0.35562977676643337,0.03341533129748983,86.50559682971041,14.552747941597525,0.1617357420634826,1 +90,1840.8163265306125,410.9277777777778,True,0.5185945165471002,3.9082026022141827,0.6206370471679022,0.4321790801433593,0.45934614936665363,0.10847477048998702,86.5055946395047,14.552749220525714,0.16173579075844663,0 +91,1880.6122448979593,410.9277777777778,True,0.6763559584369843,1.4346563647884154,0.33588636379992753,0.6058500774919157,0.35832110264369155,0.035828819864392764,88.49664883325784,14.573271942486176,0.16263646912645113,1 +92,1880.6122448979593,410.9277777777778,True,0.5309064820584051,3.7410139517049115,0.6641136362000725,0.44646458723520455,0.4511951139487792,0.10234029881601621,88.4966457877233,14.573273138828913,0.16263651665919118,0 +93,1920.4081632653065,410.9277777777778,True,0.6684485957066514,1.558778780926972,0.2768076112304329,0.5994317418125031,0.36182459681442314,0.03874366137307367,90.48448378728614,14.592545492414738,0.1635861601161876,1 +94,1920.4081632653065,410.9277777777778,True,0.5441631030564227,3.5551859651040263,0.723192388769567,0.461941713769377,0.44226709605664544,0.09579119017397751,90.48447962090077,14.592546667377375,0.16358620907041838,0 +95,1960.2040816326532,410.9277777777778,True,0.65895670968427,1.7131883962690375,0.18508776852323286,0.5909761581808722,0.36657016830240774,0.04245367351671994,92.46905643881546,14.610692513730893,0.16458268946091217,1 +96,1960.2040816326532,410.9277777777778,True,0.5589856115916305,3.3399173228769365,0.8149122314767672,0.4793369476415886,0.43213530480890955,0.08852774754950182,92.46905126172551,14.6106935989276,0.1645827371748031,0 +97,2000.0,410.9277777777778,True,0.576652513102834,3.0751242405709176,1.0,0.5,0.42,0.08,94.44144653694346,14.629987507535887,0.16559313243727006,0 diff --git a/tests/regression/test_equilibrium_liq_gas.py b/tests/regression/test_equilibrium_liq_gas.py index 810a2f932..f09ee5ef4 100644 --- a/tests/regression/test_equilibrium_liq_gas.py +++ b/tests/regression/test_equilibrium_liq_gas.py @@ -59,13 +59,13 @@ def test_equilibrium_CH4_liq_gas(temperature, pressure, num_regression): options = EquilibriumOptions() options.hessian = GibbsHessian.Exact - options.nonlinear.max_iterations = 100 - options.optimum.max_iterations = 200 - options.optimum.ipnewton.step = StepMode.Conservative - options.optimum.tolerance = 1e-17 + options.optimum.max_iterations = 2000 + options.optimum.tolerance = 1e-12 solver.setOptions(options) state = ChemicalState(system) + state.setSpeciesAmounts(0.001) # start will all having 0.001 moles + state.setSpeciesAmount("CH4(g)", 1.0) result = solver.solve(state, problem) @@ -111,7 +111,6 @@ def test_equilibrium_H2S_liq_gas(temperature, pressure, num_regression): problem = EquilibriumProblem(system) - problem.setTemperature(temperature, "K") problem.setPressure(pressure, "Pa") problem.add("H2S(g)", 1.0, "mol") @@ -313,10 +312,6 @@ def test_equilibrium_CH4_H2S_liq_gas(temperature, pressure, num_regression): options = EquilibriumOptions() options.hessian = GibbsHessian.Exact - options.nonlinear.max_iterations = 100 - options.optimum.max_iterations = 200 - options.optimum.ipnewton.step = StepMode.Conservative - options.optimum.tolerance = 1e-17 solver.setOptions(options) state = ChemicalState(system) @@ -372,24 +367,25 @@ def test_equilibrium_CH4_CO2_H2S_liq_gas(temperature, pressure, num_regression): problem = EquilibriumProblem(system) - + overall_composition = np.array([0.60, 0.35, 0.05]) problem.setTemperature(temperature, "K") problem.setPressure(pressure, "bar") - problem.add("CH4(g)", 0.60, "mol") - problem.add("H2S(g)", 0.35, "mol") - problem.add("CO2(g)", 0.05, "mol") + problem.add("CH4(g)", overall_composition[0], "mol") + problem.add("H2S(g)", overall_composition[1], "mol") + problem.add("CO2(g)", overall_composition[2], "mol") solver = EquilibriumSolver(problem.system()) options = EquilibriumOptions() options.hessian = GibbsHessian.Exact - options.nonlinear.max_iterations = 100 - options.optimum.max_iterations = 200 - options.optimum.ipnewton.step = StepMode.Conservative solver.setOptions(options) state = ChemicalState(system) + state.setSpeciesAmounts(0.001) # start will all having 0.001 moles + state.setSpeciesAmount("CH4(g)", overall_composition[0]) # overwrite amount of C1(g) (same below) + state.setSpeciesAmount("H2S(g)", overall_composition[1]) + state.setSpeciesAmount("CO2(g)", overall_composition[2]) result = solver.solve(state, problem) diff --git a/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_273_15_K_and_30_0_bar_.csv b/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_273_15_K_and_30_0_bar_.csv index 620520e19..af7757f9e 100644 --- a/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_273_15_K_and_30_0_bar_.csv +++ b/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_273_15_K_and_30_0_bar_.csv @@ -1,2 +1,2 @@ ,CH4(g),H2S(g),CH4(liq),H2S(liq) -0,0.4884814532256655,0.33460032889894697,0.011518546774334504,0.16539967110105305 +0,0.48848145322566555,0.33460032889894803,0.011518546774334445,0.16539967110105194 diff --git a/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_293_15_K_and_70_0_bar_.csv b/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_293_15_K_and_70_0_bar_.csv index a5fd195c2..296f22a94 100644 --- a/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_293_15_K_and_70_0_bar_.csv +++ b/tests/regression/test_equilibrium_liq_gas/test_equilibrium_CH4_H2S_liq_gas_temperature_equal_293_15_K_and_70_0_bar_.csv @@ -1,2 +1,2 @@ ,CH4(g),H2S(g),CH4(liq),H2S(liq) -0,0.45441917885769817,0.28241374380200812,0.045580821142301817,0.21758625619799188 +0,0.45441917885769839,0.28241374380200823,0.04558082114230165,0.2175862561979918 diff --git a/tests/regression/test_equilibrium_liq_gas_aq.py b/tests/regression/test_equilibrium_liq_gas_aq.py index a983be87e..9b19775fb 100644 --- a/tests/regression/test_equilibrium_liq_gas_aq.py +++ b/tests/regression/test_equilibrium_liq_gas_aq.py @@ -62,12 +62,13 @@ def test_equilibrium_CH4_H2S_CO2_H2O_liq_gas_aq(temperature, pressure, num_regre problem = EquilibriumProblem(system) + overall_composition = np.array([0.05, 0.05, 0.40, 0.50]) problem.setTemperature(temperature, "K") problem.setPressure(pressure, "bar") - problem.add("H2O(g)", 0.50, "mol") - problem.add("CO2(g)", 0.05, "mol") - problem.add("H2S(g)", 0.40, "mol") - problem.add("CH4(g)", 0.05, "mol") + problem.add("CH4(g)", overall_composition[0], "mol") + problem.add("CO2(g)", overall_composition[1], "mol") + problem.add("H2S(g)", overall_composition[2], "mol") + problem.add("H2O(g)", overall_composition[3], "mol") # This is a workaround to avoid an Eigen assertion when in Debug: # `DenseBase::resize() does not actually allow to resize.`, triggered by `y(iee) = optimum_state.y * RT;` @@ -77,13 +78,18 @@ def test_equilibrium_CH4_H2S_CO2_H2O_liq_gas_aq(temperature, pressure, num_regre options = EquilibriumOptions() options.hessian = GibbsHessian.Exact - options.nonlinear.max_iterations = 100 - options.optimum.max_iterations = 200 - options.optimum.ipnewton.step = StepMode.Conservative - options.optimum.tolerance = 1e-14 + # options.nonlinear.max_iterations = 100 + # options.optimum.max_iterations = 200 + # options.optimum.ipnewton.step = StepMode.Conservative + # options.optimum.tolerance = 1e-14 solver.setOptions(options) state = ChemicalState(system) + state.setSpeciesAmounts(0.001) # start will all having 0.001 moles + state.setSpeciesAmount("CH4(g)", overall_composition[0]) # overwrite amount of C1(g) (same below) + state.setSpeciesAmount("CO2(g)", overall_composition[1]) + state.setSpeciesAmount("H2S(g)", overall_composition[2]) + state.setSpeciesAmount("H2O(g)", overall_composition[3]) result = solver.solve(state, problem) diff --git a/tests/regression/test_pedersen63.py b/tests/regression/test_pedersen63.py new file mode 100644 index 000000000..20ea52f09 --- /dev/null +++ b/tests/regression/test_pedersen63.py @@ -0,0 +1,379 @@ +import numpy as np +import pandas as pd + +import reaktoro + +from numpy.testing import assert_allclose +import pytest + +is_debug_plots_on = False + + +@pytest.fixture +def data_dir(): + from pathlib import Path + import os + return Path(os.path.abspath(__file__)).parents[1] / "data" + + +@pytest.fixture +def pedersen_pvtlib_composition_results(data_dir): + df_pvtlib_result = pd.read_csv( + data_dir / "pvtlib-pedersen63-phase-compositions.csv", + ) + return df_pvtlib_result + + +@pytest.fixture +def pedersen_pvtlib_fugacities_results(data_dir): + df_pvtlib_result = pd.read_csv( + data_dir / "pvtlib-pedersen63-phase-fugacities.csv" + ) + return df_pvtlib_result + + +@pytest.fixture +def composition(): + return np.array([0.40, 0.60]) + + +@pytest.fixture +def gaseous_species(): + return ["CH4(g)", "CO2(g)"] + + +@pytest.fixture +def oil_species(): + return ["CH4(liq)", "CO2(liq)"] + + +@pytest.fixture +def pedersen_chemical_system(gaseous_species, oil_species): + + temperature = -42.0 # degC + + db = reaktoro.Database('supcrt98.xml') + editor = reaktoro.ChemicalEditor(db) + + def calculate_bips(T): + k = np.zeros((2, 2)) + k[0, 1] = 0.12 + k[1, 0] = 0.12 + bips = reaktoro.BinaryInteractionParams(k) + return bips + + eos_params = reaktoro.CubicEOSParams( + model=reaktoro.CubicEOSModel.SoaveRedlichKwong, + binary_interaction_values=calculate_bips + ) + + editor.addGaseousPhase(gaseous_species).setChemicalModelCubicEOS(eos_params) + editor.addLiquidPhase(oil_species).setChemicalModelCubicEOS(eos_params) + + system = reaktoro.ChemicalSystem(editor) + + return system + + +def test_composition_results( + composition, + pedersen_chemical_system, + pedersen_pvtlib_composition_results, + num_regression +): + temperature = -42.0 # degC + system = pedersen_chemical_system + problem = reaktoro.EquilibriumProblem(system) + + problem.setTemperature(temperature, 'degC') + problem.add('CH4', composition[0], "mol") + problem.add('CO2', composition[1], "mol") + system = problem.system() + + options = reaktoro.EquilibriumOptions() + options.hessian = reaktoro.GibbsHessian.Exact # required change for this case + + solver = reaktoro.EquilibriumSolver(system) + solver.setOptions(options) + + # In this case, we should provide a better initial guess instead of the default. + state = reaktoro.ChemicalState(system) + state.setSpeciesAmounts(0.001) + state.setSpeciesAmount("CH4(g)", composition[0]) + state.setSpeciesAmount("CO2(g)", composition[1]) + + # Retrieve pvtlib solution + df_pvtlib_result = pedersen_pvtlib_composition_results + + df_pressures = df_pvtlib_result["Pressure [Pa]"].copy() + df_pressures.drop_duplicates(inplace=True) + + df_pvtlib_result_gas = df_pvtlib_result[df_pvtlib_result.Phase == 1] + pvtlib_phase_fractions_gas = df_pvtlib_result_gas["Molar Fraction"].values + pvtlib_pressure_values_gas = df_pvtlib_result_gas["Pressure [Pa]"].values + pvtlib_pressure_values_gas = pvtlib_pressure_values_gas / 100000 # to bar + + df_pvtlib_result_liq = df_pvtlib_result[df_pvtlib_result.Phase == 2] + pvtlib_phase_fractions_liquid = df_pvtlib_result_liq["Molar Fraction"].values + pvtlib_pressure_values_liquid = df_pvtlib_result_liq["Pressure [Pa]"].values + pvtlib_pressure_values_liquid = pvtlib_pressure_values_liquid / 100000 # to bar + + # Phase molar fractions + temperature = problem.temperature() + pressure_values = df_pressures.values / 100000 # to bar + num_of_components = len(composition) + num_of_phases = 2 + phase_fractions_liquid = list() + phase_fractions_gas = list() + composition_liq = list() + composition_gas = list() + pressure_values_converged = list() + for P in pressure_values: + problem.setPressure(P, 'bar') + has_converged = solver.solve(state, problem) + assert has_converged + + molar_base = state.phaseAmount('Gaseous') + state.phaseAmount('Liquid') + + gas_phase_molar_fraction = state.phaseAmount('Gaseous') / molar_base + phase_fractions_gas.append(gas_phase_molar_fraction) + + liquid_phase_molar_fraction = state.phaseAmount('Liquid') / molar_base + phase_fractions_liquid.append(liquid_phase_molar_fraction) + + mixture_properties = state.properties() + x_gas = mixture_properties.moleFractions().val[0:num_of_components] + composition_gas.append(x_gas) + x_liq = mixture_properties.moleFractions().val[num_of_components:num_of_phases * num_of_components] + composition_liq.append(x_liq) + + pressure_values_converged.append(P) + + phase_fractions_gas = np.array(phase_fractions_gas) + phase_fractions_liquid = np.array(phase_fractions_liquid) + composition_gas = np.array(composition_gas) + composition_liq = np.array(composition_liq) + pressure_values_converged = np.array(pressure_values_converged) + + zero_threshold = 1e-5 + + # Phase fractions + reaktoro_phase_fractions_liquid = phase_fractions_liquid[phase_fractions_liquid > zero_threshold] + reaktoro_phase_fractions_gas = phase_fractions_gas[phase_fractions_gas > zero_threshold] + + assert_allclose(reaktoro_phase_fractions_liquid, pvtlib_phase_fractions_liquid, atol=1e-2) + assert_allclose(reaktoro_phase_fractions_gas, pvtlib_phase_fractions_gas, atol=1e-2) + + # Component molar fractions + n_points_gas_pvtlib = pvtlib_pressure_values_gas.shape[0] + reaktoro_c1_gas_composition = composition_gas[:n_points_gas_pvtlib, 0] + reaktoro_co2_gas_composition = composition_gas[:n_points_gas_pvtlib, 1] + assert_allclose(reaktoro_c1_gas_composition, df_pvtlib_result_gas["C1"], rtol=2e-3) + assert_allclose(reaktoro_co2_gas_composition, df_pvtlib_result_gas["CO2"], rtol=1e-3) + + n_points_liq_pvtlib = pvtlib_pressure_values_liquid.shape[0] + reaktoro_c1_liq_composition = composition_liq[-n_points_liq_pvtlib:, 0] + reaktoro_co2_liq_composition = composition_liq[-n_points_liq_pvtlib:, 1] + assert_allclose(reaktoro_c1_liq_composition, df_pvtlib_result_liq["C1"], rtol=5e-3) + assert_allclose(reaktoro_co2_liq_composition, df_pvtlib_result_liq["CO2"], rtol=2e-3) + + molar_fractions = { + "liquid_phase": reaktoro_phase_fractions_liquid, + "gas_phase": reaktoro_phase_fractions_gas, + "C1(g)": reaktoro_c1_gas_composition, + "CO2(g)": reaktoro_co2_gas_composition, + "C1(liq)": reaktoro_c1_liq_composition, + "CO2(liq)": reaktoro_co2_liq_composition, + } + num_regression.check(molar_fractions) + + if is_debug_plots_on: + import matplotlib.pyplot as plt + plt.figure(figsize=(8, 6)) + plt.plot(pressure_values_converged, phase_fractions_liquid, "-x", label="Liquid (Reaktoro)") + plt.plot(pvtlib_pressure_values_liquid, pvtlib_phase_fractions_liquid, "-x", label="Liquid (pvtlib)") + + plt.plot(pressure_values_converged, phase_fractions_gas, "-o", label="Gas (Reaktoro)") + plt.plot(pvtlib_pressure_values_gas, pvtlib_phase_fractions_gas, "-o", label="Gas (pvtlib)") + + plt.xlabel("Pressure [bar]") + plt.ylabel("Phase molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_using_prev_pedersen.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + plt.plot(pvtlib_pressure_values_gas, reaktoro_c1_gas_composition, "-x", label="C1(g) - Reaktoro") + plt.plot(pvtlib_pressure_values_gas, df_pvtlib_result_gas["C1"], "-x", label="C1(g) - pvtlib") + plt.plot(pvtlib_pressure_values_gas, reaktoro_co2_gas_composition, "-x", label="CO2(g) - Reaktoro") + plt.plot(pvtlib_pressure_values_gas, df_pvtlib_result_gas["CO2"], "-x", label="CO2(g) - pvtlib") + + plt.ylim([0, 1]) + plt.grid(True) + + plt.xlabel("Pressure [bar]") + plt.ylabel("Molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True, ncol=2) + + # plt.savefig("reaktoro_pvtlib_compositions_pedersen_gas.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + plt.plot(pvtlib_pressure_values_liquid, reaktoro_c1_liq_composition, "-x", label="C1(liq) - Reaktoro") + plt.plot(pvtlib_pressure_values_liquid, df_pvtlib_result_liq["C1"], "-x", label="C1(liq) - pvtlib") + plt.plot(pvtlib_pressure_values_liquid, reaktoro_co2_liq_composition, "-x", label="CO2(liq) - Reaktoro") + plt.plot(pvtlib_pressure_values_liquid, df_pvtlib_result_liq["CO2"], "-x", label="CO2(liq) - pvtlib") + + plt.ylim([0, 1]) + plt.grid(True) + + plt.xlabel("Pressure [bar]") + plt.ylabel("Molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True, ncol=2) + + # plt.savefig("reaktoro_pvtlib_compositions_pedersen_liq.png", dpi=300) + plt.show() + + +def test_fugacities_results( + oil_species, + gaseous_species, + pedersen_chemical_system, + pedersen_pvtlib_composition_results, + pedersen_pvtlib_fugacities_results, + num_regression +): + temperature = -42.0 # degC + system = pedersen_chemical_system + state = reaktoro.ChemicalState(system) + state.setTemperature(temperature, 'degC') + + # Gathering pvtlib results + df_pvtlib_fugacities = pedersen_pvtlib_fugacities_results + df_pvtlib_compositions = pedersen_pvtlib_composition_results + + # Normalizing fugacities + P_1_atm_as_Pa = 101325.0 + df_pvtlib_fugacities["C1"] = df_pvtlib_fugacities["C1"] / P_1_atm_as_Pa + df_pvtlib_fugacities["CO2"] = df_pvtlib_fugacities["CO2"] / P_1_atm_as_Pa + + # Retrieve results by phase + df_pvtlib_fugacities_gas = df_pvtlib_fugacities[df_pvtlib_fugacities.Phase == 1] + df_pvtlib_fugacities_gas.reset_index(drop=True, inplace=True) + df_pvtlib_fugacities_liq = df_pvtlib_fugacities[df_pvtlib_fugacities.Phase == 2] + df_pvtlib_fugacities_liq.reset_index(drop=True, inplace=True) + df_pvtlib_composition_gas = df_pvtlib_compositions[df_pvtlib_compositions.Phase == 1] + df_pvtlib_composition_gas.reset_index(drop=True, inplace=True) + df_pvtlib_composition_liq = df_pvtlib_compositions[df_pvtlib_compositions.Phase == 2] + df_pvtlib_composition_liq.reset_index(drop=True, inplace=True) + + # Properties' calculation loop for gas phase + activities_gas = list() + pvtlib_fugacities_gas = list() + for index, df_row in df_pvtlib_composition_gas.iterrows(): + P = df_row["Pressure [Pa]"] + composition_0 = df_row["C1"] + composition_1 = df_row["CO2"] + state.setPressure(P, 'Pa') + state.setSpeciesAmount(gaseous_species[0], composition_0) + state.setSpeciesAmount(gaseous_species[1], composition_1) + + df_row_fugacities = df_pvtlib_fugacities_gas.iloc[index, :] + fugacity_0 = df_row_fugacities["C1"] + fugacity_1 = df_row_fugacities["CO2"] + fugacities = np.array([fugacity_0, fugacity_1]) + + gas_properties = state.properties() + activities = np.exp(gas_properties.lnActivities().val) + activities_gas.append(activities) + pvtlib_fugacities_gas.append(fugacities) + + activities_gas = np.array(activities_gas) + pvtlib_fugacities_gas = np.array(pvtlib_fugacities_gas) + + reaktoro_c1_activity_gas = activities_gas[:, 0] + reaktoro_co2_activity_gas = activities_gas[:, 1] + assert_allclose(reaktoro_c1_activity_gas, pvtlib_fugacities_gas[:, 0], rtol=2e-2) + assert_allclose(reaktoro_co2_activity_gas, pvtlib_fugacities_gas[:, 1], rtol=2e-2) + + # Properties' calculation loop for gas phase + activities_liq = list() + pvtlib_fugacities_liq = list() + for index, df_row in df_pvtlib_composition_liq.iterrows(): + P = df_row["Pressure [Pa]"] + composition_0 = df_row["C1"] + composition_1 = df_row["CO2"] + state.setPressure(P, 'Pa') + state.setSpeciesAmount(oil_species[0], composition_0) + state.setSpeciesAmount(oil_species[1], composition_1) + + df_row_fugacities = df_pvtlib_fugacities_liq.iloc[index, :] + fugacity_0 = df_row_fugacities["C1"] + fugacity_1 = df_row_fugacities["CO2"] + fugacities = np.array([fugacity_0, fugacity_1]) + + liq_properties = state.properties() + activities = np.exp(liq_properties.lnActivities().val) + activities_liq.append(activities) + pvtlib_fugacities_liq.append(fugacities) + + activities_liq = np.array(activities_liq) + pvtlib_fugacities_liq = np.array(pvtlib_fugacities_liq) + + reaktoro_c1_activity_liq = activities_liq[:, 2] + reaktoro_co2_activity_liq = activities_liq[:, 3] + assert_allclose(reaktoro_c1_activity_liq, pvtlib_fugacities_liq[:, 0], rtol=2e-2) + assert_allclose(reaktoro_co2_activity_liq, pvtlib_fugacities_liq[:, 1], rtol=2e-2) + + components_activities = { + "c1_activities_liq": reaktoro_c1_activity_liq, + "co2_activities_liq": reaktoro_co2_activity_liq, + "c1_activities_gas": reaktoro_c1_activity_gas, + "co2_activities_gas": reaktoro_co2_activity_gas, + } + num_regression.check(components_activities) + + if is_debug_plots_on: + import matplotlib.pyplot as plt + + plt.figure(figsize=(8, 6)) + + pressure_values_gas = df_pvtlib_composition_gas["Pressure [Pa]"].values / 100000 # to bar + plt.plot(pressure_values_gas, activities_gas[:, 0], "-x", label="C1(g) - Reaktoro") + plt.plot(pressure_values_gas, pvtlib_fugacities_gas[:, 0], "-o", label="C1(g) - pvtlib") + plt.plot(pressure_values_gas, activities_gas[:, 1], "-x", label="CO2(g) - Reaktoro") + plt.plot(pressure_values_gas, pvtlib_fugacities_gas[:, 1], "-o", label="CO2(g) - pvtlib") + + plt.xlabel("Pressure [bar]") + plt.ylabel("Fugacities [bar]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_fugacities_gas_pedersen.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + + pressure_values_liq = df_pvtlib_composition_liq["Pressure [Pa]"].values / 100000 # to bar + plt.plot(pressure_values_liq, activities_liq[:, 2], "-x", label="C1(liq) - Reaktoro") + plt.plot(pressure_values_liq, pvtlib_fugacities_liq[:, 0], "-o", label="C1(liq) - pvtlib") + plt.plot(pressure_values_liq, activities_liq[:, 3], "-x", label="CO2(liq) - Reaktoro") + plt.plot(pressure_values_liq, pvtlib_fugacities_liq[:, 1], "-o", label="CO2(liq) - pvtlib") + + plt.xlabel("Pressure [bar]") + plt.ylabel("Fugacities [bar]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_fugacities_liq_pedersen.png", dpi=300) + plt.show() diff --git a/tests/regression/test_pedersen63/test_composition_results.csv b/tests/regression/test_pedersen63/test_composition_results.csv new file mode 100644 index 000000000..177fc4078 --- /dev/null +++ b/tests/regression/test_pedersen63/test_composition_results.csv @@ -0,0 +1,181 @@ +,liquid_phase,gas_phase,C1(g),CO2(g),C1(liq),CO2(liq) +0,0.019155836900118437,1,0.40000000000000002,0.59999999999999998,0.02892370196855712,0.9710762980314428 +1,0.043672525574634365,1,0.40000000000000002,0.59999999999999998,0.030233146101422373,0.96976685389857764 +2,0.066302371573641841,1,0.40000000000000002,0.59999999999999998,0.031547509679817773,0.96845249032018232 +3,0.087263395424666879,1,0.40000000000000002,0.59999999999999998,0.032866841371208315,0.96713315862879168 +4,0.10674139329856486,1,0.40000000000000002,0.59999999999999998,0.034191190612847276,0.96580880938715274 +5,0.12489568101743448,1,0.40000000000000002,0.59999999999999998,0.035520607628429519,0.96447939237157054 +6,0.14186365177899979,1,0.40000000000000002,0.59999999999999998,0.036855143445491907,0.96314485655450821 +7,0.15776442392398873,1,0.40000000000000002,0.59999999999999998,0.03819484991271465,0.96180515008728529 +8,0.17270178387007654,1,0.40000000000000002,0.59999999999999998,0.03953977971823714,0.96046022028176281 +9,0.18676657815211969,1,0.40000000000000002,0.59999999999999998,0.040889986408315614,0.95911001359168435 +10,0.2000386712374595,1,0.40000000000000002,0.59999999999999998,0.042245524406457353,0.95775447559354265 +11,0.21258855838145094,1,0.40000000000000002,0.59999999999999998,0.043606449033147143,0.95639355096685286 +12,0.22447870241253032,1,0.40000000000000002,0.59999999999999998,0.044972816526118113,0.95502718347388194 +13,0.23576464805062147,1,0.40000000000000002,0.59999999999999998,0.046344684061220949,0.95365531593877906 +14,0.2464959557881635,1,0.40000000000000002,0.59999999999999998,0.047722109773872722,0.9522778902261273 +15,0.25671698852794861,1,0.40000000000000002,0.59999999999999998,0.049105152781165312,0.95089484721883466 +16,0.2664675773703728,1,0.40000000000000002,0.59999999999999998,0.050493873204585239,0.9495061267954148 +17,0.27578358767260752,1,0.40000000000000002,0.59999999999999998,0.051888332193419567,0.9481116678065804 +18,0.28469740238517449,1,0.40000000000000002,0.59999999999999998,0.053288591948862075,0.94671140805113796 +19,0.29323833643601804,1,0.40000000000000002,0.59999999999999998,0.054694715748813988,0.94530528425118598 +20,0.3014329933743522,1,0.40000000000000002,0.59999999999999998,0.056106767973449656,0.94389323202655029 +21,0.30930557344944187,0.98084416309988165,0.40724710133373776,0.59275289866626224,0.057524814131544734,0.94247518586845513 +22,0.31687814067085218,0.9563274744253657,0.41688611152078536,0.58311388847921464,0.05894892088761236,0.94105107911238761 +23,0.32417085508510896,0.93369762842635806,0.42616400982148273,0.57383599017851716,0.06037915608983959,0.93962084391016032 +24,0.33120217544479019,0.91273660457533312,0.43510025327606661,0.56489974672393339,0.06181558879892686,0.93818441120107321 +25,0.33798903658289187,0.8932586067014352,0.44371291997853085,0.55628708002146909,0.063258289317781144,0.9367417106822189 +26,0.34454700510310432,0.87510431898256558,0.45201882900085993,0.54798117099914012,0.064707329222154414,0.93529267077784561 +27,0.35089041641898794,0.85813634822100016,0.46003364801221092,0.53996635198778908,0.066162781392238121,0.93383721860776192 +28,0.3570324956998443,0.84223557607601129,0.4677719900436757,0.53222800995632435,0.067624720045241588,0.93237527995475844 +29,0.36298546488835459,0.82729821612992349,0.47524750065106486,0.52475249934893509,0.069093220769029615,0.93090677923097043 +30,0.3687606376278505,0.81323342184788028,0.48247293657247881,0.51752706342752131,0.070568360556804363,0.92943163944319562 +31,0.37436850366609331,0.79996132876254045,0.48946023683131018,0.51053976316868976,0.072050217842935693,0.92794978215706425 +32,0.37981880407367169,0.78741144161854892,0.49622058711866268,0.50377941288133721,0.073538872539914854,0.92646112746008513 +33,0.38512059842528157,0.77552129758746968,0.50276447818430625,0.49723552181569386,0.075034406076547669,0.92496559392345223 +34,0.39028232493025983,0.76423535194937853,0.50910175887683939,0.49089824112316061,0.076536901437381136,0.92346309856261877 +35,0.39531185436322452,0.75350404421183648,0.51524168439620821,0.48475831560379173,0.078046443203427032,0.92195355679657287 +36,0.40021653853074229,0.74328301147205145,0.52119296025559847,0.47880703974440153,0.079563117594259367,0.92043688240574062 +37,0.40500325391129427,0.73353242262962715,0.52696378239070762,0.47303621760929238,0.081087012511512957,0.91891298748848704 +38,0.40967844102277973,0.72421641232739253,0.53256187380491726,0.46743812619508279,0.082618217583838124,0.91738178241616197 +39,0.41424814000030302,0.71530259761482551,0.53799451809430898,0.46200548190569091,0.084156824213392684,0.91584317578660734 +40,0.41871802280585685,0.70676166356398196,0.54326859015778739,0.45673140984221272,0.085702925623932655,0.91429707437606733 +41,0.42309342243851061,0.69856700662564775,0.54839058436450627,0.45160941563549384,0.087256616910534351,0.91274338308946568 +42,0.42737935946896066,0.69069442655055813,0.55336664042053452,0.44663335957946554,0.088817995091058949,0.91118200490894108 +43,0.43158056618278923,0.68312185932914793,0.55820256715112526,0.44179743284887463,0.090387159159410951,0.90961284084058902 +44,0.43570150858298012,0.67582914491489099,0.56290386439156559,0.43709613560843452,0.09196421014067227,0.90803578985932776 +45,0.43974640647275559,0.66879782455520975,0.56747574316020311,0.43252425683979695,0.093549251148178872,0.9064507488518212 +46,0.443719251814442,0.66201096341710808,0.5719231442683036,0.4280768557316964,0.095142387442647178,0.90485761255735286 +47,0.44762382553759811,0.65545299489689568,0.57625075550642668,0.42374924449357343,0.096743726493416449,0.90325627350658355 +48,0.4514637129502384,0.64910958358101201,0.58046302753256862,0.41953697246743138,0.098353378041919098,0.90164662195808087 +49,0.45524231789001618,0.6429675043001557,0.58456418857489234,0.41543581142510749,0.099971454167462434,0.90002854583253755 +50,0.45896287573716088,0.63701453511164541,0.58855825805106665,0.41144174194893335,0.10159806935541975,0.89840193064458029 +51,0.46262846539812491,0.6312393623721495,0.59244905919577484,0.40755094080422505,0.10323334056796359,0.89676665943203648 +52,0.46624202035708373,0.62563149633390669,0.59624023077993427,0.40375976922006585,0.1048773873174188,0.8951226126825812 +53,0.46980633888254442,0.62018119592632837,0.59993523799641546,0.40006476200358448,0.10653033174240442,0.89346966825759566 +54,0.47332409346699672,0.61487940157471854,0.60353738258089784,0.39646261741910205,0.10819229868682589,0.89180770131317411 +55,0.47679783957002947,0.60971767506974017,0.60704981222944709,0.39295018777055296,0.10986341578190285,0.89013658421809716 +56,0.4802300237280881,0.60468814563677553,0.61047552936904914,0.3895244706309508,0.11154381353136016,0.88845618646863977 +57,0.48362299108772838,0.59978346146925776,0.61381739933251112,0.38618260066748888,0.11323362539990751,0.88676637460009256 +58,0.48697899241398673,0.59499674608870567,0.61707815798399868,0.38292184201600138,0.11493298790519622,0.88506701209480376 +59,0.49030019062022773,0.59032155897722038,0.62026041883776384,0.37973958116223605,0.11664204071337636,0.88335795928662364 +60,0.49358866686190755,0.58575185999969692,0.62336667970880799,0.37663332029119195,0.1183609267384871,0.88163907326151292 +61,0.49684642623212566,0.5812819771941431,0.62639932893095429,0.37360067106904571,0.1200897922457832,0.8799102077542168 +62,0.5000754030942175,0.57690657756148944,0.62936065117443918,0.37063934882556088,0.12182878695927549,0.87817121304072454 +63,0.50327746608276125,0.57262064053103934,0.63225283289284651,0.36774716710715349,0.12357806417363158,0.8764219358263684 +64,0.50645442280195196,0.56841943381721083,0.63507796742644962,0.36492203257355038,0.125337780870656,0.87466221912934394 +65,0.50960802424799123,0.56429849141701993,0.63783805978682961,0.36216194021317027,0.12710809784063265,0.87289190215936729 +66,0.51273996897949381,0.56025359352724435,0.64053503114553445,0.35946496885446555,0.12888917980869896,0.87111082019130104 +67,0.51585190705816375,0.55628074818555806,0.64317072304785805,0.35682927695214184,0.1306811955665482,0.86931880443345178 +68,0.51894544378038376,0.55237617446240195,0.64574690137098356,0.35425309862901638,0.13248431810972919,0.86751568189027073 +69,0.52202214321846974,0.54853628704976165,0.6482652600442057,0.35173473995579424,0.13429872478084087,0.86570127521915918 +70,0.52508353158896903,0.54475768210998377,0.65072742454763477,0.34927257545236529,0.13612459741888683,0.86387540258111317 +71,0.52813110046434608,0.54103712426283912,0.65313495520433762,0.34686504479566249,0.13796212251515769,0.86203787748484229 +72,0.53116630984307545,0.53737153460187514,0.6554893502799467,0.34451064972005324,0.13981149137597035,0.86018850862402974 +73,0.53419059109210076,0.53375797964291627,0.65779204890246523,0.34220795109753466,0.14167290029261381,0.8583270997073863 +74,0.53720534977495771,0.53019366111745558,0.66004443381421751,0.33995556618578243,0.14354655071892022,0.8564534492810798 +75,0.54021196837781671,0.52667590653300334,0.66224783396673426,0.33775216603326574,0.14543264945684042,0.85456735054315958 +76,0.54321180894525767,0.52320216042997048,0.66440352696886984,0.33559647303113022,0.1473314088505108,0.85266859114948923 +77,0.54620621563662808,0.5197699762719119,0.66651274139751526,0.33348725860248479,0.14924304698919794,0.85075695301080212 +78,0.54919651721382845,0.51637700891227167,0.66857665897949092,0.33142334102050902,0.15116778791972169,0.84883221208027826 +79,0.55218402947036238,0.51302100758601332,0.67059641665281799,0.32940358334718189,0.15310586186880262,0.84689413813119752 +80,0.55517005761153704,0.50969980937977222,0.67257310851469176,0.3274268914853084,0.15505750547594466,0.84494249452405534 +81,0.55815589859518022,0.50641133313809239,0.67450778766332598,0.32549221233667408,0.15702296203744473,0.84297703796255519 +82,0.56114284344198351,0.5031535737678744,0.67640146793975531,0.32359853206024464,0.15900248176215953,0.84099751823784052 +83,0.56413217952461236,0.4999245969057825,0.67825512557599632,0.32174487442400374,0.16099632203975403,0.83900367796024589 +84,0.56712519284422946,0.49672253391723886,0.68006970075483875,0.31993029924516125,0.16300474772209911,0.83699525227790084 +85,0.57012317030355164,0.49354557719804804,0.68184609908648042,0.31815390091351964,0.16502803141871814,0.83497196858128175 +86,0.57312740198488188,0.49039197575200882,0.6835851930069875,0.31641480699301244,0.16706645380697799,0.83293354619302207 +87,0.57613918344229198,0.48726003102050619,0.68528782310290237,0.31471217689709763,0.16912030395805344,0.83087969604194656 +88,0.57915981801673211,0.48414809294183625,0.68695479936613357,0.31304520063386648,0.17118987967955029,0.82881012032044976 +89,0.58219061918341319,0.48105455621961624,0.68858690238323028,0.31141309761676977,0.17327548787587313,0.82672451212412679 +90,0.58523291294063107,0.47797785678153026,0.69018488446250892,0.30981511553749108,0.17537744492737922,0.82462255507262083 +91,0.58828804025004944,0.47491646841103097,0.69174947070235904,0.30825052929764107,0.17749607708962048,0.82250392291037966 +92,0.59135735953826685,0.47186889953565392,0.6932813600040082,0.30671863999599175,0.17963172091382162,0.82036827908617826 +93,0.59444224927037104,0.46883369015692455,0.69478122603164605,0.30521877396835395,0.18178472369006507,0.81821527630993496 +94,0.59754411060665591,0.46580940890789918,0.69624971812254988,0.30375028187745012,0.18395544391466162,0.81604455608533844 +95,0.60066437015389029,0.46279465022504229,0.69768746214988575,0.30231253785011419,0.18614425178319899,0.81385574821680096 +96,0.60380448282405663,0.45978803162218335,0.69909506134045918,0.30090493865954082,0.18835152971115668,0.81164847028884335 +97,0.60696593481334549,0.45678819105474233,0.70047309704973348,0.29952690295026646,0.19057767288376518,0.80942232711623485 +98,0.61015024671585882,0.45379378436337187,0.70182212949600109,0.29817787050399885,0.19282308983721819,0.80717691016278181 +99,0.61335897678719864,0.45080348278617155,0.70314269845586375,0.2968573015441362,0.19508820307337357,0.8049117969266264 +100,0.61659372437429028,0.44781597052963756,0.70443532392258468,0.29556467607741532,0.19737344971024626,0.80262655028975383 +101,0.61985613352927815,0.44482994238846302,0.70570050672910878,0.29429949327089122,0.19967928217085126,0.80032071782914871 +102,0.62314789682673533,0.44184410140481978,0.70693872913724931,0.29306127086275069,0.20200616891312431,0.79799383108687572 +103,0.62647075940508123,0.43885715655801655,0.70815045539439725,0.2918495446056027,0.20435459520386057,0.79564540479613954 +104,0.62982652325514732,0.43586782047538764,0.70933613225921921,0.29066386774078079,0.2067250639399007,0.79327493606009924 +105,0.63321705178079402,0.43287480715577054,0.71049618949736004,0.28950381050263996,0.20911809652003993,0.79088190347996012 +106,0.63664427465914386,0.42987682969644836,0.71163104034851821,0.2883689596514819,0.21153423377151298,0.78846576622848707 +107,0.64011019303017302,0.42687259801511807,0.71274108196564123,0.28725891803435882,0.21397403693500461,0.78602596306499539 +108,0.64361688504929759,0.42386081655770802,0.71382669582740577,0.28617330417259412,0.21643808871292847,0.78356191128707153 +109,0.64716651183893459,0.42084018198326784,0.71488824812466945,0.28511175187533055,0.21892699438559196,0.78107300561440807 +110,0.65076132387992625,0.41780938081658675,0.71592609012181985,0.28407390987818021,0.22144138300080743,0.7785586169991926 +111,0.65440366788724669,0.41476708705936893,0.7169405584934968,0.28305944150650325,0.22398190864260759,0.77601809135739241 +112,0.65809599421967602,0.41171195974995056,0.7179319756375161,0.2820680243624839,0.22654925178548235,0.77345074821451765 +113,0.66184086487894767,0.40864264046173326,0.71890064996434844,0.28109935003565151,0.22914412074120791,0.77085587925879218 +114,0.6656409621592746,0.40555775072962891,0.71984687616366294,0.28015312383633711,0.23176725320563726,0.76823274679436271 +115,0.66949909801646446,0.40245588939334409,0.72077093544840631,0.27922906455159363,0.23441941791410476,0.7655805820858953 +116,0.67341822423284436,0.39933562984610971,0.72167309577644279,0.27832690422355716,0.23710141641438603,0.76289858358561391 +117,0.67740144346423414,0.39619551717594331,0.72255361205035207,0.27744638794964799,0.23981408496745746,0.76018591503254263 +118,0.68145202126528481,0.39303406518665457,0.72341272629517572,0.27658727370482428,0.24255829658709516,0.75744170341290495 +119,0.68557339920147398,0.38984975328414118,0.7242506678143712,0.27574933218562891,0.24533496323049314,0.7546650367695068 +120,0.68976920917002271,0.38664102321280136,0.72506765332391299,0.27493234667608701,0.24814503815343936,0.75185496184656053 +121,0.69404328906768276,0.38340627562570972,0.72586388706438754,0.27413611293561252,0.25098951844497613,0.74901048155502381 +122,0.69839969996114404,0.38014386647072185,0.72663956089095316,0.27336043910904678,0.25386944775789466,0.74613055224210523 +123,0.70284274493694943,0.37685210317326467,0.72739485434085149,0.27260514565914845,0.25678591925338612,0.74321408074661377 +124,0.70737698983181008,0.37352924059491871,0.72812993467804943,0.27187006532195063,0.259740078780063,0.74025992121993711 +125,0.71200728607154884,0.37017347674485274,0.72884495691461204,0.2711550430853879,0.26273312830965478,0.73726687169034533 +126,0.71673879587984013,0.36678294821920593,0.72954006380811698,0.27045993619188302,0.26576632965449326,0.73423367034550679 +127,0.72157702015462211,0.36335572534085608,0.73021538583452628,0.26978461416547372,0.2688410084943812,0.73115899150561892 +128,0.72652782935426075,0.35988980696982698,0.73087104113549239,0.26912895886450755,0.27195855874393632,0.72804144125606363 +129,0.73159749778589733,0.35638311495070246,0.73150713543940749,0.26849286456059246,0.27512044729477381,0.72487955270522608 +130,0.73679274174884768,0.35283348816106536,0.73212376195474582,0.26787623804525418,0.27832821917139533,0.72167178082860461 +131,0.74212076205508415,0.34923867612007381,0.73272100123473205,0.26727899876526795,0.28158350314371405,0.71841649685628595 +132,0.74758929153261511,0.34559633211275337,0.733298921011724,0.266701078988276,0.28488801784508111,0.71511198215491889 +133,0.75320664821390237,0.34190400578032398,0.73385757599962209,0.26614242400037791,0.28824357844990633,0.71175642155009367 +134,0.75898179502876273,0.33815913512105228,0.73439700766271643,0.26560299233728357,0.29165210397255259,0.70834789602744752 +135,0.76492440695757091,0.3343590378407254,0.73491724394852787,0.26508275605147208,0.29511562525631191,0.70488437474368804 +136,0.77104494676564195,0.3305009019835356,0.73541829898264699,0.26458170101735295,0.29863629373038447,0.70136370626961553 +137,0.77735475063730464,0.32658177576715575,0.73590017272268793,0.26409982727731213,0.30221639102335551,0.6977836089766446 +138,0.78386612526373101,0.32259855653576586,0.73636285056859274,0.26363714943140726,0.30585833953258901,0.69414166046741099 +139,0.79059245822600366,0.31854797873471524,0.73680630292594984,0.26319369707405016,0.30956471406312391,0.69043528593687609 +140,0.79754834386076356,0.31442660079852608,0.73723048471854635,0.2627695152814537,0.31333825466468496,0.6866617453353151 +141,0.80474972721802795,0.31023079082997729,0.73763533484608834,0.26236466515391177,0.31718188081333781,0.68281811918666224 +142,0.81221406923754003,0.30595671093231724,0.73802077558248513,0.26197922441751498,0.32109870710523791,0.6789012928947622 +143,0.81996053690289727,0.30160030003885602,0.73838671190941885,0.26161328809058115,0.32509206065329577,0.67490793934670423 +144,0.82801022291677406,0.29715725506305063,0.73873303077932495,0.26126696922067516,0.32916550040582604,0.67083449959417396 +145,0.83638640041043888,0.29262301016818992,0.7390596003013552,0.26094039969864491,0.3333228386378822,0.66667716136211785 +146,0.84511481941366728,0.28799271392845122,0.73936626884267476,0.26063373115732535,0.33756816490393821,0.66243183509606185 +147,0.85422405333092366,0.28326120412015987,0.73965286403695885,0.2603471359630411,0.34190587278408785,0.65809412721591221 +148,0.86374590558868003,0.27842297984537795,0.73991919169053111,0.26008080830946895,0.34634068980705074,0.65365931019294932 +149,0.8737158890563651,0.27347217064573925,0.74016503457555161,0.25983496542444823,0.35087771099319143,0.64912228900680857 +150,0.88417379396167006,0.26840250221410267,0.74039015109809625,0.25960984890190375,0.35552243653150911,0.64447756346849083 +151,0.89516436403554311,0.26320725825115227,0.74059427382747756,0.2594057261725225,0.36028081418727148,0.63971918581272846 +152,0.90673810583341197,0.25787923794491591,0.74077710787113382,0.25922289212886612,0.36515928713510371,0.63484071286489629 +153,0.91895226299857646,0.25241070846738495,0.74093832907739154,0.25906167092260834,0.37016484802908567,0.62983515197091433 +154,0.93187199623243044,0.24679335178609757,0.7410775820455785,0.2589224179544215,0.37530510026191155,0.62469489973808834 +155,0.94557182172956156,0.24101820497123722,0.74119447792051874,0.25880552207948138,0.38058832753050864,0.61941167246949136 +156,0.96013737695443657,0.23507559304242903,0.74128859194433994,0.25871140805566012,0.38602357302968804,0.61397642697031196 +157,0.97566760459584823,0.22895505323435802,0.7413594607349574,0.25864053926504266,0.39162072984584456,0.60837927015415549 +158,0.99227747571806213,0.22264524936269531,0.74140657925572295,0.25859342074427705,0.3973906444306779,0.60260935556932216 +159,1,0.21613387473626905,0.74142939743494052,0.25857060256505948,0.40000000000000002,0.59999999999999998 +160,1,0.20940754177399629,0.74142731638753623,0.25857268361246377,0.40000000000000002,0.59999999999999998 +161,1,0.20245165613923646,0.74139968418301549,0.25860031581698456,0.40000000000000002,0.59999999999999998 +162,1,0.19525027278197199,0.74134579109448684,0.25865420890551311,0.40000000000000002,0.59999999999999998 +163,1,0.18778593076246,0.74126486425238014,0.25873513574761997,0.40000000000000002,0.59999999999999998 +164,1,0.18003946309710281,0.74115606161237035,0.25884393838762959,0.40000000000000002,0.59999999999999998 +165,1,0.17198977708322594,0.74101846513114866,0.25898153486885139,0.40000000000000002,0.59999999999999998 +166,1,0.16361359958956115,0.74085107302294062,0.25914892697705932,0.40000000000000002,0.59999999999999998 +167,0.99999999999987754,0.15488518058633266,0.7406527909457592,0.25934720905424075,0.40000000000000002,0.59999999999999998 +168,0.99999999999950318,0.14577594666907631,0.74042242193599106,0.259577578064009,0.40000000000000002,0.59999999999999998 +169,0.99999999999798539,0.13625409441131997,0.74015865487284949,0.25984134512715046,0.40000000000000008,0.59999999999999998 +170,0.99999999999183142,0.12628411094363484,0.73986005120805542,0.26013994879194469,0.40000000000000002,0.60000000000000009 +171,0.99999999996687872,0.11582620603832999,0.73952502963873767,0.26047497036126227,0.40000000000000002,0.59999999999999998 +172,0.99999999986570531,0.10483563596445687,0.73915184832870451,0.26084815167129555,0.39999999999999997,0.59999999999999998 +173,0.99999999945545914,0.093261894166588089,0.73873858419143901,0.26126141580856094,0.40000000000000002,0.59999999999999998 +174,0.99999999779166227,0.081047737001423509,0.73828310863382496,0.26171689136617504,0.39999999999999997,0.59999999999999998 +175,0.99999999104948312,0.068128003767569528,0.73778305899294061,0.26221694100705945,0.40000000000000002,0.59999999999999998 +176,0.99999996359197352,0.054428178270438471,0.7372358047442451,0.26276419525575495,0.40000000000000008,0.59999999999999998 +177,0.99999985113982759,0.039862623045563518,0.73663840724008889,0.26336159275991106,0.40000000000000002,0.59999999999999987 +178,0.99999945254845679,0.024332395404151788,0.73598757145675242,0.26401242854324763,0.40000000000000002,0.59999999999999998 +179,,0.0077225242819379137,0.73527958774227142,0.26472041225772858,, diff --git a/tests/regression/test_pedersen63/test_fugacities_results.csv b/tests/regression/test_pedersen63/test_fugacities_results.csv new file mode 100644 index 000000000..66eefc466 --- /dev/null +++ b/tests/regression/test_pedersen63/test_fugacities_results.csv @@ -0,0 +1,181 @@ +,c1_activities_liq,co2_activities_liq,c1_activities_gas,co2_activities_gas +0,6.5804202243170611,8.3084987370365813,3.8874666780184621,5.3957269848859015 +1,6.8548117585943036,8.3043958485412031,4.0109102760055642,5.5517971269939519 +2,7.1283209451809171,8.3002910838780597,4.1341504835353318,5.7066009273427385 +3,7.4009501318995286,8.2961843533836106,4.2571895250787204,5.8601388374425545 +4,7.6727024301394744,8.2920755363911649,4.3800296811778274,6.0124112447124309 +5,7.9435748995098479,8.287964743646123,4.5026732907164408,6.1634184704611261 +6,8.2135698214380071,8.2838518852463707,4.6251227533067238,6.3131607677753285 +7,8.4826879350137947,8.2797369296594994,4.7473805317979449,6.4616383193081752 +8,8.7509299700241172,8.2756198450419749,4.8694491549160928,6.6088512349638702 +9,9.0182966463079079,8.2715005992563295,4.9913312200414861,6.7547995494705271 +10,9.2847886730470854,8.267379159890762,5.1130293961344693,6.8994832198362301 +11,9.5504098738290359,8.2632553704258918,5.2345464268174728,7.0429021226796742 +12,9.8151556576139338,8.2591294063276486,5.3558851336250264,7.1850560514290303 +13,10.07902908840456,8.2550011400291705,5.4770484194317541,7.3259447133797915 +14,10.342030870969051,8.250870536277672,5.5980392720707393,7.4655677266032665 +15,10.60416170165958,8.246737559384405,5.7188607681556993,7.6039246166964549 +16,10.865422267967638,8.2426021732309511,5.8395160771196251,7.7410148133620806 +17,11.125813248034046,8.2384643412771741,5.9600084654866823,7.8768376468091388 +18,11.385338290485539,8.2343239047230892,6.0803413013919947,8.0113923439604893 +19,11.643992871602357,8.2301810373558428,6.2005180593686831,8.1446780244562227 +20,11.901780009326437,8.2260356048334788,6.3205423254198925,8.2766936964372722 +21,12.158700368960055,8.2218875676922796,6.561827555942231,8.3017157414824361 +22,12.414754607567833,8.2177368859171871,6.8355572310583304,8.2976569438673238 +23,12.669943373623898,8.2135835189413093,7.1084177820387557,8.2935958149056894 +24,12.924267306623163,8.2094274256467141,7.380409939266837,8.2895323317076155 +25,13.177727036656801,8.2052685643666869,7.6515344247640318,8.2854664737122921 +26,13.430326571018258,8.2011067492002052,7.9217919485594495,8.2813982257488803 +27,13.682060521209131,8.1969421910300948,8.1911832233000332,8.2773275653281946 +28,13.932932249852811,8.1927747297829914,8.4597089551449738,8.2732544704869984 +29,14.182942369554709,8.1886043204733259,8.7273698456957316,8.2691789180628685 +30,14.432091484157525,8.1844309174365026,8.9941665918771854,8.2651008837450668 +31,14.680380188395519,8.180254474324089,9.2600998858221715,8.2610203421197674 +32,14.927809067521027,8.1760749441002822,9.5251704155996695,8.256937265993006 +33,15.174378696897319,8.1718922790392359,9.7893788619610245,8.2528516291188936 +34,15.420093478834533,8.1677062615745033,10.052725902697278,8.2487634024107184 +35,15.66494709548088,8.1635171445205454,10.315212209722835,8.2446725563791876 +36,15.908943270783007,8.1593247384397767,10.57683844964755,8.2405790605813323 +37,16.152082558522498,8.1551289917304839,10.837605283682377,8.2364828836384518 +38,16.394365502915988,8.1509298519579989,11.097513367545169,8.2323839932520375 +39,16.635792638255737,8.1467272658458505,11.356563351537162,8.2282823560747289 +40,16.876364488516632,8.1425211792676802,11.614755879814965,8.2241779382588138 +41,17.116081566932152,8.1383115372404244,11.872091591210582,8.2200707046944821 +42,17.354948862256219,8.1340980781025998,12.128571118561879,8.2159606195060118 +43,17.592958767269817,8.1298811153387813,12.384195088761768,8.2118476459389047 +44,17.830115521545522,8.1256604195801003,12.63896412266987,8.2077317463605866 +45,18.06641961275583,8.1214359312173272,12.892878835022726,8.2036128822617016 +46,18.301871517917267,8.117207589617502,13.145939834343839,8.1994910142546988 +47,18.536471702988703,8.1129753331102261,13.398147722894482,8.1953661020375979 +48,18.770220622439908,8.10873909897483,13.649503096432429,8.1912381045154206 +49,19.003123334509997,8.1044986038842648,13.900006544335959,8.1871069796150202 +50,19.235171904994843,8.1002541794408813,14.149658649375485,8.1829726843926451 +51,19.466370644060088,8.096005575387391,14.398459987653293,8.1788351749983121 +52,19.696719976140386,8.0917527235626086,14.646411128510065,8.1746944066668039 +53,19.92622031402189,8.0874955545596912,14.893512634430349,8.1705503337065544 +54,20.154872058412902,8.0832339977055572,15.139765060946999,8.1664029094882409 +55,20.382686366580106,8.0789674520745134,15.385168956553001,8.1622520864241892 +56,20.6096442337025,8.0746967928442412,15.629724862566194,8.1580978159851423 +57,20.835755026328414,8.0704215051710868,15.873433313082444,8.1539400486412585 +58,21.061014265955858,8.0661417537676634,16.116294834840705,8.1497787338740739 +59,21.285431191130424,8.0618570178245168,16.358309947126987,8.1456138201531036 +60,21.509002095772875,8.0575674180848011,16.599479161670143,8.1414452549177021 +61,21.731727962452613,8.0532728394936655,16.839802982534895,8.1372729845578959 +62,21.953607323611489,8.0489732890708812,17.079281906012987,8.1330969543944729 +63,22.174638258045132,8.0446687968448494,17.317916420517331,8.1289171086542122 +64,22.394827581850411,8.0403589417286572,17.555707006453716,8.1247333904599301 +65,22.6141731678021,8.0360437570719974,17.79265413612741,8.1205457417903251 +66,22.832673980881143,8.0317232194291961,18.028758273613015,8.1163541034658095 +67,23.050331802809737,8.027397156236626,18.264019874638468,8.1121584151207813 +68,23.267145351126501,8.0230655523553178,18.498439386462941,8.1079586151768712 +69,23.483111095519803,8.0187285113064846,18.73201724775333,8.1037546408151755 +70,23.698238218693373,8.0143854583085368,18.96475388845904,8.0995464279456275 +71,23.912522393587256,8.010036531386838,19.196649729676064,8.0953339111824381 +72,24.125964042552564,8.0056816141161136,19.4277051835249,8.0911170238046797 +73,24.338559038475108,8.0013208344955267,19.657920653009484,8.0868956977282771 +74,24.550315529212842,7.9969536501494609,19.88729653188091,8.0826698634713168 +75,24.761230043186071,7.9925801455450607,20.115833204497235,8.0784394501177221 +76,24.971302772024128,7.9882002032700292,20.343531045680066,8.0742043852804777 +77,25.180533897284537,7.9838137028415188,20.570390420565619,8.069964595064663 +78,25.388919103763925,7.9794207727397293,20.796411684457603,8.0657200040254757 +79,25.596466697456425,7.9750208301571748,21.021595182673597,8.0614705351265972 +80,25.803173034880636,7.9706139567628584,21.245941250383673,8.0572161097007946 +81,26.009038239561288,7.9662000197415619,21.469450212456145,8.0529566473999488 +82,26.214062424215943,7.9617788826365707,21.692122383289792,8.0486920661515757 +83,26.418240836958372,7.9573506868973727,21.913958066647211,8.0444222821092932 +84,26.621582382467547,7.9529147790421479,22.134957555482515,8.0401472096025479 +85,26.824083033979111,7.9484712477819945,22.35512113176495,8.0358667610851402 +86,27.025742842175756,7.9440199418770225,22.574449066300659,8.0315808470789847 +87,27.226557203191881,7.9395609824497173,22.792941618547999,8.027289376118306 +88,27.426534566792945,7.935093709633362,23.010599036428435,8.0229922546906192 +89,27.625671025035171,7.9306181910515043,23.227421556134647,8.0186893871751952 +90,27.823966563204696,7.9261342582721177,23.443409401932787,8.0143806757785683 +91,28.021416511848269,7.9216420221981121,23.658562785957848,8.0100660204705321 +92,28.218029246080562,7.9171407909914953,23.87288190801101,8.0057453189110568 +93,28.413800794806278,7.9126306190450677,24.086366955344207,8.0014184663808621 +94,28.608731074299953,7.9081113178199614,24.299018102444801,7.9970853557045771 +95,28.802815147074945,7.9035829979455796,24.510835510810097,7.9927458771748734 +96,28.996061672276916,7.8990449088208026,24.721819328723036,7.9883999184680539 +97,29.188466443672635,7.8944970991341989,24.931969691016455,7.9840473645601691 +98,29.380024898561263,7.8899396405234867,25.141286718833889,7.979688097638733 +99,29.570744834040102,7.8853718031124176,25.349770519386052,7.9753219970082787 +100,29.760622357780829,7.8807935978494728,25.557421185695812,7.9709489389968633 +101,29.949653099263131,7.8762050658904874,25.76423879634471,7.9665687968518251 +102,30.137844321443598,7.8716054755809042,25.970223415207023,7.9621814406361331 +103,30.325192289826497,7.8669948066694291,26.175375091179856,7.9577867371175985 +104,30.51169267682133,7.8623730764271906,26.379693857906421,7.9533845496536824 +105,30.697352476817635,7.8577395312580371,26.583179733488905,7.9489747380731171 +106,30.882167986209364,7.8530941244551853,26.785832720201959,7.944557158546445 +107,31.066134787762081,7.8484368550152102,26.987652804190997,7.9401316634571435 +108,31.249259841626625,7.8437669275950075,27.188639955168522,7.9356981012613614 +109,31.43153936293718,7.8390842727383054,27.388794126096869,7.9312563163469383 +110,31.61296871620841,7.8343888765370204,27.58811525287102,7.9268061488782777 +111,31.793555054214178,7.8296798807301,27.786603253988048,7.9223474346391134 +112,31.973290668958068,7.8249574651526128,27.984258030209478,7.9178800048660296 +113,32.152181772123996,7.8202208024728339,28.181079464213301,7.913403686075517 +114,32.330224748124749,7.8154697535888529,28.377067420243847,7.9089182998773397 +115,32.507414961947191,7.8107042469148382,28.572221743746688,7.9044236627841533 +116,32.683759191167724,7.8059233545677058,28.76654226099744,7.8999195860080782 +117,32.859249650449172,7.8011272074779887,28.960028778718716,7.8954058752502227 +118,33.033892530264296,7.7963148772341544,29.152681083694532,7.8908823304736151 +119,33.207680427685638,7.7914864390447258,29.344498942369256,7.8863487456689088 +120,33.380619123148584,7.7866409479612759,29.535482100436905,7.8818049086083288 +121,33.552701431474333,7.7817784315328407,29.725630282427705,7.8772506005807692 +122,33.723932871422093,7.7768979133004574,29.914943191279193,7.8726855961177327 +123,33.894306334423405,7.7719993795101399,30.103420507896143,7.868109662704236 +124,34.063827208238017,7.7670818074055807,30.291061890709464,7.8635225604686658 +125,34.232488333790414,7.7621451471636718,30.477866975217214,7.8589240418602317 +126,34.400295089342322,7.7571883143931446,30.663835373518456,7.854313851306971 +127,34.567240144783547,7.7522112277764794,30.848966673840835,7.8496917248513016 +128,34.733328988158924,7.747212724703509,31.033260440056285,7.8450573897668781 +129,34.898553998260937,7.742192696668238,31.216716211184373,7.8404105641543662 +130,35.062917647140118,7.7371501620143661,31.399333500896276,7.8357509565071588 +131,35.226421644143194,7.7320841563124372,31.581111797002229,7.8310782652561031 +132,35.389058824972885,7.726994441456295,31.76205056093108,7.8263921782863441 +133,35.55083125112121,7.7218799469199011,31.942149227211733,7.8216923724182488 +134,35.711740509732408,7.7167395888460311,32.121407202935167,7.8169785128637779 +135,35.871779532499552,7.7115730083006673,32.299823867223445,7.8122502526401902 +136,36.030950175455139,7.7063790054759158,32.47739857068602,7.8075072319508383 +137,36.1892511664146,7.7011566046867195,32.654130634873098,7.8027490775255339 +138,36.346681216396711,7.6959047758550829,32.830019351735409,7.7979754019109269 +139,36.503241520658598,7.690622193272767,33.00506398307131,7.7931858027218794 +140,36.658925620560716,7.685308190448719,33.179263759990498,7.7883798618315341 +141,36.813734853071729,7.6799612982397818,33.352617882368037,7.7835571445148259 +142,36.967667876554671,7.6745802246049077,33.525125518319506,7.7787171985219725 +143,37.120723346555998,7.6691635982447757,33.696785803674295,7.7738595530940824 +144,37.272899920724342,7.6637099619947193,33.867597841476048,7.768983717898851 +145,37.424196264731954,7.6582177655104795,34.037560701490229,7.7640891818954092 +146,37.574611059288593,7.6526853571647209,34.206673419748562,7.7591754121055727 +147,37.724143008349394,7.6471109750610751,34.374934998111065,7.7542418522996686 +148,37.872790848634047,7.6414927370610535,34.542344403880755,7.7492879215708834 +149,38.020553360562644,7.6358286297081097,34.708900569447358,7.7443130128075026 +150,38.167429380711958,7.6301164959217544,34.874602392005798,7.7393164910305092 +151,38.313417815857321,7.624354021324776,35.039448733321734,7.7342976916074155 +152,38.458517658604876,7.6185387190603464,35.203438419591023,7.7292559183090175 +153,38.602728004512208,7.6126679129552732,35.366570241392211,7.7241904412023592 +154,38.746048070415412,7.6067387188954774,35.528842953740408,7.7191004943690222 +155,38.888477213411889,7.6007480243070482,35.690255276285185,7.7139852734162533 +156,39.030017821644478,7.5946921126779694,35.850805893663313,7.7088439327658289 +157,39.170665379914944,7.5885678518056707,36.010493456024314,7.703675582703962 +158,39.31042286713847,7.5823709144306513,36.169316579783896,7.6984792861488227 +159,39.389659422072718,7.5838121620043815,36.327273848624337,7.6932540551175457 +160,39.448445175224556,7.5878806402246912,36.484363814789859,7.6879988468531844 +161,39.50721043874703,7.5919585541615788,36.640585000739577,7.682712559566296 +162,39.565955716304146,7.5960458388617562,36.795935901192109,7.6773940277596084 +163,39.62468150495534,7.6001424303870433,36.950414985664693,7.6720420170655679 +164,39.683388295279904,7.6042482657940988,37.104020701566071,7.6666552185504893 +165,39.742076571498053,7.6083632831146337,37.25675147795036,7.66123224241211 +166,39.800746811590294,7.6124874213362936,37.408605730047064,7.6557716109916436 +167,39.859399487412539,7.6166206203838103,37.559581864701606,7.650271751011589 +168,39.918035064809914,7.620762821100687,37.70967828688886,7.6447309849348342 +169,39.976654003726424,7.6249139652313422,37.858893407492594,7.6391475213232276 +170,40.035256758313693,7.6290739954037425,38.007225652576807,7.6335194440581011 +171,40.093843777035538,7.6332428551122886,38.154673474421053,7.627844700260189 +172,40.152415502771426,7.6374204887013004,38.301235364642963,7.6221210867205818 +173,40.210972372916977,7.6416068413487448,38.446909869793799,7.6163462346241682 +174,40.269514819482197,7.6458018590504624,38.591695609892426,7.6105175923097299 +175,40.328043269187582,7.6500054886046653,38.735591300445073,7.6046324057692445 +176,40.386558143558133,7.6542176775969217,38.878595778623584,7.5986876965365022 +177,40.445059859014805,7.6584383743853817,39.020708034389749,7.5926802365603532 +178,40.503548826964689,7.6626675280863967,39.161927247548874,7.5866065195745271 +179,,,39.302252831838047,7.5804627284316322 diff --git a/tests/regression/test_whitson18.py b/tests/regression/test_whitson18.py new file mode 100644 index 000000000..9de33c74d --- /dev/null +++ b/tests/regression/test_whitson18.py @@ -0,0 +1,374 @@ +import numpy as np +import pandas as pd +import pytest + +import reaktoro + +from numpy.testing import assert_allclose + +is_debug_plots_on = False + + +@pytest.fixture +def data_dir(): + from pathlib import Path + import os + return Path(os.path.abspath(__file__)).parents[1] / "data" + + +@pytest.fixture +def whitson_pvtlib_results(data_dir): + df_pvtlib_result = pd.read_csv( + data_dir / "pvtlib_table_whitson18_fixed_T.csv", + ) + return df_pvtlib_result + + +@pytest.fixture +def composition(): + return np.array([0.5, 0.42, 0.08]) + + +@pytest.fixture +def gaseous_species(): + return ["C1(g)", "C4(g)", "C10(g)"] + + +@pytest.fixture +def oil_species(): + return ["C1(liq)", "C4(liq)", "C10(liq)"] + + +@pytest.fixture +def custom_hydrocarbon_db(data_dir): + return reaktoro.Database(str(data_dir / 'hydrocarbons.xml')) + + +@pytest.fixture +def whitson_chemical_system(gaseous_species, oil_species, custom_hydrocarbon_db): + + editor = reaktoro.ChemicalEditor(custom_hydrocarbon_db) + + eos_params = reaktoro.CubicEOSParams( + model=reaktoro.CubicEOSModel.PengRobinson, + ) + + editor.addGaseousPhase(gaseous_species).setChemicalModelCubicEOS(eos_params) + editor.addLiquidPhase(oil_species).setChemicalModelCubicEOS(eos_params) + + system = reaktoro.ChemicalSystem(editor) + + return system + + +def test_composition_results( + composition, + whitson_chemical_system, + whitson_pvtlib_results, + num_regression +): + temperature = 280 # degF + + system = whitson_chemical_system + problem = reaktoro.EquilibriumProblem(system) + + problem.setTemperature(temperature, 'degF') + problem.setElementAmount('C1', composition[0]) + problem.setElementAmount('C4', composition[1]) + problem.setElementAmount('C10', composition[2]) + + options = reaktoro.EquilibriumOptions() + options.hessian = reaktoro.GibbsHessian.Exact # required change for this case + + solver = reaktoro.EquilibriumSolver(system) + solver.setOptions(options) + + # In this case, we should provide a better initial guess instead of the default. + state = reaktoro.ChemicalState(system) + state.setSpeciesAmounts(0.001) # start will all having 0.001 moles + state.setSpeciesAmount("C1(g)", composition[0]) # overwrite amount of C1(g) (same below) + state.setSpeciesAmount("C4(g)", composition[1]) + state.setSpeciesAmount("C10(g)", composition[2]) + + # Retrieve pvtlib solution + df_pvtlib_result = whitson_pvtlib_results + + df_pressures = df_pvtlib_result["P"].copy() + df_pressures.drop_duplicates(inplace=True) + + df_pvtlib_result_gas = df_pvtlib_result[df_pvtlib_result.phase_id == 1] + pvtlib_phase_fractions_gas = df_pvtlib_result_gas.F.values + pvtlib_pressure_values_gas = df_pvtlib_result_gas.P.values + + df_pvtlib_result_liq = df_pvtlib_result[df_pvtlib_result.phase_id == 0] + pvtlib_phase_fractions_liquid = df_pvtlib_result_liq.F.values + pvtlib_pressure_values_liquid = df_pvtlib_result_liq.P.values + + pressure_values = df_pressures.values + num_of_components = len(composition) + num_of_phases = 2 + phase_fractions_liquid = list() + phase_fractions_gas = list() + composition_liq = list() + composition_gas = list() + pressure_values_converged = list() + for P in pressure_values: + problem.setPressure(P, 'psi') + has_converged = solver.solve(state, problem) + assert has_converged + + molar_base = state.phaseAmount('Gaseous') + state.phaseAmount('Liquid') + + gas_phase_molar_fraction = state.phaseAmount('Gaseous') / molar_base + phase_fractions_gas.append(gas_phase_molar_fraction) + + liquid_phase_molar_fraction = state.phaseAmount('Liquid') / molar_base + phase_fractions_liquid.append(liquid_phase_molar_fraction) + + mixture_properties = state.properties() + x_gas = mixture_properties.moleFractions().val[0:num_of_components] + composition_gas.append(x_gas) + x_liq = mixture_properties.moleFractions().val[num_of_components:num_of_phases * num_of_components] + composition_liq.append(x_liq) + + pressure_values_converged.append(P) + + phase_fractions_gas = np.array(phase_fractions_gas) + phase_fractions_liquid = np.array(phase_fractions_liquid) + composition_gas = np.array(composition_gas) + composition_liq = np.array(composition_liq) + pressure_values_converged = np.array(pressure_values_converged) + + zero_threshold = 1e-5 + + # Phase fractions + reaktoro_phase_fractions_liquid = phase_fractions_liquid[phase_fractions_liquid > zero_threshold] + reaktoro_phase_fractions_gas = phase_fractions_gas[phase_fractions_gas > zero_threshold] + + assert_allclose(reaktoro_phase_fractions_liquid, pvtlib_phase_fractions_liquid, atol=1e-2) + assert_allclose(reaktoro_phase_fractions_gas, pvtlib_phase_fractions_gas, atol=1e-2) + + # Component molar fractions + n_points_gas_pvtlib = pvtlib_pressure_values_gas.shape[0] + reaktoro_c1_gas_composition = composition_gas[:n_points_gas_pvtlib, 0] + reaktoro_c4_gas_composition = composition_gas[:n_points_gas_pvtlib, 1] + reaktoro_c10_gas_composition = composition_gas[:n_points_gas_pvtlib, 2] + assert_allclose(reaktoro_c1_gas_composition, df_pvtlib_result_gas.x0, rtol=2e-3) + assert_allclose(reaktoro_c4_gas_composition, df_pvtlib_result_gas.x1, rtol=1e-3) + assert_allclose(reaktoro_c10_gas_composition, df_pvtlib_result_gas.x2, rtol=3e-3) + + n_points_liq_pvtlib = pvtlib_pressure_values_liquid.shape[0] + reaktoro_c1_liq_composition = composition_liq[-n_points_liq_pvtlib:, 0] + reaktoro_c4_liq_composition = composition_liq[-n_points_liq_pvtlib:, 1] + reaktoro_c10_liq_composition = composition_liq[-n_points_liq_pvtlib:, 2] + assert_allclose(reaktoro_c1_liq_composition, df_pvtlib_result_liq.x0, rtol=5e-3) + assert_allclose(reaktoro_c4_liq_composition, df_pvtlib_result_liq.x1, rtol=2e-3) + assert_allclose(reaktoro_c10_liq_composition, df_pvtlib_result_liq.x2, rtol=2e-3) + + molar_fractions = { + "liquid_phase": reaktoro_phase_fractions_liquid, + "gas_phase": reaktoro_phase_fractions_gas, + "C1(g)": reaktoro_c1_gas_composition, + "C4(g)": reaktoro_c4_gas_composition, + "C10(g)": reaktoro_c10_gas_composition, + "C1(liq)": reaktoro_c1_liq_composition, + "C4(liq)": reaktoro_c4_liq_composition, + "C10(liq)": reaktoro_c10_liq_composition, + } + num_regression.check(molar_fractions) + + if is_debug_plots_on: + import matplotlib.pyplot as plt + + plt.figure(figsize=(8, 6)) + plt.plot(pressure_values_converged, phase_fractions_liquid, "-x", label="Liquid (Reaktoro)") + plt.plot(pvtlib_pressure_values_liquid, pvtlib_phase_fractions_liquid, "-x", label="Liquid (pvtlib)") + + plt.plot(pressure_values_converged, phase_fractions_gas, "-o", label="Gas (Reaktoro)") + plt.plot(pvtlib_pressure_values_gas, pvtlib_phase_fractions_gas, "-o", label="Gas (pvtlib)") + + plt.xlabel("Pressure [psi]") + plt.ylabel("Phase molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degF") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_using_prev.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + plt.plot(pressure_values_converged, composition_gas[:, 0], "-x", label="C1(g) - Reaktoro") + plt.plot(pvtlib_pressure_values_gas, df_pvtlib_result_gas.x0, "-x", label="C1(g) - pvtlib") + plt.plot(pressure_values_converged, composition_gas[:, 1], "-x", label="C4(g) - Reaktoro") + plt.plot(pvtlib_pressure_values_gas, df_pvtlib_result_gas.x1, "-x", label="C4(g) - pvtlib") + plt.plot(pressure_values_converged, composition_gas[:, 2], "-x", label="C10(g) - Reaktoro") + plt.plot(pvtlib_pressure_values_gas, df_pvtlib_result_gas.x2, "-x", label="C10(g) - pvtlib") + + plt.ylim([0, 1]) + plt.grid(True) + + plt.xlabel("Pressure [bar]") + plt.ylabel("Molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True, ncol=3) + + # plt.savefig("reaktoro_pvtlib_compositions_whitson_gas.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + plt.plot(pressure_values_converged, composition_liq[:, 0], "-x", label="C1(liq) - Reaktoro") + plt.plot(pvtlib_pressure_values_liquid, df_pvtlib_result_liq.x0, "-x", label="C1(liq) - pvtlib") + plt.plot(pressure_values_converged, composition_liq[:, 1], "-x", label="C4(liq) - Reaktoro") + plt.plot(pvtlib_pressure_values_liquid, df_pvtlib_result_liq.x1, "-x", label="C4(liq) - pvtlib") + plt.plot(pressure_values_converged, composition_liq[:, 2], "-x", label="C10(liq) - Reaktoro") + plt.plot(pvtlib_pressure_values_liquid, df_pvtlib_result_liq.x2, "-x", label="C10(liq) - pvtlib") + + plt.ylim([0, 1]) + plt.grid(True) + + plt.xlabel("Pressure [bar]") + plt.ylabel("Molar fraction [mol / mol]") + plt.title(f"Fixed T = {temperature} degC") + plt.legend(shadow=True, ncol=3) + + # plt.savefig("reaktoro_pvtlib_compositions_whitson_liq.png", dpi=300) + plt.show() + + +def test_fugacities_result( + oil_species, + gaseous_species, + whitson_chemical_system, + whitson_pvtlib_results, + num_regression +): + temperature = 280 # degF + system = whitson_chemical_system + + state = reaktoro.ChemicalState(system) + state.setTemperature(temperature, 'degF') + + # Gathering pvtlib results + df_pvtlib_result = whitson_pvtlib_results + df_pvtlib_result_gas = df_pvtlib_result[df_pvtlib_result.phase_id == 1] + df_pvtlib_result_liq = df_pvtlib_result[df_pvtlib_result.phase_id == 0] + + # Properties' calculation loop for gas phase + activities_gas = list() + pvtlib_fugacities_gas = list() + for _, df_row in df_pvtlib_result_gas.iterrows(): + P = df_row.P + composition_0 = df_row.x0 + composition_1 = df_row.x1 + composition_2 = df_row.x2 + state.setPressure(P, 'psi') + state.setSpeciesAmount(gaseous_species[0], composition_0) + state.setSpeciesAmount(gaseous_species[1], composition_1) + state.setSpeciesAmount(gaseous_species[2], composition_2) + + fugacity_0 = df_row.fugacity_0 + fugacity_1 = df_row.fugacity_1 + fugacity_2 = df_row.fugacity_2 + fugacities = np.array([fugacity_0, fugacity_1, fugacity_2]) + + gas_properties = state.properties() + activities = np.exp(gas_properties.lnActivities().val) + activities_gas.append(activities) + pvtlib_fugacities_gas.append(fugacities) + + activities_gas = np.array(activities_gas) + pvtlib_fugacities_gas = np.array(pvtlib_fugacities_gas) + + reaktoro_c1_activity_gas = activities_gas[:, 0] + reaktoro_c4_activity_gas = activities_gas[:, 1] + reaktoro_c10_activity_gas = activities_gas[:, 2] + assert_allclose(reaktoro_c1_activity_gas, pvtlib_fugacities_gas[:, 0], rtol=2e-2) + assert_allclose(reaktoro_c4_activity_gas, pvtlib_fugacities_gas[:, 1], rtol=2e-2) + assert_allclose(reaktoro_c10_activity_gas, pvtlib_fugacities_gas[:, 2], rtol=2e-2) + + # Properties' calculation loop for liq phase + activities_liq = list() + pvtlib_fugacities_liq = list() + for _, df_row in df_pvtlib_result_liq.iterrows(): + P = df_row.P + composition_0 = df_row.x0 + composition_1 = df_row.x1 + composition_2 = df_row.x2 + state.setPressure(P, 'psi') + state.setSpeciesAmount(oil_species[0], composition_0) + state.setSpeciesAmount(oil_species[1], composition_1) + state.setSpeciesAmount(oil_species[2], composition_2) + + fugacity_0 = df_row.fugacity_0 + fugacity_1 = df_row.fugacity_1 + fugacity_2 = df_row.fugacity_2 + fugacities = np.array([fugacity_0, fugacity_1, fugacity_2]) + + gas_properties = state.properties() + activities = np.exp(gas_properties.lnActivities().val) + activities_liq.append(activities) + pvtlib_fugacities_liq.append(fugacities) + + activities_liq = np.array(activities_liq) + pvtlib_fugacities_liq = np.array(pvtlib_fugacities_liq) + + reaktoro_c1_activity_liq = activities_liq[:, 3] + reaktoro_c4_activity_liq = activities_liq[:, 4] + reaktoro_c10_activity_liq = activities_liq[:, 5] + assert_allclose(reaktoro_c1_activity_liq, pvtlib_fugacities_liq[:, 0], rtol=2e-2) + assert_allclose(reaktoro_c4_activity_liq, pvtlib_fugacities_liq[:, 1], rtol=2e-2) + assert_allclose(reaktoro_c10_activity_liq, pvtlib_fugacities_liq[:, 2], rtol=2e-2) + + components_activities = { + "c1_activities_liq": reaktoro_c1_activity_liq, + "c4_activities_liq": reaktoro_c4_activity_liq, + "c10_activities_liq": reaktoro_c10_activity_liq, + "c1_activities_gas": reaktoro_c1_activity_gas, + "c4_activities_gas": reaktoro_c4_activity_gas, + "c10_activities_gas": reaktoro_c10_activity_gas, + } + num_regression.check(components_activities) + + if is_debug_plots_on: + import matplotlib.pyplot as plt + + plt.figure(figsize=(8, 6)) + + pressure_values_gas = df_pvtlib_result_gas.P.values + plt.plot(pressure_values_gas, activities_gas[:, 0], "-x", label="C1(g) - Reaktoro") + plt.plot(pressure_values_gas, pvtlib_fugacities_gas[:, 0], "-o", label="C1(g) - pvtlib") + plt.plot(pressure_values_gas, activities_gas[:, 1], "-x", label="C4(g) - Reaktoro") + plt.plot(pressure_values_gas, pvtlib_fugacities_gas[:, 1], "-o", label="C4(g) - pvtlib") + plt.plot(pressure_values_gas, activities_gas[:, 2], "-x", label="C10(g) - Reaktoro") + plt.plot(pressure_values_gas, pvtlib_fugacities_gas[:, 2], "-o", label="C10(g) - pvtlib") + + plt.xlabel("Pressure [psi]") + plt.ylabel("Fugacities [psi]") + plt.title(f"Fixed T = {temperature} degF") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_fugacities_gas_whitson.png", dpi=300) + plt.show() + + plt.figure(figsize=(8, 6)) + + pressure_values_liq = df_pvtlib_result_liq.P.values + plt.plot(pressure_values_liq, activities_liq[:, 3], "-x", label="C1(liq) - Reaktoro") + plt.plot(pressure_values_liq, pvtlib_fugacities_liq[:, 0], "-o", label="C1(liq) - pvtlib") + plt.plot(pressure_values_liq, activities_liq[:, 4], "-x", label="C4(liq) - Reaktoro") + plt.plot(pressure_values_liq, pvtlib_fugacities_liq[:, 1], "-o", label="C4(liq) - pvtlib") + plt.plot(pressure_values_liq, activities_liq[:, 5], "-x", label="C10(liq) - Reaktoro") + plt.plot(pressure_values_liq, pvtlib_fugacities_liq[:, 2], "-o", label="C10(liq) - pvtlib") + + plt.xlabel("Pressure [psi]") + plt.ylabel("Fugacities [psi]") + plt.title(f"Fixed T = {temperature} degF") + plt.legend(shadow=True) + + plt.grid(True) + + # plt.savefig("reaktoro_pvtlib_fugacities_liq_whitson.png", dpi=300) + plt.show() diff --git a/tests/regression/test_whitson18/test_composition_results.csv b/tests/regression/test_whitson18/test_composition_results.csv new file mode 100644 index 000000000..82dd6464c --- /dev/null +++ b/tests/regression/test_whitson18/test_composition_results.csv @@ -0,0 +1,50 @@ +,liquid_phase,gas_phase,C1(g),C4(g),C10(g),C1(liq),C4(liq),C10(liq) +0,0.019903719415111761,1,0.50000000000000011,0.42000000000000004,0.080000000000000016,0.012742541516468519,0.1192315638833107,0.86802589460022084 +1,0.04466977982413689,0.98009628058488829,0.50989518675735523,0.4261079821237726,0.063996831118872152,0.018969422074514818,0.16891061494594076,0.81211996297954436 +2,0.060574767864030356,0.95533022017586311,0.52249225404033928,0.43174055557928237,0.045767190380378422,0.025356585356914364,0.21465021423495362,0.75999320040813212 +3,0.073035922302919568,0.93942523213596973,0.53060532512504854,0.43324109165703745,0.03615358321791394,0.031915318844943349,0.25660420877469292,0.71148047238036372 +4,0.083932243946893997,0.92696407769708045,0.53688060543722549,0.43287402888599891,0.030245365676775621,0.038655879535108156,0.29492650935502329,0.66641761110986852 +5,0.094084640170745415,0.91606775605310597,0.54226941403238282,0.43145952213549493,0.026271063832122295,0.0455871386671955,0.32977262333867841,0.62464023799412605 +6,0.10390380388192376,0.90591535982925464,0.54719344923737001,0.42937064392895463,0.023435906833675343,0.052716235080210651,0.3613009819909288,0.58598278292886063 +7,0.11361194462818663,0.89609619611807623,0.55186327627672516,0.42680624611698764,0.021330477606287201,0.0600482664936456,0.3896739248458343,0.55027780866052012 +8,0.12333329468059347,0.88638805537181342,0.55639039434622339,0.42388701579440852,0.019722589859368072,0.067586049891453004,0.4150582130119001,0.51735573709664684 +9,0.13313620833286208,0.87666670531940649,0.5608338799787157,0.4206952321414214,0.018470887879862966,0.075329979419537535,0.43762497659133032,0.48704504398913212 +10,0.14305500095253426,0.8668637916671379,0.56522242234156128,0.41729308966658718,0.017484487991851493,0.0832780023336087,0.4575490570173899,0.45917294064900127 +11,0.1531024659376562,0.85694499904746579,0.56956591827873604,0.41373170927730452,0.016702372443959338,0.091425721375142002,0.4750077750331787,0.43356650359167948 +12,0.16327774290957645,0.8468975340623438,0.57386221716352281,0.41005567301285406,0.016082109823623094,0.099766617611175057,0.4901792259170426,0.41005415647178228 +13,0.17357166556601833,0.83672225709042358,0.57810142823349153,0.40630524584499295,0.015593325921515565,0.10829237411408729,0.50324026046760362,0.38846736541830912 +14,0.18397059976295962,0.82642833443398167,0.58226889399489723,0.40251735807024736,0.015213747934855458,0.116993270645614,0.51436434134479248,0.36864238800959342 +15,0.19445926966024113,0.8160294002370404,0.58634735181368236,0.39872593258478761,0.014926715601530029,0.12585861455640657,0.52371946458112462,0.35042192086246871 +16,0.20502283403665053,0.80554073033975893,0.59031853737842088,0.39496189755235617,0.014719565069223067,0.13487717380030934,0.53146630832113073,0.33365651787855999 +17,0.21564837100870834,0.79497716596334944,0.59416436069357892,0.39125308825202798,0.014582551054393097,0.14403758331479255,0.53775672417623765,0.31820569250896985 +18,0.2263258871796919,0.78435162899129163,0.59786773235520407,0.38762415630272201,0.014508111342073922,0.15332870421229838,0.54273263266768357,0.30393866312001799 +19,0.2370489510477822,0.77367411282030807,0.60141309794232201,0.38409654722302394,0.014490354834654036,0.16273992426124981,0.54652533370496492,0.29073474203378519 +20,0.24781504258067275,0.76295104895221788,0.60478673211598566,0.38068856884472158,0.014524699039292745,0.17226139637918655,0.54925520311337817,0.27848340050743514 +21,0.2586257034619841,0.75218495741932723,0.60797684161389642,0.37741554873257255,0.014607609653531058,0.18188421832695975,0.55103171995842037,0.26708406171461985 +22,0.26948656335108323,0.74137429653801601,0.61097352336294575,0.37429006520953417,0.014736411427520071,0.19160056114579624,0.55195375643292499,0.2564456824212788 +23,0.28040730696159705,0.73051343664891677,0.61376861909271652,0.37132223097018158,0.014909149937101882,0.20140375627045684,0.55211005983913253,0.24648618389041071 +24,0.29140163621247328,0.7195926930384029,0.61635550135940786,0.36852000797060674,0.015124490669985334,0.21128835210804034,0.55157986134508097,0.23713178654687869 +25,0.30248727255569824,0.70859836378752672,0.61872881859284579,0.36588953510473521,0.015381646302419042,0.22125015070743606,0.5504335554854457,0.22831629380711835 +26,0.31368603795911426,0.69751272744430171,0.62088421948480166,0.36343545444239173,0.015680326072806589,0.23128623444093349,0.54873340522246428,0.21998036033660226 +27,0.32502404972752813,0.68631396204088568,0.62281807033713876,0.36116122639099929,0.016020703271861954,0.24139499176958604,0.54653423799462597,0.21207077023578805 +28,0.33653206503059202,0.67497595027247193,0.62452717318437756,0.3590694284061553,0.016403398409467165,0.25157615046395698,0.54388410749821892,0.20453974203782413 +29,0.34824601640838582,0.66346793496940804,0.62600848764615658,0.3571620355356438,0.016829476818199681,0.26183082632289084,0.5408249034596857,0.19734427021742337 +30,0.36020779077291187,0.65175398359161418,0.62725885541545212,0.35544068410461999,0.017300460479927834,0.27216159565774961,0.53739289721220507,0.19044550713004529 +31,0.37246632343255931,0.63979220922708813,0.62827472278928254,0.35390692236105215,0.017818354849665274,0.28257260077748753,0.5336192145219546,0.18380818470055782 +32,0.38507910873091733,0.62753367656744075,0.62905185335214298,0.3525624541207556,0.018385692527101344,0.29306969967111457,0.52953022890219981,0.17740007142668568 +33,0.39811427565916269,0.61492089126908267,0.62958501939268019,0.35140938367258051,0.019005596934739268,0.30366067442148054,0.52514786863214313,0.17119145694637633 +34,0.41165345000792852,0.60188572434083731,0.62986765630918506,0.35045047279791369,0.019681870892901156,0.31435551822265256,0.5204898287264621,0.16515465305088534 +35,0.42579574132954695,0.58834654999207148,0.62989145835835858,0.34968942422367999,0.020419117417961371,0.32516682926301382,0.51556967475699711,0.15926349597998904 +36,0.44066338384475318,0.5742042586704531,0.62964588544731548,0.34913121089348464,0.021222903659199766,0.33611035298438463,0.51039681779668866,0.15349282921892665 +37,0.45640988238448571,0.55933661615524688,0.62911753735603493,0.34878247826344683,0.022099984380518425,0.34720573552564338,0.50497632706208551,0.14781793741227114 +38,0.47323207747529433,0.54359011761551435,0.62828933054130787,0.34865205936781901,0.023058610090873222,0.35847758633413773,0.49930852569857559,0.14221388796728671 +39,0.4913885701401266,0.52676792252470572,0.62713937763602701,0.34875166316513989,0.024108959198833005,0.36995700804347204,0.49338827906237953,0.13665471289414835 +40,0.51122891147001737,0.5086114298598734,0.62563940981795796,0.34909683228423966,0.025263757897802358,0.38168385880140876,0.4872038207428192,0.13111232045577201 +41,0.53324194346695575,0.48877108852998263,0.62375247532788192,0.34970832986806227,0.026539194804055741,0.39371021267637918,0.48073484187317683,0.1255549454504441 +42,0.55814032194066532,0.46675805653304425,0.62142944716182835,0.35061423436979661,0.027956318468375024,0.40610588205886222,0.47394933189276639,0.11994478604837143 +43,0.58701867545720099,0.44185967805933474,0.61860347485466671,0.35185325802217932,0.029543267123153971,0.41896771749292888,0.4667981520730658,0.11423413043400522 +44,0.6216765432496496,0.41298132454279907,0.61518066391799997,0.35348031106687772,0.03133902501512232,0.43243639646756254,0.45920513612327712,0.10835846740916033 +45,0.66535960770824287,0.37832345675035034,0.61102327054822958,0.35557652038785892,0.033400209063911522,0.44672968861858203,0.45104737725360894,0.10222293412780917 +46,0.72476936636090938,0.33464039229175707,0.60591642341948482,0.35826904574083629,0.035814530839678782,0.46221762938426952,0.44211059677027298,0.095671773845457553 +47,0.81714215387192701,0.27523063363909062,0.59949293960745675,0.36177580090134159,0.038731259491201771,0.47963062567777814,0.43196557184854423,0.088403802473677559 +48,0.99999999999859224,0.18285784612807299,0.59102521307740885,0.36652910247132314,0.042445684451268124,0.5,0.41999999999999998,0.080000000000000002 diff --git a/tests/regression/test_whitson18/test_fugacities_result.csv b/tests/regression/test_whitson18/test_fugacities_result.csv new file mode 100644 index 000000000..83591d99b --- /dev/null +++ b/tests/regression/test_whitson18/test_fugacities_result.csv @@ -0,0 +1,50 @@ +,c1_activities_liq,c4_activities_liq,c10_activities_liq,c1_activities_gas,c4_activities_gas,c10_activities_gas +0,3.1846844532911187,2.4745353141952768,0.32354007163931253,1.7355393438036955,1.396849413352498,0.2455127254006137 +1,4.7186481931332116,3.5249412775189479,0.30878293456949163,3.1899453802646072,2.4752184442323291,0.32430514884010625 +2,6.2761428072926435,4.5044056506763992,0.29489402324979497,4.7261794090382736,3.5258066788938276,0.30947155783979502 +3,7.8585775535292735,5.4152148632726123,0.2818634477573011,6.2858103501988625,4.5053797211223463,0.29551359307948838 +4,9.4672308825803668,6.259753831461274,0.26967923546844186,7.8702449920882822,5.416232856349974,0.28242067194426135 +5,11.103204964849802,7.0405276650527044,0.25832685177838877,9.4807621654856042,6.2607609296100719,0.2701803745676658 +6,12.767378040838146,7.7601764236004795,0.24778880286229718,11.118464296139292,7.041477992621755,0.25877765213494447 +7,14.460350322295515,8.421480723120343,0.23804438169296288,12.784228336897124,7.7610320067262082,0.24819451751096724 +8,16.182416594398585,9.0273635620266468,0.22906940646404367,14.478659940995046,8.4222127450225113,0.23840982830278232 +9,17.933540941955439,9.5808783618478301,0.22083620354090902,16.202056268893831,9.0279504616497057,0.22939894765616675 +10,19.713330615635023,10.085183697330283,0.21331386550451301,17.954380511903963,9.5813042212211208,0.22113376160615988 +11,21.52106308174578,10.5435156722515,0.20646848094867637,19.73525071395872,10.085440126516421,0.21358297466810025 +12,23.355709122822024,10.959147849279118,0.20026366838860796,21.543947603645517,10.543598986763451,0.20671228842109513 +13,25.215941261938415,11.335342927945669,0.1946613895364504,23.379438542745003,10.959056821009465,0.20048494765651265 +14,27.100232372762523,11.675315698334176,0.18962241042431585,25.240413398624987,11.335082407720476,0.19486261386374185 +15,29.006859880322498,11.982183516263587,0.18510731776247905,27.125338132797147,11.674890732419765,0.18980572910383137 +16,30.934013842746058,12.258936350568122,0.18107696229626377,29.032505889408533,11.981603381010178,0.18527463635465552 +17,32.87980131339809,12.508401279687508,0.1774933351074586,30.960099826573241,12.258209436398236,0.18122991993371537 +18,34.842357940018239,12.733227997954909,0.17431977549137231,32.906242180438859,12.507539082336955,0.17763338646780605 +19,36.81979755206401,12.935867139621699,0.17152179181466701,34.869051968525284,12.732238588734093,0.17444813780950433 +20,38.810354227899637,13.118574512760755,0.16906682153014319,36.84667290828073,12.934763744946233,0.17163958165266649 +21,40.812312775023486,13.283404343602625,0.16692480788615352,38.837322850109231,13.117366801495365,0.16917497226784553 +22,42.824090833260655,13.432219833389736,0.1650679695097948,40.839303212216166,13.282104172481839,0.16702415998124784 +23,44.844201336781389,13.566699642851029,0.16347098610984201,42.851026332562867,13.430837377002428,0.16515924305913682 +24,46.871332980498032,13.688353781588729,0.1621105908537013,44.871016176210993,13.565246441757843,0.16355484309110843 +25,48.904206886091998,13.798529626976423,0.1609660763388665,46.897930706186195,13.686834307085,0.16218749640217361 +26,50.941710841446799,13.898432867486713,0.16001855418230679,48.930526269554917,13.796954540335932,0.16103654762726552 +27,52.982832972619093,13.989137971582659,0.15925106803784231,50.967687825312289,13.896811391211175,0.16008303487064277 +28,55.026694266239083,14.071602659709272,0.15864826501616736,53.008408301251819,13.987479694976667,0.15930997385246504 +29,57.072486935673382,14.146678683290157,0.15819646645311025,55.051794505268781,14.069913382063541,0.15870190226485048 +30,59.119504212302473,14.215124408752494,0.15788335791566593,57.097042775540096,14.144964251347432,0.15824511239916667 +31,61.167078934549266,14.277614734713749,0.15769806776807066,59.143442961323679,14.213389090043746,0.15792723039095863 +32,63.214662663385255,14.334751649612391,0.15763067580744775,61.190350033894511,14.275867201342995,0.15773746329762164 +33,65.261750413597795,14.387071978283235,0.15767237169806206,63.237209254449084,14.332998589004788,0.15766583270778495 +34,67.30793755071565,14.435054779370974,0.15781508655331461,65.283523417719593,14.385321248774169,0.15770354142515272 +35,69.352859429739311,14.479127067466615,0.15805164403058397,67.328873844013643,14.433309886917529,0.15784240232120758 +36,71.396118161081532,14.519674360024384,0.15837584704909957,69.372887501573516,14.477391128675755,0.15807524063920839 +37,73.437484569994623,14.557037374891012,0.15878173585109379,71.415208421047836,14.517956388447146,0.15839594966059301 +38,75.476668529084179,14.591526873585709,0.15926420595969595,73.455570532345263,14.555342677893661,0.15879852891249718 +39,77.513476212930357,14.623418590560933,0.1598184947384271,75.493712763818024,14.589862654000449,0.15927786025000634 +40,79.54771774310629,14.652962309861627,0.16044036124450939,77.529428549847864,14.621791551414425,0.15982918507307331 +41,81.579232896324939,14.680382869845184,0.16112597118372859,79.562533262110989,14.651379895706057,0.16044826214933897 +42,83.60789250744611,14.70588299094333,0.16187181837230447,81.592867750859583,14.678854122221047,0.16113129062578629 +43,85.63358255971805,14.729646247256984,0.16267473932498697,83.620302418333992,14.704417757362606,0.16187476552506358 +44,87.656216588052274,14.751837808906945,0.16353183962303494,85.644724277651804,14.728256403959618,0.16267554959860711 +45,89.675722432139281,14.772607218627755,0.1644404888905813,87.666041628513582,14.75053794836893,0.16353078836399706 +46,91.692051620916956,14.792088606794572,0.16539826199829771,89.684174346840194,14.771416404714154,0.1644379148063469 +47,93.705181050198874,14.81040061180911,0.16640291864102782,91.699055844655533,14.791032677745628,0.16539458117331707 +48,95.706091918156346,14.829835823552445,0.16742123138719267,93.710617928557824,14.809518965359482,0.16639870335390353 diff --git a/Reaktoro/Thermodynamics/Core/ChemicalEditor-test.py b/tests/test_chemicaleditor.py similarity index 100% rename from Reaktoro/Thermodynamics/Core/ChemicalEditor-test.py rename to tests/test_chemicaleditor.py diff --git a/Reaktoro/Thermodynamics/Core/Database-test.py b/tests/test_database.py similarity index 99% rename from Reaktoro/Thermodynamics/Core/Database-test.py rename to tests/test_database.py index 4c3986d56..bf6f301d9 100644 --- a/Reaktoro/Thermodynamics/Core/Database-test.py +++ b/tests/test_database.py @@ -28,7 +28,7 @@ def get_test_data_dir(): - return Path(os.path.abspath(__file__)).parents[3] / "tests/data" + return Path(os.path.abspath(__file__)).parents[0] / "data" LANGUAGES = { diff --git a/Reaktoro/Thermodynamics/Species/FluidSpecies-test.py b/tests/test_fluidspecies.py similarity index 100% rename from Reaktoro/Thermodynamics/Species/FluidSpecies-test.py rename to tests/test_fluidspecies.py diff --git a/tests/test_oil_equilibrium.py b/tests/test_oil_equilibrium.py index db253e7f1..1c8fba0fa 100644 --- a/tests/test_oil_equilibrium.py +++ b/tests/test_oil_equilibrium.py @@ -56,12 +56,7 @@ def test_ternary_c1_c4_c10_bips_setup(): editor.addLiquidPhase(oil_species).setChemicalModelCubicEOS(eos_params) def calculate_bips(T): - zero = 0.0 - k = [ - [zero, zero, zero], - [zero, zero, zero], - [zero, zero, zero] - ] + k = np.zeros((3, 3)) bips = reaktoro.BinaryInteractionParams(k) return bips @@ -169,8 +164,7 @@ def calculate_bips(T): [ # psi, degF, [mol / mol], [mol / mol], [mol / mol] (500, 280, [0.853401, 1 - 0.853401], [0.08588, 0.46349, 0.45064], [0.57114, 0.41253, 0.01633]), - # The case below is currently failing. Modifications in the Cubic EOS fugacities is required. - # (1500, 280, [0.566844, 1 - 0.566844], [0.330082, 0.513307, 0.156611], [0.629843, 0.348699, 0.021457]), + (1500, 280, [0.566844, 1 - 0.566844], [0.330082, 0.513307, 0.156611], [0.629843, 0.348699, 0.021457]), ] ) def test_ternary_c1_c4_c10_mixture(P, T, F_expected, x_expected, y_expected): @@ -197,7 +191,6 @@ def test_ternary_c1_c4_c10_mixture(P, T, F_expected, x_expected, y_expected): eos_params = reaktoro.CubicEOSParams( model=reaktoro.CubicEOSModel.PengRobinson, - phase_identification_method=reaktoro.PhaseIdentificationMethod.GibbsEnergyAndEquationOfStateMethod, ) editor.addGaseousPhase(gaseous_species).setChemicalModelCubicEOS(eos_params) @@ -280,12 +273,8 @@ def test_equilibrium_CH4_CO2_pedersen(): editor = reaktoro.ChemicalEditor(db) def calculate_bips(T): - k_00 = k_11 = 0.0 - k_01 = k_10 = 0.12 - k = [ - [k_00, k_01], - [k_10, k_11], - ] + k = np.zeros((2, 2)) + k[0, 1] = k[1, 0] = 0.12 bips = reaktoro.BinaryInteractionParams(k) return bips diff --git a/Reaktoro/Thermodynamics/Species/ThermoData-test.py b/tests/test_thermodata.py similarity index 100% rename from Reaktoro/Thermodynamics/Species/ThermoData-test.py rename to tests/test_thermodata.py