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

This is the system representing the (chemical) source term at a point, integrated with the QssIntegrator. More...

#include <sourceSystem.h>

Inheritance diagram for SourceSystemQSS:
[legend]

Public Member Functions

 SourceSystemQSS ()
 
void odefun (double t, const dvec &y, dvec &q, dvec &d, bool corrector=false)
 The ODE function: ydot = f(t,y)
 
double time () const
 Current integrator time, relative to tInitial.
 
void unroll_y (const dvec &y, bool corrector=false)
 Assign the current state variables from y.
 
void unroll_y ()
 Assign the state variables using the current integrator state.
 
void roll_y (dvec &y) const
 fill in y with current state variables.
 
void roll_ydot (dvec &q, dvec &d) const
 fill in q and d with current creation and destruction rates for each component.
 
void initialize (size_t nSpec)
 Resize internal arrays for a problem of the specified size (nSpec+2)
 
void setOptions (ConfigOptions &options)
 Set integrator tolerances and other parameters.
 
void setState (double tStart, double uu, double tt, const dvec &yy)
 Set the initial condition for integrator.
 
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.
 
virtual std::string getStats ()
 Return a string indicating the number of internal timesteps taken.
 
- Public Member Functions inherited from SourceSystem
 SourceSystem ()
 
virtual ~SourceSystem ()
 
virtual void setState (double tInitial, double uu, double tt, const dvec &yy)=0
 Set the initial condition for integrator.
 
virtual int integrateToTime (double tf)=0
 Take as many steps as needed to reach tf.
 
virtual int integrateOneStep (double tf)=0
 Take one step toward tf without stepping past it.
 
virtual double time () const =0
 Current integrator time, relative to tInitial.
 
virtual void unroll_y ()=0
 Extract current internal integrator state into U, T, and Y.
 
virtual void setDebug (bool debug_)
 
virtual std::string getStats ()=0
 Return a string indicating the number of internal timesteps taken.
 
void updateThermo ()
 Compute thermodynamic properties (density, enthalpies, heat capacities) from the current state variables.
 
double getQdotIgniter (double t)
 Calculate the heat release rate associated with a possible external ignition source.
 
void setGas (CanteraGas *_gas)
 Set the CanteraGas object to use for thermodynamic and kinetic property calculations.
 
virtual void initialize (size_t nSpec)
 Resize internal arrays for a problem of the specified size (nSpec+2)
 
virtual void setOptions (ConfigOptions &options_)
 Set integrator tolerances and other parameters.
 
void setTimers (PerfTimer *reactionRates, PerfTimer *thermo, PerfTimer *jacobian)
 
void setPosition (size_t j, double x)
 Set the index j and position x that are represented by this system.
 
void setStrainFunction (ScalarFunction *f)
 Set the function used to compute the strain rate as a function of time.
 
void setRateMultiplierFunction (ScalarFunction *f)
 Set the function used to compute the reaction rate multiplier.
 
void setHeatLossFunction (IntegratorCallback *f)
 Set the function used to compute the heat loss rate to the environment.
 
void setRhou (double _rhou)
 Set the density of the unburned mixture.
 
void resetSplitConstants ()
 Set all the balanced splitting constants to zero.
 
void setupQuasi2d (std::shared_ptr< BilinearInterpolator > vzInterp, std::shared_ptr< BilinearInterpolator > TInterp)
 Assign the interpolators used for solving quasi-2D problems.
 
virtual void writeState (std::ostream &out, bool init)
 Write the current values of the state variables, formatted to be read by Python, to the specified stream.
 
virtual void writeJacobian (std::ostream &out)
 

Public Attributes

double dUdtQ
 tangential velocity "creation" rate
 
double dUdtD
 tangential velocity "destruction" rate
 
double dTdtQ
 temperature "creation" rate
 
double dTdtD
 temperature "destruction" rate
 
dvec dYdtQ
 species mass fraction creation rate
 
dvec dYdtD
 species mass fraction destruction rate
 
double tCall
 the last time at which odefun was called
 
dvec wDotQ
 
dvec wDotD
 species production / destruction rates [kmol/m^3*s]
 
- Public Attributes inherited from SourceSystem
double U
 tangential velocity
 
double T
 temperature
 
dvec Y
 species mass fraction
 
dvec splitConst
 Extra constant term introduced by splitting.
 

Private Attributes

QssIntegrator integrator
 

Additional Inherited Members

- Protected Attributes inherited from SourceSystem
bool debug
 
ConfigOptionsoptions
 
CanteraGasgas
 Cantera data.
 
PerfTimerreactionRatesTimer
 Timer for time spent evaluating reaction rates.
 
PerfTimerthermoTimer
 Timer for time spent evaluating thermodynamic properties.
 
PerfTimerjacobianTimer
 Timer for time spent evaluating and factorizing the Jacobian.
 
ScalarFunctionstrainFunction
 A class that provides the strain rate and its time derivative.
 
ScalarFunctionrateMultiplierFunction
 Provides a multiplier (optional) for the production terms.
 
IntegratorCallbackheatLoss
 Heat loss rate.
 
size_t nSpec
 number of species
 
int j
 grid index for this system
 
double x
 grid position for this system
 
double rhou
 density of the unburned gas
 
double qDot
 heat release rate per unit volume [W/m^3]
 
double qLoss
 heat loss to the environment [W/m^3]
 
double rho
 density [kg/m^3]
 
double cp
 specific heat capacity (average) [J/kg*K]
 
dvec cpSpec
 species specific heat capacity [J/mol*K]
 
double Wmx
 mixture molecular weight [kg/mol]
 
dvec W
 species molecular weights [kg/kmol]
 
dvec hk
 species enthalpies [J/kmol]
 
bool quasi2d
 Flag set to 'true' when solving a quasi-2D problem with prescribed velocity and temperature fields.
 
std::shared_ptr< BilinearInterpolatorvzInterp
 An interpolator for computing the axial (z) velocity when solving a quasi-2D problem.
 
std::shared_ptr< BilinearInterpolatorTInterp
 An interpolator for computing the temperature when solving a quasi-2D problem.
 
- Private Member Functions inherited from QssOde
 QssOde ()
 
virtual ~QssOde ()
 
virtual void odefun (double t, const dvec &y, dvec &q, dvec &d, bool corrector=false)=0
 Evaluate the ODE function.
 

Detailed Description

This is the system representing the (chemical) source term at a point, integrated with the QssIntegrator.

The implementation of this class differs from SourceSystemCVODE primarily in that the QSS integrator requires separately calculating creation (Q) and destruction (D) rates of the state variables.

Constructor & Destructor Documentation

◆ SourceSystemQSS()

SourceSystemQSS::SourceSystemQSS ( )

Member Function Documentation

◆ odefun()

void SourceSystemQSS::odefun ( double  t,
const dvec y,
dvec q,
dvec d,
bool  corrector = false 
)
virtual

The ODE function: ydot = f(t,y)

Implements QssOde.

◆ time()

double SourceSystemQSS::time ( ) const
inlinevirtual

Current integrator time, relative to tInitial.

Implements SourceSystem.

◆ unroll_y() [1/2]

void SourceSystemQSS::unroll_y ( const dvec y,
bool  corrector = false 
)

Assign the current state variables from y.

The current value of the temperature is not updated during corrector iterations.

◆ unroll_y() [2/2]

void SourceSystemQSS::unroll_y ( )
inlinevirtual

Assign the state variables using the current integrator state.

Implements SourceSystem.

◆ roll_y()

void SourceSystemQSS::roll_y ( dvec y) const

fill in y with current state variables.

◆ roll_ydot()

void SourceSystemQSS::roll_ydot ( dvec q,
dvec d 
) const

fill in q and d with current creation and destruction rates for each component.

The net time derivative is ydot = q - d.

◆ initialize()

void SourceSystemQSS::initialize ( size_t  nSpec)
virtual

Resize internal arrays for a problem of the specified size (nSpec+2)

Reimplemented from SourceSystem.

◆ setOptions()

void SourceSystemQSS::setOptions ( ConfigOptions options_)
virtual

Set integrator tolerances and other parameters.

Reimplemented from SourceSystem.

◆ setState()

void SourceSystemQSS::setState ( double  tInitial,
double  uu,
double  tt,
const dvec yy 
)
virtual

Set the initial condition for integrator.

Parameters
tInitialintegrator start time
uutangential velocity
tttemperature
yyvector of species mass fractions

Implements SourceSystem.

◆ integrateToTime()

int SourceSystemQSS::integrateToTime ( double  tf)
inlinevirtual

Take as many steps as needed to reach tf.

tf is relative to tInitial.

Implements SourceSystem.

◆ integrateOneStep()

int SourceSystemQSS::integrateOneStep ( double  tf)
inlinevirtual

Take one step toward tf without stepping past it.

tf is relative to tInitial.

Implements SourceSystem.

◆ getStats()

std::string SourceSystemQSS::getStats ( )
virtual

Return a string indicating the number of internal timesteps taken.

Implements SourceSystem.

Member Data Documentation

◆ dUdtQ

double SourceSystemQSS::dUdtQ

tangential velocity "creation" rate

◆ dUdtD

double SourceSystemQSS::dUdtD

tangential velocity "destruction" rate

◆ dTdtQ

double SourceSystemQSS::dTdtQ

temperature "creation" rate

◆ dTdtD

double SourceSystemQSS::dTdtD

temperature "destruction" rate

◆ dYdtQ

dvec SourceSystemQSS::dYdtQ

species mass fraction creation rate

◆ dYdtD

dvec SourceSystemQSS::dYdtD

species mass fraction destruction rate

◆ tCall

double SourceSystemQSS::tCall

the last time at which odefun was called

◆ wDotQ

dvec SourceSystemQSS::wDotQ

◆ wDotD

dvec SourceSystemQSS::wDotD

species production / destruction rates [kmol/m^3*s]

◆ integrator

QssIntegrator SourceSystemQSS::integrator
private

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