Mathias copeman (#1116)

* Add ability to set Mathias-Copeman constants in cubic backends

* Add some docs
This commit is contained in:
Ian Bell
2016-06-08 10:41:27 -06:00
committed by Ian Bell
parent c16a4b64f5
commit 4bb21ac03c
3 changed files with 21 additions and 0 deletions

View File

@@ -358,3 +358,19 @@ void CoolProp::AbstractCubicBackend::copy_k(AbstractCubicBackend *donor){
}
}
}
void CoolProp::AbstractCubicBackend::set_C_MC(double c1, double c2, double c3)
{
get_cubic()->set_C_MC(c1, c2, c3);
if (SatL.get() != NULL){
/// Cast to this type so that we can access its internal methods
CoolProp::AbstractCubicBackend* _SatL = static_cast<CoolProp::AbstractCubicBackend*>(this->SatL.get());
_SatL->get_cubic()->set_C_MC(c1, c2, c3);
}
if (SatV.get() != NULL){
/// Cast to this type so that we can access its internal methods
CoolProp::AbstractCubicBackend* _SatV = static_cast<CoolProp::AbstractCubicBackend*>(this->SatV.get());
_SatV->get_cubic()->set_C_MC(c1, c2, c3);
}
}

View File

@@ -171,6 +171,10 @@ public:
// Copy the entire kij matrix from another instance in one shot
void copy_k(AbstractCubicBackend *donor);
// Set the Mathias-Copeman constants c1,c2,c3 for a pure fluid
void set_C_MC(double c1, double c2, double c3);
};

View File

@@ -95,6 +95,7 @@ public:
void set_C_MC(double c1, double c2, double c3){
C1.resize(1); C2.resize(1); C3.resize(1);
C1[0] = c1, C2[0] = c2; C3[0] = c3;
simple_aii = false;
}
/// Get the leading constant in the expression for the pure fluid attractive energy term