From 14019cfd2eef5b1dad9e6e50714208a55dfbce86 Mon Sep 17 00:00:00 2001 From: Steven DeCaluwe Date: Mon, 28 Jul 2014 21:02:18 +0000 Subject: [PATCH] Adding HighPressureGas transport module. --- include/cantera/thermo/RedlichKwongMFTP.h | 6 ++++ include/cantera/thermo/ThermoPhase.h | 11 +++++++ include/cantera/transport.h | 1 + include/cantera/transport/MultiTransport.h | 1 + include/cantera/transport/TransportBase.h | 1 + include/cantera/transport/TransportParams.h | 8 ++++++ src/thermo/RedlichKwongMFTP.cpp | 32 +++++++++++++++++++++ src/transport/TransportFactory.cpp | 15 ++++++++++ 8 files changed, 75 insertions(+) diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 037ee9138..a28a2b87c 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -370,6 +370,12 @@ public: /// Critical pressure (Pa). virtual doublereal critPressure() const; + + /// Critical volume (m3/kmol) + virtual doublereal critVolume() const; + + // Critical compressibility (unitless) + virtual doublereal critCompressibility() const; /// Critical density (kg/m3). virtual doublereal critDensity() const; diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 42182147f..89ff730b3 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -1199,6 +1199,17 @@ public: virtual doublereal critPressure() const { throw NotImplementedError("ThermoPhase::critPressure"); } + + /// Critical volume (m3/kmol). + virtual doublereal critVolume() const { + throw NotImplementedError("ThermoPhase::critVolume"); + } + + /// Critical compressibility (unitless). + virtual doublereal critCompressibility() const { + throw NotImplementedError("ThermoPhase::critCompressibility"); + } + /// Critical density (kg/m3). virtual doublereal critDensity() const { diff --git a/include/cantera/transport.h b/include/cantera/transport.h index 3a216886e..7bbf222da 100644 --- a/include/cantera/transport.h +++ b/include/cantera/transport.h @@ -15,4 +15,5 @@ #include "transport/MixTransport.h" #include "transport/PecosTransport.h" #include "transport/LiquidTransport.h" +#include "transport/HighPressureGasTransport.h" #endif diff --git a/include/cantera/transport/MultiTransport.h b/include/cantera/transport/MultiTransport.h index 0ad9f770a..7af07f131 100644 --- a/include/cantera/transport/MultiTransport.h +++ b/include/cantera/transport/MultiTransport.h @@ -164,6 +164,7 @@ public: vector_fp m_eps; vector_fp m_sigma; vector_fp m_alpha; + vector_fp m_w_ac; DenseMatrix m_dipole; protected: diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index b51623798..29e9830a9 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -44,6 +44,7 @@ const int cMulticomponent = 200; const int CK_Multicomponent = 202; const int cMixtureAveraged = 210; const int CK_MixtureAveraged = 211; +const int cHighP = 270; const int cSolidTransport = 300; const int cDustyGasTransport = 400; const int cUserTransport = 500; diff --git a/include/cantera/transport/TransportParams.h b/include/cantera/transport/TransportParams.h index 49dce3b18..6f0553ee2 100644 --- a/include/cantera/transport/TransportParams.h +++ b/include/cantera/transport/TransportParams.h @@ -236,6 +236,14 @@ public: * Length nsp * nsp .This is a symmetric matrix */ DenseMatrix delta; + + //! Pitzer acentric factor + /*! + * Length is the number of species in the phase. + * Unitless + */ + vector_fp w_ac; + }; } // End of namespace Cantera diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 7f175bce3..3e55d6024 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -672,6 +672,38 @@ doublereal RedlichKwongMFTP::critPressure() const return pc; } + +doublereal RedlichKwongMFTP::critVolume() const +{ + double pc, tc, vc; + double a0 = 0.0; + double aT = 0.0; + for (size_t i = 0; i < m_kk; i++) { + for (size_t j = 0; j ::iterator iter = m_models.begin(); @@ -350,6 +352,10 @@ Transport* TransportFactory::newTransport(const std::string& transportModel, tr = new MixTransport; initTransport(tr, phase, CK_Mode, log_level); break; + case cHighP: + tr = new HighPressureGasTransport; + initTransport(tr, phase, 0, log_level); + break; // adding pecos transport model 2/13/12 case cPecosTransport: tr = new PecosTransport; @@ -438,6 +444,7 @@ void TransportFactory::setupMM(const std::vector &transport_dat tr.poly.resize(nsp); tr.sigma.resize(nsp); tr.eps.resize(nsp); + tr.w_ac.resize(nsp); XML_Node root, log; getTransportData(transport_database, log, tr.thermo->speciesNames(), tr); @@ -729,6 +736,14 @@ void TransportFactory::getTransportData(const std::vector &xspe throw TransportDBError(i, "invalid geometry"); } + // Pitzer's acentric factor: + double acentric; + ctml::getOptionalFloat(node, "acentric_factor", acentric); + if (acentric) { + tr.w_ac[j] = acentric; + } /*else { + throw TransportDBError(i, "acentric factor not defined"); + }*/ // Well-depth parameter in Kelvin (converted to Joules) double welldepth = ctml::getFloat(node, "LJ_welldepth"); if (welldepth >= 0.0) {