Cantera 2.6.0

Public Member Functions | Protected Attributes | List of all members
ThirdBodyCalc3 Class Reference

Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencies. More...

`#include <ThirdBodyCalc.h>`

## Public Member Functions
void | install (size_t rxnNumber, const std::map< size_t, double > &efficiencies, double default_efficiency, bool mass_action)
| Install reaction that uses third-body effects in ThirdBodyCalc3 manager. More...
void | resizeCoeffs (size_t nSpc, size_t nRxn)
| Resize the sparse coefficient matrix. More...
void | update (const vector_fp &conc, double ctot, double *concm) const
| Update third-body concentrations in full vector. More...
void | multiply (double *output, const double *concm)
| Multiply output with effective third-body concentration. More...
Eigen::SparseMatrix< double > | derivatives (const double *product)
| Calculate derivatives with respect to species concentrations. More...
void | scale (const double *in, double *out, double factor) const
| Scale entries involving third-body collider in law of mass action by factor. More...
void | scaleM (const double *in, double *out, const double *concm, double factor) const
| Scale entries involving third-body collider in rate expression by third-body concentration and factor. More...
bool | empty () const
| Return boolean indicating whether ThirdBodyCalc3 is empty. More...

## Protected Attributes
std::vector< size_t > | m_reaction_index
| Indices of reactions that use third-bodies within vector of concentrations. More...
std::vector< size_t > | m_mass_action_index
| Indices within m_reaction_index of reactions that consider third-body effects in the law of mass action. More...
std::vector< size_t > | m_no_mass_action_index
| Indices within m_reaction_index of reactions that consider third-body effects in the rate expression. More...
std::vector< std::vector< size_t > > | m_species
| m_species[i][j] is the index of the j-th species in reaction i. More...
std::vector< vector_fp > | m_eff
| m_eff[i][j] is the efficiency of the j-th species in reaction i. More...
vector_fp | m_default
| The default efficiency for each reaction. More...
std::vector< Eigen::Triplet< double > > | m_efficiencyList
| Sparse efficiency matrix (compensated for defaults) Each triplet corresponds to (reaction index, species index, efficiency) More...
Eigen::SparseMatrix< double > | m_multipliers
| Sparse derivative multiplier matrix. More...

## Detailed Description

Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencies.

Definition at line 88 of file ThirdBodyCalc.h.

## Member Function Documentation

## ◆ install()

void install | ( | size_t | rxnNumber,
|  | const std::map< size_t, double > & | efficiencies,
|  | double | default_efficiency,
|  | bool | mass_action
| ) |  |
| inline

Install reaction that uses third-body effects in ThirdBodyCalc3 manager.

Definition at line 92 of file ThirdBodyCalc.h.

References AssertTrace, ThirdBodyCalc3::m_default, ThirdBodyCalc3::m_eff, ThirdBodyCalc3::m_efficiencyList, ThirdBodyCalc3::m_mass_action_index, ThirdBodyCalc3::m_no_mass_action_index, ThirdBodyCalc3::m_reaction_index, ThirdBodyCalc3::m_species, and Cantera::npos.

## ◆ resizeCoeffs()

void resizeCoeffs | ( | size_t | nSpc,
|  | size_t | nRxn
| ) |  |
| inline

Resize the sparse coefficient matrix.

Definition at line 116 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_default, ThirdBodyCalc3::m_efficiencyList, ThirdBodyCalc3::m_multipliers, and ThirdBodyCalc3::m_reaction_index.

## ◆ update()

void update | ( | const vector_fp & | conc,
|  | double | ctot,
|  | double * | concm
| ) |  | const
| inline

Update third-body concentrations in full vector.

Definition at line 144 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_default, ThirdBodyCalc3::m_eff, ThirdBodyCalc3::m_reaction_index, and ThirdBodyCalc3::m_species.

Referenced by GasKinetics::update_rates_C().

## ◆ multiply()

void multiply | ( | double * | output,
|  | const double * | concm
| ) |  |
| inline

Multiply output with effective third-body concentration.

Definition at line 155 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_mass_action_index, and ThirdBodyCalc3::m_reaction_index.

Referenced by GasKinetics::processThirdBodies().

## ◆ derivatives()

Eigen::SparseMatrix< double > derivatives | ( | const double * | product | ) |
| inline

Calculate derivatives with respect to species concentrations.

Parameters

  product | Product of law of mass action and rate terms.

Definition at line 166 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_multipliers.

Referenced by GasKinetics::process_ddX().

## ◆ scale()

void scale | ( | const double * | in,
|  | double * | out,
|  | double | factor
| ) |  | const
| inline

Scale entries involving third-body collider in law of mass action by factor.

Definition at line 172 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_mass_action_index, and ThirdBodyCalc3::m_reaction_index.

Referenced by GasKinetics::process_ddC().

## ◆ scaleM()

void scaleM | ( | const double * | in,
|  | double * | out,
|  | const double * | concm,
|  | double | factor
| ) |  | const
| inline

Scale entries involving third-body collider in rate expression by third-body concentration and factor.

Definition at line 181 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_no_mass_action_index, and ThirdBodyCalc3::m_reaction_index.

Referenced by GasKinetics::process_ddC().

## ◆ empty()

bool empty | ( |  | ) | const
| inline

Return boolean indicating whether ThirdBodyCalc3 is empty.

Definition at line 191 of file ThirdBodyCalc.h.

References ThirdBodyCalc3::m_reaction_index.

Referenced by GasKinetics::process_ddC(), and GasKinetics::process_ddX().

## Member Data Documentation

## ◆ m_reaction_index

std::vector<size_t> m_reaction_index
| protected

Indices of reactions that use third-bodies within vector of concentrations.

Definition at line 197 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::empty(), ThirdBodyCalc3::install(), ThirdBodyCalc3::multiply(), ThirdBodyCalc3::resizeCoeffs(), ThirdBodyCalc3::scale(), ThirdBodyCalc3::scaleM(), and ThirdBodyCalc3::update().

## ◆ m_mass_action_index

std::vector<size_t> m_mass_action_index
| protected

Indices within m_reaction_index of reactions that consider third-body effects in the law of mass action.

Definition at line 201 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), ThirdBodyCalc3::multiply(), and ThirdBodyCalc3::scale().

## ◆ m_no_mass_action_index

std::vector<size_t> m_no_mass_action_index
| protected

Indices within m_reaction_index of reactions that consider third-body effects in the rate expression.

Definition at line 205 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), and ThirdBodyCalc3::scaleM().

## ◆ m_species

std::vector<std::vector<size_t> > m_species
| protected

m_species[i][j] is the index of the j-th species in reaction i.

Definition at line 208 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), and ThirdBodyCalc3::update().

## ◆ m_eff

std::vector<vector_fp> m_eff
| protected

m_eff[i][j] is the efficiency of the j-th species in reaction i.

Definition at line 211 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), and ThirdBodyCalc3::update().

## ◆ m_default

vector_fp m_default
| protected

The default efficiency for each reaction.

Definition at line 214 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), ThirdBodyCalc3::resizeCoeffs(), and ThirdBodyCalc3::update().

## ◆ m_efficiencyList

std::vector<Eigen::Triplet<double> > m_efficiencyList
| protected

Sparse efficiency matrix (compensated for defaults) Each triplet corresponds to (reaction index, species index, efficiency)

Definition at line 218 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::install(), and ThirdBodyCalc3::resizeCoeffs().

## ◆ m_multipliers

Eigen::SparseMatrix<double> m_multipliers
| protected

Sparse derivative multiplier matrix.

Definition at line 221 of file ThirdBodyCalc.h.

Referenced by ThirdBodyCalc3::derivatives(), and ThirdBodyCalc3::resizeCoeffs().

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

- ThirdBodyCalc.h