*** empty log message ***
This commit is contained in:
parent
673513edae
commit
d0de362e22
8 changed files with 48 additions and 37 deletions
|
|
@ -23,23 +23,22 @@ namespace Cantera {
|
|||
|
||||
|
||||
Kinetics::Kinetics() : m_ii(0), m_thermo(0),
|
||||
m_index(-1), m_surfphase(-1) {}
|
||||
m_index(-1), m_surfphase(-1), m_rxnphase(-1),
|
||||
m_mindim(4) {}
|
||||
|
||||
Kinetics::Kinetics(thermo_t* thermo) :
|
||||
m_ii(0),
|
||||
m_index(-1),
|
||||
m_surfphase(-1) ,
|
||||
m_rxnphase(0)
|
||||
m_rxnphase(0), m_mindim(4)
|
||||
{
|
||||
if (thermo) {
|
||||
addPhase(*thermo);
|
||||
}
|
||||
deprecatedMethod("Kinetics","Kinetics(thermo_t*)","Kinetics()");
|
||||
removeAtVersion("Kinetics(thermo_t*)","1.6.0");
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor. Does nothing.
|
||||
*/
|
||||
Kinetics::~Kinetics(){}
|
||||
|
||||
/**
|
||||
|
|
@ -189,6 +188,14 @@ namespace Cantera {
|
|||
else {
|
||||
m_start.push_back(0);
|
||||
}
|
||||
|
||||
// the phase with lowest dimensionality is assumed to be the
|
||||
// phase/interface at which reactions take place
|
||||
if (thermo.nDim() <= m_mindim) {
|
||||
m_mindim = thermo.nDim();
|
||||
m_rxnphase = nPhases();
|
||||
}
|
||||
|
||||
// there should only be one surface phase
|
||||
int ptype = -100;
|
||||
if (type() == cEdgeKinetics) ptype = cEdge;
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ namespace Cantera {
|
|||
/// @section kinmodman Models and Managers
|
||||
///
|
||||
/// A kinetics manager is a C++ class that implements a kinetics
|
||||
/// model, which is a set of mathematical equation describing how
|
||||
/// various kinetic quanities are to be computed -- reaction
|
||||
/// rates, species production rates, etc. Many different kinetics
|
||||
/// models might be defined to handle different types of kinetic
|
||||
/// processes. For example, one kinetics model might use
|
||||
/// model; a kinetics model is a set of mathematical equation
|
||||
/// describing how various kinetic quanities are to be computed --
|
||||
/// reaction rates, species production rates, etc. Many different
|
||||
/// kinetics models might be defined to handle different types of
|
||||
/// kinetic processes. For example, one kinetics model might use
|
||||
/// expressions valid for elementary reactions in ideal gas
|
||||
/// mixtures. It might, for example, require the reaction orders
|
||||
/// to be integral and equal to the forward stoichiometric
|
||||
|
|
@ -64,16 +64,6 @@ namespace Cantera {
|
|||
/// kinetics manager classes should have a common set of public
|
||||
/// methods, but differ in how they implement these methods.
|
||||
///
|
||||
/// All kinetics manager classes derive from a common base class
|
||||
/// (class Kinetics). The primary purpose of class Kinetics is to
|
||||
/// define the common public interface for the family of kinetics
|
||||
/// managers. For example, Kinetics defines a method
|
||||
/// getNetProductionRates that every family member is required to
|
||||
/// implement. The details of how it is implemented are left to
|
||||
/// the individual manager, but the end result must be that the
|
||||
/// net production rates for each species are written to an output
|
||||
/// array.
|
||||
///
|
||||
/// A kinetics manager computes reaction rates of progress,
|
||||
/// species production rates, equilibrium constants, and similar
|
||||
/// quantities for a reaction mechanism. All kinetics manager
|
||||
|
|
@ -142,7 +132,7 @@ namespace Cantera {
|
|||
/// Default constructor.
|
||||
Kinetics();
|
||||
|
||||
/// This Constructor initializes with a starting phase.
|
||||
/// This constructor initializes with a starting phase.
|
||||
/// @deprecated
|
||||
Kinetics(thermo_t* thermo);
|
||||
|
||||
|
|
@ -155,7 +145,7 @@ namespace Cantera {
|
|||
/// mix_defs.h.
|
||||
virtual int type() { return 0; }
|
||||
|
||||
/// Number of reactions in the reaction mechanism
|
||||
/// Number of reactions in the reaction mechanism.
|
||||
int nReactions() const {return m_ii;}
|
||||
|
||||
//@}
|
||||
|
|
@ -182,10 +172,15 @@ namespace Cantera {
|
|||
*
|
||||
* If a -1 is returned, then the phase is not defined in
|
||||
* the Kinetics object.
|
||||
* @todo (HKM -> unfound object will create another entry in the
|
||||
* map, suggest rewriting this function)
|
||||
*/
|
||||
int phaseIndex(string ph) { return m_phaseindex[ph] - 1; }
|
||||
int phaseIndex(string ph) {
|
||||
if (m_phaseindex.find(ph) == m_phaseindex.end()) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
return m_phaseindex[ph] - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the integer index of the phase which has
|
||||
|
|
@ -803,6 +798,8 @@ namespace Cantera {
|
|||
*/
|
||||
int m_rxnphase;
|
||||
|
||||
/// number of spatial dimensions of lowest-dimensional phase.
|
||||
int m_mindim;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -735,15 +735,13 @@ namespace Cantera {
|
|||
|
||||
// don't require formation reactions for solution species
|
||||
// present in trace amounts to be equilibrated
|
||||
if (!isStoichPhase(ik) && fabs(moles(ik)) <= Tiny)
|
||||
if (!isStoichPhase(ik) && fabs(moles(ik)) <= SmallNumber)
|
||||
err = 0.0;
|
||||
|
||||
// for stoichiometric phase species, no error if not present and
|
||||
// delta G for the formation reaction is positive
|
||||
else if (isStoichPhase(ik) && moles(ik) <= 0.0 &&
|
||||
m_deltaG_RT[j] >= 0.0) err = 0.0;
|
||||
//else err = fabs(m_deltaG_RT[j]);
|
||||
//}
|
||||
else {
|
||||
err = fabs(m_deltaG_RT[j]);
|
||||
}
|
||||
|
|
@ -751,7 +749,6 @@ namespace Cantera {
|
|||
maxerr = err;
|
||||
}
|
||||
}
|
||||
|
||||
return maxerr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,16 +104,17 @@ namespace Cantera {
|
|||
inline doublereal equilibrate(MultiPhase& s, int XY,
|
||||
doublereal tol = 1.0e-9, int maxsteps = 1000, int loglevel = 0) {
|
||||
s.init();
|
||||
//MultiPhaseEquil e(&s);
|
||||
if (XY == TP || XY == HP) {
|
||||
writelog("in equilibrate(MultiPhase, ...)\n");
|
||||
if (XY == TP || XY == HP || XY == SP || XY == TV) {
|
||||
double err = s.equilibrate(XY, tol, maxsteps, maxsteps, loglevel);
|
||||
if (loglevel > 0) {
|
||||
writelog("writing log file\n");
|
||||
write_logfile("equilibrate.html");
|
||||
}
|
||||
return err;
|
||||
}
|
||||
else {
|
||||
throw CanteraError("equilibrate","only fixed T, P supported");
|
||||
throw CanteraError("equilibrate","unsupported option");
|
||||
return -1.0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ using namespace ct;
|
|||
*/
|
||||
namespace Cantera {
|
||||
|
||||
#define CANTERA_VERSION 1.6
|
||||
//#define CANTERA_VERSION 1.6
|
||||
|
||||
// use kg-moles, rather than g-moles.
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Cantera {
|
|||
};
|
||||
|
||||
void deprecatedMethod(string classnm, string oldnm, string newnm);
|
||||
|
||||
void removeAtVersion(string func, string version);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -561,6 +561,15 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
|
||||
void removeAtVersion(string func, string version) {
|
||||
if (version >= "CANTERA_VERSION") {
|
||||
writelog("Removed procedure: "+func+"\n");
|
||||
writelog("Removed in version: "+version+"\n");
|
||||
throw CanteraError("removeAtVersion","procedure has been removed.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @defgroup logs Diagnostic Output
|
||||
///
|
||||
/// Writing diagnostic information to the screen or to a file.
|
||||
|
|
@ -639,7 +648,6 @@ namespace Cantera {
|
|||
///
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/// Create a new group for log messages. Usually this is called
|
||||
/// upon entering the function, with the title parameter equal to
|
||||
/// the name of the function or method. Subsequent messages
|
||||
|
|
@ -689,6 +697,7 @@ namespace Cantera {
|
|||
/// file will be overwritten. will be appended to the name.
|
||||
/// @ingroup HTML_logs
|
||||
void write_logfile(string file) {
|
||||
if (!__app->xmllog) return;
|
||||
string::size_type idot = file.rfind('.');
|
||||
string ext = "";
|
||||
string nm = file;
|
||||
|
|
@ -730,6 +739,5 @@ namespace Cantera {
|
|||
__app->current = 0;
|
||||
}
|
||||
}
|
||||
///
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ namespace Cantera {
|
|||
s = "";
|
||||
}
|
||||
nm = stripws(name);
|
||||
if (x[nm] == 0.0) {
|
||||
if (x.find(nm) == x.end()) {
|
||||
//if (x[nm] == 0.0) {
|
||||
throw CanteraError("parseCompString",
|
||||
"unknown species " + nm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue