mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Copy k_ij matrix in one shot
This commit is contained in:
@@ -460,13 +460,7 @@ double CoolProp::AbstractCubicBackend::get_binary_interaction_double(const std::
|
||||
};
|
||||
|
||||
void CoolProp::AbstractCubicBackend::copy_k(AbstractCubicBackend *donor){
|
||||
std::size_t N = mole_fractions.size();
|
||||
for (std::size_t i = 0; i < N; ++i){
|
||||
for (std::size_t j = i+1; j < N; ++j){
|
||||
double val = donor->get_binary_interaction_double(i, j, "kij");
|
||||
this->set_binary_interaction_double(i, j, "kij", val);
|
||||
}
|
||||
}
|
||||
get_cubic()->set_kmat(donor->get_cubic()->get_kmat());
|
||||
for (std::vector<shared_ptr<HelmholtzEOSMixtureBackend> >::iterator it = linked_states.begin(); it != linked_states.end(); ++it) {
|
||||
AbstractCubicBackend *ACB = static_cast<AbstractCubicBackend *>(it->get());
|
||||
ACB->copy_k(this);
|
||||
|
||||
@@ -60,6 +60,10 @@ public:
|
||||
/// If no Mathias-Copeman coefficients are passed in (all empty vectors), use the predictive scheme for m_ii
|
||||
simple_aii = (C1.empty() && C2.empty() && C3.empty() && L_Twu.empty() && M_Twu.empty() && N_Twu.empty());
|
||||
};
|
||||
/// Get the entire kij matrix in one shot
|
||||
const std::vector< std::vector<double> > & get_kmat(){return k;};
|
||||
/// Set the entire kij matrix in one shot
|
||||
void set_kmat(const std::vector< std::vector<double> > &k){ this->k = k; };
|
||||
/// Set the kij factor for the ij pair
|
||||
void set_kij(std::size_t i, std::size_t j, double val){ k[i][j] = val; k[j][i] = val;}
|
||||
/// Get the kij factor for the ij pair
|
||||
|
||||
Reference in New Issue
Block a user