mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
@@ -312,10 +312,26 @@ protected:
|
||||
/// Parse the transport properties
|
||||
void parse_higher_order_viscosity(rapidjson::Value &higher, CoolPropFluid & fluid)
|
||||
{
|
||||
// First check for hardcoded higher-order term
|
||||
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;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("hardcoded higher order viscosity term [%s] is not understood for fluid %s",target.c_str(), fluid.name.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
std::string type = cpjson::get_string(higher, "type");
|
||||
if (!type.compare("modified_Batschinski_Hildebrand")){
|
||||
// Get a reference to the entry in the fluid instance to simplify the code that follows
|
||||
CoolProp::ViscosityModifiedBatschinskiHildebrandData &BH = fluid.transport.viscosity_higher_order.modified_Batschinski_Hildebrand;
|
||||
|
||||
// Set the flag for the type of this model
|
||||
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_BATSCHINKI_HILDEBRAND;
|
||||
|
||||
BH.T_reduce = cpjson::get_double(higher, "T_reduce");
|
||||
BH.rhomolar_reduce = cpjson::get_double(higher, "rhomolar_reduce");
|
||||
// Load up the values
|
||||
|
||||
@@ -160,7 +160,19 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void)
|
||||
long double B_eta_initial = TransportRoutines::viscosity_initial_density_dependence_Rainwater_Friend(*this);
|
||||
long double rho = rhomolar();
|
||||
long double initial_part = eta_dilute*B_eta_initial*rhomolar();
|
||||
long double delta_eta_h = TransportRoutines::modified_Batschinski_Hildebrand_viscosity_term(*this);
|
||||
|
||||
// Higher order terms
|
||||
long double delta_eta_h;
|
||||
switch(components[0]->transport.viscosity_higher_order.type)
|
||||
{
|
||||
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_BATSCHINKI_HILDEBRAND:
|
||||
delta_eta_h = TransportRoutines::modified_Batschinski_Hildebrand_viscosity_term(*this); break;
|
||||
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HYDROGEN:
|
||||
delta_eta_h = TransportRoutines::viscosity_hydrogen_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()));
|
||||
}
|
||||
|
||||
long double eta_residual = initial_part + delta_eta_h;
|
||||
|
||||
// Critical part
|
||||
|
||||
@@ -251,6 +251,12 @@ long double TransportRoutines::viscosity_water_hardcoded(HelmholtzEOSMixtureBack
|
||||
return (mubar_0*mubar_1*mubar_2)/1e6;
|
||||
}
|
||||
|
||||
long double TransportRoutines::viscosity_hydrogen_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS)
|
||||
{
|
||||
long double Tr = HEOS.T()/33.145, rhor = HEOS.keyed_output(CoolProp::iDmass)/90.5;
|
||||
long double c[] = {0, 6.43449673e-6, 4.56334068e-2, 2.32797868e-1, 9.58326120e-1, 1.27941189e-1, 3.63576595e-1};
|
||||
return c[1]*pow(rhor,2)*exp(c[2]*Tr+c[3]/Tr+c[4]*pow(rhor,2)/(c[5]+Tr)+c[6]*pow(rhor,6));
|
||||
}
|
||||
|
||||
|
||||
}; /* namespace CoolProp */
|
||||
@@ -80,9 +80,11 @@ public:
|
||||
*/
|
||||
static long double modified_Batschinski_Hildebrand_viscosity_term(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
static long double TransportRoutines::viscosity_water_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double viscosity_water_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
static long double viscosity_hydrogen_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
};
|
||||
}; /* class TransportRoutines */
|
||||
|
||||
}; /* namespace CoolProp */
|
||||
#endif
|
||||
@@ -58,6 +58,10 @@ vel("Ethanol", "T", 300, "Q", 1, "V", 8.8293820936046416e-006, 1e-3),
|
||||
vel("Ethanol", "T", 500, "Q", 0, "V", 6.0979347125450671e-005, 1e-3),
|
||||
vel("Ethanol", "T", 500, "Q", 1, "V", 1.7229157141572511e-005, 1e-3),
|
||||
|
||||
// From CoolProp v5 implementation of correlation - more or less agrees with REFPROP
|
||||
// Errata in BibTeX File
|
||||
vel("Hydrogen", "T", 35, "Dmass", 100, "V", 5.6658815444656859e-005, 1e-3),
|
||||
|
||||
// From Meng 2012 experimental data (note erratum in BibTeX file)
|
||||
vel("DimethylEther", "T", 253.146, "Dmass", 734.28, "V", 0.20444e-3, 3e-3),
|
||||
vel("DimethylEther", "T", 373.132, "Dmass", 613.78, "V", 0.09991e-3, 3e-3),
|
||||
|
||||
Reference in New Issue
Block a user