2#ifndef HELMHOLTZEOSMIXTUREBACKEND_H_
3#define HELMHOLTZEOSMIXTUREBACKEND_H_
20class ResidualHelmholtz;
25 std::vector<CoolPropDbl> mole_fractions;
27 bool verify_mole_fractions_set(T i)
const {
28 if (i >= mole_fractions.size()){
36 return mole_fractions.resize(N);
39 return mole_fractions.size();
42 mole_fractions.clear();
47 mole_fractions = values;
52 verify_mole_fractions_set(i);
53 return mole_fractions[i];
55 operator std::vector<CoolPropDbl>& () {
return mole_fractions; }
64 std::vector<shared_ptr<HelmholtzEOSMixtureBackend>>
72 bool sat_states =
false;
80 bool sat_states =
true;
88 bool sat_states =
true;
97 std::vector<CoolPropDbl>
K,
133 for (std::vector<CoolPropFluid>::iterator it =
components.begin(); it !=
components.end(); ++it) {
134 (*it).EOS().alphar.clear();
135 (*it).EOS().alpha0.clear();
191 virtual void set_cubic_alpha_C(
const size_t i,
const std::string& parameter,
const double c1,
const double c2,
const double c3) {
192 throw ValueError(
"set_cubic_alpha_C only defined for cubic backends");
197 throw ValueError(
"set_fluid_parameter_double only defined for cubic backends");
236 bool find_critical_points =
true;
269 void calc_change_EOS(
const std::size_t i,
const std::string& EOS_name);
321 return SatL->get_mole_fractions();
324 return SatV->get_mole_fractions();
399 void calc_ideal_curve(
const std::string& type, std::vector<double>&
T, std::vector<double>&
p);
645 bool cache_values =
false) {
647 std::size_t N = x.size();
648 for (std::size_t i = 0; i < N; ++i) {
650 summer = summer + derivs * x[i];
658 std::size_t N = x.size();
659 if (i == N - 1)
return 0;
669 std::size_t N = x.size();
670 if (i == N - 1)
return 0;
680 std::size_t N = x.size();
681 if (i == N - 1)
return 0;
692 std::size_t N = x.size();
693 if (i == N - 1)
return 0;
704 std::size_t N = x.size();
705 if (i == N - 1)
return 0;
716 std::size_t N = x.size();
717 if (i == N - 1)
return 0;
814 bool cache_values =
false) {
816 a.delta_x_dalphar_ddelta = delta * a.dalphar_ddelta;
817 a.tau_x_dalphar_dtau = tau * a.dalphar_dtau;
819 a.delta2_x_d2alphar_ddelta2 =
POW2(delta) * a.d2alphar_ddelta2;
820 a.deltatau_x_d2alphar_ddelta_dtau = delta * tau * a.d2alphar_ddelta_dtau;
821 a.tau2_x_d2alphar_dtau2 =
POW2(tau) * a.d2alphar_dtau2;