Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tracker.

Emil Atz
Philip Berndt
Wolfgang Bessler, Offenburg University of Applied Science
Tilman Bremer
Victor Brunini, Sandia National Laboratory
Bang-Shiuh Chen, Purdue University
Expand All @@ -25,16 +26,20 @@ Jon Kristofer
Kyle Linevitch, Jr.
Christopher Leuth
Nicholas Malaya, University of Texas at Austin
Thanasis Mattas, Aristotle University of Thessaloniki
Evan McCorkle
Ivan Mitrichev, Mendeleev University of Chemical Technology of Russia
Harry Moffat, Sandia National Laboratory
Christopher Neal
Kyle Niemeyer, Oregon State University
@pwcnorthrop
Paul Northrop
Andreas Rücker
Jeff Santner
Satyam Saxena
Ingmar Schoegl, Louisiana State University
Santosh Shanbhogue, Massachusetts Institute of Technology
David Sondak
Raymond Speth, Massachusetts Institute of Technology
Sergey Torokhov
Bryan Weber, University of Connecticut
Armin Wehrfritz
9 changes: 6 additions & 3 deletions include/cantera/clib/ctreactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
extern "C" {
#endif

CANTERA_CAPI int reactor_new(int type);
CANTERA_CAPI int reactor_new2(const char* type);
CANTERA_CAPI int reactor_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int reactor_del(int i);
CANTERA_CAPI int reactor_setInitialVolume(int i, double v);
CANTERA_CAPI int reactor_setChemistry(int i, int cflag);
Expand Down Expand Up @@ -47,7 +48,8 @@ extern "C" {
CANTERA_CAPI double reactornet_atol(int i);
CANTERA_CAPI double reactornet_sensitivity(int i, const char* v, int p, int r);

CANTERA_CAPI int flowdev_new(int type);
CANTERA_CAPI int flowdev_new2(const char* type);
CANTERA_CAPI int flowdev_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int flowdev_del(int i);
CANTERA_CAPI int flowdev_install(int i, int n, int m);
CANTERA_CAPI int flowdev_setMaster(int i, int n);
Expand All @@ -56,7 +58,8 @@ extern "C" {
CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v);
CANTERA_CAPI int flowdev_setFunction(int i, int n);

CANTERA_CAPI int wall_new(int type);
CANTERA_CAPI int wall_new2(const char* type);
CANTERA_CAPI int wall_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int wall_del(int i);
CANTERA_CAPI int wall_install(int i, int n, int m);
CANTERA_CAPI double wall_vdot(int i, double t);
Expand Down
11 changes: 11 additions & 0 deletions include/cantera/zeroD/ConstPressureReactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ class ConstPressureReactor : public Reactor
public:
ConstPressureReactor() {}

virtual std::string typeStr() const {
return "ConstPressureReactor";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("ConstPressureReactor::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"ConstPressureReactor::typeStr() during transition");
return ConstPressureReactorType;
}

Expand Down
19 changes: 17 additions & 2 deletions include/cantera/zeroD/FlowDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace Cantera
class Func1;
class ReactorBase;

//! Magic numbers
//! @deprecated To be removed after Cantera 2.5.
const int MFC_Type = 1;
const int PressureController_Type = 2;
const int Valve_Type = 3;
Expand All @@ -33,8 +35,21 @@ class FlowDevice
FlowDevice(const FlowDevice&) = delete;
FlowDevice& operator=(const FlowDevice&) = delete;

//! String indicating the flow device implemented. Usually
//! corresponds to the name of the derived class.
virtual std::string typeStr() const {
return "FlowDevice";
}

//! Return an integer indicating the type of flow device
int type() {
/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("FlowDevice::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"FlowDevice::typeStr() during transition.");
return m_type;
}

Expand Down Expand Up @@ -100,7 +115,7 @@ class FlowDevice
doublereal m_mdot;
Func1* m_func;
vector_fp m_coeffs;
int m_type;
int m_type; //!< @deprecated To be removed after Cantera 2.5.

private:
size_t m_nspin, m_nspout;
Expand Down
3 changes: 3 additions & 0 deletions include/cantera/zeroD/FlowDeviceFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ class FlowDeviceFactory : public Factory<FlowDevice>
* @param name the name of the flow device type.
* @param type the type identifier of the flow device.
* Integer type identifiers are used by clib and matlab interfaces.
*
* @deprecated To be removed after Cantera 2.5.
*/
void reg_type(const std::string& name, const int type) {
m_types[type] = name;
}

protected:
//! Map containing flow device type identifier / type name pairs.
//! @deprecated To be removed after Cantera 2.5.
std::unordered_map<int, std::string> m_types;

private:
Expand Down
11 changes: 11 additions & 0 deletions include/cantera/zeroD/FlowReactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ class FlowReactor : public Reactor
public:
FlowReactor();

virtual std::string typeStr() const {
return "FlowReactor";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("FlowReactor::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"FlowReactor::typeStr() during transition");
return FlowReactorType;
}

Expand Down
12 changes: 12 additions & 0 deletions include/cantera/zeroD/IdealGasConstPressureReactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@ class IdealGasConstPressureReactor : public ConstPressureReactor
public:
IdealGasConstPressureReactor() {}

virtual std::string typeStr() const {
return "IdealGasConstPressureReactor";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("IdealGasConstPressureReactor::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"IdealGasConstPressureReactor::typeStr() during "
"transition");
return IdealGasConstPressureReactorType;
}

Expand Down
11 changes: 11 additions & 0 deletions include/cantera/zeroD/IdealGasReactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ class IdealGasReactor : public Reactor
public:
IdealGasReactor() {}

virtual std::string typeStr() const {
return "IdealGasReactor";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("IdealGasReactor::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"IdealGasReactor::typeStr() during transition");
return IdealGasReactorType;
}

Expand Down
19 changes: 14 additions & 5 deletions include/cantera/zeroD/Reactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,18 @@ class Reactor : public ReactorBase
public:
Reactor();

virtual std::string typeStr() const {
return "Reactor";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("Reactor::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"Reactor::typeStr() during transition");
return ReactorType;
}

Expand All @@ -53,10 +64,9 @@ class Reactor : public ReactorBase
setKineticsMgr(contents);
}

void setKineticsMgr(Kinetics& kin);
virtual void setKineticsMgr(Kinetics& kin);

//! Enable or disable changes in reactor composition due to chemical reactions.
void setChemistry(bool cflag = true) {
virtual void setChemistry(bool cflag = true) {
m_chem = cflag;
}

Expand All @@ -65,8 +75,7 @@ class Reactor : public ReactorBase
return m_chem;
}

//! Set the energy equation on or off.
void setEnergy(int eflag = 1) {
virtual void setEnergy(int eflag = 1) {
if (eflag > 0) {
m_energy = true;
} else {
Expand Down
29 changes: 29 additions & 0 deletions include/cantera/zeroD/ReactorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class FlowDevice;
class WallBase;
class ReactorNet;
class ReactorSurface;
class Kinetics;

//! Magic numbers
//! @deprecated To be removed after Cantera 2.5.
const int ReservoirType = 1;
const int ReactorType = 2;
const int FlowReactorType = 3;
Expand Down Expand Up @@ -49,8 +52,19 @@ class ReactorBase
ReactorBase(const ReactorBase&) = delete;
ReactorBase& operator=(const ReactorBase&) = delete;

//! String indicating the reactor model implemented. Usually
//! corresponds to the name of the derived class.
virtual std::string typeStr() const {
return "ReactorBase";
}

//! Return a constant indicating the type of this Reactor
//! @deprecated To be changed after Cantera 2.5.
virtual int type() const {
warn_deprecated("ReactorBase::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"ReactorBase::typeStr() during transition");
return 0;
}

Expand All @@ -77,6 +91,21 @@ class ReactorBase
//! the substance is modified.
virtual void setThermoMgr(thermo_t& thermo);

//! Specify chemical kinetics governing the reactor.
virtual void setKineticsMgr(Kinetics& kin) {
throw NotImplementedError("ReactorBase::setKineticsMgr");
}

//! Enable or disable changes in reactor composition due to chemical reactions.
virtual void setChemistry(bool cflag = true) {
throw NotImplementedError("ReactorBase::setChemistry");
}

//! Set the energy equation on or off.
virtual void setEnergy(int eflag = 1) {
throw NotImplementedError("ReactorBase::setEnergy");
}

//! Connect an inlet FlowDevice to this reactor
void addInlet(FlowDevice& inlet);

Expand Down
3 changes: 3 additions & 0 deletions include/cantera/zeroD/ReactorFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ class ReactorFactory : public Factory<ReactorBase>
* @param name the name of the reactor type.
* @param type the type identifier of the reactor.
* Integer type identifiers are used by clib and matlab interfaces.
*
* @deprecated To be removed after Cantera 2.5.
*/
void reg_type(const std::string& name, const int type) {
m_types[type] = name;
}

protected:
//! Map containing reactor type identifier / reactor type name pairs.
//! @deprecated To be removed after Cantera 2.5.
std::unordered_map<int, std::string> m_types;

private:
Expand Down
12 changes: 12 additions & 0 deletions include/cantera/zeroD/Reservoir.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ class Reservoir : public ReactorBase
{
public:
Reservoir() {}

virtual std::string typeStr() const {
return "Reservoir";
}

/*!
* @deprecated To be changed after Cantera 2.5.
*/
virtual int type() const {
warn_deprecated("Reservoir::type()",
"To be changed after Cantera 2.5. "
"Return string instead of magic number; use "
"Reservoir::typeStr() during transition");
return ReservoirType;
}
virtual void initialize(doublereal t0 = 0.0) {}
Expand Down
2 changes: 2 additions & 0 deletions include/cantera/zeroD/Wall.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Kinetics;
class SurfPhase;
class Func1;

//! Magic numbers
//! @deprecated To be removed after Cantera 2.5.
const int WallType = 1;

/**
Expand Down
3 changes: 3 additions & 0 deletions include/cantera/zeroD/WallFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ class WallFactory : public Factory<WallBase>
* @param name the name of the wall type.
* @param type the type identifier of the wall.
* Integer type identifiers are used by clib and matlab interfaces.
*
* @deprecated To be removed after Cantera 2.5.
*/
void reg_type(const std::string& name, const int type) {
m_types[type] = name;
}

protected:
//! Map containing wall type identifier / wall type name pairs.
//! @deprecated To be removed after Cantera 2.5.
std::unordered_map<int, std::string> m_types;

private:
Expand Down
12 changes: 12 additions & 0 deletions include/cantera/zeroD/flowControllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class MassFlowController : public FlowDevice
public:
MassFlowController();

virtual std::string typeStr() const {
return "MassFlowController";
}

virtual bool ready() {
return FlowDevice::ready() && m_mdot >= 0.0;
}
Expand All @@ -40,6 +44,10 @@ class PressureController : public FlowDevice
public:
PressureController();

virtual std::string typeStr() const {
return "PressureController";
}

virtual bool ready() {
return FlowDevice::ready() && m_master != 0 && m_coeffs.size() == 1;
}
Expand Down Expand Up @@ -76,6 +84,10 @@ class Valve : public FlowDevice
public:
Valve();

virtual std::string typeStr() const {
return "Valve";
}

virtual bool ready() {
return FlowDevice::ready() && (m_coeffs.size() == 1 || m_func);
}
Expand Down
Loading