Add access to conformal state in AbstractState; closes #799

This commit is contained in:
Ian Bell
2015-08-29 17:27:57 -06:00
parent 70c2209cb0
commit eb1c140ca9
6 changed files with 48 additions and 0 deletions

View File

@@ -653,6 +653,31 @@ CoolPropDbl HelmholtzEOSMixtureBackend::calc_conductivity(void)
return summer;
}
}
void HelmholtzEOSMixtureBackend::calc_conformal_state(const std::string &reference_fluid, CoolPropDbl &T, CoolPropDbl &rhomolar){
shared_ptr<CoolProp::HelmholtzEOSMixtureBackend> REF(new CoolProp::HelmholtzEOSBackend(reference_fluid));
if (T < 0 && rhomolar < 0){
// Collect some parameters
CoolPropDbl Tc = T_critical(),
Tc0 = REF->T_critical(),
rhocmolar = rhomolar_critical(),
rhocmolar0 = REF->rhomolar_critical();
// Starting guess values for shape factors
CoolPropDbl theta = 1;
CoolPropDbl phi = 1;
// The equivalent substance reducing ratios
CoolPropDbl f = Tc/Tc0*theta;
CoolPropDbl h = rhocmolar0/rhocmolar*phi; // Must be the ratio of MOLAR densities!!
// Starting guesses for conformal state
T = this->T()/f;
rhomolar = this->rhomolar()*h;
}
TransportRoutines::conformal_state_solver(*this, *REF, T, rhomolar);
}
CoolPropDbl HelmholtzEOSMixtureBackend::calc_Ttriple(void)
{
double summer = 0;

View File

@@ -118,6 +118,9 @@ public:
const CoolProp::PhaseEnvelopeData &calc_phase_envelope_data(){return PhaseEnvelope;};
/// Calculate the conformal state (unity shape factors starting point if T < 0 and rhomolar < 0)
void calc_conformal_state(const std::string &reference_fluid, CoolPropDbl &T, CoolPropDbl &rhomolar);
void resize(std::size_t N);
shared_ptr<HelmholtzEOSMixtureBackend> SatL, SatV; ///<