Ethane viscosity

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-05-22 23:36:10 +02:00
parent f29c329b8c
commit bc5c75d06b
7 changed files with 75 additions and 7 deletions

View File

@@ -260,6 +260,12 @@ protected:
/// Parse the transport properties
void parse_dilute_viscosity(rapidjson::Value &dilute, CoolPropFluid & fluid)
{
if (dilute.HasMember("hardcoded")){
std::string target = cpjson::get_string(dilute, "hardcoded");
if (!target.compare("Ethane")){
fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE; return;
}
}
std::string type = cpjson::get_string(dilute, "type");
if (!type.compare("collision_integral")){
// Get a reference to the entry in the fluid instance
@@ -328,12 +334,13 @@ protected:
if (higher.HasMember("hardcoded")){
std::string target = cpjson::get_string(higher,"hardcoded");
if (!target.compare("Hydrogen")){
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HYDROGEN;
return;
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HYDROGEN; return;
}
else if (!target.compare("n-Hexane")){
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEXANE;
return;
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEXANE; return;
}
else if (!target.compare("Ethane")){
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_ETHANE; return;
}
else{
throw ValueError(format("hardcoded higher order viscosity term [%s] is not understood for fluid %s",target.c_str(), fluid.name.c_str()));

View File

@@ -158,6 +158,8 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void)
eta_dilute = TransportRoutines::viscosity_dilute_powers_of_T(*this); break;
case ViscosityDiluteVariables::VISCOSITY_DILUTE_COLLISION_INTEGRAL_POWERS_OF_TSTAR:
eta_dilute = TransportRoutines::viscosity_dilute_collision_integral_powers_of_T(*this); break;
case ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE:
eta_dilute = TransportRoutines::viscosity_dilute_ethane(*this); break;
default:
throw ValueError(format("dilute viscosity type [%d] is invalid for fluid %s", components[0]->transport.viscosity_dilute.type, name().c_str()));
}
@@ -179,7 +181,8 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void)
delta_eta_h = TransportRoutines::viscosity_hydrogen_higher_order_hardcoded(*this); break;
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEXANE:
delta_eta_h = TransportRoutines::viscosity_hexane_higher_order_hardcoded(*this); break;
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_ETHANE:
delta_eta_h = TransportRoutines::viscosity_ethane_higher_order_hardcoded(*this); break;
default:
throw ValueError(format("higher order viscosity type [%d] is invalid for fluid %s", components[0]->transport.viscosity_dilute.type, name().c_str()));
}

View File

@@ -415,4 +415,34 @@ long double TransportRoutines::viscosity_R23_hardcoded(HelmholtzEOSMixtureBacken
return (pow((rhoL-rhobar)/rhoL,C1)*eta_DG+pow(rhobar/rhoL,C1)*eta_L+DELTAeta_c)/1e6;
}
long double TransportRoutines::viscosity_dilute_ethane(HelmholtzEOSMixtureBackend &HEOS)
{
double C[] = {0, -3.0328138281, 16.918880086, -37.189364917, 41.288861858, -24.615921140, 8.9488430959, -1.8739245042, 0.20966101390, -9.6570437074e-3};
double OMEGA_2_2 = 0, e_k = 245, sigma = 0.43682, Tstar;
Tstar = HEOS.T()/e_k;
for (int i = 1; i<= 9; i++)
{
OMEGA_2_2 += C[i]*pow(Tstar,(i-1)/3.0-1);
}
return 12.0085*sqrt(Tstar)*OMEGA_2_2/1e6; //[Pa-s]
}
long double TransportRoutines::viscosity_ethane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS)
{
double r[] = {0,1,1,2,2,2,3,3,4,4,1,1};
double s[] = {0,0,1,0,1,1.5,0,2,0,1,0,1};
double g[] = {0, 0.47177003, -0.23950311, 0.39808301, -0.27343335, 0.35192260, -0.21101308, -0.00478579, 0.07378129, -0.030435255, -0.30435286, 0.001215675};
double sum1 = 0, sum2 = 0, tau = 305.33/HEOS.T(), delta = HEOS.rhomolar()/6870;
for (int i = 1; i<= 9; ++i){
sum1 += g[i]*pow(delta,r[i])*pow(tau,s[i]);
}
for (int i = 10; i<= 11; ++i){
sum2 += g[i]*pow(delta,r[i])*pow(tau,s[i]);
}
return 15.977*sum1/(1+sum2)/1e6;
}
}; /* namespace CoolProp */

View File

@@ -82,6 +82,9 @@ public:
*/
static long double viscosity_higher_order_modified_Batschinski_Hildebrand(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_dilute_ethane(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_ethane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_water_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_helium_hardcoded(HelmholtzEOSMixtureBackend &HEOS);