[home] [Personal Program] [Help]
tag COOLPROP: AN OPEN-SOURCE REFERENCE-QUALITY THERMOPHYSICAL PROPERTY LIBRARY
Ian Bell, Sylvain Quoilin, Jorrit Wronski, Vincent Lemort
Session: Poster session & Sponsor Exhibition
Session starts: Monday 07 October, 14:00



Ian Bell (University of Liege, Liege, Belgium)
Sylvain Quoilin (University of Liege, Liege, Belgium)
Jorrit Wronski (University of Liege, Liege, Belgium)
Vincent Lemort (University of Liege, Liege, Belgium)


Abstract:
Modeling and simulation of thermodynamic cycles requires access to thermodynamic and transport properties of the working fluids. It is especially true in the case of Organic Rankine Cycles (ORC), for which the properties of organic fluids are not as easily available as those of water (e.g. when simulating traditional steam cycles) or air (e.g. when simulating gas turbines). Therefore, libraries of thermodynamic and transport properties based on high accuracy equations of states are needed. This work presents a new open-source and computationally efficient thermodynamic properties library named CoolProp. This library has been successfully tested for the simulation of refrigeration and ORC systems in steady-state as well as in dynamic models. %For all manner of analysis, it is useful to have access to thermodynamic and transport properties for fluids. In truth, it is not possible to conduct research in thermal sciences without access to accurate thermophysical properties. It is for that reason that a library of thermodynamic and transport properties has been developed which covers 86 pure and pseudo-pure fluids, and 21 brines and incompressible liquids. The working fluids available in CoolProp include all the most significant Organic Rankine Cycle working fluids, including R245fa, the siloxanes (MM, MDM, MD2M, MD3M, MD4M, D4, D5, D6), water, and many others. Wrappers have been developed that allow the use of CoolProp with Modelica, MATLAB, Python, C\#, Octave, Microsoft Excel, Labview, and EES. CoolProp is cross-platform and can be used on Linux/Unix, Mac OSX and Microsoft Windows. For Organic Rankine Cycles, the ability to capture the transient behavior of the system is very important, and it is here that the routines developed in CoolProp excel. Dynamic modeling involves numerous calls to the thermodynamic properties with p and h as inputs variables, both during the initialization phase and during the integration phase. Advanced lookup table methods have been developed (based on the Tabular Taylor Series Expansion) that allow for computationally efficient evaluation of the thermophysical properties. {\bf HELMHOLTZ ENERGY BASED EQUATION OF STATE} {\bf Core formulation} All the working fluids that are implemented in CoolProp are based on Helmholtz energy equations of state. The total non-dimensionalized Helmholtz energy can be given as the sum of two components, the residual- and ideal-gas components to the Helmholtz energy. Thus the non-dimensionalized Helmholtz energy can be given by \begin{equation} \alpha = \alpha^0+\alpha^r. \end{equation} The elegance of this formulation is that all other thermodynamic properties can be obtained through analytic derivatives of the terms $\alpha^0$ and $\alpha^r$. For instance, the other fundamental thermodynamic properties can be obtained from \begin{equation} \frac{p}{\rho RT}=1+\delta \left( \frac{\partial \alpha^r}{\partial \delta} \right)_{\tau} \end{equation} \begin{equation} \frac{h}{RT}=\tau\left[\left( \frac{\partial \alpha^0}{\partial \tau} \right)_{\delta} + \left( \frac{\partial \alpha^r}{\partial \tau} \right)_{\delta} \right]+\delta \left( \frac{\partial \alpha^r}{\partial \delta} \right)_{\tau}+1 \end{equation} \begin{equation} \frac{s}{R}=\tau\left[\left( \frac{\partial \alpha^0}{\partial \tau} \right)_{\delta} + \left( \frac{\partial \alpha^r}{\partial \tau} \right)_{\delta} \right]-\alpha^0-\alpha^r \end{equation} where $\delta=\rho/\rho_c$, $\tau=T_c/T$, and $\rho_c$ is the critical density and $T_c$ is the critical temperature. The exact form of the non-dimensional Helmholtz energy terms is fluid dependent, but a canonical example is the propane equation of state \citep{Lemmon-2009}. Analytic derivatives of $\alpha^0$ and $\alpha^r$ with respect to $\tau$ and $\delta$ are presented in the paper of Lemmon \citeyearpar{Lemmon-2009}. Additionally, other thermodynamic parameters (speed of sound, specific heats, etc.) can be obtained analytically. As the equations of state use temperature and density as the fundamental properties, if other inputs are desired, it is necessary to employ numerical solvers to obtain temperature and density given the set of inputs. {\bf Saturation curve} In the two-phase region, as well as along the saturation curves, it is necessary to evaluate the phase equilibrium between the saturated liquid and the saturated vapor. For a pure fluid, it is known that at equilibrium the temperatures, pressures and Gibbs free energy in each phase are the same. A number of numerical methods can be used to carry out the necessary equilibrium calculations, but the algorithm implemented in CoolProp is that of Akasaka \citeyearpar{Akasaka-2008}. When this solver begins at the values from the ancillary equations, this solver generally can yield convergence for temperatures below 0.1 K less than critical temperature. In the near vicinity of the critical point, the behavior of the saturation solvers becomes significantly less robust, even with good guess values for the saturation densities. As a result, it is necessary to employ other methods to extend the saturation curves all the way up to the critical temperature. In CoolProp, the saturation solver of Akasaka is used to get as close to the critical temperature as possible. Beyond that point, a spline curve is used for the saturation curve, where the value and derivative constraints can be obtained directly. This yields a smooth ($C_1$ continuous) transition from the EOS to the critical region spline. {\bf TABULAR TAYLOR SERIES EXPANSION INTERPOLATION} While the evaluation of the thermodynamic properties using CoolProp has been optimized in order to achieve computational speeds better than the state of the art thermophysical property databases \cite{Lemmon2010}, the evaluation of thermodynamic properties using the full equation of state is too slow for use in dynamic simulations. For that reason, the tabular Taylor series expansion method has been extended to all the fluids in the CoolProp database. This method was originally proposed for the evaluation of the thermodynamic properties of water \citep{Miyagawa-2001}, but it works just as well for other fluids. This TTSE method is based on a two-dimensional Taylor expansion around each point in a grid of tabulated data points. Thus, the expansion of temperature in terms of pressure and enthalpy can be expressed as \begin{equation} T = T_{i,j}+\Delta h\left(\frac{\partial T}{\partial h}\right)_{p}+\Delta p\left(\frac{\partial T}{\partial p}\right)_{h}+\frac{\Delta h^2}{2}\left(\frac{\partial^2 T}{\partial h^2}\right)_{p}+\frac{\Delta p^2}{2}\left(\frac{\partial^2T}{\partial p^2}\right)_{h}+\Delta h\Delta p\left(\frac{\partial^2T}{\partial p\partial h}\right) \end{equation} where each of the partial derivatives are the values evaluated at the $i,j$ grid point. Thus if the values of $\Delta h = h-h_i$ and $\Delta p = p-p_j$ are known, it is then possible to evaluate the dependent variable ($T$ in this case). The same form of expansion can be carried out with entropy or density as the dependent variable. Pressure and enthalpy are used as the independent variables as they are one of the most computationally expensive pairs of input values, and are most commonly used as the state variables in dynamic modeling. In principle this tabular method can be used with any pair of independent variables. Furthermore, a similar methodology can be employed for the saturation properties, which can be evaluated based on a tabular one-dimensional Taylor series with pressure as the independent variable. As with the single-phase tables, pressure is used as the independent variable as it is the independent variable that requires the most computational effort in the two-phase region. Speed Comparison For pressure and enthalpy as inputs, the TTSE method is extremely fast. For the same configuration in Modelica (a dynamic modeling programming language), the computational time of CoolProp using the TTSE method is 8.1 times less than that when using the full equation of state. Figure \ref{fig:speeds} compares several different thermophysical property packages in Modelica on the same configuration. Transport properties (viscosity and thermal conductivity) are not calculated. This benchmark example can be found in the CoolProp2Modelica package for Modelica. For the sake of the benchmark, the thermodynamic properties are called 20,000 times along an isobar with various libraries spanning the three regions (sub-cooled, two-phase, superheated). One grid point corresponds to one call to the library. The Modelica library CoolProp2Modelica is derived from the ExternalMedia library developed by Casella \citep{Casella-2008}. A speed comparison on a complete ORC model was also performed. The selected ORC model is the one proposed by Quoilin \citeyearpar{Quoilin-2011}, comprising two discretized heat exchangers (20 cells) and pump/expander models based on efficiency curves, plus a control system with variable set point temperature based on two PI controllers. The simulation length is 1669 seconds, it is solved in 142 seconds with TILMedia, 91 seconds with CoolProp and 13.5 seconds with the CoolProp/TTSE method. These results should be considered to be representative, but they are not one-to-one comparisons due to the vagaries of the integrator in Dymola.