2#ifndef HELMHOLTZEOSMIXTUREBACKEND_H_
3#define HELMHOLTZEOSMIXTUREBACKEND_H_
20class ResidualHelmholtz;
26 std::vector<CoolPropDbl> mole_fractions;
28 bool verify_mole_fractions_set(T i)
const {
29 if (i >= mole_fractions.size()) {
38 return mole_fractions.resize(N);
41 return mole_fractions.size();
44 mole_fractions.clear();
49 mole_fractions = values;
54 verify_mole_fractions_set(i);
55 return mole_fractions[i];
57 operator std::vector<CoolPropDbl>&() {
58 return mole_fractions;
68 std::vector<shared_ptr<HelmholtzEOSMixtureBackend>>
76 bool sat_states =
false;
84 bool sat_states =
true;
92 bool sat_states =
true;
101 std::vector<CoolPropDbl>
K,
137 for (std::vector<CoolPropFluid>::iterator it =
components.begin(); it !=
components.end(); ++it) {
138 (*it).EOS().alphar.clear();
139 (*it).EOS().alpha0.clear();
195 virtual void set_cubic_alpha_C(
const size_t i,
const std::string& parameter,
const double c1,
const double c2,
const double c3) {
196 throw ValueError(
"set_cubic_alpha_C only defined for cubic backends");
201 throw ValueError(
"set_fluid_parameter_double only defined for cubic backends");
240 bool find_critical_points =
true;
273 void calc_change_EOS(
const std::size_t i,
const std::string& EOS_name);
325 return SatL->get_mole_fractions();
328 return SatV->get_mole_fractions();
403 void calc_ideal_curve(
const std::string& type, std::vector<double>&
T, std::vector<double>&
p);
652 bool cache_values =
false) {
654 std::size_t N = x.size();
655 for (std::size_t i = 0; i < N; ++i) {
657 summer = summer + derivs * x[i];
665 std::size_t N = x.size();
666 if (i == N - 1)
return 0;
676 std::size_t N = x.size();
677 if (i == N - 1)
return 0;
687 std::size_t N = x.size();
688 if (i == N - 1)
return 0;
699 std::size_t N = x.size();
700 if (i == N - 1)
return 0;
711 std::size_t N = x.size();
712 if (i == N - 1)
return 0;
723 std::size_t N = x.size();
724 if (i == N - 1)
return 0;
821 bool cache_values =
false) {
823 a.delta_x_dalphar_ddelta = delta * a.dalphar_ddelta;
824 a.tau_x_dalphar_dtau = tau * a.dalphar_dtau;
826 a.delta2_x_d2alphar_ddelta2 =
POW2(delta) * a.d2alphar_ddelta2;
827 a.deltatau_x_d2alphar_ddelta_dtau = delta * tau * a.d2alphar_ddelta_dtau;
828 a.tau2_x_d2alphar_dtau2 =
POW2(tau) * a.d2alphar_dtau2;