Removing deprecated / nonfunctional methods from Reactor

These functions / variables are for driving the time integration, which is
handled entirely by ReactorNet.
This commit is contained in:
Ray Speth 2012-10-12 20:34:33 +00:00
parent 2134e5d570
commit 11a11bea79
17 changed files with 0 additions and 238 deletions

View file

@ -135,11 +135,7 @@ protected:
Kinetics* m_kin;
//! Tolerance on the temperature
doublereal m_temp_atol;
doublereal m_maxstep; // max step size
doublereal m_vdot, m_Q;
vector_fp m_atol;
doublereal m_rtol;
vector_fp m_work;
vector_fp m_sdot; // surface production rates
bool m_chem;

View file

@ -58,16 +58,6 @@ public:
m_vol0 = vol;
}
/**
* Set initial time. Default = 0.0 s. Restarts integration
* from this time using the current mixture state as the
* initial condition.
*/
void setInitialTime(doublereal time) {
m_time = time;
m_init = false;
}
/**
* Specify the mixture contained in the reactor. Note that
* a pointer to this substance is stored, and as the integration
@ -102,19 +92,6 @@ public:
tilt();
}
/**
* Advance the state of the reactor in time.
* @param time Time to advance to (s).
* Note that this method
* changes the state of the mixture object.
*/
virtual void advance(doublereal time) {
tilt();
}
virtual double step(doublereal time) {
tilt();
return 0.0;
}
virtual void start() {}
//@}
@ -139,7 +116,6 @@ public:
doublereal residenceTime();
/**
* @name Solution components.
* The values returned are those after the last call to advance
@ -147,12 +123,6 @@ public:
*/
//@{
/// the current time (s).
doublereal time() const {
return m_time;
}
//! Returns the current volume of the reactor
/*!
* @return Return the volume in m**3
@ -198,7 +168,6 @@ protected:
size_t m_nsp;
thermo_t* m_thermo;
doublereal m_time;
doublereal m_vol, m_vol0;
bool m_init;
size_t m_nInlets, m_nOutlets;

View file

@ -23,9 +23,6 @@ public:
return ReservoirType;
}
virtual void initialize(doublereal t0 = 0.0) {}
virtual void advance(doublereal time) {
m_time = time;
}
void insert(Cantera::ThermoPhase& contents) {
setThermoMgr(contents);

View file

@ -1,22 +0,0 @@
function advance(r, tout)
% ADVANCE - Advance the state of the reactor in time.
%
% Method advance integrates the system of ordinary differential
% equations that determine the rate of change of the reactor
% volume, the mass of each species, and the total energy. The
% integration is carried out from the current reactor time to time
% 'tout.' (Note 'tout' is an absolute time, not a time interval.) The
% integrator may take many internal time steps before reaching
% tout.
%
% for i in 1:10
% tout = 0.1*i
% advance(r, tout)
% ...
% <add output commands here>
% ...
% end
%
% See also: Reactor/step
%
reactormethods(8, reactor_hndl(r), tout);

View file

@ -1,4 +0,0 @@
function setInitialTime(r, t0)
% SETINITIALTIME - set the initial time. Deprecated.
%
reactormethods(5, reactor_hndl(r), t0);

View file

@ -1,27 +0,0 @@
function t = step(r, tout)
% STEP - Take one internal time step toward tout.
%
% The integrator used to integrate the ODEs (CVODE) takes
% variable-size steps, chosen so that a specified error
% tolerance is maintained. At times when the solution is rapidly
% changing, the time step becomes smaller to resolve the
% solution.
%
% Method 'step' takes one internal time step and returns. This
% can be useful when it is desired to resolve a rapidly-changing
% solution in the output file.
%
% This method can be used as follows:
%
% t = 0.0
% tout = 0.1
% while t < tout
% t = step(r, tout)
% ,,,
% <commands to save desired variables>
% ...
% end
%
% See also: Reactor/advance
%
t = reactormethods(21, reactor_hndl(r), tout);

View file

@ -1,4 +0,0 @@
function t = time(r)
% TIME - time
%
t = reactormethods(22, reactor_hndl(r));

View file

@ -94,14 +94,6 @@ class ReactorBase:
_cantera.reactor_setThermoMgr(self.__reactor_id, contents._phase_id)
_cantera.reactor_setKineticsMgr(self.__reactor_id, contents.ckin)
def setInitialTime(self, T0):
"""Deprecated.
Set the initial time. Restarts integration from this time
using the current state as the initial condition. Default: 0.0 s"""
raise "use method setInitialTime of class ReactorNet"
#_cantera.reactor_setInitialTime(self.__reactor_id, T0)
def _setInitialVolume(self, V0):
"""Set the initial reactor volume. """
_cantera.reactor_setInitialVolume(self.__reactor_id, V0)
@ -134,11 +126,6 @@ class ReactorBase:
if non-rigid walls are installed on the reactor."""
return _cantera.reactor_volume(self.__reactor_id)
def time(self):
"""Deprecated. The current time [s]."""
raise "use method time of class ReactorNet"
#return _cantera.reactor_time(self.__reactor_id)
def mass(self):
"""The total mass of fluid in the reactor [kg]."""
return _cantera.reactor_mass(self.__reactor_id)
@ -155,22 +142,6 @@ class ReactorBase:
"""The pressure in the reactor [Pa]."""
return _cantera.reactor_pressure(self.__reactor_id)
def advance(self, time):
"""Deprecated.
Advance the state of the reactor in time from the current
time to time *time*. Note: this method is deprecated. See
:class:`.ReactorNet`."""
raise "use method advance of class ReactorNet"
#return _cantera.reactor_advance(self.__reactor_id, time)
def step(self, time):
"""Deprecated.
Take one internal time step from the current time toward
time *time*. Note: this method is deprecated. See class
:class:`.ReactorNet`."""
raise "use method step of class ReactorNet"
#return _cantera.reactor_step(self.__reactor_id, time)
def massFraction(self, s):
"""The mass fraction of species *s*, specified either by name or
index number.

View file

@ -93,16 +93,6 @@ extern "C" {
}
}
int reactor_setInitialTime(int i, double t)
{
try {
ReactorCabinet::item(i).setInitialTime(t);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}
int reactor_setThermoMgr(int i, int n)
{
try {
@ -126,34 +116,6 @@ extern "C" {
}
}
int reactor_advance(int i, double t)
{
try {
ReactorCabinet::item(i).advance(t);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}
double reactor_step(int i, double t)
{
try {
return ReactorCabinet::item(i).step(t);
} catch (...) {
return handleAllExceptions(DERR, DERR);
}
}
double reactor_time(int i)
{
try {
return ReactorCabinet::item(i).time();
} catch (...) {
return handleAllExceptions(DERR, DERR);
}
}
double reactor_mass(int i)
{
try {

View file

@ -12,13 +12,9 @@ extern "C" {
CANTERA_CAPI int reactor_copy(int i);
CANTERA_CAPI int reactor_assign(int i, int j);
CANTERA_CAPI int reactor_setInitialVolume(int i, double v);
CANTERA_CAPI int reactor_setInitialTime(int i, double t);
CANTERA_CAPI int reactor_setEnergy(int i, int eflag);
CANTERA_CAPI int reactor_setThermoMgr(int i, int n);
CANTERA_CAPI int reactor_setKineticsMgr(int i, int n);
CANTERA_CAPI int reactor_advance(int i, double t);
CANTERA_CAPI double reactor_step(int i, double t);
CANTERA_CAPI double reactor_time(int i);
CANTERA_CAPI double reactor_mass(int i);
CANTERA_CAPI double reactor_volume(int i);
CANTERA_CAPI double reactor_density(int i);

View file

@ -48,18 +48,12 @@ void reactormethods(int nlhs, mxArray* plhs[],
case 4:
iok = reactor_setInitialVolume(i, v);
break;
case 5:
iok = reactor_setInitialTime(i, v);
break;
case 6:
iok = reactor_setThermoMgr(i, int(v));
break;
case 7:
iok = reactor_setKineticsMgr(i, int(v));
break;
case 8:
iok = reactor_advance(i, v);
break;
case 9:
iok = reactor_setEnergy(i, int(v));
break;
@ -80,12 +74,6 @@ void reactormethods(int nlhs, mxArray* plhs[],
else if (job < 40) {
switch (job) {
case 21:
r = reactor_step(i, v);
break;
case 22:
r = reactor_time(i);
break;
case 23:
r = reactor_mass(i);
break;

View file

@ -39,18 +39,6 @@ py_reactor_setInitialVolume(PyObject* self, PyObject* args)
return Py_BuildValue("i",0);
}
// static PyObject*
// py_reactor_setInitialTime(PyObject *self, PyObject *args)
// {
// int n;
// double t;
// if (!PyArg_ParseTuple(args, "id:reactor_setInitialTime", &n, &t))
// return NULL;
// int iok = reactor_setInitialTime(n, t);
// if (iok < 0) return reportError(iok);
// return Py_BuildValue("i",0);
// }
static PyObject*
py_reactor_setEnergy(PyObject* self, PyObject* args)
{
@ -143,39 +131,6 @@ py_flowReactor_setMassFlowRate(PyObject* self, PyObject* args)
return Py_BuildValue("i",_val);
}
// static PyObject*
// py_reactor_advance(PyObject *self, PyObject *args)
// {
// int n;
// double t;
// if (!PyArg_ParseTuple(args, "id:reactor_advance", &n, &t))
// return NULL;
// int iok = reactor_advance(n, t);
// if (iok < 0) return reportError(iok);
// return Py_BuildValue("i",0);
// }
// static PyObject*
// py_reactor_step(PyObject *self, PyObject *args)
// {
// int n;
// double t;
// if (!PyArg_ParseTuple(args, "id:reactor_step", &n, &t))
// return NULL;
// return Py_BuildValue("d",reactor_step(n, t));
// }
// static PyObject*
// py_reactor_time(PyObject *self, PyObject *args)
// {
// int n;
// if (!PyArg_ParseTuple(args, "i:reactor_time", &n))
// return NULL;
// double t = reactor_time(n);
// return Py_BuildValue("d",t);
// }
static PyObject*
py_reactor_mass(PyObject* self, PyObject* args)
{

View file

@ -202,7 +202,6 @@ static PyMethodDef ct_methods[] = {
// {"bndry_setmdot", py_bndry_setmdot, METH_VARARGS},
{"flowdev_ready", py_flowdev_ready, METH_VARARGS},
//{"reactor_setInitialTime", py_reactor_setInitialTime, METH_VARARGS},
{"reactornet_setInitialTime", py_reactornet_setInitialTime, METH_VARARGS},
{"reactornet_setTolerances", py_reactornet_setTolerances, METH_VARARGS},
{"reactornet_setSensitivityTolerances", py_reactornet_setSensitivityTolerances, METH_VARARGS},
@ -217,10 +216,7 @@ static PyMethodDef ct_methods[] = {
{"reactor_setThermoMgr", py_reactor_setThermoMgr, METH_VARARGS},
{"reactor_setEnergy", py_reactor_setEnergy, METH_VARARGS},
{"reactor_volume", py_reactor_volume, METH_VARARGS},
//{"reactor_time", py_reactor_time, METH_VARARGS},
{"reactornet_time", py_reactornet_time, METH_VARARGS},
// {"reactor_advance", py_reactor_advance, METH_VARARGS},
//{"reactor_step", py_reactor_step, METH_VARARGS},
{"reactornet_addreactor", py_reactornet_addreactor, METH_VARARGS},
{"reactornet_advance", py_reactornet_advance, METH_VARARGS},
{"reactornet_step", py_reactornet_step, METH_VARARGS},

View file

@ -27,7 +27,6 @@ getInitialConditions(double t0, size_t leny, double* y)
throw CanteraError("getInitialConditions",
"Error: reactor is empty.");
}
m_time = t0;
m_thermo->restoreState(m_state);
// total mass
@ -132,7 +131,6 @@ void ConstPressureReactor::evalEqs(doublereal time, doublereal* y,
doublereal* ydot, doublereal* params)
{
size_t nk;
m_time = time;
m_thermo->restoreState(m_state);
Kinetics* kin;

View file

@ -25,7 +25,6 @@ void FlowReactor::getInitialConditions(double t0, size_t leny, double* y)
writelog("Error: reactor is empty.\n");
return;
}
m_time = t0;
m_thermo->restoreState(m_state);
m_thermo->getMassFractions(y+2);
@ -79,7 +78,6 @@ void FlowReactor::updateState(doublereal* y)
void FlowReactor::evalEqs(doublereal time, doublereal* y,
doublereal* ydot, doublereal* params)
{
m_time = time;
m_thermo->restoreState(m_state);
double mult;

View file

@ -7,7 +7,6 @@
// Copyright 2001 California Institute of Technology
#include "cantera/zeroD/Reactor.h"
//#include "../CVode.h"
#include "cantera/zeroD/FlowDevice.h"
#include "cantera/zeroD/Wall.h"
#include "cantera/kinetics/InterfaceKinetics.h"
@ -19,11 +18,8 @@ namespace Cantera
{
Reactor::Reactor() : ReactorBase(),
m_kin(0),
m_temp_atol(1.e-11),
m_maxstep(0.0),
m_vdot(0.0),
m_Q(0.0),
m_rtol(1.e-9),
m_chem(true),
m_energy(true),
m_nsens(npos)
@ -38,7 +34,6 @@ void Reactor::getInitialConditions(double t0, size_t leny, double* y)
cout << "Error: reactor is empty." << endl;
return;
}
m_time = t0;
m_thermo->restoreState(m_state);
// total mass
@ -180,7 +175,6 @@ void Reactor::updateState(doublereal* y)
void Reactor::evalEqs(doublereal time, doublereal* y,
doublereal* ydot, doublereal* params)
{
m_time = time;
m_thermo->restoreState(m_state);
// process sensitivity parameters

View file

@ -14,7 +14,6 @@ namespace Cantera
ReactorBase::ReactorBase(string name) : m_nsp(0),
m_thermo(0),
m_time(0.0),
m_vol(1.0),
m_vol0(1.0),
m_init(false),