Removed calculatePsat from matlab toolbox, and overwrote 'satPressure' for MixtureFugacityTP
class to point to the calculatePsat function. Removed 'const' declaration from satPressure within the ThermoPhase class.
This commit is contained in:
parent
1b9d23c120
commit
6321cf4c8e
7 changed files with 24 additions and 25 deletions
|
|
@ -765,6 +765,17 @@ public:
|
|||
*/
|
||||
doublereal calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
|
||||
doublereal& molarVolLiquid);
|
||||
|
||||
public:
|
||||
//! Calculate the saturation pressure at the current mixture content for the given temperature
|
||||
/*!
|
||||
* @param TKelvin (input) Temperature (Kelvin)
|
||||
* @param molarVolGas (return) Molar volume of the gas
|
||||
* @param molarVolLiquid (return) Molar volume of the liquid
|
||||
*
|
||||
* @return Returns the saturation pressure at the given temperature
|
||||
*/
|
||||
virtual doublereal satPressure(doublereal TKelvin);
|
||||
|
||||
protected:
|
||||
//! Calculate the pressure given the temperature and the molar volume
|
||||
|
|
|
|||
|
|
@ -1278,7 +1278,7 @@ public:
|
|||
/*!
|
||||
* @param t Temperature (Kelvin)
|
||||
*/
|
||||
virtual doublereal satPressure(doublereal t) const {
|
||||
virtual doublereal satPressure(doublereal t) {
|
||||
err("satPressure");
|
||||
return -1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
function v = calculatePsat(a, T)
|
||||
% calcPsat - Calculate saturation pressure for temperature T (in K) for a
|
||||
% fluid with the MFTP thermo model.
|
||||
v = thermo_get(a.tp_id,26,T);
|
||||
|
|
@ -734,7 +734,7 @@ extern "C" {
|
|||
double th_satTemperature(int n, double p)
|
||||
{
|
||||
try {
|
||||
return ThermoCabinet::get<PureFluidPhase>(n).satTemperature(p);
|
||||
return ThermoCabinet::item(n).satTemperature(p);
|
||||
} catch (...) {
|
||||
return handleAllExceptions(DERR, DERR);
|
||||
}
|
||||
|
|
@ -743,7 +743,7 @@ extern "C" {
|
|||
double th_satPressure(int n, double t)
|
||||
{
|
||||
try {
|
||||
return ThermoCabinet::get<PureFluidPhase>(n).satPressure(t);
|
||||
return ThermoCabinet::item(n).satPressure(t);
|
||||
} catch (...) {
|
||||
return handleAllExceptions(DERR, DERR);
|
||||
}
|
||||
|
|
@ -769,18 +769,6 @@ extern "C" {
|
|||
}
|
||||
}
|
||||
|
||||
//-------------MFTP Models------------------//
|
||||
|
||||
|
||||
double th_calculatePsat(int n, double TKelvin, double molarVolGas, double molarVolLiquid)
|
||||
{
|
||||
try {
|
||||
return ThermoCabinet::get<MixtureFugacityTP>(n).calculatePsat(TKelvin, molarVolGas, molarVolLiquid);
|
||||
} catch (...) {
|
||||
return handleAllExceptions(DERR, DERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------- Kinetics ------------------//
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ extern "C" {
|
|||
CANTERA_CAPI double th_cv_mole(int n);
|
||||
CANTERA_CAPI double th_pressure(int n);
|
||||
CANTERA_CAPI int th_setPressure(int n, double p);
|
||||
CANTERA_CAPI double th_calculatePsat(int n, double TKelvin, double molarVolGas, double molarVolLiquid);
|
||||
CANTERA_CAPI double th_enthalpy_mass(int n);
|
||||
CANTERA_CAPI double th_intEnergy_mass(int n);
|
||||
CANTERA_CAPI double th_entropy_mass(int n);
|
||||
|
|
|
|||
|
|
@ -175,11 +175,6 @@ static void thermoget(int nlhs, mxArray* plhs[],
|
|||
case 25:
|
||||
vv = th_electricPotential(n);
|
||||
break;
|
||||
case 26:
|
||||
double molarVolGas, molarVolLiquid;
|
||||
TK = getDouble(prhs[3]);
|
||||
vv = th_calculatePsat(n,TK,molarVolGas,molarVolLiquid);
|
||||
break;
|
||||
default:
|
||||
ok = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "cantera/thermo/VPSSMgr.h"
|
||||
#include "cantera/thermo/PDSS.h"
|
||||
#include "cantera/base/stringUtils.h"
|
||||
#include "cantera/base/xml.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -828,6 +829,15 @@ doublereal MixtureFugacityTP::densSpinodalGas() const
|
|||
throw CanteraError("", "unimplmented");
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
doublereal MixtureFugacityTP::satPressure(doublereal TKelvin)
|
||||
{
|
||||
doublereal molarVolGas;
|
||||
doublereal molarVolLiquid;
|
||||
return calculatePsat(TKelvin, molarVolGas, molarVolLiquid);
|
||||
}
|
||||
|
||||
|
||||
doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
|
||||
doublereal& molarVolLiquid)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue