*** empty log message ***
This commit is contained in:
parent
44a4226481
commit
9e54a6857e
28 changed files with 292 additions and 132 deletions
|
|
@ -16,7 +16,7 @@
|
|||
#endif
|
||||
|
||||
// Cantera includes
|
||||
#include "ChemEquil.h"
|
||||
#include "equil.h" //"ChemEquil.h"
|
||||
#include "KineticsFactory.h"
|
||||
#include "transport/TransportFactory.h"
|
||||
#include "ctml.h"
|
||||
|
|
@ -487,14 +487,13 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT th_equil(int n, int XY, int solver,
|
||||
double rtol, int maxsteps, int loglevel) {
|
||||
int DLL_EXPORT th_equil(int n, char* XY, int solver,
|
||||
double rtol, int maxsteps, int maxiter, int loglevel) {
|
||||
try {
|
||||
equilibrate(*th(n), XY, solver, rtol, maxsteps,
|
||||
loglevel); return 0;
|
||||
maxiter, loglevel); return 0;
|
||||
}
|
||||
catch (CanteraError) {
|
||||
cout << "exception caught in th_equil. returning -1." << endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ extern "C" {
|
|||
int DLL_IMPORT th_set_UV(int n, double* vals);
|
||||
int DLL_IMPORT th_set_SV(int n, double* vals);
|
||||
int DLL_IMPORT th_set_SP(int n, double* vals);
|
||||
int DLL_IMPORT th_equil(int n, int XY, int solver,
|
||||
double rtol, int maxsteps, int loglevel);
|
||||
int DLL_IMPORT th_equil(int n, char* XY, int solver,
|
||||
double rtol, int maxsteps, int maxiter, int loglevel);
|
||||
|
||||
#ifdef INCL_PURE_FLUIDS
|
||||
double DLL_IMPORT th_critTemperature(int n);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
// Cantera includes
|
||||
#include "equil.h"
|
||||
#include "MultiPhase.h"
|
||||
#include "MultiPhaseEquil.h"
|
||||
|
||||
|
|
@ -196,11 +197,10 @@ extern "C" {
|
|||
doublereal DLL_EXPORT mix_equilibrate(int i, char* XY,
|
||||
doublereal err, int maxsteps, int maxiter, int loglevel) {
|
||||
try {
|
||||
return _mix(i)->equilibrate(_equilflag(XY),
|
||||
return equilibrate(*_mix(i), XY,
|
||||
err, maxsteps, maxiter, loglevel);
|
||||
}
|
||||
catch (CanteraError) {
|
||||
write_logfile("equil_err.html");
|
||||
return DERR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ int flamespeed(int np, void* p) {
|
|||
gas.getMassFractions(yin);
|
||||
|
||||
try {
|
||||
equilibrate(gas,HP);
|
||||
equilibrate(gas,"HP");
|
||||
}
|
||||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
#ifndef CT_EQUIL_INCL
|
||||
#define CT_EQUIL_INCL
|
||||
#include "kernel/equil.h"
|
||||
#include "kernel/ChemEquil.h"
|
||||
#include "kernel/MultiPhaseEquil.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#endif
|
||||
|
||||
// Cantera includes
|
||||
#include "ChemEquil.h"
|
||||
#include "equil.h"
|
||||
#include "KineticsFactory.h"
|
||||
#include "transport/TransportFactory.h"
|
||||
#include "ctml.h"
|
||||
|
|
@ -368,9 +368,9 @@ extern "C" {
|
|||
catch (CanteraError) {handleError(); return -1;}
|
||||
}
|
||||
|
||||
status_t DLL_EXPORT th_equil_(const integer* n, integer* XY) {
|
||||
status_t DLL_EXPORT th_equil_(const integer* n, char* XY, ftnlen lenxy) {
|
||||
try {
|
||||
equilibrate(*_fth(n), *XY); return 0;
|
||||
equilibrate(*_fth(n), f2string(XY,lenxy).c_str()); return 0;
|
||||
}
|
||||
catch (CanteraError) {handleError(); return -1;}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,38 @@
|
|||
function a = equilibrate(a, xy, solver, rtol, maxsteps, loglevel)
|
||||
function a = equilibrate(a, xy, solver, rtol, maxsteps, maxiter, loglevel)
|
||||
% EQUILIBRATE Set the phase to a state of chemical equilibrium.
|
||||
%
|
||||
% The second argument must be one of the strings 'TP', 'TV',
|
||||
% 'HP', 'SP', 'SV', 'UV', 'PT', 'VT', 'PH', 'PS', 'VS', or 'VU',
|
||||
% and specifies the two thermodynamic properties held fixed at
|
||||
% the values in the initial state. Note that if U, H, V, or S is
|
||||
% specified, it is the specific value (per unit mass), not the
|
||||
% molar value, that is held fixed.
|
||||
% XY -- A two-letter string, which must be one of the set
|
||||
% ['TP','TV','HP','SP','SV','UV','PT','VT','PH','PS','VS','VU'].
|
||||
% If H, U, S, or V is specified, the value must be the specific
|
||||
% value (per unit mass).
|
||||
%
|
||||
% solver -- specifies the equilibrium solver to use. If solver
|
||||
% = 0, a fast solver using the element potential method will be
|
||||
% used. If solver > 0, a slower but more robust Gibbs
|
||||
% minimization solver will be used. If solver < 0 or
|
||||
% unspecified, the fast solver will be tried first, then if it
|
||||
% fails the other will be tried.
|
||||
%
|
||||
% rtol -- the relative error tolerance.
|
||||
%
|
||||
% maxsteps -- maximum number of steps in composition to take to
|
||||
% find a converged solution.
|
||||
%
|
||||
% maxiter -- for the Gibbs minimization solver only, this
|
||||
% specifies the number of 'outer' iterations on T or P when
|
||||
% some property pair other than TP is specified.
|
||||
%
|
||||
% loglevel -- set to a value > 0 to write diagnostic output to
|
||||
% a file in HTML format. Larger values generate more detailed
|
||||
% information. The file will be named 'equilibrate_log.html.'
|
||||
% Subsequent files will be named 'equillibrate_log1.html',
|
||||
% etc., so that log files are not overwritten.
|
||||
%
|
||||
%
|
||||
|
||||
% use the ChemEquil solver by default
|
||||
if nargin < 3
|
||||
solver = 0;
|
||||
solver = -1;
|
||||
end
|
||||
if nargin < 4
|
||||
rtol = 1.0e-9;
|
||||
|
|
@ -20,38 +41,42 @@ if nargin < 5
|
|||
maxsteps = 1000;
|
||||
end
|
||||
if nargin < 6
|
||||
maxiter = 100;
|
||||
end
|
||||
if nargin < 7
|
||||
loglevel = 0;
|
||||
end
|
||||
|
||||
iok = 0;
|
||||
switch xy
|
||||
case 'TP'
|
||||
iok = thermo_set(a.tp_id, 50, 104, solver, rtol, maxsteps, loglevel);
|
||||
case 'TV'
|
||||
iok = thermo_set(a.tp_id, 50, 100, solver, rtol, maxsteps, loglevel);
|
||||
case 'HP'
|
||||
iok = thermo_set(a.tp_id, 50, 101, solver, rtol, maxsteps, loglevel);
|
||||
case 'SP'
|
||||
iok = thermo_set(a.tp_id, 50, 102, solver, rtol, maxsteps, loglevel);
|
||||
case 'SV'
|
||||
iok = thermo_set(a.tp_id, 50, 107, solver, rtol, maxsteps, loglevel);
|
||||
case 'UV'
|
||||
iok = thermo_set(a.tp_id, 50, 105, solver, rtol, maxsteps, loglevel);
|
||||
case 'PT'
|
||||
iok = thermo_set(a.tp_id, 50, 104, solver, rtol, maxsteps, loglevel);
|
||||
case 'VT'
|
||||
iok = thermo_set(a.tp_id, 50, 100, solver, rtol, maxsteps, loglevel);
|
||||
case 'PH'
|
||||
iok = thermo_set(a.tp_id, 50, 101, solver, rtol, maxsteps, loglevel);
|
||||
case 'PS'
|
||||
iok = thermo_set(a.tp_id, 50, 102, solver, rtol, maxsteps, loglevel);
|
||||
case 'VS'
|
||||
iok = thermo_set(a.tp_id, 50, 107, solver, rtol, maxsteps, loglevel);
|
||||
case 'VU'
|
||||
iok = thermo_set(a.tp_id, 50, 105, solver, rtol, maxsteps, loglevel);
|
||||
otherwise
|
||||
error('unsupported option')
|
||||
end
|
||||
iok = thermo_set(a.tp_id, 50, xy, solver, rtol, maxsteps, maxiter, loglevel);
|
||||
% $$$ switch xy
|
||||
% $$$ case 'TP'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 104, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'TV'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 100, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'HP'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 101, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'SP'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 102, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'SV'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 107, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'UV'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 105, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'PT'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 104, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'VT'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 100, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'PH'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 101, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'PS'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 102, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'VS'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 107, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ case 'VU'
|
||||
% $$$ iok = thermo_set(a.tp_id, 50, 105, solver, rtol, maxsteps, loglevel);
|
||||
% $$$ otherwise
|
||||
% $$$ error('unsupported option')
|
||||
% $$$ end
|
||||
if iok < 0
|
||||
e = geterr;
|
||||
if e == 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function i = thermo_set(n, job, a, b, c, d, e)
|
||||
function i = thermo_set(n, job, a, b, c, d, e, f)
|
||||
if nargin == 2
|
||||
i = ctmethods(20,n,-job);
|
||||
elseif nargin == 3
|
||||
|
|
@ -11,4 +11,6 @@ elseif nargin == 6
|
|||
i = ctmethods(20, n,-job, a, b, c, d);
|
||||
elseif nargin == 7
|
||||
i = ctmethods(20, n,-job, a, b, c, d, e);
|
||||
elseif nargin == 8
|
||||
i = ctmethods(20, n,-job, a, b, c, d, e, f);
|
||||
end
|
||||
|
|
@ -60,12 +60,13 @@ static void thermoset( int nlhs, mxArray *plhs[],
|
|||
|
||||
// equilibrate
|
||||
else if (job == 50) {
|
||||
int xy = getInt(prhs[3]); //int(*ptr);
|
||||
char* xy = getString(prhs[3]); //int(*ptr);
|
||||
int solver = getInt(prhs[4]);
|
||||
double rtol = getDouble(prhs[5]);
|
||||
int maxsteps = getInt(prhs[6]);
|
||||
int loglevel = getInt(prhs[7]);
|
||||
ierr = th_equil(th, xy, solver, rtol, maxsteps, loglevel);
|
||||
int maxiter = getInt(prhs[7]);
|
||||
int loglevel = getInt(prhs[8]);
|
||||
ierr = th_equil(th, xy, solver, rtol, maxsteps, maxiter, loglevel);
|
||||
}
|
||||
if (ierr < 0) reportError();
|
||||
|
||||
|
|
|
|||
|
|
@ -269,20 +269,41 @@ class ThermoPhase(Phase):
|
|||
"""Set the electric potential."""
|
||||
_cantera.thermo_setfp(self._phase_id, 6, v, 0);
|
||||
|
||||
def equilibrate(self, XY, solver = 0, rtol = 1.0e-9,
|
||||
maxsteps = 1000, loglevel = 0):
|
||||
def equilibrate(self, XY, solver = -1, rtol = 1.0e-9,
|
||||
maxsteps = 1000, maxiter = 100, loglevel = 0):
|
||||
"""Set to a state of chemical equilibrium holding property pair
|
||||
'XY' constant. The pair is specified by a two-letter string,
|
||||
which must be one of the set
|
||||
'XY' constant.
|
||||
|
||||
XY -- A two-letter string, which must be one of the set
|
||||
['TP','TV','HP','SP','SV','UV','PT','VT','PH','PS','VS','VU'].
|
||||
If H, U, S, or V is specified, the value must be the specific
|
||||
value (per unit mass).
|
||||
|
||||
solver -- specifies the equilibrium solver to use. If solver =
|
||||
0, a fast solver using the element potential method will be
|
||||
used. If solver > 0, a slower but more robust Gibbs
|
||||
minimization solver will be used. If solver < 0 or
|
||||
unspecified, the fast solver will be tried first, then if it
|
||||
fails the other will be tried.
|
||||
|
||||
rtol -- the relative error tolerance.
|
||||
|
||||
maxsteps -- maximum number of steps in composition to take to
|
||||
find a converged solution.
|
||||
|
||||
maxiter -- for the Gibbs minimization solver only, this
|
||||
specifies the number of 'outer' iterations on T or P when some
|
||||
property pair other than TP is specified.
|
||||
|
||||
loglevel -- set to a value > 0 to write diagnostic output to a
|
||||
file in HTML format. Larger values generate more detailed
|
||||
information. The file will be named 'equilibrate_log.html.'
|
||||
Subsequent files will be named 'equillibrate_log1.html', etc.,
|
||||
so that log files are not overwritten.
|
||||
|
||||
"""
|
||||
ixy = ThermoPhase._equilmap[XY]
|
||||
if ixy > 0:
|
||||
_cantera.thermo_equil(self._phase_id, ixy, solver, rtol, maxsteps, loglevel)
|
||||
else:
|
||||
raise 'invalid equilibrium option: '+XY
|
||||
_cantera.thermo_equil(self._phase_id, XY, solver,
|
||||
rtol, maxsteps, maxiter, loglevel)
|
||||
|
||||
|
||||
def critTemperature(self):
|
||||
|
|
|
|||
|
|
@ -288,8 +288,6 @@ class Mixture:
|
|||
"""
|
||||
i = _cantera.mix_equilibrate(self.__mixid, XY, err, maxsteps,
|
||||
maxiter, loglevel)
|
||||
if loglevel > 0:
|
||||
writeLogFile("equilibrate_log");
|
||||
|
||||
def selectSpecies(self, f, species):
|
||||
"""Given an array 'f' of floating-point species properties,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,17 @@ gas.set(T = temp, P = OneAtm, X = comp)
|
|||
# (ChemEquil) solver... (This will fail, throwing an exception that
|
||||
# will be caught in the 'except' block, where we will try the other
|
||||
# solver.)
|
||||
|
||||
####################################################################
|
||||
# Note: We are setting solver = 0 here to demonstrate the difference
|
||||
# between the two solvers. If you do not set 'solver', or set it to a
|
||||
# negative value, then ChemEquil will be tried first, and if it fails
|
||||
# the MultiPhaseEquil solver will be tried. In most cases this will
|
||||
# give the best results.
|
||||
####################################################################
|
||||
|
||||
try:
|
||||
gas.equilibrate("TP")
|
||||
gas.equilibrate("TP", solver = 0) # use the ChemEquil (0) solver
|
||||
except:
|
||||
print "ChemEquil solver failed! Try the MultiPhaseEquil solver..."
|
||||
|
||||
|
|
@ -42,6 +51,9 @@ except:
|
|||
# 1.0e-9), max_steps (default = 1000), loglevel (default = 0).
|
||||
mix = Mixture([(gas,1.0)])
|
||||
mix.equilibrate("TP", loglevel=4)
|
||||
|
||||
# Note: another way to do this is:
|
||||
# gas.equilibrate("TP", solver = 1, loglevel = 4)
|
||||
|
||||
# print a summary of the results
|
||||
print gas
|
||||
|
|
|
|||
|
|
@ -231,17 +231,18 @@ thermo_equil(PyObject *self, PyObject *args)
|
|||
{
|
||||
int iok = -2;
|
||||
int th;
|
||||
int XY;
|
||||
char* XY;
|
||||
int solver;
|
||||
double rtol;
|
||||
int maxsteps;
|
||||
int maxiter;
|
||||
int loglevel;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iiidii:thermo_equil", &th, &XY,
|
||||
&solver, &rtol, &maxsteps, &loglevel))
|
||||
if (!PyArg_ParseTuple(args, "isidiii:thermo_equil", &th, &XY,
|
||||
&solver, &rtol, &maxsteps, &maxiter, &loglevel))
|
||||
return NULL;
|
||||
|
||||
iok = th_equil(th, XY, solver, rtol, maxsteps, loglevel);
|
||||
iok = th_equil(th, XY, solver, rtol, maxsteps, maxiter, loglevel);
|
||||
if (iok >= 0)
|
||||
return Py_BuildValue("i",iok);
|
||||
if (iok == -1) return reportCanteraError();
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ HETEROKIN = $(THERMO) $(HETEROKIN_OBJ)
|
|||
CK = $(KINETICS)
|
||||
|
||||
# chemical equilibrium
|
||||
EQUIL_OBJ = ChemEquil.o MultiPhaseEquil.o sort.o MultiPhase.o
|
||||
EQUIL_H = ChemEquil.h MultiPhaseEquil.h MultiPhase.h sort.h
|
||||
EQUIL_OBJ = ChemEquil.o MultiPhaseEquil.o sort.o MultiPhase.o equilibrate.o
|
||||
EQUIL_H = ChemEquil.h MultiPhaseEquil.h MultiPhase.h sort.h equil.h
|
||||
EQUIL = $(THERMO) $(EQUIL_OBJ)
|
||||
|
||||
# reaction path analysis
|
||||
|
|
|
|||
|
|
@ -15,10 +15,15 @@
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
/// Classes used by ChemEquil. These classes are used only by the
|
||||
/// ChemEquil equilibrium solver. Each one returns a particular
|
||||
/// property of the object supplied as the argument.
|
||||
///
|
||||
template<class M>
|
||||
class PropertyCalculator {
|
||||
public:
|
||||
virtual doublereal value(const M& s) =0;
|
||||
virtual string symbol() =0;
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -27,6 +32,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.enthalpy_mass();
|
||||
}
|
||||
virtual string symbol() { return "H"; }
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -35,6 +41,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.entropy_mass();
|
||||
}
|
||||
virtual string symbol() { return "S"; }
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -43,6 +50,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.temperature();
|
||||
}
|
||||
virtual string symbol() { return "T"; }
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -51,6 +59,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.pressure();
|
||||
}
|
||||
virtual string symbol() { return "P"; }
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -59,6 +68,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.density();
|
||||
}
|
||||
virtual string symbol() { return "V"; }
|
||||
};
|
||||
|
||||
template<class M>
|
||||
|
|
@ -67,6 +77,7 @@ namespace Cantera {
|
|||
virtual doublereal value(const M& s) {
|
||||
return s.intEnergy_mass();
|
||||
}
|
||||
virtual string symbol() { return "U"; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace Cantera {
|
|||
/// a base class, so this constructor should not be called
|
||||
/// explicitly.
|
||||
ThermoPhase() : Phase(), m_spthermo(0), m_speciesData(0),
|
||||
m_index(-1), m_phi(0.0) {}
|
||||
m_index(-1), m_phi(0.0), m_hasElementPotentials(false) {}
|
||||
|
||||
|
||||
/// Destructor. Deletes the species thermo manager.
|
||||
|
|
@ -684,10 +684,12 @@ namespace Cantera {
|
|||
// the element potentials to this object
|
||||
void setElementPotentials(const vector_fp& lambda) {
|
||||
m_lambda = lambda;
|
||||
m_hasElementPotentials = true;
|
||||
}
|
||||
|
||||
void getElementPotentials(doublereal* lambda) {
|
||||
copy(m_lambda.begin(), m_lambda.end(), lambda);
|
||||
if (m_hasElementPotentials)
|
||||
copy(m_lambda.begin(), m_lambda.end(), lambda);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
@ -809,7 +811,7 @@ namespace Cantera {
|
|||
*
|
||||
* @see importCTML.cpp
|
||||
*/
|
||||
virtual void initThermo() {}
|
||||
virtual void initThermo() { }
|
||||
|
||||
|
||||
|
||||
|
|
@ -876,6 +878,7 @@ namespace Cantera {
|
|||
int m_index;
|
||||
doublereal m_phi;
|
||||
vector_fp m_lambda;
|
||||
bool m_hasElementPotentials;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -91,10 +91,24 @@ namespace Cantera {
|
|||
/// Close a Cantera input file.
|
||||
void close_XML_File(string file);
|
||||
|
||||
void beginLogGroup(string title, int loglevel=1);
|
||||
void addLogEntry(string tag, string value, int loglevel=1);
|
||||
void endLogGroup(int loglevel=1);
|
||||
#ifdef WITH_HTML_LOGS
|
||||
void beginLogGroup(string title, int loglevel=-99);
|
||||
void addLogEntry(string tag, string value);
|
||||
void addLogEntry(string tag, doublereal value);
|
||||
void addLogEntry(string tag, int value);
|
||||
void addLogEntry(string msg);
|
||||
void endLogGroup(string title="");
|
||||
void write_logfile(string file = "log.html");
|
||||
#else
|
||||
inline void beginLogGroup(string title, int loglevel=-99) {}
|
||||
inline void addLogEntry(string tag, string value) {}
|
||||
inline void addLogEntry(string tag, doublereal value) {}
|
||||
inline void addLogEntry(string tag, int value) {}
|
||||
inline void addLogEntry(string msg) {}
|
||||
inline void endLogGroup(string title="") {}
|
||||
inline void write_logfile(string file = "log.html") {}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,8 +57,11 @@ namespace Cantera {
|
|||
// install a default logwriter that writes to standard
|
||||
// output / standard error
|
||||
logwriter = new Logger();
|
||||
|
||||
// HTML log files
|
||||
xmllog = 0;
|
||||
current = 0;
|
||||
loglevel = 0;
|
||||
}
|
||||
|
||||
/// Delete any open XML trees, the logwriter, and
|
||||
|
|
@ -72,7 +75,8 @@ namespace Cantera {
|
|||
}
|
||||
delete logwriter;
|
||||
if (xmllog) {
|
||||
delete xmllog;
|
||||
write_logfile("orphan");
|
||||
//delete xmllog;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +93,9 @@ namespace Cantera {
|
|||
string sleep;
|
||||
Logger* logwriter;
|
||||
XML_Node *xmllog, *current;
|
||||
int loglevel;
|
||||
vector<int> loglevels;
|
||||
vector<string> loggroups;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -624,7 +631,7 @@ namespace Cantera {
|
|||
__app->logwriter = logwriter;
|
||||
}
|
||||
|
||||
|
||||
#ifdef WITH_HTML_LOGS
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
///
|
||||
|
|
@ -638,16 +645,19 @@ namespace Cantera {
|
|||
/// C. You want to be able to print diagnostic messages just from
|
||||
/// function A, or from A and B, or from A, B, and C, or to turn
|
||||
/// off printing diagnostic messages altogether. All you need to
|
||||
/// do is to pass into each function the parameter loglevel, and
|
||||
/// when calling other functions decrement the value of
|
||||
/// logvalue. Since the procedures that print HTML log output only
|
||||
/// do so if loglevel > 0, the initial value of loglevel controls
|
||||
/// how deeply nested the log messages will be. For an example of
|
||||
/// how to do this, see files MultiPhase.cpp and
|
||||
/// MultiPhaseEquil.cpp.
|
||||
/// do is call 'beginLogGroup' within function A, and specify a
|
||||
/// loglevel value. Then in B, call beginLogGroup again, but
|
||||
/// without an explicit value for loglevel. By default, the
|
||||
/// current level is decremented by one in beginLogGroup. If it
|
||||
/// is <= 0, no log messages are written. Thus, if each function
|
||||
/// begins with beginLogGroup and calls endLogGroup before
|
||||
/// returning, then setting loglevel = 3 will cause messages from
|
||||
/// A, B, and C to be written (in nested HTML lists), loglevel =
|
||||
/// 2 results in messages only being written from A and B, etc.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/// 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
|
||||
|
|
@ -655,22 +665,49 @@ namespace Cantera {
|
|||
/// heading, until endLogGroup() is called.
|
||||
/// @ingroup HTML_logs
|
||||
void beginLogGroup(string title, int loglevel) {
|
||||
if (loglevel <= 0) return;
|
||||
appinit();
|
||||
if (loglevel != -99) __app->loglevel = loglevel;
|
||||
else __app->loglevel--;
|
||||
__app->loglevels.push_back(__app->loglevel);
|
||||
__app->loggroups.push_back(title);
|
||||
if (__app->loglevel <= 0) return;
|
||||
if (__app->xmllog == 0) {
|
||||
__app->xmllog = new XML_Node("html");
|
||||
__app->current = &__app->xmllog->addChild("ul");
|
||||
}
|
||||
__app->current = &__app->current->addChild("li",title);
|
||||
__app->current = &__app->current->addChild("li","<b>"+title+"</b>");
|
||||
__app->current = &__app->current->addChild("ul");
|
||||
}
|
||||
|
||||
/// Add an entry to the log file. Entries appear in the form "tag:
|
||||
/// value".
|
||||
/// @ingroup HTML_logs
|
||||
void addLogEntry(string tag, string value, int loglevel) {
|
||||
if (loglevel <= 0) return;
|
||||
__app->current->addChild("li",tag+": "+value);
|
||||
void addLogEntry(string tag, string value) {
|
||||
if (__app->loglevel > 0)
|
||||
__app->current->addChild("li",tag+": "+value);
|
||||
}
|
||||
|
||||
/// Add an entry to the log file. Entries appear in the form "tag:
|
||||
/// value".
|
||||
/// @ingroup HTML_logs
|
||||
void addLogEntry(string tag, doublereal value) {
|
||||
if (__app->loglevel > 0)
|
||||
__app->current->addChild("li",tag+": "+fp2str(value));
|
||||
}
|
||||
|
||||
/// Add an entry to the log file. Entries appear in the form "tag:
|
||||
/// value".
|
||||
/// @ingroup HTML_logs
|
||||
void addLogEntry(string tag, int value) {
|
||||
if (__app->loglevel > 0)
|
||||
__app->current->addChild("li",tag+": "+int2str(value));
|
||||
}
|
||||
|
||||
/// Add an entry to the log file.
|
||||
/// @ingroup HTML_logs
|
||||
void addLogEntry(string msg) {
|
||||
if (__app->loglevel > 0)
|
||||
__app->current->addChild("li",msg);
|
||||
}
|
||||
|
||||
/// Close the current group of log messages. This is typically
|
||||
|
|
@ -680,13 +717,27 @@ namespace Cantera {
|
|||
/// appear at the next-higher level in the outline, unless
|
||||
/// beginLogGroup is called first to create a new group.
|
||||
/// @ingroup HTML_logs
|
||||
void endLogGroup(int loglevel) {
|
||||
if (loglevel <= 0) return;
|
||||
__app->current = __app->current->parent();
|
||||
__app->current = __app->current->parent();
|
||||
void endLogGroup(string title) {
|
||||
if (__app->loglevel > 0) {
|
||||
__app->current = __app->current->parent();
|
||||
__app->current = __app->current->parent();
|
||||
}
|
||||
__app->loglevels.pop_back();
|
||||
__app->loglevel = __app->loglevels.back();
|
||||
if (title != "" && title != __app->loggroups.back()) {
|
||||
writelog("Logfile error."
|
||||
"\n beginLogGroup: "+ __app->loggroups.back()+
|
||||
"\n endLogGroup; "+title+"\n");
|
||||
}
|
||||
if (__app->loggroups.size() == 1) {
|
||||
write_logfile(__app->loggroups.back()+"_log");
|
||||
__app->loggroups.clear();
|
||||
__app->loglevels.clear();
|
||||
}
|
||||
else
|
||||
__app->loggroups.pop_back();
|
||||
}
|
||||
|
||||
|
||||
/// Write the HTML log file. Log entries are stored in memory in
|
||||
/// an XML tree until this function is called, which writes the
|
||||
/// tree to a file and clears the entries stored in memory. The
|
||||
|
|
@ -739,5 +790,7 @@ namespace Cantera {
|
|||
__app->current = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WITH_HTML_LOGS
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ typedef int ftnlen; // Fortran hidden string length type
|
|||
|
||||
#undef INCL_PURE_FLUIDS
|
||||
|
||||
#define WITH_HTML_LOGS
|
||||
|
||||
//--------------------- compile options ----------------------------
|
||||
#undef USE_PCH
|
||||
|
||||
|
|
|
|||
20
config/configure
vendored
20
config/configure
vendored
|
|
@ -1589,7 +1589,7 @@ BUILD_CK=
|
|||
|
||||
NEED_CKREADER=
|
||||
NEED_LAPACK=
|
||||
NEED_RECIPES=
|
||||
#NEED_RECIPES=
|
||||
NEED_MATH=
|
||||
NEED_TPX=
|
||||
NEED_F2C=
|
||||
|
|
@ -1661,7 +1661,7 @@ if test "$ENABLE_EQUIL" = "y" ; then
|
|||
KERNEL=$KERNEL' 'equil
|
||||
KERNEL_OBJ=$KERNEL_OBJ' $(EQUIL_OBJ)'
|
||||
NEED_LAPACK=1
|
||||
NEED_RECIPES=1
|
||||
# NEED_RECIPES=1
|
||||
fi
|
||||
|
||||
if test "$ENABLE_REACTORS" = "y" ; then
|
||||
|
|
@ -1786,9 +1786,9 @@ fi
|
|||
|
||||
LOCAL_LIBS=$LOCAL_LIBS' '-lcantera
|
||||
|
||||
if test -n "$NEED_RECIPES"
|
||||
then LOCAL_LIBS=$LOCAL_LIBS' '-lrecipes
|
||||
fi
|
||||
#if test -n "$NEED_RECIPES"
|
||||
#then LOCAL_LIBS=$LOCAL_LIBS' '-lrecipes
|
||||
#fi
|
||||
|
||||
if test -n "$NEED_CVODE"
|
||||
then LOCAL_LIBS=$LOCAL_LIBS' '-lcvode
|
||||
|
|
@ -3875,8 +3875,6 @@ fi
|
|||
|
||||
|
||||
if test "x${BUILD_F90}" != "x0"; then
|
||||
echo F90 = $F90
|
||||
echo BUILD_F90 = $BUILD_F90
|
||||
if test "$F90" = "default" -o \
|
||||
"$F90"x = "x"; then
|
||||
for ac_prog in f95 gfortran g95
|
||||
|
|
@ -4045,11 +4043,11 @@ if test -z "$OBJ_EXT"; then OBJ_EXT=$OBJEXT; fi
|
|||
if test -z "$EXE_EXT"; then EXE_EXT=$EXEEXT; fi
|
||||
|
||||
|
||||
local_math_libs='-lrecipes -lcvode'
|
||||
local_math_libs='-lcvode'
|
||||
|
||||
|
||||
|
||||
math_libs='-lrecipes -lcvode -lctmath'
|
||||
math_libs='-lcvode -lctmath'
|
||||
|
||||
|
||||
if test "$LAPACK_FTN_TRAILING_UNDERSCORE" = "y"
|
||||
|
|
@ -4108,7 +4106,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|||
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/fortran/src/Makefile ../Cantera/fortran/f77demos/f77demos.mak ../Cantera/fortran/f77demos/isentropic.dsp ../Cantera/matlab/Makefile ../Cantera/matlab/setup_matlab.py ../Cantera/matlab/setup_winmatlab.py ../Cantera/python/Makefile ../Cantera/python/setup.py ../Cantera/cxx/Makefile ../Cantera/cxx/src/Makefile ../Cantera/cxx/demos/Makefile ../Cantera/user/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/recipes/Makefile ../ext/f2c_libs/Makefile ../ext/f2c_blas/Makefile ../ext/f2c_lapack/Makefile ../ext/f2c_math/Makefile ../ext/f2c_recipes/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/src/finish_install.py ../tools/src/package4mac ../tools/templates/f77/demo.mak ../tools/templates/f90/demo.mak ../tools/templates/cxx/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile ../test_problems/surfkin/Makefile ../test_problems/diamondSurf/Makefile ../test_problems/ck2cti_test/Makefile ../test_problems/ck2cti_test/runtest ../test_problems/python/Makefile ../bin/install_tsc"
|
||||
ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/fortran/src/Makefile ../Cantera/fortran/f77demos/f77demos.mak ../Cantera/fortran/f77demos/isentropic.dsp ../Cantera/matlab/Makefile ../Cantera/matlab/setup_matlab.py ../Cantera/matlab/setup_winmatlab.py ../Cantera/python/Makefile ../Cantera/python/setup.py ../Cantera/cxx/Makefile ../Cantera/cxx/src/Makefile ../Cantera/cxx/demos/Makefile ../Cantera/user/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/f2c_libs/Makefile ../ext/f2c_blas/Makefile ../ext/f2c_lapack/Makefile ../ext/f2c_math/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/src/finish_install.py ../tools/src/package4mac ../tools/templates/f77/demo.mak ../tools/templates/f90/demo.mak ../tools/templates/cxx/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile ../test_problems/surfkin/Makefile ../test_problems/diamondSurf/Makefile ../test_problems/ck2cti_test/Makefile ../test_problems/ck2cti_test/runtest ../test_problems/python/Makefile ../bin/install_tsc"
|
||||
|
||||
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
|
|
@ -4606,12 +4604,10 @@ do
|
|||
"../ext/math/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/math/Makefile" ;;
|
||||
"../ext/tpx/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/tpx/Makefile" ;;
|
||||
"../ext/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/Makefile" ;;
|
||||
"../ext/recipes/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/recipes/Makefile" ;;
|
||||
"../ext/f2c_libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/f2c_libs/Makefile" ;;
|
||||
"../ext/f2c_blas/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/f2c_blas/Makefile" ;;
|
||||
"../ext/f2c_lapack/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/f2c_lapack/Makefile" ;;
|
||||
"../ext/f2c_math/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/f2c_math/Makefile" ;;
|
||||
"../ext/f2c_recipes/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/f2c_recipes/Makefile" ;;
|
||||
"../examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../examples/Makefile" ;;
|
||||
"../examples/cxx/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../examples/cxx/Makefile" ;;
|
||||
"../Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Makefile" ;;
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ BUILD_CK=
|
|||
|
||||
NEED_CKREADER=
|
||||
NEED_LAPACK=
|
||||
NEED_RECIPES=
|
||||
#NEED_RECIPES=
|
||||
NEED_MATH=
|
||||
NEED_TPX=
|
||||
NEED_F2C=
|
||||
|
|
@ -306,7 +306,7 @@ if test "$ENABLE_EQUIL" = "y" ; then
|
|||
KERNEL=$KERNEL' 'equil
|
||||
KERNEL_OBJ=$KERNEL_OBJ' $(EQUIL_OBJ)'
|
||||
NEED_LAPACK=1
|
||||
NEED_RECIPES=1
|
||||
# NEED_RECIPES=1
|
||||
fi
|
||||
|
||||
if test "$ENABLE_REACTORS" = "y" ; then
|
||||
|
|
@ -428,9 +428,9 @@ fi
|
|||
|
||||
LOCAL_LIBS=$LOCAL_LIBS' '-lcantera
|
||||
|
||||
if test -n "$NEED_RECIPES"
|
||||
then LOCAL_LIBS=$LOCAL_LIBS' '-lrecipes
|
||||
fi
|
||||
#if test -n "$NEED_RECIPES"
|
||||
#then LOCAL_LIBS=$LOCAL_LIBS' '-lrecipes
|
||||
#fi
|
||||
|
||||
if test -n "$NEED_CVODE"
|
||||
then LOCAL_LIBS=$LOCAL_LIBS' '-lcvode
|
||||
|
|
@ -768,11 +768,11 @@ if test -z "$EXE_EXT"; then EXE_EXT=$EXEEXT; fi
|
|||
AC_SUBST(EXE_EXT)
|
||||
|
||||
dnl AC_LANG_FORTRAN77
|
||||
local_math_libs='-lrecipes -lcvode'
|
||||
local_math_libs='-lcvode'
|
||||
AC_SUBST(local_math_libs)
|
||||
|
||||
|
||||
math_libs='-lrecipes -lcvode -lctmath'
|
||||
math_libs='-lcvode -lctmath'
|
||||
AC_SUBST(math_libs)
|
||||
|
||||
if test "$LAPACK_FTN_TRAILING_UNDERSCORE" = "y"
|
||||
|
|
@ -845,12 +845,10 @@ AC_OUTPUT(../Cantera/Makefile \
|
|||
../ext/math/Makefile \
|
||||
../ext/tpx/Makefile \
|
||||
../ext/Makefile \
|
||||
../ext/recipes/Makefile \
|
||||
../ext/f2c_libs/Makefile \
|
||||
../ext/f2c_blas/Makefile \
|
||||
../ext/f2c_lapack/Makefile \
|
||||
../ext/f2c_math/Makefile \
|
||||
../ext/f2c_recipes/Makefile \
|
||||
../examples/Makefile \
|
||||
../examples/cxx/Makefile \
|
||||
../Makefile \
|
||||
|
|
|
|||
4
configure
vendored
4
configure
vendored
|
|
@ -139,7 +139,7 @@ F90=${F90:="default"}
|
|||
# these compilers will be added automatically, and you do not need to
|
||||
# specify them here. Otherwise, add any required compiler-specific
|
||||
# flags here.
|
||||
F90FLAGS=${F90FLAGS:='-O3 -g'}
|
||||
F90FLAGS=${F90FLAGS:='-O3'}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
|
@ -305,7 +305,7 @@ F77=${F77:=g77}
|
|||
|
||||
# Fortran 77 compiler flags. Note that the Fortran compiler flags must be set
|
||||
# to produce object code compatible with the C/C++ compiler you are using.
|
||||
FFLAGS=${FFLAGS:='-O3 -g'}
|
||||
FFLAGS=${FFLAGS:='-O3'}
|
||||
|
||||
# the additional Fortran flags required for linking, if any. Leave commented
|
||||
# out if no additional flags are required.
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ int equil_example1(int job) {
|
|||
if (temp > gas.maxTemp()) break;
|
||||
gas.setState_TPX(temp, pres, "SIH4:0.01, H2:1.0");
|
||||
try {
|
||||
// This uses the MultiPhaseEquil solver.
|
||||
equilibrate(gas,TP,1);
|
||||
equilibrate(gas,"TP",-1,1.0e-9,1000,100,10);
|
||||
output(0,i) = temp;
|
||||
output(1,i) = gas.pressure();
|
||||
gas.getMoleFractions(&output(2,i));
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ int transport_example2(int job) {
|
|||
doublereal temp = 2000.0;
|
||||
doublereal pres = 2.0*OneAtm;
|
||||
gas.setState_TPX(temp, pres, "H2:1.0, O2:0.5, CH4:0.1, N2:0.2");
|
||||
equilibrate(gas,TP);
|
||||
equilibrate(gas,"TP");
|
||||
|
||||
|
||||
// create a transport manager that implements
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
#!/bin/sh
|
||||
# $Id$
|
||||
#
|
||||
echo " "
|
||||
echo "***************************************************"
|
||||
echo " Testing CK2CTI "
|
||||
echo "***************************************************"
|
||||
echo " "
|
||||
BINDIR=@buildbin@
|
||||
CK2CTI=$BINDIR/ck2cti
|
||||
$CK2CTI -i ./gri30.inp -id gri30 -tr ./gri30_tran.dat
|
||||
|
|
@ -26,4 +31,5 @@ then
|
|||
else
|
||||
echo "unsuccessful diff comparison on ck2cti test"
|
||||
fi
|
||||
echo
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ temp_success="1"
|
|||
/bin/rm -f eq1.csv tr1.csv tr2.csv kin1.csv kin2.csv \
|
||||
kin1_blessed_tmp.csv kin2_blessed_tmp.csv
|
||||
|
||||
echo " "
|
||||
echo "***************************************************"
|
||||
echo " Testing the Cantera C++ Examples "
|
||||
echo "***************************************************"
|
||||
echo " "
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
|
|
@ -140,6 +145,8 @@ else
|
|||
echo 'cxx_examples csv test FAILED!'
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
|
|
|
|||
|
|
@ -27,7 +27,12 @@ FIRSTARG=$1
|
|||
PYTHON_CMD=${FIRSTARG:=PYTHON_CMDA}
|
||||
|
||||
#echo $PYTHON_CMD
|
||||
|
||||
echo " "
|
||||
echo "***************************************************"
|
||||
echo " Testing the Cantera Python Interface "
|
||||
echo "***************************************************"
|
||||
echo " "
|
||||
echo "Testing a flame simulation..."
|
||||
$PYTHON_CMD ../../Cantera/python/examples/flames/flame1.py > flame1.out
|
||||
retnStat=$?
|
||||
if [ $retnStat != "0" ]
|
||||
|
|
@ -36,14 +41,6 @@ then
|
|||
echo "flame1.py returned with bad status, $retnStat, check output"
|
||||
fi
|
||||
|
||||
$PYTHON_CMD ../../Cantera/python/examples/surface_chemistry/diamond.py > diamond.out
|
||||
retnStat=$?
|
||||
if [ $retnStat != "0" ]
|
||||
then
|
||||
temp_success="0"
|
||||
echo "diamond.py returned with bad status, $retnStat, check output"
|
||||
fi
|
||||
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
|
|
@ -70,11 +67,21 @@ else
|
|||
echo "FAILED" > csvCode.txt
|
||||
temp_success="0"
|
||||
fi
|
||||
echo " "
|
||||
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
|
||||
echo "Testing surface chemistry..."
|
||||
$PYTHON_CMD ../../Cantera/python/examples/surface_chemistry/diamond.py > diamond.out
|
||||
retnStat=$?
|
||||
if [ $retnStat != "0" ]
|
||||
then
|
||||
temp_success="0"
|
||||
echo "diamond.py returned with bad status, $retnStat, check output"
|
||||
fi
|
||||
|
||||
$CANTERA_BIN/csvdiff diamond.csv diamond_blessed.csv > diamond_test.out
|
||||
retnStat=$?
|
||||
if [ $retnStat = "1" ]
|
||||
|
|
@ -89,10 +96,12 @@ else
|
|||
echo "FAILED" > csvCode.txt
|
||||
temp_success="0"
|
||||
fi
|
||||
echo
|
||||
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
echo "testing handling of fractional product stoichiometric coefficients..."
|
||||
$PYTHON_CMD frac.py > frac_test.out
|
||||
diff -w frac_test.out frac_blessed.out > diff_test.out
|
||||
retnStat=$?
|
||||
|
|
@ -104,6 +113,7 @@ else
|
|||
echo "FAILED" > csvCode.txt
|
||||
temp_success="0"
|
||||
fi
|
||||
echo
|
||||
|
||||
if [ $temp_success = "1" ]
|
||||
then
|
||||
|
|
@ -112,6 +122,7 @@ else
|
|||
echo 'Python csv test FAILED!'
|
||||
fi
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
#################################################################
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ int main(int argc, char **argv) {
|
|||
IdealGasMix g("silane.xml", "silane");
|
||||
g.setState_TPX(1500.0, 100.0, "SIH4:0.01, H2:0.99");
|
||||
//g.setState_TPX(1500.0, 1.0132E5, "SIH4:0.01, H2:0.99");
|
||||
equilibrate(g, TP);
|
||||
equilibrate(g, "TP");
|
||||
cout << g;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue