Revision: 3431
Author:
steven....@gmail.com
Date: Tue Jun 9 16:49:34 2015 UTC
Log: Trying to find source of error in RedlichKwongMFTP::setState_UV
https://code.google.com/p/cantera/source/detail?r=3431
Modified:
/cantera/trunk/include/cantera/thermo/RedlichKwongMFTP.h
/cantera/trunk/include/cantera/transport/HighPressureGasTransport.h
/cantera/trunk/src/clib/ct.cpp
/cantera/trunk/src/thermo/RedlichKwongMFTP.cpp
=======================================
--- /cantera/trunk/include/cantera/thermo/RedlichKwongMFTP.h Tue Jun 9
16:49:26 2015 UTC
+++ /cantera/trunk/include/cantera/thermo/RedlichKwongMFTP.h Tue Jun 9
16:49:34 2015 UTC
@@ -131,20 +131,6 @@
*/
virtual doublereal pressure() const;
- //! Set the specific internal energy (J/kg) and specific volume
(m^3/kg).
- /*!
- * This function fixes the internal state of the phase so that
- * the specific internal energy and specific volume have the value of
the input parameters.
- *
- * @param u specific internal energy (J/kg)
- * @param v specific volume (m^3/kg).
- * @param tol Optional parameter setting the tolerance of the
calculation.
- * Important for some applications where numerical
Jacobians
- * are being calculated.Defaults to 1.0E-4
- */
- virtual void setState_UV(doublereal u, doublereal v, doublereal tol =
1.e-4);
-
-
// @}
protected:
@@ -488,18 +474,6 @@
*/
void readXMLCrossFluid(XML_Node& pureFluidParam);
- //! Carry out work in HP and UV calculations.
- /*!
- * @param h Specific enthalpy or internal energy (J/kg)
- * @param p Pressure (Pa) or specific volume (m^3/kg)
- * @param tol Optional parameter setting the tolerance of the
calculation.
- * Defaults to 1.0E-4. Important for some applications
where
- * numerical Jacobians are being calculated.
- * @param doUV True if solving for UV, false for HP.
- */
- void setState_HPorUV(doublereal h, doublereal p,
- doublereal tol = 1.e-4, bool doUV = false);
-
private:
//! @internal Initialize the internal lengths in this object.
=======================================
--- /cantera/trunk/include/cantera/transport/HighPressureGasTransport.h Thu
Feb 26 21:52:52 2015 UTC
+++ /cantera/trunk/include/cantera/transport/HighPressureGasTransport.h Tue
Jun 9 16:49:34 2015 UTC
@@ -14,7 +14,7 @@
namespace Cantera
{
-//! Class MultiTransport implements transport properties for
+//! Class HighPressureGasTransport implements transport properties for
//! high pressure gas mixtures.
/*!
* The implementation employs a method of corresponding states, using
=======================================
--- /cantera/trunk/src/clib/ct.cpp Thu Feb 26 21:52:52 2015 UTC
+++ /cantera/trunk/src/clib/ct.cpp Tue Jun 9 16:49:34 2015 UTC
@@ -557,7 +557,8 @@
if (vals[1] < 0.0)
throw CanteraError("th_set_UV",
"specific volume cannot be negative");
- ThermoCabinet::item(n).setState_UV(vals[0],vals[1]);
+ //This is patently wrong.
+ ThermoCabinet::item(n).setState_HP(vals[0],vals[1]);
if (ThermoCabinet::item(n).temperature() < 0.0)
throw CanteraError("th_set_UV",
"temperature cannot be negative");
=======================================
--- /cantera/trunk/src/thermo/RedlichKwongMFTP.cpp Tue Jun 9 16:49:30 2015
UTC
+++ /cantera/trunk/src/thermo/RedlichKwongMFTP.cpp Tue Jun 9 16:49:34 2015
UTC
@@ -705,7 +705,7 @@
setState_PX(pres, &m_pp[0]);
}
-
+/*
void RedlichKwongMFTP::setState_UV(doublereal u, doublereal v, doublereal
dTtol)
{
setState_HPorUV(u, v, dTtol, true);
@@ -870,10 +870,10 @@
}
}
// We are here when there hasn't been convergence
- /*
- * Formulate a detailed error message, since questions seem to
- * arise often about the lack of convergence.
- */
+ //
+ // Formulate a detailed error message, since questions seem to
+ // arise often about the lack of convergence.
+ //
string ErrString = "No convergence in 500 iterations\n";
if (doUV) {
ErrString += "\tTarget Internal Energy = " + fp2str(Htarget)
+ "\n";
@@ -899,7 +899,7 @@
} else {
throw CanteraError("setState_HPorUV (HP)", ErrString);
}
-}
+}*/
void RedlichKwongMFTP::initLengths()