32typedef Cabinet<ReactorBase> ReactorBaseCabinet;
33template<> ReactorBaseCabinet* ReactorBaseCabinet::s_storage = 0;
35typedef Cabinet<Solution> SolutionCabinet;
36template<> SolutionCabinet* SolutionCabinet::s_storage;
42 int32_t
reactor_new(
const char* model, int32_t contents,
const char* name)
46 return ReactorBaseCabinet::add(
newReactorBase(model, SolutionCabinet::at(contents), name));
56 string out = ReactorBaseCabinet::at(handle)->type();
58 return int(out.size()) + 1;
68 string out = ReactorBaseCabinet::at(handle)->name();
70 return int(out.size()) + 1;
80 ReactorBaseCabinet::at(handle)->setName(name);
91 ReactorBaseCabinet::at(handle)->setInitialVolume(vol);
102 bool cflag_ = (cflag != 0);
103 ReactorBaseCabinet::at(handle)->setChemistry(cflag_);
114 ReactorBaseCabinet::at(handle)->setEnergy(eflag);
125 return ReactorBaseCabinet::at(handle)->mass();
135 return ReactorBaseCabinet::at(handle)->volume();
145 return ReactorBaseCabinet::at(handle)->density();
155 return ReactorBaseCabinet::at(handle)->temperature();
165 return ReactorBaseCabinet::at(handle)->enthalpy_mass();
175 return ReactorBaseCabinet::at(handle)->intEnergy_mass();
185 return ReactorBaseCabinet::at(handle)->pressure();
195 return ReactorBaseCabinet::at(handle)->massFraction(k);
205 return ReactorBaseCabinet::at(handle)->nSensParams();
215 ReactorBaseCabinet::at(handle)->addSensitivityReaction(rxn);
226 ReactorBaseCabinet::at(handle)->addSurface(ReactorBaseCabinet::at(surf));
237 ReactorBaseCabinet::as<FlowReactor>(handle)->setMassFlowRate(mdot);
248 return ReactorBaseCabinet::as<FlowReactor>(handle)->area();
258 ReactorBaseCabinet::as<FlowReactor>(handle)->setArea(area);
269 ReactorBaseCabinet::del(handle);
281 return ReactorBaseCabinet::size();
293 return ReactorBaseCabinet::parent(handle);
int32_t reactor_nSensParams(int32_t handle)
Number of sensitivity parameters associated with this reactor.
double reactor_volume(int32_t handle)
Returns the current volume (m^3) of the reactor.
int32_t reactor_parentHandle(int32_t handle)
Return handle to parent of ReactorBase object.
int32_t reactor_setName(int32_t handle, const char *name)
Set the name of this reactor.
int32_t reactor_del(int32_t handle)
Delete ReactorBase object.
double reactor_enthalpy_mass(int32_t handle)
Returns the current enthalpy (J/kg) of the reactor's contents.
double reactor_pressure(int32_t handle)
Returns the current pressure (Pa) of the reactor.
int32_t reactor_addSurface(int32_t handle, int32_t surf)
Add a ReactorSurface object to a Reactor object.
double reactor_mass(int32_t handle)
Returns the mass (kg) of the reactor's contents.
int32_t reactor_setArea(int32_t handle, double area)
Sets the area of the reactor [m^2].
int32_t reactor_new(const char *model, int32_t contents, const char *name)
Create a ReactorBase object of the specified type and contents.
int32_t reactor_setMassFlowRate(int32_t handle, double mdot)
Set the mass flow rate through the reactor [kg/s].
double reactor_area(int32_t handle)
The cross-sectional area of the reactor [m^2].
int32_t reactor_setEnergy(int32_t handle, int32_t eflag)
Set the energy equation on or off.
int32_t reactor_setInitialVolume(int32_t handle, double vol)
Set the initial reactor volume.
double reactor_temperature(int32_t handle)
Returns the current temperature (K) of the reactor's contents.
int32_t reactor_setChemistry(int32_t handle, int32_t cflag)
Enable or disable changes in reactor composition due to chemical reactions.
double reactor_massFraction(int32_t handle, int32_t k)
Return the mass fraction of the.
double reactor_intEnergy_mass(int32_t handle)
Returns the current internal energy (J/kg) of the reactor's contents.
int32_t reactor_addSensitivityReaction(int32_t handle, int32_t rxn)
Add a sensitivity parameter associated with the reaction number.
double reactor_density(int32_t handle)
Returns the current density (kg/m^3) of the reactor's contents.
int32_t reactor_type(int32_t handle, int32_t bufLen, char *buf)
String indicating the reactor model implemented.
int32_t reactor_name(int32_t handle, int32_t bufLen, char *buf)
Return the name of this reactor.
int32_t reactor_cabinetSize()
Return size of ReactorBase storage.
size_t copyString(const string &source, char *dest, size_t length)
Copy the contents of a string into a char array of a given length.
shared_ptr< ReactorBase > newReactorBase(const string &model, shared_ptr< Solution > contents, const string &name)
Create a ReactorBase object of the specified type and contents.
CTREACTOR - Generated CLib Cantera interface library.
Namespace for the Cantera kernel.
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.
Contains declarations for string manipulation functions within Cantera.