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"
15#include "cantera/kinetics/MultiRate.h"
16
17 namespace Cantera
18{
19
20 class ElementaryReaction2;
21
22//! Partial specialization of Kinetics for chemistry in a single bulk phase
23 class BulkKinetics : public Kinetics
24{
25 public:
26 BulkKinetics(ThermoPhase* thermo = 0);
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
53 protected:
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.
68 vector_fp m_dn;
69
70 ThirdBodyCalc3 m_multi_concm; //!< used with MultiRate evaluator
71
72 //! Third body concentrations
73 vector_fp m_concm;
74
75 //! Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations
76 vector_fp m_act_conc;
77
78 //! Physical concentrations, as calculated by ThermoPhase::getConcentrations
79 vector_fp m_phys_conc;
80
81 vector_fp m_grt;
82
83 bool m_ROP_ok;
84 doublereal m_temp;
85};
86
87}
88
89#endif
Kinetics.h
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
MultiRate.h
RateCoeffMgr.h
ThirdBodyCalc.h
Cantera::BulkKinetics
Partial specialization of Kinetics for chemistry in a single bulk phase.
Definition: BulkKinetics.h:24
Cantera::BulkKinetics::resizeReactions
virtual void resizeReactions()
Finalize Kinetics object and associated objects.
Definition: BulkKinetics.cpp:20
Cantera::BulkKinetics::m_act_conc
vector_fp m_act_conc
Activity concentrations, as calculated by ThermoPhase::getActivityConcentrations.
Definition: BulkKinetics.h:76
Cantera::BulkKinetics::getDeltaSSGibbs
virtual void getDeltaSSGibbs(doublereal *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
Definition: BulkKinetics.cpp:61
Cantera::BulkKinetics::m_revindex
std::vector< size_t > m_revindex
Indices of reversible reactions.
Definition: BulkKinetics.h:62
Cantera::BulkKinetics::getRevRateConstants
virtual void getRevRateConstants(double *krev, bool doIrreversible=false)
Return the reverse rate constants.
Definition: BulkKinetics.cpp:96
Cantera::BulkKinetics::setMultiplier
virtual void setMultiplier(size_t i, double f)
Set the multiplier for reaction i to f.
Definition: BulkKinetics.cpp:230
Cantera::BulkKinetics::m_bulk_rates
std::vector< unique_ptr< MultiRateBase > > m_bulk_rates
Vector of rate handlers.
Definition: BulkKinetics.h:58
Cantera::BulkKinetics::m_multi_concm
ThirdBodyCalc3 m_multi_concm
used with MultiRate evaluator
Definition: BulkKinetics.h:70
Cantera::BulkKinetics::getDeltaEnthalpy
virtual void getDeltaEnthalpy(doublereal *deltaH)
Return the vector of values for the reactions change in enthalpy.
Definition: BulkKinetics.cpp:45
Cantera::BulkKinetics::m_dn
vector_fp m_dn
Difference between the global reactants order and the global products order.
Definition: BulkKinetics.h:68
Cantera::BulkKinetics::addReaction
virtual bool addReaction(shared_ptr< Reaction > r, bool resize=true)
Add a single reaction to the mechanism.
Definition: BulkKinetics.cpp:115
Cantera::BulkKinetics::m_irrev
std::vector< size_t > m_irrev
Indices of irreversible reactions.
Definition: BulkKinetics.h:63
Cantera::BulkKinetics::m_rates
Rate1< Arrhenius2 > m_rates
Definition: BulkKinetics.h:61
Cantera::BulkKinetics::modifyReaction
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
Definition: BulkKinetics.cpp:190
Cantera::BulkKinetics::m_bulk_types
std::map< std::string, size_t > m_bulk_types
Mapping of rate handlers.
Definition: BulkKinetics.h:59
Cantera::BulkKinetics::getDeltaSSEntropy
virtual void getDeltaSSEntropy(doublereal *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction.
Definition: BulkKinetics.cpp:83
Cantera::BulkKinetics::getDeltaEntropy
virtual void getDeltaEntropy(doublereal *deltaS)
Return the vector of values for the reactions change in entropy.
Definition: BulkKinetics.cpp:53
Cantera::BulkKinetics::getDeltaSSEnthalpy
virtual void getDeltaSSEnthalpy(doublereal *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
Definition: BulkKinetics.cpp:72
Cantera::BulkKinetics::getDeltaGibbs
virtual void getDeltaGibbs(doublereal *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
Definition: BulkKinetics.cpp:37
Cantera::BulkKinetics::m_concm
vector_fp m_concm
Third body concentrations.
Definition: BulkKinetics.h:73
Cantera::BulkKinetics::resizeSpecies
virtual void resizeSpecies()
Resize arrays with sizes that depend on the total number of species.
Definition: BulkKinetics.cpp:219
Cantera::BulkKinetics::isReversible
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
Definition: BulkKinetics.cpp:33
Cantera::BulkKinetics::m_phys_conc
vector_fp m_phys_conc
Physical concentrations, as calculated by ThermoPhase::getConcentrations.
Definition: BulkKinetics.h:79
Cantera::ElementaryReaction2
A reaction which follows mass-action kinetics with a modified Arrhenius reaction rate.
Definition: Reaction.h:217
Cantera::Kinetics
Public interface for kinetics managers.
Definition: Kinetics.h:114
Cantera::Kinetics::thermo
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
Cantera::Rate1
This rate coefficient manager supports one parameterization of the rate constant of any type.
Definition: RateCoeffMgr.h:28
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Cantera::ThirdBodyCalc3
Calculate and apply third-body effects on reaction rates, including non- unity third-body efficiencie...
Definition: ThirdBodyCalc.h:89
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::vector_fp
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