Adding HighPressureGas transport module.
This commit is contained in:
parent
8954090881
commit
14019cfd2e
8 changed files with 75 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@
|
|||
#include "transport/MixTransport.h"
|
||||
#include "transport/PecosTransport.h"
|
||||
#include "transport/LiquidTransport.h"
|
||||
#include "transport/HighPressureGasTransport.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <m_kk; j++) {
|
||||
size_t counter = i + m_kk * j;
|
||||
a0 += moleFractions_[i] * moleFractions_[j] * a_coeff_vec(0, counter);
|
||||
aT += moleFractions_[i] * moleFractions_[j] * a_coeff_vec(1, counter);
|
||||
}
|
||||
}
|
||||
calcCriticalConditions(m_a_current, m_b_current, a0, aT, pc, tc, vc);
|
||||
return vc;
|
||||
}
|
||||
|
||||
doublereal RedlichKwongMFTP::critCompressibility() 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 <m_kk; j++) {
|
||||
size_t counter = i + m_kk * j;
|
||||
a0 += moleFractions_[i] * moleFractions_[j] * a_coeff_vec(0, counter);
|
||||
aT += moleFractions_[i] * moleFractions_[j] * a_coeff_vec(1, counter);
|
||||
}
|
||||
}
|
||||
calcCriticalConditions(m_a_current, m_b_current, a0, aT, pc, tc, vc);
|
||||
return pc*vc/tc/GasConstant;
|
||||
}
|
||||
|
||||
doublereal RedlichKwongMFTP::critDensity() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "cantera/transport/SimpleTransport.h"
|
||||
#include "cantera/transport/LiquidTransport.h"
|
||||
#include "cantera/transport/AqueousTransport.h"
|
||||
#include "cantera/transport/HighPressureGasTransport.h"
|
||||
#include "cantera/transport/TransportFactory.h"
|
||||
|
||||
#include "cantera/numerics/polyfit.h"
|
||||
|
|
@ -175,6 +176,7 @@ TransportFactory::TransportFactory() :
|
|||
m_models["Aqueous"] = cAqueousTransport;
|
||||
m_models["Simple"] = cSimpleTransport;
|
||||
m_models["User"] = cUserTransport;
|
||||
m_models["HighP"] = cHighP;
|
||||
m_models["Pecos"] = cPecosTransport;
|
||||
m_models["None"] = None;
|
||||
for (map<string, int>::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<const XML_Node*> &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<const XML_Node*> &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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue