Added critical point values for REFPROP to close https://github.com/CoolProp/CoolProp/issues/117

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-26 13:14:17 +02:00
parent 289c1b3b61
commit 12d62b076b
2 changed files with 32 additions and 0 deletions

View File

@@ -631,6 +631,34 @@ long double REFPROPMixtureBackend::calc_Tmax(void){
limits(Tmin, Tmax, rhomolarmax, pmax);
return static_cast<long double>(Tmax);
};
long double REFPROPMixtureBackend::calc_T_critical(){
long ierr;
char herr[255];
double Tcrit, pcrit_kPa, dcrit_mol_L;
CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());}
return static_cast<long double>(Tcrit);
};
long double REFPROPMixtureBackend::calc_p_critical(){
long ierr;
char herr[255];
double Tcrit, pcrit_kPa, dcrit_mol_L;
CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());}
return static_cast<long double>(pcrit_kPa*1000);
};
long double REFPROPMixtureBackend::calc_rhomolar_critical(){
long ierr;
char herr[255];
double Tcrit, pcrit_kPa, dcrit_mol_L;
CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());}
return static_cast<long double>(dcrit_mol_L*1000);
};
long double REFPROPMixtureBackend::calc_Ttriple(){
if (mole_fractions.size() != 1){throw ValueError("calc_Ttriple cannot be evaluated for mixtures");}
long icomp = 0;
double wmm, ttrp, tnbpt, tc, pc, Dc, Zc, acf, dip, Rgas;
INFOdll(&icomp, &wmm, &ttrp, &tnbpt, &tc, &pc, &Dc, &Zc, &acf, &dip, &Rgas);
return static_cast<long double>(ttrp);
};
double REFPROPMixtureBackend::calc_melt_Tmax()
{

View File

@@ -95,6 +95,10 @@ public:
long double calc_melting_line(int param, int given, long double value);
bool has_melting_line(){return true;};
double calc_melt_Tmax();
long double calc_T_critical(void);
long double calc_p_critical(void);
long double calc_rhomolar_critical(void);
long double calc_Ttriple(void);
/// A wrapper function to calculate the limits for the EOS
void limits(double &Tmin, double &Tmax, double &rhomolarmax, double &pmax);