Cantera  3.2.0a2
Loading...
Searching...
No Matches
ReactorNet.h
Go to the documentation of this file.
1//! @file ReactorNet.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_REACTORNET_H
7#define CT_REACTORNET_H
8
9#include "Reactor.h"
12
13namespace Cantera
14{
15
16class Array2D;
17class Integrator;
18class SystemJacobian;
19
20//! A class representing a network of connected reactors.
21/*!
22 * This class is used to integrate the governing equations for a network of reactors
23 * that are time dependent (Reactor, ConstPressureReactor) connected by various
24 * means, for example Wall, MassFlowController, Valve, or PressureController; or
25 * reactors dependent on a single spatial variable (FlowReactor).
26 *
27 * @ingroup zerodGroup
28 */
29class ReactorNet : public FuncEval
30{
31public:
32 ReactorNet();
33 //! Create reactor network containing single reactor.
34 //! @since New in %Cantera 3.2.
35 ReactorNet(shared_ptr<ReactorBase> reactor);
36 //! Create reactor network from multiple reactors.
37 //! @since New in %Cantera 3.2.
38 ReactorNet(vector<shared_ptr<ReactorBase>>& reactors);
39 ~ReactorNet() override;
40 ReactorNet(const ReactorNet&) = delete;
41 ReactorNet& operator=(const ReactorNet&) = delete;
42
43 //! @name Methods to set up a simulation
44 //! @{
45
46 //! Set the type of linear solver used in the integration.
47 //! @param linSolverType type of linear solver. Default type: "DENSE"
48 //! Other options include: "DIAG", "DENSE", "GMRES", "BAND"
49 void setLinearSolverType(const string& linSolverType="DENSE");
50
51 //! Set preconditioner used by the linear solver
52 //! @param preconditioner preconditioner object used for the linear solver
53 void setPreconditioner(shared_ptr<SystemJacobian> preconditioner);
54
55 //! Set the initial value of the independent variable (typically time).
56 //! Default = 0.0 s. Restarts integration from this value using the current mixture
57 //! state as the initial condition.
58 void setInitialTime(double time);
59
60 //! Get the initial value of the independent variable (typically time).
61 /*!
62 * @since New in %Cantera 3.0.
63 */
64 double getInitialTime() const {
65 return m_initial_time;
66 }
67
68 //! Get the maximum integrator step.
69 double maxTimeStep() const {
70 return m_maxstep;
71 }
72
73 //! Set the maximum integrator step.
74 void setMaxTimeStep(double maxstep);
75
76 //! Set the maximum number of error test failures permitted by the CVODES
77 //! integrator in a single step.
78 void setMaxErrTestFails(int nmax);
79
80 //! Set the relative and absolute tolerances for the integrator.
81 void setTolerances(double rtol, double atol);
82
83 //! Set the relative and absolute tolerances for integrating the
84 //! sensitivity equations.
85 void setSensitivityTolerances(double rtol, double atol);
86
87 //! Current value of the simulation time [s], for reactor networks that are solved
88 //! in the time domain.
89 double time();
90
91 //! Current position [m] along the length of the reactor network, for reactors that
92 //! are solved as a function of space.
93 double distance();
94
95 //! Relative tolerance.
96 double rtol() {
97 return m_rtol;
98 }
99
100 //! Absolute integration tolerance
101 double atol() {
102 return m_atols;
103 }
104
105 //! Relative sensitivity tolerance
106 double rtolSensitivity() const {
107 return m_rtolsens;
108 }
109
110 //! Absolute sensitivity tolerance
111 double atolSensitivity() const {
112 return m_atolsens;
113 }
114
115 //! Problem type of integrator
116 string linearSolverType() const;
117
118 //! Returns the maximum number of internal integration steps the
119 //! integrator will take before reaching the next output point
120 int maxSteps();
121
122 //! @}
123
124 /**
125 * Advance the state of all reactors in the independent variable (time or space).
126 * Take as many internal steps as necessary to reach *t*.
127 * @param t Time/distance to advance to (s or m).
128 */
129 void advance(double t);
130
131 /**
132 * Advance the state of all reactors in the independent variable (time or space).
133 * Take as many internal steps as necessary towards *t*. If *applylimit* is true,
134 * the advance step will be automatically reduced if needed to stay within limits
135 * (set by setAdvanceLimit).
136 * Returns the time/distance at the end of integration.
137 * @param t Time/distance to advance to (s or m).
138 * @param applylimit Limit advance step (boolean).
139 */
140 double advance(double t, bool applylimit);
141
142 //! Advance the state of all reactors with respect to the independent variable
143 //! (time or space). Returns the new value of the independent variable [s or m].
144 double step();
145
146 //! Solve directly for the steady-state solution.
147 //!
148 //! This approach is generally more efficient than time marching to the
149 //! steady-state, but imposes a few limitations:
150 //!
151 //! - The volume of control volume reactor types (such as Reactor and
152 //! IdealGasMoleReactor) must be constant; no moving walls can be used.
153 //! - The mass of constant pressure reactor types (such as ConstPressureReactor and
154 //! IdealGasConstPressureReactor) must be constant; if flow devices are used,
155 //! inlet and outlet flows must be balanced.
156 //! - The solver is currently not compatible with the ConstPressureMoleReactor or
157 //! IdealGasConstPressureMoleReactor classes.
158 //! - Only ideal gas reactor types can be used for when the energy equation is
159 //! disabled (fixed temperature simulations).
160 //! - Reacting surfaces are not yet supported.
161 //!
162 //! @param loglevel Print information about solver progress to aid in understanding
163 //! cases where the solver fails to converge. Higher levels are more verbose.
164 //! - 0: No logging.
165 //! - 1: Basic info about each steady-state attempt and round of time stepping.
166 //! - 2: Adds details about each time step and steady-state Newton iteration.
167 //! - 3: Adds details about Newton iterations for each time step.
168 //! - 4: Adds details about state variables that are limiting steady-state
169 //! Newton step sizes.
170 //! - 5: Adds details about state variables that are limiting time-stepping
171 //! Newton step sizes.
172 //! - 6: Print current state vector after different solver stages
173 //! - 7: Print current residual vector after different solver stages
174 //!
175 //! @see SteadyStateSystem, MultiNewton
176 //! @since New in %Cantera 3.2.
177 void solveSteady(int loglevel=0);
178
179 //! Get the Jacobian used by the steady-state solver.
180 //!
181 //! @param rdt Reciprocal of the pseudo-timestep [1/s]. Default of 0.0 returns the
182 //! steady-state Jacobian.
183 //! @since New in %Cantera 3.2.
184 Eigen::SparseMatrix<double> steadyJacobian(double rdt=0.0);
185
186 //! Add the reactor *r* to this reactor network.
187 //! @deprecated To be removed after %Cantera 3.2. Replaceable by reactor net
188 //! instantiation with contents.
189 void addReactor(Reactor& r);
190
191 //! Return a reference to the *n*-th reactor in this network. The reactor
192 //! indices are determined by the order in which the reactors were added
193 //! to the reactor network.
194 Reactor& reactor(int n) {
195 return *m_reactors[n];
196 }
197
198 //! Returns `true` if verbose logging output is enabled.
199 bool verbose() const {
200 return m_verbose;
201 }
202
203 //! Enable or disable verbose logging while setting up and integrating the
204 //! reactor network.
205 void setVerbose(bool v = true) {
206 m_verbose = v;
207 suppressErrors(!m_verbose);
208 }
209
210 //! Return a reference to the integrator. Only valid after adding at least one
211 //! reactor to the network.
213
214 //! Update the state of all the reactors in the network to correspond to
215 //! the values in the solution vector *y*.
216 void updateState(double* y);
217
218 //! Return the sensitivity of the *k*-th solution component with respect to
219 //! the *p*-th sensitivity parameter.
220 /*!
221 * The sensitivity coefficient @f$ S_{ki} @f$ of solution variable @f$ y_k
222 * @f$ with respect to sensitivity parameter @f$ p_i @f$ is defined as:
223 *
224 * @f[ S_{ki} = \frac{1}{y_k} \frac{\partial y_k}{\partial p_i} @f]
225 *
226 * For reaction sensitivities, the parameter is a multiplier on the forward
227 * rate constant (and implicitly on the reverse rate constant for
228 * reversible reactions) which has a nominal value of 1.0, and the
229 * sensitivity is nondimensional.
230 *
231 * For species enthalpy sensitivities, the parameter is a perturbation to
232 * the molar enthalpy of formation, such that the dimensions of the
233 * sensitivity are kmol/J.
234 */
235 double sensitivity(size_t k, size_t p);
236
237 //! Return the sensitivity of the component named *component* with respect to
238 //! the *p*-th sensitivity parameter.
239 //! @copydetails ReactorNet::sensitivity(size_t, size_t)
240 double sensitivity(const string& component, size_t p, int reactor=0) {
241 size_t k = globalComponentIndex(component, reactor);
242 return sensitivity(k, p);
243 }
244
245 //! Evaluate the Jacobian matrix for the reactor network.
246 /*!
247 * @param[in] t Time/distance at which to evaluate the Jacobian
248 * @param[in] y Global state vector at *t*
249 * @param[out] ydot Derivative of the state vector evaluated at *t*, with respect
250 * to *t*.
251 * @param[in] p sensitivity parameter vector (unused?)
252 * @param[out] j Jacobian matrix, size neq() by neq().
253 */
254 void evalJacobian(double t, double* y,
255 double* ydot, double* p, Array2D* j);
256
257 // overloaded methods of class FuncEval
258 size_t neq() const override {
259 return m_nv;
260 }
261
262 size_t nReactors() const {
263 return m_reactors.size();
264 }
265
266 void eval(double t, double* y, double* ydot, double* p) override;
267
268 //! eval coupling for IDA / DAEs
269 void evalDae(double t, double* y, double* ydot, double* p,
270 double* residual) override;
271
272 void getState(double* y) override;
273 void getStateDae(double* y, double* ydot) override;
274
275 //! Return k-th derivative at the current state of the system
276 virtual void getDerivative(int k, double* dky);
277
278 void getConstraints(double* constraints) override;
279
280 size_t nparams() const override {
281 return m_sens_params.size();
282 }
283
284 //! Return the index corresponding to the component named *component* in the
285 //! reactor with index *reactor* in the global state vector for the
286 //! reactor network.
287 size_t globalComponentIndex(const string& component, size_t reactor=0);
288
289 //! Return the name of the i-th component of the global state vector. The
290 //! name returned includes both the name of the reactor and the specific
291 //! component, for example `'reactor1: CH4'`.
292 string componentName(size_t i) const;
293
294 //! Get the upper bound on the i-th component of the global state vector.
295 double upperBound(size_t i) const;
296
297 //! Get the lower bound on the i-th component of the global state vector.
298 double lowerBound(size_t i) const;
299
300 //! Reset physically or mathematically problematic values, such as negative species
301 //! concentrations.
302 //!
303 //! This method is used within solveSteady() if certain errors are encountered.
304 //!
305 //! @param[inout] y current state vector, to be updated; length neq()
306 void resetBadValues(double* y);
307
308 //! Used by Reactor and Wall objects to register the addition of
309 //! sensitivity parameters so that the ReactorNet can keep track of the
310 //! order in which sensitivity parameters are added.
311 //! @param name A name describing the parameter, for example the reaction string
312 //! @param value The nominal value of the parameter
313 //! @param scale A scaling factor to be applied to the sensitivity
314 //! coefficient
315 //! @returns the index of this parameter in the vector of sensitivity
316 //! parameters (global across all reactors)
317 size_t registerSensitivityParameter(const string& name, double value, double scale);
318
319 //! The name of the p-th sensitivity parameter added to this ReactorNet.
320 const string& sensitivityParameterName(size_t p) const {
321 return m_paramNames.at(p);
322 }
323
324 //! Initialize the reactor network. Called automatically the first time
325 //! advance or step is called.
326 void initialize();
327
328 //! Reinitialize the integrator. Used to solve a new problem (different
329 //! initial conditions) but with the same configuration of the reactor
330 //! network. Can be called manually, or automatically after calling
331 //! setInitialTime or modifying a reactor's contents.
332 void reinitialize();
333
334 //! Called to trigger integrator reinitialization before further
335 //! integration.
337 m_integrator_init = false;
338 }
339
340 //! Set the maximum number of internal integration steps the
341 //! integrator will take before reaching the next output point
342 //! @param nmax The maximum number of steps, setting this value
343 //! to zero disables this option.
344 virtual void setMaxSteps(int nmax);
345
346 //! Set absolute step size limits during advance
347 void setAdvanceLimits(const double* limits);
348
349 //! Check whether ReactorNet object uses advance limits
350 bool hasAdvanceLimits() const;
351
352 //! Retrieve absolute step size limits during advance
353 bool getAdvanceLimits(double* limits) const;
354
355 void preconditionerSetup(double t, double* y, double gamma) override;
356
357 void preconditionerSolve(double* rhs, double* output) override;
358
359 //! Get solver stats from integrator
360 AnyMap solverStats() const;
361
362 //! Set derivative settings of all reactors
363 //! @param settings the settings map propagated to all reactors and kinetics objects
364 virtual void setDerivativeSettings(AnyMap& settings);
365
366protected:
367 //! Add the reactor *r* to this reactor network.
368 //! @since Changed in %Cantera 3.2. Previous version used a reference.
369 void addReactor(shared_ptr<ReactorBase> reactor);
370
371 //! Check that preconditioning is supported by all reactors in the network
372 virtual void checkPreconditionerSupported() const;
373
374 void updatePreconditioner(double gamma) override;
375
376 //! Create reproducible names for reactors and walls/connectors.
377 void updateNames(Reactor& r);
378
379 //! Estimate a future state based on current derivatives.
380 //! The function is intended for internal use by ReactorNet::advance
381 //! and deliberately not exposed in external interfaces.
382 virtual void getEstimate(double time, int k, double* yest);
383
384 //! Returns the order used for last solution step of the ODE integrator
385 //! The function is intended for internal use by ReactorNet::advance
386 //! and deliberately not exposed in external interfaces.
387 virtual int lastOrder() const;
388
389 vector<Reactor*> m_reactors;
390 map<string, int> m_counts; //!< Map used for default name generation
391 unique_ptr<Integrator> m_integ;
392
393 //! The independent variable in the system. May be either time or space depending
394 //! on the type of reactors in the network.
395 double m_time = 0.0;
396
397 //! The initial value of the independent variable in the system.
398 double m_initial_time = 0.0;
399
400 bool m_init = false;
401 bool m_integrator_init = false; //!< True if integrator initialization is current
402 size_t m_nv = 0;
403
404 //! m_start[n] is the starting point in the state vector for reactor n
405 vector<size_t> m_start;
406
407 vector<double> m_atol;
408 double m_rtol = 1.0e-9;
409 double m_rtolsens = 1.0e-4;
410 double m_atols = 1.0e-15;
411 double m_atolsens = 1.0e-6;
412 shared_ptr<SystemJacobian> m_precon;
413 string m_linearSolverType;
414
415 //! Maximum integrator internal timestep. Default of 0.0 means infinity.
416 double m_maxstep = 0.0;
417
418 bool m_verbose = false;
419
420 //! Indicates whether time or space is the independent variable
422
423 //! Names corresponding to each sensitivity parameter
424 vector<string> m_paramNames;
425
426 vector<double> m_ydot;
427 vector<double> m_yest;
428 vector<double> m_advancelimits;
429 //! m_LHS is a vector representing the coefficients on the
430 //! "left hand side" of each governing equation
431 vector<double> m_LHS;
432 vector<double> m_RHS;
433};
434
435
436//! Adapter class to enable using the SteadyStateSystem solver with ReactorNet.
437//!
438//! @see ReactorNet::solveSteady
439//! @since New in %Cantera 3.2.
441{
442public:
443 SteadyReactorSolver(ReactorNet* net, double* x0);
444 void eval(double* x, double* r, double rdt=-1.0, int count=1) override;
445 void initTimeInteg(double dt, double* x) override;
446 void evalJacobian(double* x0) override;
447 double weightedNorm(const double* step) const override;
448 string componentName(size_t i) const override;
449 double upperBound(size_t i) const override;
450 double lowerBound(size_t i) const override;
451 void resetBadValues(double* x) override;
452 void writeDebugInfo(const string& header_suffix, const string& message,
453 int loglevel, int attempt_counter) override;
454
455private:
456 ReactorNet* m_net = nullptr;
457
458 //! Initial value of each state variable
459 vector<double> m_initialState;
460
461 //! Indices of variables that are held constant in the time-stepping mode of the
462 //! steady-state solver.
463 vector<size_t> m_algebraic;
464};
465
466
467/**
468 * Create a reactor network containing one or more coupled reactors.
469 * Wall and FlowDevice objects should be installed prior to calling newReactorNet().
470 * @param reactors A vector of shared pointers to the reactors to be linked together.
471 * @since New in %Cantera 3.2.
472 */
473shared_ptr<ReactorNet> newReactorNet(vector<shared_ptr<ReactorBase>>& reactors);
474
475}
476
477#endif
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
Virtual base class for ODE/DAE right-hand-side function evaluators.
Definition FuncEval.h:32
bool suppressErrors() const
Get current state of error suppression.
Definition FuncEval.h:166
vector< double > m_sens_params
Values for the problem parameters for which sensitivities are computed This is the array which is per...
Definition FuncEval.h:181
Abstract base class for ODE system integrators.
Definition Integrator.h:44
A class representing a network of connected reactors.
Definition ReactorNet.h:30
void setLinearSolverType(const string &linSolverType="DENSE")
Set the type of linear solver used in the integration.
void preconditionerSetup(double t, double *y, double gamma) override
Evaluate the setup processes for the Jacobian preconditioner.
double step()
Advance the state of all reactors with respect to the independent variable (time or space).
virtual int lastOrder() const
Returns the order used for last solution step of the ODE integrator The function is intended for inte...
const string & sensitivityParameterName(size_t p) const
The name of the p-th sensitivity parameter added to this ReactorNet.
Definition ReactorNet.h:320
void eval(double t, double *y, double *ydot, double *p) override
Evaluate the right-hand-side ODE function.
size_t nparams() const override
Number of sensitivity parameters.
Definition ReactorNet.h:280
void initialize()
Initialize the reactor network.
void advance(double t)
Advance the state of all reactors in the independent variable (time or space).
size_t neq() const override
Number of equations.
Definition ReactorNet.h:258
vector< size_t > m_start
m_start[n] is the starting point in the state vector for reactor n
Definition ReactorNet.h:405
vector< double > m_LHS
m_LHS is a vector representing the coefficients on the "left hand side" of each governing equation
Definition ReactorNet.h:431
double m_initial_time
The initial value of the independent variable in the system.
Definition ReactorNet.h:398
void evalJacobian(double t, double *y, double *ydot, double *p, Array2D *j)
Evaluate the Jacobian matrix for the reactor network.
double time()
Current value of the simulation time [s], for reactor networks that are solved in the time domain.
double getInitialTime() const
Get the initial value of the independent variable (typically time).
Definition ReactorNet.h:64
void setNeedsReinit()
Called to trigger integrator reinitialization before further integration.
Definition ReactorNet.h:336
void getConstraints(double *constraints) override
Given a vector of length neq(), mark which variables should be considered algebraic constraints.
double m_time
The independent variable in the system.
Definition ReactorNet.h:395
AnyMap solverStats() const
Get solver stats from integrator.
Reactor & reactor(int n)
Return a reference to the n-th reactor in this network.
Definition ReactorNet.h:194
map< string, int > m_counts
Map used for default name generation.
Definition ReactorNet.h:390
double upperBound(size_t i) const
Get the upper bound on the i-th component of the global state vector.
virtual void setMaxSteps(int nmax)
Set the maximum number of internal integration steps the integrator will take before reaching the nex...
string componentName(size_t i) const
Return the name of the i-th component of the global state vector.
void addReactor(Reactor &r)
Add the reactor r to this reactor network.
void getStateDae(double *y, double *ydot) override
Fill in the vectors y and ydot with the current state of the system.
void setInitialTime(double time)
Set the initial value of the independent variable (typically time).
virtual void getDerivative(int k, double *dky)
Return k-th derivative at the current state of the system.
void setMaxErrTestFails(int nmax)
Set the maximum number of error test failures permitted by the CVODES integrator in a single step.
size_t registerSensitivityParameter(const string &name, double value, double scale)
Used by Reactor and Wall objects to register the addition of sensitivity parameters so that the React...
double maxTimeStep() const
Get the maximum integrator step.
Definition ReactorNet.h:69
double m_maxstep
Maximum integrator internal timestep. Default of 0.0 means infinity.
Definition ReactorNet.h:416
double distance()
Current position [m] along the length of the reactor network, for reactors that are solved as a funct...
double atolSensitivity() const
Absolute sensitivity tolerance.
Definition ReactorNet.h:111
void setSensitivityTolerances(double rtol, double atol)
Set the relative and absolute tolerances for integrating the sensitivity equations.
int maxSteps()
Returns the maximum number of internal integration steps the integrator will take before reaching the...
virtual void setDerivativeSettings(AnyMap &settings)
Set derivative settings of all reactors.
double sensitivity(size_t k, size_t p)
Return the sensitivity of the k-th solution component with respect to the p-th sensitivity parameter.
void updateNames(Reactor &r)
Create reproducible names for reactors and walls/connectors.
void updateState(double *y)
Update the state of all the reactors in the network to correspond to the values in the solution vecto...
void getState(double *y) override
Fill in the vector y with the current state of the system.
void setAdvanceLimits(const double *limits)
Set absolute step size limits during advance.
double rtol()
Relative tolerance.
Definition ReactorNet.h:96
bool verbose() const
Returns true if verbose logging output is enabled.
Definition ReactorNet.h:199
size_t globalComponentIndex(const string &component, size_t reactor=0)
Return the index corresponding to the component named component in the reactor with index reactor in ...
void solveSteady(int loglevel=0)
Solve directly for the steady-state solution.
bool m_timeIsIndependent
Indicates whether time or space is the independent variable.
Definition ReactorNet.h:421
double atol()
Absolute integration tolerance.
Definition ReactorNet.h:101
bool hasAdvanceLimits() const
Check whether ReactorNet object uses advance limits.
double sensitivity(const string &component, size_t p, int reactor=0)
Return the sensitivity of the component named component with respect to the p-th sensitivity paramete...
Definition ReactorNet.h:240
void setMaxTimeStep(double maxstep)
Set the maximum integrator step.
double rtolSensitivity() const
Relative sensitivity tolerance.
Definition ReactorNet.h:106
double lowerBound(size_t i) const
Get the lower bound on the i-th component of the global state vector.
void evalDae(double t, double *y, double *ydot, double *p, double *residual) override
eval coupling for IDA / DAEs
virtual void checkPreconditionerSupported() const
Check that preconditioning is supported by all reactors in the network.
bool m_integrator_init
True if integrator initialization is current.
Definition ReactorNet.h:401
void reinitialize()
Reinitialize the integrator.
Integrator & integrator()
Return a reference to the integrator.
bool getAdvanceLimits(double *limits) const
Retrieve absolute step size limits during advance.
void setVerbose(bool v=true)
Enable or disable verbose logging while setting up and integrating the reactor network.
Definition ReactorNet.h:205
Eigen::SparseMatrix< double > steadyJacobian(double rdt=0.0)
Get the Jacobian used by the steady-state solver.
string linearSolverType() const
Problem type of integrator.
void updatePreconditioner(double gamma) override
Update the preconditioner based on already computed jacobian values.
void setPreconditioner(shared_ptr< SystemJacobian > preconditioner)
Set preconditioner used by the linear solver.
void preconditionerSolve(double *rhs, double *output) override
Evaluate the linear system Ax=b where A is the preconditioner.
vector< string > m_paramNames
Names corresponding to each sensitivity parameter.
Definition ReactorNet.h:424
void resetBadValues(double *y)
Reset physically or mathematically problematic values, such as negative species concentrations.
void setTolerances(double rtol, double atol)
Set the relative and absolute tolerances for the integrator.
virtual void getEstimate(double time, int k, double *yest)
Estimate a future state based on current derivatives.
Class Reactor is a general-purpose class for stirred reactors.
Definition Reactor.h:47
Adapter class to enable using the SteadyStateSystem solver with ReactorNet.
Definition ReactorNet.h:441
double weightedNorm(const double *step) const override
Compute the weighted norm of step.
vector< double > m_initialState
Initial value of each state variable.
Definition ReactorNet.h:459
string componentName(size_t i) const override
Get the name of the i-th component of the state vector.
double upperBound(size_t i) const override
Get the upper bound for global component i in the state vector.
vector< size_t > m_algebraic
Indices of variables that are held constant in the time-stepping mode of the steady-state solver.
Definition ReactorNet.h:463
void evalJacobian(double *x0) override
Evaluates the Jacobian at x0 using finite differences.
void resetBadValues(double *x) override
Reset values such as negative species concentrations.
void writeDebugInfo(const string &header_suffix, const string &message, int loglevel, int attempt_counter) override
Write solver debugging based on the specified log level.
void eval(double *x, double *r, double rdt=-1.0, int count=1) override
Evaluate the residual function.
void initTimeInteg(double dt, double *x) override
Prepare for time stepping beginning with solution x and timestep dt.
double lowerBound(size_t i) const override
Get the lower bound for global component i in the state vector.
Base class for representing a system of differential-algebraic equations and solving for its steady-s...
double rdt() const
Reciprocal of the time step.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
Definition utilities.h:104
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
shared_ptr< ReactorNet > newReactorNet(vector< shared_ptr< ReactorBase > > &reactors)
Create a reactor network containing one or more coupled reactors.