R123 viscosity and powers of T dilute term

Signed-off-by: Ian bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian bell
2014-05-21 20:23:44 +02:00
parent d8aaa2d2cf
commit fe04964cbc
8 changed files with 168 additions and 36 deletions

View File

@@ -277,6 +277,16 @@ protected:
else if (!type.compare("kinetic_theory")){
fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_KINETIC_THEORY;
}
else if (!type.compare("powers_of_T")){
// Get a reference to the entry in the fluid instance
CoolProp::ViscosityDiluteGasPowersOfT &CI = fluid.transport.viscosity_dilute.powers_of_T;
// Load up the values
CI.a = cpjson::get_long_double_array(dilute["a"]);
CI.t = cpjson::get_long_double_array(dilute["t"]);
fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_POWERS_OF_T;
}
else{
throw ValueError(format("type [%s] is not understood for fluid %s",type.c_str(),fluid.name.c_str()));
}

View File

@@ -137,15 +137,17 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void)
switch(components[0]->transport.viscosity_dilute.type)
{
case ViscosityDiluteVariables::VISCOSITY_DILUTE_KINETIC_THEORY:
eta_dilute = TransportRoutines::general_dilute_gas_viscosity(*this); break;
eta_dilute = TransportRoutines::viscosity_dilute_kinetic_theory(*this); break;
case ViscosityDiluteVariables::VISCOSITY_DILUTE_COLLISION_INTEGRAL:
eta_dilute = TransportRoutines::dilute_gas_viscosity(*this); break;
eta_dilute = TransportRoutines::viscosity_dilute_collision_integral(*this); break;
case ViscosityDiluteVariables::VISCOSITY_DILUTE_POWERS_OF_T:
eta_dilute = TransportRoutines::viscosity_dilute_powers_of_T(*this); break;
default:
throw ValueError(format("dilute viscosity type [%d] is invalid for fluid %s", components[0]->transport.viscosity_dilute.type, name().c_str()));
}
// Residual part
long double B_eta_initial = TransportRoutines::initial_density_dependence_viscosity_term(*this);
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);

View File

@@ -4,7 +4,7 @@
namespace CoolProp{
long double TransportRoutines::general_dilute_gas_viscosity(HelmholtzEOSMixtureBackend &HEOS)
long double TransportRoutines::viscosity_dilute_kinetic_theory(HelmholtzEOSMixtureBackend &HEOS)
{
if (HEOS.is_pure_or_pseudopure)
{
@@ -21,11 +21,11 @@ long double TransportRoutines::general_dilute_gas_viscosity(HelmholtzEOSMixtureB
return 26.692e-9*sqrt(molar_mass_kgkmol*HEOS.T())/(pow(sigma_nm, 2)*OMEGA22); // Pa-s
}
else{
throw NotImplementedError("TransportRoutines::general_dilute_gas_viscosity is only for pure and pseudo-pure");
throw NotImplementedError("TransportRoutines::viscosity_dilute_kinetic_theory is only for pure and pseudo-pure");
}
}
long double TransportRoutines::dilute_gas_viscosity(HelmholtzEOSMixtureBackend &HEOS)
long double TransportRoutines::viscosity_dilute_collision_integral(HelmholtzEOSMixtureBackend &HEOS)
{
if (HEOS.is_pure_or_pseudopure)
{
@@ -54,7 +54,27 @@ long double TransportRoutines::dilute_gas_viscosity(HelmholtzEOSMixtureBackend &
return C*sqrt(molar_mass_kgkmol*HEOS.T())/(pow(sigma_nm, 2)*S); // Pa-s
}
else{
throw NotImplementedError("TransportRoutines::dilute_gas_viscosity is only for pure and pseudo-pure");
throw NotImplementedError("TransportRoutines::viscosity_dilute_collision_integral is only for pure and pseudo-pure");
}
}
long double TransportRoutines::viscosity_dilute_powers_of_T(HelmholtzEOSMixtureBackend &HEOS)
{
if (HEOS.is_pure_or_pseudopure)
{
// Retrieve values from the state class
CoolProp::ViscosityDiluteGasPowersOfT &data = HEOS.components[0]->transport.viscosity_dilute.powers_of_T;
const std::vector<long double> &a = data.a, &t = data.t;
long double summer = 0, T = HEOS.T();
for (std::size_t i = 0; i < a.size(); ++i)
{
summer += a[i]*pow(T, t[i]);
}
return summer;
}
else{
throw NotImplementedError("TransportRoutines::viscosity_dilute_powers_of_T is only for pure and pseudo-pure");
}
}
@@ -66,7 +86,7 @@ long double TransportRoutines::modified_Batschinski_Hildebrand_viscosity_term(He
long double delta = HEOS.rhomolar()/HO.rhomolar_reduce, tau = HO.T_reduce/HEOS.T();
// The first term that is formed of powers of tau and delta
// The first term that is formed of powers of tau (Tc/T) and delta (rho/rhoc)
long double S = 0;
for (unsigned int i = 0; i < HO.a.size(); ++i){
S += HO.a[i]*pow(delta, HO.d1[i])*pow(tau, HO.t1[i])*exp(HO.gamma[i]*pow(delta, HO.l[i]));
@@ -89,7 +109,6 @@ long double TransportRoutines::modified_Batschinski_Hildebrand_viscosity_term(He
}
long double delta0 = summer_numer/summer_denom;
double Tr = 1/tau;
// The higher-order-term component
return S + F*(1/(delta0-delta)-1/delta0); // Pa-s
}
@@ -98,7 +117,7 @@ long double TransportRoutines::modified_Batschinski_Hildebrand_viscosity_term(He
}
}
long double TransportRoutines::initial_density_dependence_viscosity_term(HelmholtzEOSMixtureBackend &HEOS)
long double TransportRoutines::viscosity_initial_density_dependence_Rainwater_Friend(HelmholtzEOSMixtureBackend &HEOS)
{
if (HEOS.is_pure_or_pseudopure)
{
@@ -119,7 +138,7 @@ long double TransportRoutines::initial_density_dependence_viscosity_term(Helmhol
return B_eta; // [m^3/mol]
}
else{
throw NotImplementedError("TransportRoutines::initial_density_dependence_viscosity_term is only for pure and pseudo-pure");
throw NotImplementedError("TransportRoutines::viscosity_initial_density_dependence_Rainwater_Friend is only for pure and pseudo-pure");
}
}

View File

@@ -19,7 +19,7 @@ public:
\f]
with \f$T^* = \frac{T}{\varepsilon/k}\f$ and \f$\sigma\f$ in nm, M is in kg/kmol. Yields viscosity in Pa-s.
*/
static long double general_dilute_gas_viscosity(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_dilute_kinetic_theory(HelmholtzEOSMixtureBackend &HEOS);
/**
\brief The dilute gas viscosity term that is based on collision integral or effective cross section
@@ -32,21 +32,17 @@ public:
\f]
with \f$T^* = \frac{T}{\varepsilon/k}\f$ and \f$\sigma\f$ in nm, M is in kg/kmol. Yields viscosity in Pa-s.
*/
static long double dilute_gas_viscosity(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_dilute_collision_integral(HelmholtzEOSMixtureBackend &HEOS);
/**
\brief The modified Batschinski-Hildebrand contribution to the viscosity
\brief A dilute gas viscosity term formed of summation of power terms
\f[
\Delta\eta = \displaystyle\sum_{i}a_{i}\delta^{d1_i}\tau^{t1_j}+\left(\displaystyle\sum_{i}f_i\delta^{d2_i}\tau^{t2_i}\right)\left(\frac{1}{\delta_0(\tau)-\delta}-\frac{1}{\delta_0(\tau)}\right)
\eta^0 = \displaystyle\sum_ia_iT^{t_i}
\f]
where \f$\tau = T_c/T\f$ and \f$\delta = \rho/\rho_c\f$
\f[
\delta_0(\tau) = \displaystyle\frac{\displaystyle\sum_{i}g_i\tau^{h_i}}{\displaystyle\sum_{i}p_i\tau^{q_i}}
\f]
The more general form of \f$\delta_0(\tau)\f$ is selected in order to be able to handle all the forms in the literature
with T in K, \f$eta^0\f$ in Pa-s
*/
static long double modified_Batschinski_Hildebrand_viscosity_term(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_dilute_powers_of_T(HelmholtzEOSMixtureBackend &HEOS);
/**
\brief The initial density dependence term \f$B_{\eta}\f$ from Rainwater-Friend theory
@@ -68,7 +64,23 @@ public:
IMPORTANT: This function returns \f$B_{\eta}\f$, not \f$\eta_{RF}\f$
*/
static long double initial_density_dependence_viscosity_term(HelmholtzEOSMixtureBackend &HEOS);
static long double viscosity_initial_density_dependence_Rainwater_Friend(HelmholtzEOSMixtureBackend &HEOS);
/**
\brief The modified Batschinski-Hildebrand contribution to the viscosity
\f[
\Delta\eta = \displaystyle\sum_{i}a_{i}\delta^{d1_i}\tau^{t1_j}+\left(\displaystyle\sum_{i}f_i\delta^{d2_i}\tau^{t2_i}\right)\left(\frac{1}{\delta_0(\tau)-\delta}-\frac{1}{\delta_0(\tau)}\right)
\f]
where \f$\tau = T_c/T\f$ and \f$\delta = \rho/\rho_c\f$
\f[
\delta_0(\tau) = \displaystyle\frac{\displaystyle\sum_{i}g_i\tau^{h_i}}{\displaystyle\sum_{i}p_i\tau^{q_i}}
\f]
The more general form of \f$\delta_0(\tau)\f$ is selected in order to be able to handle all the forms in the literature
*/
static long double modified_Batschinski_Hildebrand_viscosity_term(HelmholtzEOSMixtureBackend &HEOS);
};
}; /* namespace CoolProp */

View File

@@ -104,12 +104,12 @@ vel("CO2", "T", 304, "Dmass", 254.3205, "V", 20.99e-6, 1e-3),
vel("CO2", "T", 220, "Dmass", 1194.86, "V", 269.37e-6, 1e-3),
vel("CO2", "T", 300, "Dmass", 1029.27, "V", 132.55e-6, 1e-3),
vel("CO2", "T", 800, "Dmass", 407.828, "V", 48.74e-6, 1e-3),
//
//// Tanaka, IJT, 1996
//vel("R123", "T", 265, "Dmass", 1545.8, "V", 627.1e-6, 1e-3),
//vel("R123", "T", 265, "Dmass", 1.614, "V", 9.534e-6, 1e-3),
//vel("R123", "T", 415, "Dmass", 1079.4, "V", 121.3e-6, 1e-3),
//vel("R123", "T", 415, "Dmass", 118.9, "V", 15.82e-6, 1e-3),
// Tanaka, IJT, 1996
vel("R123", "T", 265, "Dmass", 1545.8, "V", 627.1e-6, 1e-3),
vel("R123", "T", 265, "Dmass", 1.614, "V", 9.534e-6, 1e-3),
vel("R123", "T", 415, "Dmass", 1079.4, "V", 121.3e-6, 1e-3),
vel("R123", "T", 415, "Dmass", 118.9, "V", 15.82e-6, 1e-3),
//
//// Krauss, IJT, 1996
//vel("R152A", "T", 242, "Dmass", 1025.5, "V", 347.3e-6, 1e-3),