mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-09 13:25:12 -05:00
Implemented conductivity for CO2 from Scalabrin. All CO2 tests pass now.
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -270,6 +270,12 @@ protected:
|
||||
if (!target.compare("Ethane")){
|
||||
fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE; return;
|
||||
}
|
||||
else if (!target.compare("Ethane")){
|
||||
fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE; return;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("hardcoded dilute viscosity [%s] is not understood for fluid %s",target.c_str(),fluid.name.c_str()));
|
||||
}
|
||||
}
|
||||
std::string type = cpjson::get_string(dilute, "type");
|
||||
if (!type.compare("collision_integral")){
|
||||
@@ -528,6 +534,9 @@ protected:
|
||||
else if (!target.compare("Ethane")){
|
||||
fluid.transport.conductivity_dilute.type = CoolProp::ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_ETHANE; return;
|
||||
}
|
||||
else if (!target.compare("none")){
|
||||
fluid.transport.conductivity_dilute.type = CoolProp::ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_NONE; return;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("hardcoded dilute conductivity term [%s] is not understood for fluid %s",target.c_str(), fluid.name.c_str()));
|
||||
}
|
||||
@@ -619,6 +628,9 @@ protected:
|
||||
else if (!target.compare("Ammonia")){
|
||||
fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_AMMONIA; return;
|
||||
}
|
||||
else if (!target.compare("CarbonDioxideScalabrinJPCRD2006")){
|
||||
fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_CARBONDIOXIDE_SCALABRIN_JPCRD_2006; return;
|
||||
}
|
||||
else if (!target.compare("None")){
|
||||
fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_NONE; return;
|
||||
}
|
||||
|
||||
@@ -299,6 +299,8 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void)
|
||||
lambda_dilute = TransportRoutines::conductivity_dilute_hardcoded_CO2(*this); break;
|
||||
case ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_ETHANE:
|
||||
lambda_dilute = TransportRoutines::conductivity_dilute_hardcoded_ethane(*this); break;
|
||||
case ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_NONE:
|
||||
lambda_dilute = 0.0; break;
|
||||
default:
|
||||
throw ValueError(format("dilute conductivity type [%d] is invalid for fluid %s", components[0]->transport.conductivity_dilute.type, name().c_str()));
|
||||
}
|
||||
@@ -317,6 +319,8 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void)
|
||||
lambda_critical = TransportRoutines::conductivity_critical_hardcoded_ammonia(*this); break;
|
||||
case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_NONE:
|
||||
lambda_critical = 0.0; break;
|
||||
case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_CARBONDIOXIDE_SCALABRIN_JPCRD_2006:
|
||||
lambda_critical = TransportRoutines::conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(*this); break;
|
||||
default:
|
||||
throw ValueError(format("critical conductivity type [%d] is invalid for fluid %s", components[0]->transport.viscosity_dilute.type, name().c_str()));
|
||||
}
|
||||
|
||||
@@ -569,6 +569,20 @@ long double TransportRoutines::conductivity_critical_hardcoded_R123(HelmholtzEOS
|
||||
return a13*exp(a14*pow(HEOS.tau()-1,4)+a15*pow(HEOS.delta()-1,2));
|
||||
};
|
||||
|
||||
long double TransportRoutines::conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(HelmholtzEOSMixtureBackend &HEOS){
|
||||
long double nc = 0.775547504e-3*4.81384, Tr = HEOS.T()/304.1282, alpha, rhor = HEOS.keyed_output(iDmass)/467.6;
|
||||
static long double a[] = {0.0, 3.0, 6.70697, 0.94604, 0.30, 0.30, 0.39751, 0.33791, 0.77963, 0.79857, 0.90, 0.02, 0.20};
|
||||
|
||||
// Equation 6 from Scalabrin
|
||||
alpha = 1-a[10]*acosh(1+a[11]*pow(pow(1-Tr,2),a[12]));
|
||||
|
||||
// Equation 5 from Scalabrin
|
||||
long double numer = rhor*exp(-pow(rhor,a[1])/a[1]-pow(a[2]*(Tr-1),2)-pow(a[3]*(rhor-1),2));
|
||||
long double braced = (1-1/Tr)+a[4]*pow(pow(rhor-1,2),0.5/a[5]);
|
||||
long double denom = pow(pow(pow(braced, 2), a[6]) + pow(pow(a[7]*(rhor-alpha), 2), a[8]),a[9]);
|
||||
return nc*numer/denom;
|
||||
}
|
||||
|
||||
long double TransportRoutines::conductivity_dilute_hardcoded_CO2(HelmholtzEOSMixtureBackend &HEOS){
|
||||
|
||||
double e_k = 251.196, Tstar;
|
||||
@@ -938,4 +952,6 @@ long double TransportRoutines::conductivity_ECS(HelmholtzEOSMixtureBackend &HEOS
|
||||
|
||||
return lambda;
|
||||
}
|
||||
|
||||
|
||||
}; /* namespace CoolProp */
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
*/
|
||||
static long double conductivity_critical_simplified_Olchowy_Sengers(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
static long double conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double conductivity_critical_hardcoded_R123(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double conductivity_dilute_hardcoded_CO2(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double conductivity_dilute_hardcoded_ethane(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
namespace CoolProp {
|
||||
|
||||
|
||||
class REFPROPMixtureBackend : public AbstractState {
|
||||
protected:
|
||||
int Ncomp;
|
||||
|
||||
Reference in New Issue
Block a user