6#ifndef CT_FLOWREACTOR_H
7#define CT_FLOWREACTOR_H
19 using IdealGasReactor::IdealGasReactor;
21 string type()
const override {
44 void eval(
double t,
double* LHS,
double* RHS)
override {
48 void evalDae(
double t,
double* y,
double* ydot,
double* residual)
override;
Adiabatic flow in a constant-area duct with homogeneous and heterogeneous reactions.
double m_area
reactor area [m^2]
double inletSurfaceAtol() const
Get the steady state tolerances used to determine the initial state for surface coverages.
vector< double > m_sdot_temp
temporary storage for surface species production rates
void setInletSurfaceAtol(double atol)
Set the steady state tolerances used to determine the initial state for surface coverages.
const size_t m_offset_Y
offset to the species equations
bool isOde() const override
Indicate whether the governing equations for this reactor type are a system of ODEs or DAEs.
double area() const
The cross-sectional area of the reactor [m^2].
double surfaceAreaToVolumeRatio() const
The ratio of the reactor's surface area to volume ratio [m^-1].
void setMassFlowRate(double mdot)
Set the mass flow rate through the reactor [kg/s].
double inletSurfaceMaxSteps() const
Get the steady state tolerances used to determine the initial state for surface coverages.
double m_ss_rtol
steady-state relative tolerance, used to determine initial surface coverages
double inletSurfaceMaxErrorFailures() const
Get the steady state tolerances used to determine the initial state for surface coverages.
int m_max_ss_error_fails
maximum number of steady-state integrator error test failures
void setInletSurfaceMaxErrorFailures(int max_fails)
Set the steady state tolerances used to determine the initial state for surface coverages.
void getConstraints(double *constraints) override
Given a vector of length neq(), mark which variables should be considered algebraic constraints.
bool timeIsIndependent() const override
Indicates whether the governing equations for this reactor are functions of time or a spatial variabl...
void eval(double t, double *LHS, double *RHS) override
Not implemented; FlowReactor implements evalDae() instead.
double speed() const
The current gas speed in the reactor [m/s].
string type() const override
String indicating the reactor model implemented.
double inletSurfaceRtol() const
Get the steady state tolerances used to determine the initial state for surface coverages.
double m_u
Axial velocity [m/s]. Second component of the state vector.
size_t componentIndex(const string &nm) const override
Return the index in the solution vector for this reactor of the component named nm.
void getStateDae(double *y, double *ydot) override
Get the current state and derivative vector of the reactor for a DAE solver.
void setSurfaceAreaToVolumeRatio(double sa_to_vol)
Set the reactor's surface area to volume ratio [m^-1].
int m_max_ss_steps
maximum number of steady-state coverage integrator-steps
void setInletSurfaceMaxSteps(int max_steps)
Set the steady state tolerances used to determine the initial state for surface coverages.
void getState(double *y) override
Not implemented; FlowReactor implements getStateDAE() instead.
double m_rho
Density [kg/m^3]. First component of the state vector.
void evalDae(double t, double *y, double *ydot, double *residual) override
Evaluate the reactor governing equations.
string componentName(size_t k) override
Return the name of the solution component with index i.
void syncState() override
Set the state of the reactor to correspond to the state of the associated ThermoPhase object.
void updateState(double *y) override
Set the state of the reactor to correspond to the state vector y.
void setInletSurfaceRtol(double rtol)
Set the steady state tolerances used to determine the initial state for surface coverages.
void initialize(double t0=0.0) override
Initialize the reactor.
void updateSurfaceState(double *y) override
Update the state of SurfPhase objects attached to this reactor.
double m_P
Pressure [Pa]. Third component of the state vector.
double m_T
Temperature [K]. Fourth component of the state vector.
double m_sa_to_vol
reactor surface area to volume ratio [m^-1]
double m_ss_atol
steady-state absolute tolerance, used to determine initial surface coverages
vector< double > m_hk
temporary storage for species partial molar enthalpies
void setArea(double area)
Sets the area of the reactor [m^2].
Class IdealGasReactor is a class for stirred reactors that is specifically optimized for ideal gases.
An error indicating that an unimplemented function has been called.
Namespace for the Cantera kernel.