From 23e846e38e8ff3c395c2e652eb706c225ea9bb71 Mon Sep 17 00:00:00 2001 From: Ian bell Date: Sun, 18 May 2014 22:09:29 +0200 Subject: [PATCH] Baby steps towards transport properties. --- doc/transport_table/table.tex | 43 +++++++++++++++++++ src/Backends/Helmholtz/FlashRoutines.h | 6 +-- src/Backends/Helmholtz/Fluids/CoolPropFluid.h | 9 ++++ src/Backends/Helmholtz/Fluids/FluidLibrary.h | 25 ++++++++++- .../Helmholtz/HelmholtzEOSMixtureBackend.h | 1 + src/Backends/Helmholtz/TransportRoutines.cpp | 27 ++++++++++++ src/Backends/Helmholtz/TransportRoutines.h | 39 +++++++++++++++++ 7 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 doc/transport_table/table.tex create mode 100644 src/Backends/Helmholtz/TransportRoutines.cpp create mode 100644 src/Backends/Helmholtz/TransportRoutines.h diff --git a/doc/transport_table/table.tex b/doc/transport_table/table.tex new file mode 100644 index 00000000..906d9a01 --- /dev/null +++ b/doc/transport_table/table.tex @@ -0,0 +1,43 @@ +\documentclass[10pt,a4paper]{article} +\usepackage[latin1]{inputenc} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage[hmargin=0.5in, vmargin = 0.5in, paperwidth = 20in, paperheight = 20in]{geometry} +\author{Ian Bell, Vincent Lemort, ULg} +\begin{document} + +\centering +\begin{tabular}{ccp{3in}p{8 in}} +\hline\hline +Fluid & Reference & $\eta^0$ & $\eta^r$ \\ +\hline +Nitrogen, argon, oxygen air & Lemmon and Jacobsen 2004 & $\eta^0 = \dfrac{0.0266958\sqrt{MT}}{\sigma^2\Omega(T^*)}$\newline$\Omega(T^*)=\exp\left(\sum_{i=0}^{4}b_i[\ln T^*]^i\right)$ & $\eta^r = \sum_{i=1}^NN_i\tau^{\tau_i}\delta^{d_i}\exp(-\gamma_i\delta^{l_i})$\\\hline +Ammonia & Fenghour 1995 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\Game(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = B_{BV}\rho\eta^0(T) + \Delta\eta$\newline$\Delta\eta = \sum_i b_i(T)\rho^i$\\\hline +Carbon Dioxide & Vesovic 1990 & $\eta^0 = \dfrac{1.00697\sqrt{T}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = \Delta\eta$\newline$\Delta\eta_g = \sum_ie_i\rho^i$ \newline$\Delta\eta = \frac{\Delta\eta_g}{1+\exp[-Z(T-T_s)]}+\frac{\Delta\eta_g}{\lbrace 1+\exp[Z(T-T_s)][1+\exp[Z(\rho-\rho_s)]\rbrace}+\frac{\eta_l-\eta^0}{\lbrace 1+\exp[Z(T-T_s)]\rbrace\lbrace 1+\exp[-Z(\rho-\rho_s)]\rbrace}$ \newline $B = 18.56+0.014T$ \newline $\frac{1}{\eta_l-\Delta\eta_c} = B(T)[\frac{1}{\rho}-V_0(T)] \newline $V_0(T) = 7.41e-4-3.3e-7T$ \\\hline +Dimethyl Ether & Meng 2012 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & \eta^r = \Delta\eta$\newline$\Delta\eta = \sum_{i=0}^{1}n_i\tau^{t_i}\delta^{d_i} + \sum_{i=2}^{6}n_i\tau^{t_i}\delta^{d_i}\exp(-\delta^{p_i})$\\\hline +Ethane & Friend 1991 & $\eta^0 = \dfrac{12.0085\sqrt{t}}{\Omega^{(2,2)*}(t)}$ \newline $\Omega^{(2,2)*}(t) = \left[\sum_i C_it^{(i-1)/3-1} \right]^{-1}& $\Delta\eta = 15.977\left[\displaystyle\sum_i g_i\delta^{r_i}\tau^{s_i}\right]\left[1+\displaystyle\sum_{i=10}^{11}g_i\delta^{r_i}\tau^{s_i}\right]^{-1}$\\\hline +Ethanol & Kiselev 2005 & $\eta^0 = \sum_i a_i T^{n_i}& \eta^r = B_{RF}\rho\eta^0(T)+\Delta \eta$ \newline $\Delta\eta = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+f_1\left(\frac{\delta}{\delta_0(\tau)-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=g_2+g_3\sqrt{\tau}$\\\hline +Helium & Arp 1998 & NASTY & NASTY \\\hline +Hydrogen & Muzny 2013 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2S^*(T^*)}$\newline$S^*(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = B_{RF}\rho\eta^0(T) + \Delta\eta$\newline$\Delta\eta = c_1\rho_r^2\left[c_2T_r+c_3/T_r+\frac{c_4\rho_r^2}{c_5+T_r}+c_6\rho_r^6\right]$\\\hline +SF6 & Quinones-Cisneros 2012 & $\eta^0 = \sum_i d_i T_r^{n_i}$ & FRICTION THEORY\\\hline +H2S & Quinones-Cisneros 2012 & $\eta^0 = 8.7721\dfrac{\sqrt{T}}{S^*(T^*)}$ \newline $S^*(T^*) = \sum_i \frac{\alpha_i}{T^{*i}}$ & FRICTION THEORY\\\hline +Propane & Vogel 1998 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta_h = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+f_1\left(\frac{\delta}{\delta_0(\tau)-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=g_1(1+g_2\tau^{1/2})$\\\hline +n-Butane & Vogel 1999 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta_h = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+f_1\left(\frac{\delta}{\delta_0(\tau)-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=g_1(1+\displaystyle\sum_{l=2}g_l\tau^{(l-1)/2})$ \\\hline +Isobutane & Vogel 2000 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta_h = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+f_1\left(\frac{\delta}{\delta_0(\tau)-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=g_1(1+\displaystyle\sum_{l=2}g_l\tau^{(l-1)/2})$ \\\hline +R123 & Tanaka 1996 & $\eta^0 = \displaystyle\sum_{i}a_iT_i$ & $\eta^r = \eta^1\rho+\Delta\eta$ \newline $\eta^1 = b_0+b_1T$\newline$\Delta\eta = \frac{a_0}{\rho-\rho_0}+\frac{a_0}{\rho_0}+a_1\rho+a_2\rho^2+a_3\rho^3$\\\hline +R134a & Huber 2003 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = \eta^0(T)\rho B_{RF} + \Delta\eta$\newline$\Delta\eta = c_1\delta+\left(\frac{c_2}{\tau^6}+\frac{c_3}{\tau^2}+\frac{c_4}{\sqrt{\tau}}+c_5\tau^2\right)\delta^2+c_6\delta^3+c_7\left(\frac{1}{\delta_0-\delta}-\frac{1}{\delta_0}\right)$ \newline $\delta_0(\tau)=\frac{c_{10}}{1+c_8\tau+c_9\tau^2}$\\\hline +n-Dodecane & Huber 2004 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = \eta^0(T)\rho B_{RF} + \Delta\eta$\newline$\Delta\eta = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+c_1\left(\frac{\delta}{\delta_0-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=c_2 +c_3\sqrt{\tau}$\\\hline +Octane, nonane, decane & Huber 2004 & $\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)}$\newline$\mathfrak{S}(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = \eta^0(T)\rho B_{RF} + \Delta\eta$\newline$\Delta\eta = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+c_1\left(\frac{\delta}{\delta_0-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=c_2 +c_3\sqrt{\tau}$\\\hline +R125 & Huber 2006 & $\eta^0 = \dfrac{5}{16}\sqrt{\dfrac{MkT}{\pi N}}\dfrac{1}{\sigma^2\Omega^*(T^*)}$\newline $\Omega(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\eta^r = \eta^0(T)\rho B_{RF} + \Delta\eta$\newline$\Delta\eta = \displaystyle\sum_{i=2}^n\displaystyle\sum_{j=0}^me_{ij}\frac{\delta^i}{\tau_j}+c_1\left(\frac{\delta}{\delta_0-\delta}-\frac{\delta}{\delta_0(\tau)}\right)$ \newline $\delta_0(\tau)=c_2 +c_3\sqrt{\tau}$\\\hline +Water & Huber 2009 & & \\\hline +R152A & Krauss 1996 & $\eta^0 = \dfrac{5}{16}\sqrt{\dfrac{MkT}{1000\pi N}}\dfrac{10^{24}}{\sigma^2\Omega^*(T^*)}=\dfrac{0.2169614\sqrt{T}}{\sigma^2\Omega(T^*)}$\newline $\Omega(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & $\dfrac{\Delta\eta}{H_c} = \displaystyle\sum_{i=1}^{4}E_i\left(\frac{\rho}{\rho_c}\right)^i + \frac{E_5}{\rho/\rho_c-E_6}+\frac{E_5}{E_6}$\\\hline +R23 & Shan 2000 & $\eta^0 = \frac{5}{16}\sqrt{\frac{MkT}{1000\pi N}}\frac{10^{24}}{\sigma^2\Omega^*(T^*)}$\newline $\Omega(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$ & \\\hline +R404A, R410A, R507, R407 & Geller 2000 & $\eta^0 = \sum_i A_iT^i$&$\eta^r = \sum_j b_j\rho^j$ \\\hline +n-Hexane & Michailidou 2013 &$\eta^0 = \dfrac{0.021357\sqrt{MT}}{\sigma^2S(T^*)}$\newline$S(T^*)=\exp\left(\sum_{i=0}^{4}a_i[\ln T^*]^i\right)$& $\eta^r = \eta^0(T)\rho B_{RF} + \Delta\eta$\newline$\Delta\eta = (\rho_r^{2/3}T_r^{1/2})\left\lbrace\dfrac{c_0}{T_r}+\dfrac{c_1}{c_2+T_r+c_3\rho_r^2}+\dfrac{c_4(1+\rho_r)}{c_5 + c_6T_r+c_7\rho_r+\rho_r^2+c_8\rho_rT_r} \right\rbrace$ \\\hline +\hline\hline +\end{tabular} + +For a description of the conversion between $\mathfrak{S}$ and $\Omega$, see Vesovic 1990 ($CO_2$). Basically $\Omega = (5/4)\mathfrak{S}$. +\end{document} \ No newline at end of file diff --git a/src/Backends/Helmholtz/FlashRoutines.h b/src/Backends/Helmholtz/FlashRoutines.h index 89854576..9e3d1ae0 100644 --- a/src/Backends/Helmholtz/FlashRoutines.h +++ b/src/Backends/Helmholtz/FlashRoutines.h @@ -41,17 +41,17 @@ public: /// A generic flash routine for the pairs (T,D), (T,H), (T,S), and (T,U). Similar analysis is needed /// @param HEOS The HelmholtzEOSMixtureBackend to be used - /// @param other The index for the other input, see CoolProp::parameters; allowed values are iDmolar, iHmolar, iSmolar, iUmolar + /// @param other The index for the other input from CoolProp::parameters; allowed values are iDmolar, iHmolar, iSmolar, iUmolar static void DHSU_T_flash(HelmholtzEOSMixtureBackend &HEOS, int other); /// A generic flash routine for the pairs (P,H), (P,S), and (P,U). Similar analysis is needed /// @param HEOS The HelmholtzEOSMixtureBackend to be used - /// @param other The index for the other input, see CoolProp::parameters; allowed values are iHmolar, iSmolar, iUmolar + /// @param other The index for the other input from CoolProp::parameters; allowed values are iHmolar, iSmolar, iUmolar static void HSU_P_flash(HelmholtzEOSMixtureBackend &HEOS, int other); /// A generic flash routine for the pairs (D,P), (D,H), (D,S), and (D,U). Similar analysis is needed /// @param HEOS The HelmholtzEOSMixtureBackend to be used - /// @param other The index for the other input, see CoolProp::parameters; allowed values are iP, iHmolar, iSmolar, iUmolar + /// @param other The index for the other input from CoolProp::parameters; allowed values are iP, iHmolar, iSmolar, iUmolar static void PHSU_D_flash(HelmholtzEOSMixtureBackend &HEOS, int other); }; diff --git a/src/Backends/Helmholtz/Fluids/CoolPropFluid.h b/src/Backends/Helmholtz/Fluids/CoolPropFluid.h index a0267bc5..2488e57a 100644 --- a/src/Backends/Helmholtz/Fluids/CoolPropFluid.h +++ b/src/Backends/Helmholtz/Fluids/CoolPropFluid.h @@ -58,6 +58,13 @@ public: double residual(double T, double rhomolar); double critical(double T, double rhomolar); }; +class TransportPropertyData +{ +public: + ViscosityCorrelation viscosity; + ThermalConductivityCorrelation conductivity; + long double sigma_eta, epsilon_over_k; +}; /** The surface tension correlation class uses correlations for the surface tension that are all @@ -184,6 +191,7 @@ public: } }; + class MeltingLine { }; @@ -343,6 +351,7 @@ class CoolPropFluid { BibTeXKeysStruct BibTeXKeys; EnvironmentalFactorsStruct environment; Ancillaries ancillaries; + TransportPropertyData transport; double gas_constant(){ return pEOS->R_u; }; double molar_mass(){ return pEOS->molar_mass; }; diff --git a/src/Backends/Helmholtz/Fluids/FluidLibrary.h b/src/Backends/Helmholtz/Fluids/FluidLibrary.h index 3d9f6b33..04493ec4 100644 --- a/src/Backends/Helmholtz/Fluids/FluidLibrary.h +++ b/src/Backends/Helmholtz/Fluids/FluidLibrary.h @@ -257,9 +257,22 @@ protected: fluid.pEOS = &(fluid.EOSVector[0]); }; - /// Parse the reducing state for the given EOS - void parse_reducing_state(rapidjson::Value &alphar) + /// Parse the transport properties + void parse_transport(rapidjson::Value &transport, CoolPropFluid & fluid) { + if (!transport.HasMember("sigma_eta")|| !transport.HasMember("epsilon_over_k")){ + // Use the method of Chung to approximate the values for epsilon_over_k and sigma_eta + // Chung, T.-H.; Ajlan, M.; Lee, L. L.; Starling, K. E. Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Properties. Ind. Eng. Chem. Res. 1988, 27, 671-679. + // rhoc needs to be in mol/L to yield a sigma in nm, + long double rho_crit_molar = fluid.pEOS->reduce.rhomolar/1000.0;// [mol/m3 to mol/L] + long double Tc = fluid.pEOS->reduce.T; + fluid.transport.sigma_eta = 0.809/pow(rho_crit_molar, static_cast(1.0/3.0))/1e9; // 1e9 is to convert from nm to m + fluid.transport.epsilon_over_k = Tc/1.3593; // [K] + } + else{ + fluid.transport.sigma_eta = cpjson::get_double(transport, "sigma_eta"); + fluid.transport.epsilon_over_k = cpjson::get_double(transport, "epsilon_over_k"); + } }; /// Parse the critical state for the given EOS @@ -352,6 +365,14 @@ public: else{ parse_environmental(fluid_json["ENVIRONMENTAL"], fluid); } + + // Parse the environmental parameters + if (!(fluid_json.HasMember("TRANSPORT"))){ + std::cout << format("Transport property data are missing for fluid [%s]\n", fluid.name.c_str()) ; + } + else{ + parse_transport(fluid_json["TRANSPORT"], fluid); + } // If the fluid is ok... diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h index 7843f0ae..c03fbffe 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h @@ -36,6 +36,7 @@ public: ExcessTerm Excess; friend class FlashRoutines; // Allows the routines in the FlashRoutines class to have access to all the protected members and methods of this class + friend class TransportRoutines; // Allows the routines in the TransportRoutines class to have access to all the protected members and methods of this class // Helmholtz EOS backend uses mole fractions bool using_mole_fractions(){return true;} diff --git a/src/Backends/Helmholtz/TransportRoutines.cpp b/src/Backends/Helmholtz/TransportRoutines.cpp new file mode 100644 index 00000000..9bf7ab66 --- /dev/null +++ b/src/Backends/Helmholtz/TransportRoutines.cpp @@ -0,0 +1,27 @@ + +#include "TransportRoutines.h" + +namespace CoolProp{ + +long double TransportRoutines::general_dilute_gas_viscosity(HelmholtzEOSMixtureBackend &HEOS) +{ + if (HEOS.is_pure_or_pseudopure) + { + long double Tstar = HEOS.T()/HEOS.components[0]->transport.epsilon_over_k; + long double sigma_nm = HEOS.components[0]->transport.sigma_eta*1e9; // 1e9 to convert from m to nm + long double molar_mass_kgkmol = HEOS.molar_mass()*1000; // 1000 to convert from kg/mol to kg/kmol + + // The nondimensional empirical collision integral from Neufeld + // Neufeld, P. D.; Janzen, A. R.; Aziz, R. A. Empirical Equations to Calculate 16 of the Transport Collision Integrals (l,s)* + // for the Lennard-Jones (12-6) Potential. J. Chem. Phys. 1972, 57, 1100-1102 + long double OMEGA22 = 1.16145*pow(Tstar, static_cast(-0.14874))+0.52487*exp(-0.77320*Tstar)+2.16178*exp(-2.43787*Tstar); + + // The dilute gas component - + return 26.692e-9*sqrt(molar_mass_kgkmol*HEOS.T())/(pow(sigma_nm, 2)*OMEGA22); // Pa-s + } + else{ + throw NotImplementedError("TransportRoutines::GeneralDiluteGasViscosity is only for pure and pseudo-pure"); + } +} + +}; /* namespace CoolProp */ \ No newline at end of file diff --git a/src/Backends/Helmholtz/TransportRoutines.h b/src/Backends/Helmholtz/TransportRoutines.h new file mode 100644 index 00000000..1ab749b4 --- /dev/null +++ b/src/Backends/Helmholtz/TransportRoutines.h @@ -0,0 +1,39 @@ +#ifndef TRANSPORTROUTINES_H +#define TRANSPORTROUTINES_H + +#include "HelmholtzEOSMixtureBackend.h" + +namespace CoolProp{ + +class TransportRoutines +{ +public: + /** + \brief The general dilute gas viscosity from used for ECS + + \f[ + \eta^0 = \displaystyle\frac{26.692\times 10^{-9}\sqrt{MT}}{\sigma^2\Omega^{(2,2)}(T^*)} + \f] + \f[ + \Omega^{(2,2)}(T^*)=1.16145(T^*)^{-0.14874}+0.52487\exp(-0.77320T^*)+2.16178\exp(-2.43787T^*) + \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); + + /** + \brief A dilute gas term that has a form like + + \f[ + \eta^0 = \displaystyle\frac{A\sqrt{MT}}{\sigma^2\mathfrak{S}(T^*)} + \f] + \f[ + \mathfrak{S}(T^*)=\exp\left(\sum_ia_i[\ln T^*]^i\right) + \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_collision_integral(HelmholtzEOSMixtureBackend &HEOS); +}; + +}; /* namespace CoolProp */ +#endif \ No newline at end of file