ReactorNet.cpp Source File#
ReactorNet.cpp
Go to the documentation of this file.
Header file for class Cantera::Array2D.
Header file for base class WallBase.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
double & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
Definition Array.h:160
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
vector< double > m_paramScales
Scaling factors for each sensitivity parameter.
Definition FuncEval.h:184
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
virtual void setMaxSteps(int nmax)
Set the maximum number of time-steps the integrator can take before reaching the next output time.
Definition Integrator.h:239
virtual int maxSteps()
Returns the maximum number of time-steps the integrator can take before reaching the next output time...
Definition Integrator.h:245
virtual void setMaxErrTestFails(int n)
Set the maximum permissible number of error test failures.
Definition Integrator.h:231
void setNetwork(ReactorNet *net)
Set the ReactorNet that this reactor belongs to.
Definition ReactorBase.cpp:96
void setPreconditioner(shared_ptr< PreconditionerBase > preconditioner)
Set preconditioner used by the linear solver.
Definition ReactorNet.cpp:157
void setLinearSolverType(const string &linSolverType="DENSE")
Set the type of linear solver used in the integration.
Definition ReactorNet.cpp:151
void preconditionerSetup(double t, double *y, double gamma) override
Evaluate the setup processes for the Jacobian preconditioner.
Definition ReactorNet.cpp:528
double step()
Advance the state of all reactors with respect to the independent variable (time or space).
Definition ReactorNet.cpp:240
virtual int lastOrder() const
Returns the order used for last solution step of the ODE integrator The function is intended for inte...
Definition ReactorNet.cpp:275
void eval(double t, double *y, double *ydot, double *p) override
Evaluate the right-hand-side ODE function.
Definition ReactorNet.cpp:318
void advance(double t)
Advance the state of all reactors in the independent variable (time or space).
Definition ReactorNet.cpp:173
vector< size_t > m_start
m_start[n] is the starting point in the state vector for reactor n
Definition ReactorNet.h:333
vector< double > m_LHS
m_LHS is a vector representing the coefficients on the "left hand side" of each governing equation
Definition ReactorNet.h:359
double m_initial_time
The initial value of the independent variable in the system.
Definition ReactorNet.h:326
void evalJacobian(double t, double *y, double *ydot, double *p, Array2D *j)
Evaluate the Jacobian matrix for the reactor network.
Definition ReactorNet.cpp:376
double time()
Current value of the simulation time [s], for reactor networks that are solved in the time domain.
Definition ReactorNet.cpp:68
void getConstraints(double *constraints) override
Given a vector of length neq(), mark which variables should be considered algebraic constraints.
Definition ReactorNet.cpp:353
Reactor & reactor(int n)
Return a reference to the n-th reactor in this network.
Definition ReactorNet.h:144
virtual void setMaxSteps(int nmax)
Set the maximum number of internal integration steps the integrator will take before reaching the nex...
Definition ReactorNet.cpp:163
string componentName(size_t i) const
Return the name of the i-th component of the global state vector.
Definition ReactorNet.cpp:467
void getStateDae(double *y, double *ydot) override
Fill in the vectors y and ydot with the current state of the system.
Definition ReactorNet.cpp:452
void setInitialTime(double time)
Set the initial value of the independent variable (typically time).
Definition ReactorNet.cpp:28
virtual void getDerivative(int k, double *dky)
Return k-th derivative at the current state of the system.
Definition ReactorNet.cpp:406
void setMaxErrTestFails(int nmax)
Set the maximum number of error test failures permitted by the CVODES integrator in a single step.
Definition ReactorNet.cpp:41
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...
Definition ReactorNet.cpp:479
double m_maxstep
Maximum integrator internal timestep. Default of 0.0 means infinity.
Definition ReactorNet.h:344
double distance()
Current position [m] along the length of the reactor network, for reactors that are solved as a funct...
Definition ReactorNet.cpp:77
void setSensitivityTolerances(double rtol, double atol)
Set the relative and absolute tolerances for integrating the sensitivity equations.
Definition ReactorNet.cpp:57
int maxSteps()
Returns the maximum number of internal integration steps the integrator will take before reaching the...
Definition ReactorNet.cpp:168
virtual void setDerivativeSettings(AnyMap &settings)
Set derivative settings of all reactors.
Definition ReactorNet.cpp:493
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.
Definition ReactorNet.cpp:360
void updateState(double *y)
Update the state of all the reactors in the network to correspond to the values in the solution vecto...
Definition ReactorNet.cpp:398
void getState(double *y) override
Fill in the vector y with the current state of the system.
Definition ReactorNet.cpp:445
void setAdvanceLimits(const double *limits)
Set absolute step size limits during advance.
Definition ReactorNet.cpp:417
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 ...
Definition ReactorNet.cpp:459
bool m_timeIsIndependent
Indicates whether time or space is the independent variable.
Definition ReactorNet.h:349
bool hasAdvanceLimits() const
Check whether ReactorNet object uses advance limits.
Definition ReactorNet.cpp:427
void evalDae(double t, double *y, double *ydot, double *p, double *residual) override
eval coupling for IDA / DAEs
Definition ReactorNet.cpp:341
virtual void checkPreconditionerSupported() const
Check that preconditioning is supported by all reactors in the network.
Definition ReactorNet.cpp:571
bool getAdvanceLimits(double *limits) const
Retrieve absolute step size limits during advance.
Definition ReactorNet.cpp:436
void updatePreconditioner(double gamma) override
Update the preconditioner based on already computed jacobian values.
Definition ReactorNet.cpp:560
void preconditionerSolve(double *rhs, double *output) override
Evaluate the linear system Ax=b where A is the preconditioner.
Definition ReactorNet.cpp:519
vector< string > m_paramNames
Names corresponding to each sensitivity parameter.
Definition ReactorNet.h:352
void setTolerances(double rtol, double atol)
Set the relative and absolute tolerances for the integrator.
Definition ReactorNet.cpp:46
virtual void getEstimate(double time, int k, double *yest)
Estimate a future state based on current derivatives.
Definition ReactorNet.cpp:252
Class Reactor is a general-purpose class for stirred reactors.
Definition Reactor.h:44
virtual size_t nSensParams() const
Number of sensitivity parameters associated with this reactor (including walls)
Definition Reactor.cpp:112
virtual bool preconditionerSupported() const
Return a false if preconditioning is not supported or true otherwise.
Definition Reactor.h:238
virtual bool isOde() const
Indicate whether the governing equations for this reactor type are a system of ODEs or DAEs.
Definition Reactor.h:55
virtual bool timeIsIndependent() const
Indicates whether the governing equations for this reactor are functions of time or a spatial variabl...
Definition Reactor.h:61
void debuglog(const string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
Definition global.h:158
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
Definition global.h:175
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
Definition utilities.h:104
Integrator * newIntegrator(const string &itype)
Create new Integrator object.
Definition Integrators.cpp:14
void checkFinite(const double tmp)
Check to see that a number is finite (not NaN, +Inf or -Inf)
Definition checkFinite.cpp:15
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...
Generated by