7#ifndef MIXTURE_BINARY_PAIRS_H
8#define MIXTURE_BINARY_PAIRS_H
17using STLMatrix = std::vector<std::vector<CoolPropDbl>>;
48 static shared_ptr<ReducingFunction>
factory(
const std::vector<CoolPropFluid*>& components,
STLMatrix& F);
164 this->
N = pFluids.size();
165 T_c.resize(
N, std::vector<CoolPropDbl>(
N, 0));
166 v_c.resize(
N, std::vector<CoolPropDbl>(
N, 0));
169 for (std::size_t i = 0; i <
N; ++i) {
170 for (std::size_t j = 0; j <
N; j++) {
172 v_c[i][j] = 1.0 / 8.0 * pow(pow(
pFluids[i].EOS().reduce.rhomolar, -1.0 / 3.0) + pow(
pFluids[j].EOS().reduce.rhomolar, -1.0 / 3.0), 3);
191 throw ValueError(
format(
"Both indices i [%d] and j [%d] are out of bounds. Must be between 0 and %d.", i, j,
N - 1));
193 throw ValueError(
format(
"Index i [%d] is out of bounds. Must be between 0 and %d.", i,
N - 1));
196 throw ValueError(
format(
"Index j [%d] is out of bounds. Must be between 0 and %d.", j,
N - 1));
213 throw ValueError(
format(
"Both indices i [%d] and j [%d] are out of bounds. Must be between 0 and %d.", i, j,
N - 1));
215 throw ValueError(
format(
"Index i [%d] is out of bounds. Must be between 0 and %d.", i,
N - 1));
218 throw ValueError(
format(
"Index j [%d] is out of bounds. Must be between 0 and %d.", j,
N - 1));
220 if (parameter ==
"betaT") {
223 }
else if (parameter ==
"gammaT") {
226 }
else if (parameter ==
"betaV") {
229 }
else if (parameter ==
"gammaV") {
233 throw KeyError(
format(
"This key [%s] is invalid to set_binary_interaction_double", parameter.c_str()));
238 if (parameter ==
"betaT") {
240 }
else if (parameter ==
"gammaT") {
242 }
else if (parameter ==
"betaV") {
244 }
else if (parameter ==
"gammaV") {
247 throw KeyError(
format(
"This key [%s] is invalid to get_binary_interaction_double", parameter.c_str()));
254 CoolPropDbl Tr(
const std::vector<CoolPropDbl>& x)
const override;
385 const std::vector<CoolPropDbl>& Yc)
const;
394 const std::vector<CoolPropDbl>& Yc)
const;
399 const std::vector<CoolPropDbl>& Yc)
const;
549 double T_c, rhomolar_c;
701 gamma_T = (pFluids[i].EOS().reduce.T + pFluids[j].EOS().reduce.T + xi_ij) / (2 * sqrt(pFluids[i].EOS().reduce.T * pFluids[j].EOS().reduce.T));
702 CoolPropDbl v_i = 1 / pFluids[i].EOS().reduce.rhomolar;
703 CoolPropDbl v_j = 1 / pFluids[j].EOS().reduce.rhomolar;
705 gamma_v = (v_i + v_j + zeta_ij) / (0.25 * pow(pow(v_i, one_third) + pow(v_j, one_third), 3));