34typedef Cabinet<Kinetics> KineticsCabinet;
35template<> KineticsCabinet* KineticsCabinet::s_storage = 0;
37typedef Cabinet<Reaction> ReactionCabinet;
38template<> ReactionCabinet* ReactionCabinet::s_storage;
40typedef Cabinet<ThermoPhase> ThermoPhaseCabinet;
41template<> ThermoPhaseCabinet* ThermoPhaseCabinet::s_storage;
47 int32_t
kin_getType(int32_t handle, int32_t bufLen,
char* buf)
51 string out = KineticsCabinet::at(handle)->kineticsType();
53 return int(out.size()) + 1;
63 return KineticsCabinet::at(handle)->nReactions();
73 if (i < 0 || i >= KineticsCabinet::at(handle)->nReactions()) {
74 throw IndexError(
"kin_reaction",
"", i, KineticsCabinet::at(handle)->nReactions());
76 return ReactionCabinet::add(KineticsCabinet::at(handle)->reaction(i));
86 return KineticsCabinet::at(handle)->nPhases();
96 if (n < 0 || n >= KineticsCabinet::at(handle)->nPhases()) {
97 throw IndexError(
"kin_phase",
"", n, KineticsCabinet::at(handle)->nPhases());
99 return ThermoPhaseCabinet::add(KineticsCabinet::at(handle)->phase(n));
109 auto obj = KineticsCabinet::at(handle)->reactionPhase();
110 return ThermoPhaseCabinet::index(*obj, handle);
120 return KineticsCabinet::at(handle)->phaseIndex(ph);
130 return KineticsCabinet::at(handle)->nTotalSpecies();
140 return KineticsCabinet::at(handle)->reactantStoichCoeff(k, i);
150 return KineticsCabinet::at(handle)->productStoichCoeff(k, i);
160 auto& obj = KineticsCabinet::at(handle);
162 obj->getFwdRatesOfProgress(fwdROP);
173 auto& obj = KineticsCabinet::at(handle);
175 obj->getRevRatesOfProgress(revROP);
186 auto& obj = KineticsCabinet::at(handle);
188 obj->getNetRatesOfProgress(netROP);
199 auto& obj = KineticsCabinet::at(handle);
201 obj->getEquilibriumConstants(kc);
212 auto& obj = KineticsCabinet::at(handle);
214 obj->getFwdRateConstants(kfwd);
225 bool doIrreversible_ = (doIrreversible != 0);
226 KineticsCabinet::at(handle)->getRevRateConstants(krev, doIrreversible_);
237 auto& obj = KineticsCabinet::at(handle);
239 obj->getCreationRates(cdot);
250 auto& obj = KineticsCabinet::at(handle);
252 obj->getDestructionRates(ddot);
263 auto& obj = KineticsCabinet::at(handle);
265 obj->getNetProductionRates(wdot);
276 return KineticsCabinet::at(handle)->multiplier(i);
286 KineticsCabinet::at(handle)->setMultiplier(i, f);
297 bool out = KineticsCabinet::at(handle)->isReversible(i);
308 return KineticsCabinet::at(handle)->kineticsSpeciesIndex(nm);
318 KineticsCabinet::as<InterfaceKinetics>(handle)->advanceCoverages(tstep);
329 auto& obj = KineticsCabinet::at(handle);
331 obj->getDeltaEnthalpy(deltaH);
342 auto& obj = KineticsCabinet::at(handle);
344 obj->getDeltaGibbs(deltaG);
355 auto& obj = KineticsCabinet::at(handle);
357 obj->getDeltaEntropy(deltaS);
368 auto& obj = KineticsCabinet::at(handle);
370 obj->getDeltaSSEnthalpy(deltaH);
381 auto& obj = KineticsCabinet::at(handle);
383 obj->getDeltaSSGibbs(deltaG);
394 auto& obj = KineticsCabinet::at(handle);
396 obj->getDeltaSSEntropy(deltaS);
414 return KineticsCabinet::size();
426 return KineticsCabinet::parent(handle);
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
An array index is out of range.
CTKIN - Generated CLib Cantera interface library.
int32_t kin_getDeltaGibbs(int32_t handle, int32_t deltaGLen, double *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
int32_t kin_setMultiplier(int32_t handle, int32_t i, double f)
Set the multiplier for reaction i to f.
int32_t kin_del(int32_t handle)
Destructor; required by some APIs although object is managed by Solution.
int32_t kin_reaction(int32_t handle, int32_t i)
Return the Reaction object for reaction.
int32_t kin_nPhases(int32_t handle)
The number of phases participating in the reaction mechanism.
int32_t kin_reactionPhase(int32_t handle)
Return pointer to phase where the reactions occur.
double kin_productStoichCoeff(int32_t handle, int32_t k, int32_t i)
Stoichiometric coefficient of species k as a product in reaction i.
int32_t kin_getEquilibriumConstants(int32_t handle, int32_t kcLen, double *kc)
Return a vector of Equilibrium constants.
int32_t kin_getRevRatesOfProgress(int32_t handle, int32_t revROPLen, double *revROP)
Return the Reverse rates of progress of the reactions.
int32_t kin_getDestructionRates(int32_t handle, int32_t ddotLen, double *ddot)
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
int32_t kin_advanceCoverages(int32_t handle, double tstep)
Advance the surface coverages in time.
int32_t kin_phase(int32_t handle, int32_t n)
Return pointer to phase associated with Kinetics by index.
int32_t kin_getRevRateConstants(int32_t handle, int32_t krevLen, double *krev, int32_t doIrreversible)
Return the reverse rate constants.
int32_t kin_getDeltaEntropy(int32_t handle, int32_t deltaSLen, double *deltaS)
Return the vector of values for the reactions change in entropy.
int32_t kin_speciesIndex(int32_t handle, const char *nm)
This routine will look up a species number based on the input string nm.
int32_t kin_getDeltaEnthalpy(int32_t handle, int32_t deltaHLen, double *deltaH)
Return the vector of values for the reactions change in enthalpy.
int32_t kin_getCreationRates(int32_t handle, int32_t cdotLen, double *cdot)
Species creation rates [kmol/m^3/s or kmol/m^2/s].
int32_t kin_phaseIndex(int32_t handle, const char *ph)
Return the phase index of a phase in the list of phases defined within the object.
int32_t kin_getDeltaSSEnthalpy(int32_t handle, int32_t deltaHLen, double *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
int32_t kin_getDeltaSSGibbs(int32_t handle, int32_t deltaGLen, double *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
int32_t kin_getNetProductionRates(int32_t handle, int32_t wdotLen, double *wdot)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
double kin_reactantStoichCoeff(int32_t handle, int32_t k, int32_t i)
Stoichiometric coefficient of species k as a reactant in reaction i.
int32_t kin_getFwdRatesOfProgress(int32_t handle, int32_t fwdROPLen, double *fwdROP)
Return the forward rates of progress of the reactions.
int32_t kin_getDeltaSSEntropy(int32_t handle, int32_t deltaSLen, double *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction.
int32_t kin_getType(int32_t handle, int32_t bufLen, char *buf)
Identifies the Kinetics manager type.
int32_t kin_getNetRatesOfProgress(int32_t handle, int32_t netROPLen, double *netROP)
Net rates of progress.
int32_t kin_isReversible(int32_t handle, int32_t i)
True if reaction i has been declared to be reversible.
int32_t kin_parentHandle(int32_t handle)
Return handle to parent of Kinetics object.
int32_t kin_nTotalSpecies(int32_t handle)
The total number of species in all phases participating in the kinetics mechanism.
int32_t kin_nReactions(int32_t handle)
Number of reactions in the reaction mechanism.
int32_t kin_getFwdRateConstants(int32_t handle, int32_t kfwdLen, double *kfwd)
Return the forward rate constants.
int32_t kin_cabinetSize()
Return size of Kinetics storage.
double kin_multiplier(int32_t handle, int32_t i)
The current value of the multiplier for reaction i.
size_t copyString(const string &source, char *dest, size_t length)
Copy the contents of a string into a char array of a given length.
Namespace for the Cantera kernel.
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.
Contains declarations for string manipulation functions within Cantera.