From c63b0e95e2ff439c08484d243363c3d34fea141b Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Fri, 30 May 2014 15:16:32 +0200 Subject: [PATCH] Implemented conductivity for CO2 from Scalabrin. All CO2 tests pass now. Signed-off-by: Ian Bell --- CoolPropBibTeXLibrary.bib | 13 +++ dev/fluids/CarbonDioxide.json | 85 +++++++++++++------ include/CoolPropFluid.h | 2 + src/Backends/Helmholtz/Fluids/FluidLibrary.h | 12 +++ .../Helmholtz/HelmholtzEOSMixtureBackend.cpp | 4 + src/Backends/Helmholtz/TransportRoutines.cpp | 16 ++++ src/Backends/Helmholtz/TransportRoutines.h | 1 + src/Backends/REFPROP/REFPROPMixtureBackend.h | 1 + src/Tests/CoolProp-Tests.cpp | 16 ++-- 9 files changed, 118 insertions(+), 32 deletions(-) diff --git a/CoolPropBibTeXLibrary.bib b/CoolPropBibTeXLibrary.bib index c22c0e5e..b066d4f3 100644 --- a/CoolPropBibTeXLibrary.bib +++ b/CoolPropBibTeXLibrary.bib @@ -1164,6 +1164,19 @@ timestamp = {2013.04.10} } +@ARTICLE{Scalabrin-JPCRD-2006-CO2, + author = {G. Scalabrin and P. Marchi and F. Finezzo and R. Span}, + title = {{A Reference Multiparameter Thermal Conductivity Equation for Carbon + Dioxide with an Optimized Functional Form}}, + journal = {J. Phys. Chem Ref. Data}, + year = {2006}, + volume = {35}, + pages = {1549-1575}, + number = {4}, + owner = {Belli}, + timestamp = {2014.05.30} +} + @MASTERSTHESIS{Schroeder-MSTHESIS-2011, author = {Jacob Armin Schroeder}, title = {{A New Fundamental Equation for Ethanol}}, diff --git a/dev/fluids/CarbonDioxide.json b/dev/fluids/CarbonDioxide.json index 11d78eeb..9ced3e67 100644 --- a/dev/fluids/CarbonDioxide.json +++ b/dev/fluids/CarbonDioxide.json @@ -456,42 +456,79 @@ "NAME": "CarbonDioxide", "TRANSPORT": { "conductivity": { - "BibTeX": "Vesovic-JPCRD-1990", + "BibTeX": "Scalabrin-JPCRD-2006-CO2", "critical": { - "GAMMA": 0.052, - "R0": 1.01, - "gamma": 1.2415, - "qD": 2500000000.0, - "type": "simplified_Olchowy_Sengers", - "zeta0": 1.5e-10 + "hardcoded": "CarbonDioxideScalabrinJPCRD2006" }, "dilute": { - "hardcoded": "CO2" + "hardcoded": "none" }, "residual": { - "B": [ - 2.447164e-05, - 8.705605e-08, - -6.54795e-11, - 6.594919e-14 + "A": [ + 0.0370597124660408, + 0.0007696647124242399, + 0.0075538113451464, + -0.032416436589336, + 0.078894098855904, + 0.0177830586854928, + 0.10744756315137599, + 0.31839746259479995, + -0.00082691726160072, + 2.0846013855224798e-05 ], - "T_reducing": 304.107, + "T_reducing": 304.1282, "T_reducing_units": "K", "d": [ - 1, - 2, - 3, - 4 + 1.0, + 5.0, + 1.0, + 1.0, + 2.0, + 0.0, + 5.0, + 9.0, + 0.0, + 0.0 ], - "rhomass_reducing": 1, + "gamma": [ + 0, + 0, + 0, + 5, + 5, + 5, + 5, + 5, + 5, + 5 + ], + "l": [ + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "rhomass_reducing": 467.6, "rhomass_reducing_units": "kg/m^3", "t": [ - 0, - 0, - 0, - 0 + 0.0, + 0.0, + -1.5, + 0.0, + -1.0, + -1.5, + -1.5, + -1.5, + -3.5, + -5.5 ], - "type": "polynomial" + "type": "polynomial_and_exponential" } }, "viscosity": { diff --git a/include/CoolPropFluid.h b/include/CoolPropFluid.h index 7daad769..e81c1ada 100644 --- a/include/CoolPropFluid.h +++ b/include/CoolPropFluid.h @@ -64,6 +64,7 @@ struct ConductivityDiluteVariables CONDUCTIVITY_DILUTE_ETA0_AND_POLY, CONDUCTIVITY_DILUTE_CO2, CONDUCTIVITY_DILUTE_ETHANE, + CONDUCTIVITY_DILUTE_NONE, CONDUCTIVITY_DILUTE_NOT_SET }; int type; @@ -120,6 +121,7 @@ struct ConductivityCriticalVariables CONDUCTIVITY_CRITICAL_R123, CONDUCTIVITY_CRITICAL_AMMONIA, CONDUCTIVITY_CRITICAL_NONE, + CONDUCTIVITY_CRITICAL_CARBONDIOXIDE_SCALABRIN_JPCRD_2006, CONDUCTIVITY_CRITICAL_NOT_SET }; int type; diff --git a/src/Backends/Helmholtz/Fluids/FluidLibrary.h b/src/Backends/Helmholtz/Fluids/FluidLibrary.h index 7b66fe96..8129b65a 100644 --- a/src/Backends/Helmholtz/Fluids/FluidLibrary.h +++ b/src/Backends/Helmholtz/Fluids/FluidLibrary.h @@ -270,6 +270,12 @@ protected: if (!target.compare("Ethane")){ fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE; return; } + else if (!target.compare("Ethane")){ + fluid.transport.viscosity_dilute.type = CoolProp::ViscosityDiluteVariables::VISCOSITY_DILUTE_ETHANE; return; + } + else{ + throw ValueError(format("hardcoded dilute viscosity [%s] is not understood for fluid %s",target.c_str(),fluid.name.c_str())); + } } std::string type = cpjson::get_string(dilute, "type"); if (!type.compare("collision_integral")){ @@ -528,6 +534,9 @@ protected: else if (!target.compare("Ethane")){ fluid.transport.conductivity_dilute.type = CoolProp::ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_ETHANE; return; } + else if (!target.compare("none")){ + fluid.transport.conductivity_dilute.type = CoolProp::ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_NONE; return; + } else{ throw ValueError(format("hardcoded dilute conductivity term [%s] is not understood for fluid %s",target.c_str(), fluid.name.c_str())); } @@ -619,6 +628,9 @@ protected: else if (!target.compare("Ammonia")){ fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_AMMONIA; return; } + else if (!target.compare("CarbonDioxideScalabrinJPCRD2006")){ + fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_CARBONDIOXIDE_SCALABRIN_JPCRD_2006; return; + } else if (!target.compare("None")){ fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_NONE; return; } diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index 007ce30c..c520005c 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -299,6 +299,8 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void) lambda_dilute = TransportRoutines::conductivity_dilute_hardcoded_CO2(*this); break; case ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_ETHANE: lambda_dilute = TransportRoutines::conductivity_dilute_hardcoded_ethane(*this); break; + case ConductivityDiluteVariables::CONDUCTIVITY_DILUTE_NONE: + lambda_dilute = 0.0; break; default: throw ValueError(format("dilute conductivity type [%d] is invalid for fluid %s", components[0]->transport.conductivity_dilute.type, name().c_str())); } @@ -317,6 +319,8 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void) lambda_critical = TransportRoutines::conductivity_critical_hardcoded_ammonia(*this); break; case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_NONE: lambda_critical = 0.0; break; + case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_CARBONDIOXIDE_SCALABRIN_JPCRD_2006: + lambda_critical = TransportRoutines::conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(*this); break; default: throw ValueError(format("critical conductivity type [%d] is invalid for fluid %s", components[0]->transport.viscosity_dilute.type, name().c_str())); } diff --git a/src/Backends/Helmholtz/TransportRoutines.cpp b/src/Backends/Helmholtz/TransportRoutines.cpp index 07d24e1d..ffa9042d 100644 --- a/src/Backends/Helmholtz/TransportRoutines.cpp +++ b/src/Backends/Helmholtz/TransportRoutines.cpp @@ -569,6 +569,20 @@ long double TransportRoutines::conductivity_critical_hardcoded_R123(HelmholtzEOS return a13*exp(a14*pow(HEOS.tau()-1,4)+a15*pow(HEOS.delta()-1,2)); }; +long double TransportRoutines::conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(HelmholtzEOSMixtureBackend &HEOS){ + long double nc = 0.775547504e-3*4.81384, Tr = HEOS.T()/304.1282, alpha, rhor = HEOS.keyed_output(iDmass)/467.6; + static long double a[] = {0.0, 3.0, 6.70697, 0.94604, 0.30, 0.30, 0.39751, 0.33791, 0.77963, 0.79857, 0.90, 0.02, 0.20}; + + // Equation 6 from Scalabrin + alpha = 1-a[10]*acosh(1+a[11]*pow(pow(1-Tr,2),a[12])); + + // Equation 5 from Scalabrin + long double numer = rhor*exp(-pow(rhor,a[1])/a[1]-pow(a[2]*(Tr-1),2)-pow(a[3]*(rhor-1),2)); + long double braced = (1-1/Tr)+a[4]*pow(pow(rhor-1,2),0.5/a[5]); + long double denom = pow(pow(pow(braced, 2), a[6]) + pow(pow(a[7]*(rhor-alpha), 2), a[8]),a[9]); + return nc*numer/denom; +} + long double TransportRoutines::conductivity_dilute_hardcoded_CO2(HelmholtzEOSMixtureBackend &HEOS){ double e_k = 251.196, Tstar; @@ -938,4 +952,6 @@ long double TransportRoutines::conductivity_ECS(HelmholtzEOSMixtureBackend &HEOS return lambda; } + + }; /* namespace CoolProp */ \ No newline at end of file diff --git a/src/Backends/Helmholtz/TransportRoutines.h b/src/Backends/Helmholtz/TransportRoutines.h index ab298870..29afef5b 100644 --- a/src/Backends/Helmholtz/TransportRoutines.h +++ b/src/Backends/Helmholtz/TransportRoutines.h @@ -161,6 +161,7 @@ public: */ static long double conductivity_critical_simplified_Olchowy_Sengers(HelmholtzEOSMixtureBackend &HEOS); + static long double conductivity_critical_hardcoded_CO2_ScalabrinJPCRD2006(HelmholtzEOSMixtureBackend &HEOS); static long double conductivity_critical_hardcoded_R123(HelmholtzEOSMixtureBackend &HEOS); static long double conductivity_dilute_hardcoded_CO2(HelmholtzEOSMixtureBackend &HEOS); static long double conductivity_dilute_hardcoded_ethane(HelmholtzEOSMixtureBackend &HEOS); diff --git a/src/Backends/REFPROP/REFPROPMixtureBackend.h b/src/Backends/REFPROP/REFPROPMixtureBackend.h index 1cce9f7d..d38af71a 100644 --- a/src/Backends/REFPROP/REFPROPMixtureBackend.h +++ b/src/Backends/REFPROP/REFPROPMixtureBackend.h @@ -14,6 +14,7 @@ namespace CoolProp { + class REFPROPMixtureBackend : public AbstractState { protected: int Ncomp; diff --git a/src/Tests/CoolProp-Tests.cpp b/src/Tests/CoolProp-Tests.cpp index 384d434b..d50b1183 100644 --- a/src/Tests/CoolProp-Tests.cpp +++ b/src/Tests/CoolProp-Tests.cpp @@ -351,14 +351,14 @@ vel("R123", "T", 180, "Dmass", 0.2873e-2, "L", 2.473e-3, 1e-3), vel("R123", "T", 430, "Dmass", 996.35, "L", 45.62e-3, 1e-3), vel("R123", "T", 430, "Dmass", 166.9, "L", 21.03e-3, 1e-3), -// From Vesovic, JPCRD, 1990 -vel("CO2", "T", 220, "Dmass", 2.440, "L", 10.90e-3, 1e-4), -vel("CO2", "T", 300, "Dmass", 1.773, "L", 16.77e-3, 1e-4), -vel("CO2", "T", 800, "Dmass", 0.662, "L", 56.65e-3, 1e-4), -vel("CO2", "T", 304, "Dmass", 254.3205, "L", 42.52e-3, 1e-4), -vel("CO2", "T", 220, "Dmass", 1194.86, "L", 187.50e-3, 1e-4), -vel("CO2", "T", 300, "Dmass", 1029.27, "L", 137.61e-3, 1e-4), -vel("CO2", "T", 800, "Dmass", 407.828, "L", 78.47e-3, 1e-4), +// From Scalabrin, JPCRD, 2006 +vel("CO2", "T", 218, "Q", 0, "L", 181.09e-3, 1e-4), +vel("CO2", "T", 218, "Q", 1, "L", 10.837e-3, 1e-4), +vel("CO2", "T", 304, "Q", 0, "L", 140.3e-3, 1e-4), +vel("CO2", "T", 304, "Q", 1, "L", 217.95e-3, 1e-4), +vel("CO2", "T", 225, "Dmass", 0.23555, "L", 11.037e-3, 1e-4), +vel("CO2", "T", 275, "Dmass", 1281.64, "L", 238.44e-3, 1e-4), + // From Friend, JPCRD, 1991 vel("Ethane", "T", 100, "Dmass", 1e-13, "L", 3.46e-3, 1e-2),