10#include "cantera/numerics/eigen_sparse.h"
49 Reactor(shared_ptr<Solution> sol,
const string&
name=
"(none)");
50 Reactor(shared_ptr<Solution> sol,
bool clone,
const string&
name=
"(none)");
52 string type()
const override {
85 void eval(
double t,
double* LHS,
double* RHS)
override;
86 void evalSteady(
double t,
double* LHS,
double* RHS)
override;
158 bool m_energy =
true;
A map of string keys to values whose type can vary at runtime.
Public interface for kinetics managers.
Base class for reactor objects.
double m_vol
Current volume of the reactor [m^3].
string name() const
Return the name of this reactor.
Class Reactor is a general-purpose class for stirred reactors.
void evalWalls(double t) override
Evaluate terms related to Walls.
double upperBound(size_t k) const override
Get the upper bound on the k-th component of the local state vector.
void setChemistryEnabled(bool cflag=true) override
Enable or disable changes in reactor composition due to chemical reactions.
void resetBadValues(double *y) override
Reset physically or mathematically problematic values, such as negative species concentrations.
Kinetics * m_kin
Pointer to the homogeneous Kinetics object that handles the reactions.
vector< double > m_wdot
Species net molar production rates.
Eigen::SparseMatrix< double > finiteDifferenceJacobian()
Calculate the reactor-specific Jacobian using a finite difference method.
bool energyEnabled() const override
Returns true if solution of the energy equation is enabled.
void resetSensitivity(double *params) override
Reset the reaction rate multipliers.
void eval(double t, double *LHS, double *RHS) override
Evaluate the reactor governing equations.
string type() const override
String indicating the reactor model implemented.
double m_Qdot
net heat transfer into the reactor, through walls [W]
size_t componentIndex(const string &nm) const override
Return the index in the solution vector for this reactor of the component named nm.
vector< double > m_advancelimits
Advance step limit.
void setEnergyEnabled(bool eflag=true) override
Set the energy equation on or off.
void applySensitivity(double *params) override
Set reaction rate multipliers based on the sensitivity variables in params.
void evalSteady(double t, double *LHS, double *RHS) override
Evaluate the governing equations with modifications for the steady-state solver.
void setInitialVolume(double vol) override
Set the initial reactor volume.
vector< double > m_uk
Species molar internal energies.
void getState(double *y) override
Get the current state of the reactor.
void setAdvanceLimits(const double *limits)
Set absolute step size limits during advance.
void updateSurfaceProductionRates()
Update m_sdot to reflect current production rates of bulk phase species due to reactions on adjacent ...
void addSensitivitySpeciesEnthalpy(size_t k) override
Add a sensitivity parameter associated with the enthalpy formation of species k.
void setAdvanceLimit(const string &nm, const double limit)
Set individual step size limit for component name nm
vector< size_t > initializeSteady() override
Initialize the reactor before solving a steady-state problem.
void addSensitivityReaction(size_t rxn) override
Add a sensitivity parameter associated with the reaction number rxn
double lowerBound(size_t k) const override
Get the lower bound on the k-th component of the local state vector.
vector< double > m_sdot
Total production rate of bulk phase species on surfaces [kmol/s].
string componentName(size_t k) override
Return the name of the solution component with index i.
bool hasAdvanceLimits() const
Check whether Reactor object uses advance limits.
double m_vdot
net rate of volume change from moving walls [m^3/s]
void updateState(double *y) override
Set the state of the reactor to correspond to the state vector y.
void initialize(double t0=0.0) override
Initialize the reactor.
double m_initialVolume
Initial volume [m³]; used for steady-state calculations.
bool getAdvanceLimits(double *limits) const
Retrieve absolute step size limits during advance.
void setDerivativeSettings(AnyMap &settings) override
Use this to set the kinetics objects derivative settings.
virtual bool isOde() const
Indicate whether the governing equations for this reactor type are a system of ODEs or DAEs.
bool chemistryEnabled() const override
Returns true if changes in the reactor composition due to chemical reactions are enabled.
Namespace for the Cantera kernel.