2 #ifndef HELMHOLTZEOSMIXTUREBACKEND_H_
3 #define HELMHOLTZEOSMIXTUREBACKEND_H_
20 class 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,
131 for (std::vector<CoolPropFluid>::iterator it =
components.begin(); it !=
components.end(); ++it) {
132 (*it).EOS().alphar.clear();
133 (*it).EOS().alpha0.clear();
189 virtual void set_cubic_alpha_C(
const size_t i,
const std::string& parameter,
const double c1,
const double c2,
const double c3) {
190 throw ValueError(
"set_cubic_alpha_C only defined for cubic backends");
195 throw ValueError(
"set_fluid_parameter_double only defined for cubic backends");
233 bool find_critical_points =
true;
266 void calc_change_EOS(
const std::size_t i,
const std::string& EOS_name);
318 return SatL->get_mole_fractions();
321 return SatV->get_mole_fractions();
334 shared_ptr<HelmholtzEOSMixtureBackend>
SatL,
SatV;
394 void calc_ideal_curve(
const std::string& type, std::vector<double>&
T, std::vector<double>&
p);
640 bool cache_values =
false) {
642 std::size_t N = x.size();
643 for (std::size_t i = 0; i < N; ++i) {
645 summer = summer + derivs * x[i];
653 std::size_t N = x.size();
654 if (i == N - 1)
return 0;
664 std::size_t N = x.size();
665 if (i == N - 1)
return 0;
675 std::size_t N = x.size();
676 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;
808 bool cache_values =
false) {
810 a.delta_x_dalphar_ddelta = delta * a.dalphar_ddelta;
811 a.tau_x_dalphar_dtau = tau * a.dalphar_dtau;
813 a.delta2_x_d2alphar_ddelta2 =
POW2(delta) * a.d2alphar_ddelta2;
814 a.deltatau_x_d2alphar_ddelta_dtau = delta * tau * a.d2alphar_ddelta_dtau;
815 a.tau2_x_d2alphar_dtau2 =
POW2(tau) * a.d2alphar_dtau2;