From bb4035467eab2fa0609302291e839b19795332b8 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Tue, 27 May 2014 11:49:46 +0200 Subject: [PATCH] Added ammonia conductivity Signed-off-by: Ian Bell --- dev/fluids/Ammonia.json | 56 +++++++++++++++++++ include/CoolPropFluid.h | 1 + src/Backends/Helmholtz/Fluids/FluidLibrary.h | 3 + .../Helmholtz/HelmholtzEOSMixtureBackend.cpp | 2 + src/Backends/Helmholtz/TransportRoutines.cpp | 34 +++++++++++ src/Backends/Helmholtz/TransportRoutines.h | 2 + src/Tests/CoolProp-Tests.cpp | 9 ++- 7 files changed, 104 insertions(+), 3 deletions(-) diff --git a/dev/fluids/Ammonia.json b/dev/fluids/Ammonia.json index cf249c73..155053d9 100644 --- a/dev/fluids/Ammonia.json +++ b/dev/fluids/Ammonia.json @@ -292,6 +292,62 @@ ], "NAME": "Ammonia", "TRANSPORT": { + "conductivity": { + "BibTeX": "Tufeu-BBPC-1984", + "critical": { + "hardcoded": "Ammonia" + }, + "dilute": { + "A": [ + 0.03589, + -0.000175, + 4.551e-07, + 1.685e-10, + -4.828e-13 + ], + "B": [ + 1.0 + ], + "T_reducing": 1, + "T_reducing_units": "K", + "m": [ + 0 + ], + "n": [ + 0, + 1, + 2, + 3, + 4 + ], + "type": "ratio_of_polynomials" + }, + "residual": { + "B": [ + 0.03808645, + 0.06647986, + -0.0300295, + 0.00998779 + ], + "T_reducing": 1, + "T_reducing_units": "K", + "d": [ + 1, + 2, + 3, + 4 + ], + "rhomass_reducing": 235, + "rhomass_reducing_units": "kg/m^3", + "t": [ + 0, + 0, + 0, + 0 + ], + "type": "polynomial" + } + }, "viscosity": { "BibTeX": "Fenghour-JPCRD-1995", "_note": "There is a mysterious factor of 100 missing from the Fenghour equation for the dilute gas. From REFPROP fluid file: !=0.021357*SQRT(MW)*(unknown factor of 100) [Chapman-Enskog term]", diff --git a/include/CoolPropFluid.h b/include/CoolPropFluid.h index 3aa5d1f0..2429a942 100644 --- a/include/CoolPropFluid.h +++ b/include/CoolPropFluid.h @@ -112,6 +112,7 @@ struct ConductivityCriticalVariables { enum ConductivityResidualEnum {CONDUCTIVITY_CRITICAL_SIMPLIFIED_OLCHOWY_SENGERS, CONDUCTIVITY_CRITICAL_R123, + CONDUCTIVITY_CRITICAL_AMMONIA, CONDUCTIVITY_CRITICAL_NOT_SET }; int type; diff --git a/src/Backends/Helmholtz/Fluids/FluidLibrary.h b/src/Backends/Helmholtz/Fluids/FluidLibrary.h index eab8d10f..041c0bcb 100644 --- a/src/Backends/Helmholtz/Fluids/FluidLibrary.h +++ b/src/Backends/Helmholtz/Fluids/FluidLibrary.h @@ -580,6 +580,9 @@ protected: if (!target.compare("R123")){ fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_R123; return; } + else if (!target.compare("Ammonia")){ + fluid.transport.conductivity_critical.type = CoolProp::ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_AMMONIA; return; + } else{ throw ValueError(format("critical conductivity term [%s] is not understood for fluid %s",target.c_str(), fluid.name.c_str())); } diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index 3cd25622..4254b5f7 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -264,6 +264,8 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void) lambda_critical = TransportRoutines::conductivity_critical_simplified_Olchowy_Sengers(*this); break; case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_R123: lambda_critical = TransportRoutines::conductivity_critical_hardcoded_R123(*this); break; + case ConductivityCriticalVariables::CONDUCTIVITY_CRITICAL_AMMONIA: + lambda_critical = TransportRoutines::conductivity_critical_hardcoded_ammonia(*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 bbe770dc..a996fa1c 100644 --- a/src/Backends/Helmholtz/TransportRoutines.cpp +++ b/src/Backends/Helmholtz/TransportRoutines.cpp @@ -710,4 +710,38 @@ long double TransportRoutines::conductivity_hardcoded_R23(HelmholtzEOSMixtureBac return (pow((rhoL-rhobar)/rhoL,C1)*lambda_DG+pow(rhobar/rhoL,C1)*lambda_L+DELTAlambda_c)/1e3; } +long double TransportRoutines::conductivity_critical_hardcoded_ammonia(HelmholtzEOSMixtureBackend &HEOS){ + + /* + From "Thermal Conductivity of Ammonia in a Large + Temperature and Pressure Range Including the Critical Region" + by R. Tufeu, D.Y. Ivanov, Y. Garrabos, B. Le Neindre, + Bereicht der Bunsengesellschaft Phys. Chem. 88 (1984) 422-427 + */ + + double T = HEOS.T(), Tc = 405.4, rhoc = 235, rho; + double LAMBDA=1.2, nu=0.63, gamma =1.24, DELTA=0.50,t,zeta_0_plus=1.34e-10,a_zeta=1,GAMMA_0_plus=0.423e-8; + double pi=3.141592654,a_chi,k_B=1.3806504e-23,X_T,DELTA_lambda,dPdT,eta_B,DELTA_lambda_id,DELTA_lambda_i; + + rho = HEOS.keyed_output(CoolProp::iDmass); + t = fabs((T-Tc)/Tc); + a_chi = a_zeta/0.7; + eta_B = (2.60+1.6*t)*1e-5; + dPdT = (2.18-0.12/exp(17.8*t))*1e5; // [Pa-K] + X_T = 0.61*rhoc+16.5*log(t); + // Along the critical isochore (only a function of temperature) (Eq. 9) + DELTA_lambda_i = LAMBDA*(k_B*T*T)/(6*pi*eta_B*(zeta_0_plus*pow(t,-nu)*(1+a_zeta*pow(t,DELTA))))*dPdT*dPdT*GAMMA_0_plus*pow(t,-gamma)*(1+a_chi*pow(t,DELTA)); + DELTA_lambda_id = DELTA_lambda_i*exp(-36*t*t); + if (rho < 0.6*rhoc) + { + DELTA_lambda = DELTA_lambda_id*(X_T*X_T)/(X_T*X_T+powInt(0.6*rhoc-0.96*rhoc,2))*powInt(rho,2)/powInt(0.6*rhoc,2); + } + else + { + DELTA_lambda = DELTA_lambda_id*(X_T*X_T)/(X_T*X_T+powInt(rho-0.96*rhoc,2)); + } + + return DELTA_lambda; +} + }; /* namespace CoolProp */ \ No newline at end of file diff --git a/src/Backends/Helmholtz/TransportRoutines.h b/src/Backends/Helmholtz/TransportRoutines.h index 1f78a414..355cd59b 100644 --- a/src/Backends/Helmholtz/TransportRoutines.h +++ b/src/Backends/Helmholtz/TransportRoutines.h @@ -169,6 +169,8 @@ public: static long double conductivity_hardcoded_water(HelmholtzEOSMixtureBackend &HEOS); static long double conductivity_hardcoded_R23(HelmholtzEOSMixtureBackend &HEOS); + static long double conductivity_critical_hardcoded_ammonia(HelmholtzEOSMixtureBackend &HEOS); + }; /* class TransportRoutines */ diff --git a/src/Tests/CoolProp-Tests.cpp b/src/Tests/CoolProp-Tests.cpp index 4d20f358..559eae4d 100644 --- a/src/Tests/CoolProp-Tests.cpp +++ b/src/Tests/CoolProp-Tests.cpp @@ -407,9 +407,12 @@ vel("Water", "T", 647.35, "Dmass", 422, "L", 448.883487e-3, 1e-6), vel("Water", "T", 647.35, "Dmass", 750, "L", 600.961346e-3, 1e-6), // From Shan, ASHRAE, 2000 -vel("R23", "T", 180, "Dmolar", 21097, "V", 143.19e-3, 1e-4), -vel("R23", "T", 420, "Dmolar", 7564, "V", 50.19e-3, 1e-4), -vel("R23", "T", 370, "Dmolar", 32.62, "V", 17.455e-3, 1e-4), +vel("R23", "T", 180, "Dmolar", 21097, "L", 143.19e-3, 1e-4), +vel("R23", "T", 420, "Dmolar", 7564, "L", 50.19e-3, 1e-4), +vel("R23", "T", 370, "Dmolar", 32.62, "L", 17.455e-3, 1e-4), + +vel("Ammonia", "T", 310, "Dmolar", 34320, "L", 0.45223303481784971, 1e-4), +vel("Ammonia", "T", 395, "Q", 0, "L", 0.2264480769301, 1e-4), };