Cantera 2.6.0
BulkKinetics.h
Go to the documentation of this file.
1/**
2 * @file BulkKinetics.h
3 * @ingroup chemkinetics
4 */
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
9#ifndef CT_BULKKINETICS_H
10#define CT_BULKKINETICS_H
11
12#include "Kinetics.h"
13#include "RateCoeffMgr.h"
14#include "ThirdBodyCalc.h"
16
17namespace Cantera
18{
19
20class ElementaryReaction2;
21
22//! Partial specialization of Kinetics for chemistry in a single bulk phase
23class BulkKinetics : public Kinetics
24{
25public:
27
28 virtual void resizeReactions();
29
30 virtual bool isReversible(size_t i);
31
32 virtual void getDeltaGibbs(doublereal* deltaG);
33 virtual void getDeltaEnthalpy(doublereal* deltaH);
34 virtual void getDeltaEntropy(doublereal* deltaS);
35
36 virtual void getDeltaSSGibbs(doublereal* deltaG);
37 virtual void getDeltaSSEnthalpy(doublereal* deltaH);
38 virtual void getDeltaSSEntropy(doublereal* deltaS);
39
40 virtual void getRevRateConstants(double* krev,
41 bool doIrreversible = false);
42
43 virtual bool addReaction(shared_ptr<Reaction> r, bool resize=true);
44 virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
45
46 virtual void resizeSpecies();
47
48 virtual void setMultiplier(size_t i, double f);
49 virtual void invalidateCache();
50
51 void addThirdBody(shared_ptr<Reaction> r);
52
53protected:
54 virtual void addElementaryReaction(ElementaryReaction2& r);
55 virtual void modifyElementaryReaction(size_t i, ElementaryReaction2& rNew);
56
57 //! Vector of rate handlers
58 std::vector<unique_ptr<MultiRateBase>> m_bulk_rates;
59 std::map<std::string, size_t> m_bulk_types; //!< Mapping of rate handlers
60
61 Rate1<Arrhenius2> m_rates; //!< @deprecated (legacy only)
62 std::vector<size_t> m_revindex; //!< Indices of reversible reactions
63 std::vector<size_t> m_irrev; //!< Indices of irreversible reactions
64
65 //! Difference between the global reactants order and the global products
66 //! order. Of type "double" to account for the fact that we can have real-
67 //! valued stoichiometries.
69
70 ThirdBodyCalc3 m_multi_concm; //!< used with MultiRate evaluator
71
72 //! Third body concentrations
74
75 //! Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations
77
78 //! Physical concentrations, as calculated by ThermoPhase::getConcentrations
80
81 vector_fp m_grt;
82
83 bool m_ROP_ok;
84 doublereal m_temp;
85};
86
87}
88
89#endif
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Partial specialization of Kinetics for chemistry in a single bulk phase.
Definition: BulkKinetics.h:24
virtual void resizeReactions()
Finalize Kinetics object and associated objects.
vector_fp m_act_conc
Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations.
Definition: BulkKinetics.h:76
virtual void getDeltaSSGibbs(doublereal *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
std::vector< size_t > m_revindex
Indices of reversible reactions.
Definition: BulkKinetics.h:62
virtual void getRevRateConstants(double *krev, bool doIrreversible=false)
Return the reverse rate constants.
virtual void setMultiplier(size_t i, double f)
Set the multiplier for reaction i to f.
std::vector< unique_ptr< MultiRateBase > > m_bulk_rates
Vector of rate handlers.
Definition: BulkKinetics.h:58
ThirdBodyCalc3 m_multi_concm
used with MultiRate evaluator
Definition: BulkKinetics.h:70
virtual void getDeltaEnthalpy(doublereal *deltaH)
Return the vector of values for the reactions change in enthalpy.
vector_fp m_dn
Difference between the global reactants order and the global products order.
Definition: BulkKinetics.h:68
virtual bool addReaction(shared_ptr< Reaction > r, bool resize=true)
Add a single reaction to the mechanism.
std::vector< size_t > m_irrev
Indices of irreversible reactions.
Definition: BulkKinetics.h:63
Rate1< Arrhenius2 > m_rates
Definition: BulkKinetics.h:61
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
std::map< std::string, size_t > m_bulk_types
Mapping of rate handlers.
Definition: BulkKinetics.h:59
virtual void getDeltaSSEntropy(doublereal *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction.
virtual void getDeltaEntropy(doublereal *deltaS)
Return the vector of values for the reactions change in entropy.
virtual void getDeltaSSEnthalpy(doublereal *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
virtual void getDeltaGibbs(doublereal *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
vector_fp m_concm
Third body concentrations.
Definition: BulkKinetics.h:73
virtual void resizeSpecies()
Resize arrays with sizes that depend on the total number of species.
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
vector_fp m_phys_conc
Physical concentrations, as calculated by ThermoPhase::getConcentrations.
Definition: BulkKinetics.h:79
A reaction which follows mass-action kinetics with a modified Arrhenius reaction rate.
Definition: Reaction.h:217
Public interface for kinetics managers.
Definition: Kinetics.h:114
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
Definition: Kinetics.h:231
This rate coefficient manager supports one parameterization of the rate constant of any type.
Definition: RateCoeffMgr.h:28
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencie...
Definition: ThirdBodyCalc.h:89
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:184