Ember
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
QssIntegrator Class Reference

A Quasi-Steady-State ODE Integrator based on CHEMEQ2. More...

#include <qssintegrator.h>

Public Member Functions

 QssIntegrator ()
 
virtual ~QssIntegrator ()
 
void setOde (QssOde *ode)
 Set the ODE object to be integrated.
 
virtual void initialize (size_t N)
 Initialize integrator arrays (problem size of N)
 
void setState (const dvec &yIn, double tStart)
 Set state at the start of a global timestep.
 
int integrateToTime (double tf)
 Take as many steps as needed to reach tf.
 
int integrateOneStep (double tf)
 Take one step toward tf without stepping past it.
 

Public Attributes

double tn
 Internal integrator time (relative to tstart)
 
dvec y
 current state vector
 
bool stabilityCheck
 Flag to enable convergence-based stability check on timestep.
 
int itermax
 Number of corrector iterations to perform.
 
double epsmin
 Accuracy parameter for determining the next timestep.
 
double epsmax
 Repeat timestep if correction is greater than #epsmax * #epsmin * #y[i] for any i.
 
double dtmin
 Minimum timestep allowed.
 
double dtmax
 Maximum timestep allowed.
 
dvec ymin
 Minimum value allowed for each component.
 
dvec enforce_ymin
 Enforce the minimum value specified in ymin for each component.
 
double abstol
 Minimum component value to consider when determining stability / step size.
 
int rcount
 Total number of timestep repeats (after failed timesteps)
 
int gcount
 Total number of ODE function calls.
 

Private Member Functions

void getInitialStepSize (double tf)
 Estimate the initial step size.
 

Private Attributes

QssOdeode_
 
size_t N
 Number of state variables.
 
double ts
 Time at the start of the current internal timestep.
 
double tfd
 Round-off parameter used to determine when integration is complete.
 
double dt
 Integrator internal timestep.
 
double tstart
 Independent variable at the start of the global timestep.
 
dvec ym1
 Previous corrector iterate.
 
dvec ym2
 Second previous corrector iterate.
 
dvec scratch
 temporary array.
 
dvec q
 production rate
 
dvec d
 loss rate
 
dvec rtau
 ratio of timestep to timescale.
 
dvec rtaus
 ratio of timestep to initial timescale for current timestep
 
dvec y1
 predicted value
 
dvec ys
 initial conditions for the chemical timestep
 
dvec qs
 initial production rate
 
bool firstStep
 Flag to trigger integrator restart on the next call to integrateToTime or integrateOneStep.
 

Detailed Description

A Quasi-Steady-State ODE Integrator based on CHEMEQ2.

Constructor & Destructor Documentation

◆ QssIntegrator()

QssIntegrator::QssIntegrator ( )

◆ ~QssIntegrator()

virtual QssIntegrator::~QssIntegrator ( )
inlinevirtual

Member Function Documentation

◆ setOde()

void QssIntegrator::setOde ( QssOde ode)

Set the ODE object to be integrated.

◆ initialize()

void QssIntegrator::initialize ( size_t  N)
virtual

Initialize integrator arrays (problem size of N)

◆ setState()

void QssIntegrator::setState ( const dvec yIn,
double  tStart 
)

Set state at the start of a global timestep.

◆ integrateToTime()

int QssIntegrator::integrateToTime ( double  tf)

Take as many steps as needed to reach tf.

Note that tf is relative to tstart, not absolute.

◆ integrateOneStep()

int QssIntegrator::integrateOneStep ( double  tf)

Take one step toward tf without stepping past it.

◆ getInitialStepSize()

void QssIntegrator::getInitialStepSize ( double  tf)
private

Estimate the initial step size.

Strongly increasing functions(q >> d assumed here) use a step- size estimate proportional to the step needed for the function to reach equilibrium where as functions decreasing or in equilibrium use a stepsize estimate directly proportional to the characteristic stepsize of the function. convergence of the integration scheme is likely since the smallest estimate is chosen for the initial stepsize.

Member Data Documentation

◆ tn

double QssIntegrator::tn

Internal integrator time (relative to tstart)

◆ y

dvec QssIntegrator::y

current state vector

◆ stabilityCheck

bool QssIntegrator::stabilityCheck

Flag to enable convergence-based stability check on timestep.

◆ itermax

int QssIntegrator::itermax

Number of corrector iterations to perform.

◆ epsmin

double QssIntegrator::epsmin

Accuracy parameter for determining the next timestep.

◆ epsmax

double QssIntegrator::epsmax

Repeat timestep if correction is greater than #epsmax * #epsmin * #y[i] for any i.

◆ dtmin

double QssIntegrator::dtmin

Minimum timestep allowed.

◆ dtmax

double QssIntegrator::dtmax

Maximum timestep allowed.

◆ ymin

dvec QssIntegrator::ymin

Minimum value allowed for each component.

◆ enforce_ymin

dvec QssIntegrator::enforce_ymin

Enforce the minimum value specified in ymin for each component.

◆ abstol

double QssIntegrator::abstol

Minimum component value to consider when determining stability / step size.

◆ rcount

int QssIntegrator::rcount

Total number of timestep repeats (after failed timesteps)

◆ gcount

int QssIntegrator::gcount

Total number of ODE function calls.

◆ ode_

QssOde* QssIntegrator::ode_
private

◆ N

size_t QssIntegrator::N
private

Number of state variables.

◆ ts

double QssIntegrator::ts
private

Time at the start of the current internal timestep.

◆ tfd

double QssIntegrator::tfd
private

Round-off parameter used to determine when integration is complete.

◆ dt

double QssIntegrator::dt
private

Integrator internal timestep.

◆ tstart

double QssIntegrator::tstart
private

Independent variable at the start of the global timestep.

◆ ym1

dvec QssIntegrator::ym1
private

Previous corrector iterate.

◆ ym2

dvec QssIntegrator::ym2
private

Second previous corrector iterate.

◆ scratch

dvec QssIntegrator::scratch
private

temporary array.

◆ q

dvec QssIntegrator::q
private

production rate

◆ d

dvec QssIntegrator::d
private

loss rate

◆ rtau

dvec QssIntegrator::rtau
private

ratio of timestep to timescale.

◆ rtaus

dvec QssIntegrator::rtaus
private

ratio of timestep to initial timescale for current timestep

◆ y1

dvec QssIntegrator::y1
private

predicted value

◆ ys

dvec QssIntegrator::ys
private

initial conditions for the chemical timestep

◆ qs

dvec QssIntegrator::qs
private

initial production rate

◆ firstStep

bool QssIntegrator::firstStep
private

Flag to trigger integrator restart on the next call to integrateToTime or integrateOneStep.


The documentation for this class was generated from the following files: