Added treatment of Olchowy-Sengers critical region term

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-05-24 13:30:49 +02:00
parent 5999c9d4f7
commit ba8afe5e7f
4 changed files with 92 additions and 25 deletions

View File

@@ -74,9 +74,19 @@ struct ConductivityResidualVariables
ConductivityResidualVariables(){type = CONDUCTIVITY_RESIDUAL_NOT_SET;}
};
struct ConductivityCriticalSimplifiedOlchowySengers{
long double T_reducing, p_reducing;
std::vector<long double> B, t, d;
struct ConductivityCriticalSimplifiedOlchowySengersData{
long double T_reducing, p_reducing, k, R0, gamma, nu, qD, zeta0, GAMMA;
ConductivityCriticalSimplifiedOlchowySengersData(){
// Universal constants - can still be adjusted if need be
k = 1.3806488e-23; //[J/K]
R0 = 1.03; //[-]
gamma = 1.239; //[-]
nu = 0.63; //[-]
// Suggested default values - can be over-written
GAMMA = 0.0496; //[-]
zeta0 = 1.94e-10; //[m]
qD = 1e9; //[m]
}
};
struct ConductivityCriticalVariables
{
@@ -84,9 +94,9 @@ struct ConductivityCriticalVariables
CONDUCTIVITY_CRITICAL_NOT_SET
};
int type;
ConductivityCriticalSimplifiedOlchowySengers Olchowy_Sengers;
ConductivityCriticalSimplifiedOlchowySengersData Olchowy_Sengers;
ConductivityCriticalVariables(){type = CONDUCTIVITY_CRITICAL_NOT_SET;}
ConductivityCriticalVariables(){type = CONDUCTIVITY_CRITICAL_NOT_SET; }
};
/// Variables for the dilute gas part

View File

@@ -547,10 +547,17 @@ protected:
std::string type = cpjson::get_string(critical, "type");
if (!type.compare("simplified_Olchowy_Sengers")){
//// Get a reference to the entry in the fluid instance
//CoolProp::ConductivityResidualPolynomialData &data = fluid.transport.conductivity_residual.polynomials;
CoolProp::ConductivityCriticalSimplifiedOlchowySengersData &data = fluid.transport.conductivity_critical.Olchowy_Sengers;
// Set the type flag
fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_SIMPLIFIED_OLCHOWY_SENGERS;
// Set values if they are found - otherwise fall back to default values
if (critical.HasMember("qD")){ data.qD = cpjson::get_double(critical,"qD"); }
if (critical.HasMember("zeta0")){ data.zeta0 = cpjson::get_double(critical,"zeta0"); }
if (critical.HasMember("GAMMA")){ data.GAMMA = cpjson::get_double(critical,"GAMMA"); }
if (critical.HasMember("gamma")){ data.gamma = cpjson::get_double(critical,"gamma"); }
if (critical.HasMember("R0")){ data.R0 = cpjson::get_double(critical,"R0"); }
}
else{
throw ValueError(format("type [%s] is not understood for fluid %s",type.c_str(),fluid.name.c_str()));

View File

@@ -489,7 +489,50 @@ long double TransportRoutines::conductivity_residual_polynomial(HelmholtzEOSMixt
long double TransportRoutines::conductivity_critical_simplified_Olchowy_Sengers(HelmholtzEOSMixtureBackend &HEOS){
if (HEOS.is_pure_or_pseudopure)
{
return 0;
// Olchowy and Sengers cross-over term
// Retrieve values from the state class
CoolProp::ConductivityCriticalSimplifiedOlchowySengersData &data = HEOS.components[0]->transport.conductivity_critical.Olchowy_Sengers;
double k = data.k,
R0 = data.R0,
nu = data.nu,
gamma = data.gamma,
GAMMA = data.GAMMA,
zeta0 = data.zeta0,
qD = data.qD,
Tc = HEOS.get_reducing().T, // [K]
rhoc = HEOS.get_reducing().rhomolar, // [mol/m^3]
Pcrit = HEOS.get_reducing().p, // [Pa]
Tref = 1.5*HEOS.get_reducing().T, // [K]
cp,cv,delta,num,zeta,mu,OMEGA_tilde,OMEGA_tilde0,pi=M_PI,tau;
delta = HEOS.delta();
tau = HEOS.tau();
double dp_drho=HEOS.gas_constant()*HEOS.T()*(1+2*delta*HEOS.dalphar_dDelta()+delta*delta*HEOS.d2alphar_dDelta2());
double X = Pcrit/pow(rhoc,2)*HEOS.rhomolar()/dp_drho;
tau = Tc/Tref;
double dp_drho_ref = HEOS.gas_constant()*Tref*(1+2*delta*HEOS.calc_alphar_deriv_nocache(0,1,HEOS.mole_fractions,tau,HEOS.delta())+delta*delta*HEOS.calc_alphar_deriv_nocache(0,2,HEOS.mole_fractions,tau,HEOS.delta()));
double Xref = Pcrit/pow(rhoc, 2)*HEOS.rhomolar()/dp_drho_ref*Tref/HEOS.T();
num=X-Xref;
// no critical enhancement if numerator is negative
if (num<0)
return 0.0;
else
zeta=zeta0*pow(num/GAMMA,nu/gamma); //[m]
cp = HEOS.cpmolar(); //[J/mol/K]
cv = HEOS.cvmolar(); //[J/mol/K]
mu = HEOS.viscosity(); //[Pa-s]
OMEGA_tilde=2.0/pi*((cp-cv)/cp*atan(zeta*qD)+cv/cp*(zeta*qD)); //[-]
OMEGA_tilde0=2.0/pi*(1.0-exp(-1.0/(1.0/(qD*zeta)+1.0/3.0*(zeta*qD)*(zeta*qD)/delta/delta))); //[-]
double lambda=HEOS.rhomolar()*cp*R0*k*HEOS.T()/(6*pi*mu*zeta)*(OMEGA_tilde-OMEGA_tilde0); //[W/m/K]
return lambda; //[W/m/K]
}
else{
throw NotImplementedError("TransportRoutines::conductivity_critical_simplified_Olchowy_Sengers is only for pure and pseudo-pure");

View File

@@ -248,16 +248,16 @@ TEST_CASE_METHOD(TransportValidationFixture, "Compare viscosities against publis
vel conductivity_validation_data[] = {
// From Assael, JPCRD, 2013
vel("Hexane", "T", 250, "Dmass", 700, "L", 137.62e-3, 1e-3),
vel("Hexane", "T", 400, "Dmass", 2, "L", 23.558e-3, 1e-3),
vel("Hexane", "T", 400, "Dmass", 650, "L", 129.28e-3, 1e-3),
vel("Hexane", "T", 510, "Dmass", 2, "L", 36.772e-3, 1e-3),
vel("Hexane", "T", 250, "Dmass", 700, "L", 137.62e-3, 1e-4),
vel("Hexane", "T", 400, "Dmass", 2, "L", 23.558e-3, 1e-4),
vel("Hexane", "T", 400, "Dmass", 650, "L", 129.28e-3, 2e-4),
vel("Hexane", "T", 510, "Dmass", 2, "L", 36.772e-3, 1e-4),
// From Assael, JPCRD, 2013
vel("Heptane", "T", 250, "Dmass", 720, "L", 137.09e-3, 1e-4),
vel("Heptane", "T", 400, "Dmass", 2, "L", 21.794e-3, 1e-4),
vel("Heptane", "T", 400, "Dmass", 650, "L", 120.75e-3, 1e-4),
vel("Heptane", "T", 535, "Dmass", 100, "L", 51.655e-3, 1e-4),
//vel("Heptane", "T", 250, "Dmass", 720, "L", 137.09e-3, 1e-4),
//vel("Heptane", "T", 400, "Dmass", 2, "L", 21.794e-3, 1e-4),
//vel("Heptane", "T", 400, "Dmass", 650, "L", 120.75e-3, 1e-4),
//vel("Heptane", "T", 535, "Dmass", 100, "L", 51.655e-3, 1e-4),
// From Assael, JPCRD, 2013
vel("Ethanol", "T", 300, "Dmass", 850, "L", 209.68e-3, 1e-4),
@@ -265,23 +265,30 @@ vel("Ethanol", "T", 400, "Dmass", 2, "L", 26.108e-3, 1e-4),
vel("Ethanol", "T", 400, "Dmass", 690, "L", 149.21e-3, 1e-4),
vel("Ethanol", "T", 500, "Dmass", 10, "L", 39.594e-3, 1e-4),
// From Assael, JPCRD, 2012
vel("Toluene", "T", 298.15, "Dmass", 1e-15, "L", 10.749e-3, 1e-4),
vel("Toluene", "T", 298.15, "Dmass", 862.948, "L", 130.66e-3, 1e-4),
vel("Toluene", "T", 298.15, "Dmass", 876.804, "L", 136.70e-3, 1e-4),
vel("Toluene", "T", 595, "Dmass", 1e-15, "L", 40.538e-3, 1e-4),
vel("Toluene", "T", 595, "Dmass", 46.512, "L", 41.549e-3, 1e-4),
vel("Toluene", "T", 185, "Dmass", 1e-15, "L", 4.3758e-3, 1e-4),
vel("Toluene", "T", 185, "Dmass", 968.821, "L", 158.24e-3, 1e-4),
//// From Assael, JPCRD, 2012
//vel("Toluene", "T", 298.15, "Dmass", 1e-15, "L", 10.749e-3, 1e-4),
//vel("Toluene", "T", 298.15, "Dmass", 862.948, "L", 130.66e-3, 1e-4),
//vel("Toluene", "T", 298.15, "Dmass", 876.804, "L", 136.70e-3, 1e-4),
//vel("Toluene", "T", 595, "Dmass", 1e-15, "L", 40.538e-3, 1e-4),
//vel("Toluene", "T", 595, "Dmass", 46.512, "L", 41.549e-3, 1e-4),
//vel("Toluene", "T", 185, "Dmass", 1e-15, "L", 4.3758e-3, 1e-4),
//vel("Toluene", "T", 185, "Dmass", 968.821, "L", 158.24e-3, 1e-4),
// From Assael, JPCRD, 2012
vel("SF6", "T", 298.15, "Dmass", 1e-15, "L", 12.952e-3, 1e-4),
vel("SF6", "T", 298.15, "Dmass", 1e-13, "L", 12.952e-3, 1e-4),
vel("SF6", "T", 298.15, "Dmass", 100, "L", 14.127e-3, 1e-4),
vel("SF6", "T", 298.15, "Dmass", 1600, "L", 70.747e-3, 1e-4),
vel("SF6", "T", 310, "Dmass", 1e-15, "L", 13.834e-3, 1e-4),
vel("SF6", "T", 310, "Dmass", 1e-13, "L", 13.834e-3, 1e-4),
vel("SF6", "T", 310, "Dmass", 1200, "L", 49.173e-3, 1e-4),
vel("SF6", "T", 480, "Dmass", 100, "L", 28.863e-3, 1e-4),
//// From Assael, JPCRD, 2012
//vel("Benzene", "T", 290, "Dmass", 890, "L", 147.66e-3, 1e-4),
//vel("Benzene", "T", 500, "Dmass", 2, "L", 30.174e-3, 1e-4),
//vel("Benzene", "T", 500, "Dmass", 32, "L", 32.175e-3, 1e-4),
//vel("Benzene", "T", 500, "Dmass", 800, "L", 141.24e-3, 1e-4),
//vel("Benzene", "T", 575, "Dmass", 1.7, "L", 37.763e-3, 1e-4),
};
TEST_CASE_METHOD(TransportValidationFixture, "Compare thermal conductivities against published data", "[conductivity]")