diff --git a/Web/fluid_properties/Incompressibles.rst b/Web/fluid_properties/Incompressibles.rst index 73e1d584..818df9be 100644 --- a/Web/fluid_properties/Incompressibles.rst +++ b/Web/fluid_properties/Incompressibles.rst @@ -222,9 +222,14 @@ rewriting the equation in terms of our state variables :math:`p` and :math:`T`. dh &= \overbrace{ \left( \frac{\partial h}{\partial T} \right)_p}^{=c_p=c_v=c} dT + \left( \frac{\partial h}{\partial p} \right)_T dp \\ &= du + \underbrace{p dv}_{\stackrel{!}{=} 0} + v dp \\ +The two assumptions used above :math:`\left( \partial v / \partial T \right)_p \stackrel{!}{=} 0` +and :math:`\left( \partial u / \partial T \right)_p \stackrel{!}{=} \left( \partial u / \partial T \right)_v` +imply that :math:`v` is constant under all circumstances. Hence, we have to use +the specific volume at reference conditions to calculate enthalpy from the +integration in :math:`T` and :math:`p`. + Using only polynomials for the heat capacity functions, we can derive internal -energy and entropy by integrating the specific heat capacity in temperature, only -enthalpy requires an integration in both :math:`T` and :math:`p` +energy and entropy by integrating the specific heat capacity in temperature. .. _BaseValue: @@ -239,9 +244,7 @@ enthalpy requires an integration in both :math:`T` and :math:`p` C_{c}[i,0] \cdot \ln\left(\frac{T_{1}}{T_{0}}\right) + \sum_{j=0}^{m-1} \frac{1}{j+1} \cdot C_{c}[i,j+1] \cdot \left( T_{1}^{j+1} - T_{0}^{j+1} \right) \right) \\ - h &= u + v \cdot \left( p_{1} - p_{0} \right) - - + h &= u + v_{0} \cdot \left( p_{1} - p_{0} \right) According to Melinder :cite:`Melinder2010` and Skovrup :cite:`Skovrup2013`, diff --git a/include/IncompressibleFluid.h b/include/IncompressibleFluid.h index 697b1660..e2f0bd50 100644 --- a/include/IncompressibleFluid.h +++ b/include/IncompressibleFluid.h @@ -272,7 +272,7 @@ protected: * pressure employing functions for internal energy and * density. Provides consistent formulations. */ double h_u(double T, double p, double x) { - return u(T,p,x)+p/rho(T,p,x)-href; + return u(T,p,x)+(p-pref)/rhoref; }; /// Internal energy from h, p and rho. @@ -280,7 +280,7 @@ protected: * and pressure employing functions for enthalpy and * density. Provides consistent formulations. */ double u_h(double T, double p, double x) { - return h(T,p,x)-p/rho(T,p,x)+href; + return h(T,p,x)-(p-pref)/rhoref; }; diff --git a/src/Backends/Incompressible/IncompressibleFluid.cpp b/src/Backends/Incompressible/IncompressibleFluid.cpp index 9c7a85ee..6dbf5cf7 100644 --- a/src/Backends/Incompressible/IncompressibleFluid.cpp +++ b/src/Backends/Incompressible/IncompressibleFluid.cpp @@ -9,9 +9,11 @@ namespace CoolProp { -/// A thermophysical property provider for critical and reducing values as well as derivatives of Helmholtz energy +/// A thermophysical property provider for all properties /** -This fluid instance is populated using an entry from a JSON file +This fluid instance is populated using an entry from a JSON file and uses +simplified polynomial and exponential functions to calculate thermophysical +and transport properties. */ //IncompressibleFluid::IncompressibleFluid(); @@ -648,14 +650,22 @@ TEST_CASE("Internal consistency checks and example use cases for the incompressi double Tref = 25+273.15; double pref = 0.0; double xref = 0.0; - double href = 0.0; - double sref = 0.0; + double href = 127.0; + double sref = 23.0; XLT.set_reference_state(Tref, pref, xref, href, sref); /// A function to check coefficients and equation types. //XLT.validate(); + // Compare reference state + { + CHECK( check_abs(href,XLT.h(Tref,pref,xref),acc) ); + CHECK( check_abs(sref,XLT.s(Tref,pref,xref),acc) ); + } + href = 0; + sref = 0; + XLT.set_reference_state(Tref, pref, xref, href, sref); // Prepare the results and compare them to the calculated values double acc = 0.0001; double T = 273.15+50;