Cantera  3.2.0a2
Loading...
Searching...
No Matches
ctkin.h
Go to the documentation of this file.
1/**
2 * CTKIN - Generated CLib %Cantera interface library.
3 *
4 * @file ctkin.h
5 *
6 * Generated CLib API for %Cantera's Kinetics class.
7 *
8 * This library of functions is designed to encapsulate %Cantera functionality
9 * and make it available for use in languages and applications other than C++.
10 * A set of library functions is provided that are declared "extern C". All
11 * %Cantera objects are stored and referenced by integers - no pointers are
12 * passed to or from the calling application.
13 *
14 * This file was generated by sourcegen. It will be re-generated by the
15 * %Cantera build process. Do not manually edit.
16 *
17 * @warning This library is an experimental part of the %Cantera API and
18 * may be changed without notice.
19 */
20
21// This file is part of Cantera. See License.txt in the top-level directory or
22// at https://cantera.org/license.txt for license and copyright information.
23
24#ifndef CTKIN_H
25#define CTKIN_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31 /**
32 * @defgroup CAPIctkin ctkin Library
33 * Generated CLib API for %Cantera's Kinetics class.
34 *
35 * @warning This library is an experimental part of the %Cantera API and
36 * may be changed or removed without notice.
37 *
38 * @ingroup CAPIindex
39 */
40
41 /**
42 * @addtogroup CAPIctkin
43 * @{
44 */
45
46 /**
47 * Identifies the Kinetics manager type.
48 *
49 * Wraps C++ getter: `virtual string Kinetics::kineticsType()`
50 *
51 * @param handle Handle to queried Kinetics object.
52 * @param[in] bufLen Length of reserved array.
53 * @param[out] buf Returned string value.
54 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
55 */
56 int32_t kin_getType(int32_t handle, int32_t bufLen, char* buf);
57
58 /**
59 * Number of reactions in the reaction mechanism.
60 *
61 * Wraps C++ getter: `size_t Kinetics::nReactions()`
62 *
63 * @param handle Handle to queried Kinetics object.
64 */
65 int32_t kin_nReactions(int32_t handle);
66
67 /**
68 * Return the Reaction object for reaction
69 *
70 * Wraps C++ accessor: `shared_ptr<Reaction> Kinetics::reaction(size_t)`
71 *
72 * Uses:
73 * - `size_t Kinetics::nReactions()`
74 *
75 * @param handle Handle to queried Kinetics object.
76 * @param i Undocumented.
77 * @returns Handle to stored Reaction object or -1 for exception handling.
78 */
79 int32_t kin_reaction(int32_t handle, int32_t i);
80
81 /**
82 * The number of phases participating in the reaction mechanism.
83 *
84 * Wraps C++ getter: `size_t Kinetics::nPhases()`
85 *
86 * @param handle Handle to queried Kinetics object.
87 */
88 int32_t kin_nPhases(int32_t handle);
89
90 /**
91 * Return pointer to phase associated with Kinetics by index.
92 *
93 * Wraps C++ accessor: `shared_ptr<ThermoPhase> Kinetics::phase(size_t)`
94 *
95 * Uses:
96 * - `size_t Kinetics::nPhases()`
97 *
98 * @param handle Handle to queried Kinetics object.
99 * @param n Index of the ThermoPhase being sought.
100 * @returns Handle to stored ThermoPhase object or -1 for exception handling.
101 */
102 int32_t kin_phase(int32_t handle, int32_t n);
103
104 /**
105 * Return pointer to phase where the reactions occur.
106 *
107 * Wraps C++ getter: `shared_ptr<ThermoPhase> Kinetics::reactionPhase()`
108 *
109 * @param handle Handle to queried Kinetics object.
110 * @returns Handle to stored ThermoPhase object or -1 for exception handling.
111 */
112 int32_t kin_reactionPhase(int32_t handle);
113
114 /**
115 * Return the phase index of a phase in the list of phases defined within the object.
116 *
117 * Wraps C++ method: `size_t Kinetics::phaseIndex(const string&)`
118 *
119 * @param handle Handle to queried Kinetics object.
120 * @param ph string name of the phase
121 */
122 int32_t kin_phaseIndex(int32_t handle, const char* ph);
123
124 /**
125 * The total number of species in all phases participating in the kinetics mechanism.
126 *
127 * Wraps C++ getter: `size_t Kinetics::nTotalSpecies()`
128 *
129 * @param handle Handle to queried Kinetics object.
130 */
131 int32_t kin_nTotalSpecies(int32_t handle);
132
133 /**
134 * Stoichiometric coefficient of species k as a reactant in reaction i.
135 *
136 * Wraps C++ method: `virtual double Kinetics::reactantStoichCoeff(size_t, size_t)`
137 *
138 * @param handle Handle to queried Kinetics object.
139 * @param k kinetic species index
140 * @param i reaction index
141 */
142 double kin_reactantStoichCoeff(int32_t handle, int32_t k, int32_t i);
143
144 /**
145 * Stoichiometric coefficient of species k as a product in reaction i.
146 *
147 * Wraps C++ method: `virtual double Kinetics::productStoichCoeff(size_t, size_t)`
148 *
149 * @param handle Handle to queried Kinetics object.
150 * @param k kinetic species index
151 * @param i reaction index
152 */
153 double kin_productStoichCoeff(int32_t handle, int32_t k, int32_t i);
154
155 /**
156 * Return the forward rates of progress of the reactions.
157 *
158 * Wraps C++ getter: `virtual void Kinetics::getFwdRatesOfProgress(double*)`
159 *
160 * @param handle Handle to queried Kinetics object.
161 * @param[in] fwdROPLen Length of array reserved for fwdROP.
162 * @param fwdROP Output vector containing forward rates of progress of the reactions. Length: nReactions().
163 */
164 int32_t kin_getFwdRatesOfProgress(int32_t handle, int32_t fwdROPLen, double* fwdROP);
165
166 /**
167 * Return the Reverse rates of progress of the reactions.
168 *
169 * Wraps C++ getter: `virtual void Kinetics::getRevRatesOfProgress(double*)`
170 *
171 * @param handle Handle to queried Kinetics object.
172 * @param[in] revROPLen Length of array reserved for revROP.
173 * @param revROP Output vector containing reverse rates of progress of the reactions. Length: nReactions().
174 */
175 int32_t kin_getRevRatesOfProgress(int32_t handle, int32_t revROPLen, double* revROP);
176
177 /**
178 * Net rates of progress.
179 *
180 * Wraps C++ getter: `virtual void Kinetics::getNetRatesOfProgress(double*)`
181 *
182 * @param handle Handle to queried Kinetics object.
183 * @param[in] netROPLen Length of array reserved for netROP.
184 * @param netROP Output vector of the net ROP. Length: nReactions().
185 */
186 int32_t kin_getNetRatesOfProgress(int32_t handle, int32_t netROPLen, double* netROP);
187
188 /**
189 * Return a vector of Equilibrium constants.
190 *
191 * Wraps C++ getter: `virtual void Kinetics::getEquilibriumConstants(double*)`
192 *
193 * @param handle Handle to queried Kinetics object.
194 * @param[in] kcLen Length of array reserved for kc.
195 * @param kc Output vector containing the equilibrium constants. Length: nReactions().
196 */
197 int32_t kin_getEquilibriumConstants(int32_t handle, int32_t kcLen, double* kc);
198
199 /**
200 * Return the forward rate constants.
201 *
202 * Wraps C++ getter: `virtual void Kinetics::getFwdRateConstants(double*)`
203 *
204 * @param handle Handle to queried Kinetics object.
205 * @param[in] kfwdLen Length of array reserved for kfwd.
206 * @param kfwd Output vector containing the forward reaction rate constants. Length: nReactions().
207 */
208 int32_t kin_getFwdRateConstants(int32_t handle, int32_t kfwdLen, double* kfwd);
209
210 /**
211 * Return the reverse rate constants.
212 *
213 * Wraps C++ method: `virtual void Kinetics::getRevRateConstants(double*, bool)`
214 *
215 * @param handle Handle to queried Kinetics object.
216 * @param[in] krevLen Length of array reserved for krev.
217 * @param krev Output vector of reverse rate constants
218 * @param doIrreversible boolean indicating whether irreversible reactions should be included.
219 */
220 int32_t kin_getRevRateConstants(int32_t handle, int32_t krevLen, double* krev, int32_t doIrreversible);
221
222 /**
223 * Species creation rates [kmol/m^3/s or kmol/m^2/s].
224 *
225 * Wraps C++ getter: `virtual void Kinetics::getCreationRates(double*)`
226 *
227 * @param handle Handle to queried Kinetics object.
228 * @param[in] cdotLen Length of array reserved for cdot.
229 * @param cdot Output vector of creation rates. Length: m_kk.
230 */
231 int32_t kin_getCreationRates(int32_t handle, int32_t cdotLen, double* cdot);
232
233 /**
234 * Species destruction rates [kmol/m^3/s or kmol/m^2/s].
235 *
236 * Wraps C++ getter: `virtual void Kinetics::getDestructionRates(double*)`
237 *
238 * @param handle Handle to queried Kinetics object.
239 * @param[in] ddotLen Length of array reserved for ddot.
240 * @param ddot Output vector of destruction rates. Length: m_kk.
241 */
242 int32_t kin_getDestructionRates(int32_t handle, int32_t ddotLen, double* ddot);
243
244 /**
245 * Species net production rates [kmol/m^3/s or kmol/m^2/s].
246 *
247 * Wraps C++ getter: `virtual void Kinetics::getNetProductionRates(double*)`
248 *
249 * @param handle Handle to queried Kinetics object.
250 * @param[in] wdotLen Length of array reserved for wdot.
251 * @param wdot Output vector of net production rates. Length: m_kk.
252 */
253 int32_t kin_getNetProductionRates(int32_t handle, int32_t wdotLen, double* wdot);
254
255 /**
256 * The current value of the multiplier for reaction i.
257 *
258 * Wraps C++ method: `double Kinetics::multiplier(size_t)`
259 *
260 * @param handle Handle to queried Kinetics object.
261 * @param i index of the reaction
262 */
263 double kin_multiplier(int32_t handle, int32_t i);
264
265 /**
266 * Set the multiplier for reaction i to f.
267 *
268 * Wraps C++ method: `virtual void Kinetics::setMultiplier(size_t, double)`
269 *
270 * @param handle Handle to queried Kinetics object.
271 * @param i index of the reaction
272 * @param f value of the multiplier.
273 */
274 int32_t kin_setMultiplier(int32_t handle, int32_t i, double f);
275
276 /**
277 * True if reaction i has been declared to be reversible.
278 *
279 * Wraps C++ method: `bool Kinetics::isReversible(size_t)`
280 *
281 * @param handle Handle to queried Kinetics object.
282 * @param i reaction index
283 */
284 int32_t kin_isReversible(int32_t handle, int32_t i);
285
286 /**
287 * This routine will look up a species number based on the input string nm.
288 *
289 * Wraps C++ method: `size_t Kinetics::kineticsSpeciesIndex(const string&)`
290 *
291 * @param handle Handle to queried Kinetics object.
292 * @param nm Input string name of the species
293 */
294 int32_t kin_speciesIndex(int32_t handle, const char* nm);
295
296 /**
297 * Advance the surface coverages in time.
298 *
299 * Wraps C++ setter: `void InterfaceKinetics::advanceCoverages(double)`
300 *
301 * @param handle Handle to queried InterfaceKinetics object.
302 * @param tstep Time value to advance the surface coverages
303 */
304 int32_t kin_advanceCoverages(int32_t handle, double tstep);
305
306 /**
307 * Return the vector of values for the reactions change in enthalpy.
308 *
309 * Wraps C++ getter: `virtual void Kinetics::getDeltaEnthalpy(double*)`
310 *
311 * @param handle Handle to queried Kinetics object.
312 * @param[in] deltaHLen Length of array reserved for deltaH.
313 * @param deltaH Output vector of deltaH's for reactions Length: nReactions().
314 */
315 int32_t kin_getDeltaEnthalpy(int32_t handle, int32_t deltaHLen, double* deltaH);
316
317 /**
318 * Return the vector of values for the reaction Gibbs free energy change.
319 *
320 * Wraps C++ getter: `virtual void Kinetics::getDeltaGibbs(double*)`
321 *
322 * @param handle Handle to queried Kinetics object.
323 * @param[in] deltaGLen Length of array reserved for deltaG.
324 * @param deltaG Output vector of deltaG's for reactions Length: nReactions().
325 */
326 int32_t kin_getDeltaGibbs(int32_t handle, int32_t deltaGLen, double* deltaG);
327
328 /**
329 * Return the vector of values for the reactions change in entropy.
330 *
331 * Wraps C++ getter: `virtual void Kinetics::getDeltaEntropy(double*)`
332 *
333 * @param handle Handle to queried Kinetics object.
334 * @param[in] deltaSLen Length of array reserved for deltaS.
335 * @param deltaS Output vector of deltaS's for reactions Length: nReactions().
336 */
337 int32_t kin_getDeltaEntropy(int32_t handle, int32_t deltaSLen, double* deltaS);
338
339 /**
340 * Return the vector of values for the change in the standard state enthalpies of reaction.
341 *
342 * Wraps C++ getter: `virtual void Kinetics::getDeltaSSEnthalpy(double*)`
343 *
344 * @param handle Handle to queried Kinetics object.
345 * @param[in] deltaHLen Length of array reserved for deltaH.
346 * @param deltaH Output vector of ss deltaH's for reactions Length: nReactions().
347 */
348 int32_t kin_getDeltaSSEnthalpy(int32_t handle, int32_t deltaHLen, double* deltaH);
349
350 /**
351 * Return the vector of values for the reaction standard state Gibbs free energy change.
352 *
353 * Wraps C++ getter: `virtual void Kinetics::getDeltaSSGibbs(double*)`
354 *
355 * @param handle Handle to queried Kinetics object.
356 * @param[in] deltaGLen Length of array reserved for deltaG.
357 * @param deltaG Output vector of ss deltaG's for reactions Length: nReactions().
358 */
359 int32_t kin_getDeltaSSGibbs(int32_t handle, int32_t deltaGLen, double* deltaG);
360
361 /**
362 * Return the vector of values for the change in the standard state entropies for each reaction.
363 *
364 * Wraps C++ getter: `virtual void Kinetics::getDeltaSSEntropy(double*)`
365 *
366 * @param handle Handle to queried Kinetics object.
367 * @param[in] deltaSLen Length of array reserved for deltaS.
368 * @param deltaS Output vector of ss deltaS's for reactions Length: nReactions().
369 */
370 int32_t kin_getDeltaSSEntropy(int32_t handle, int32_t deltaSLen, double* deltaS);
371
372 /**
373 * Destructor; required by some APIs although object is managed by Solution.
374 *
375 * Wraps C++ noop: `undefined`
376 *
377 * @param handle Handle to Kinetics object.
378 * @returns Always zero.
379 */
380 int32_t kin_del(int32_t handle);
381
382 /**
383 * Return size of Kinetics storage.
384 *
385 * Wraps C++ reserved CLib function: `custom code`
386 *
387 * @returns Size or -1 for exception handling.
388 */
389 int32_t kin_cabinetSize();
390
391 /**
392 * Return handle to parent of Kinetics object.
393 *
394 * Wraps C++ reserved CLib function: `custom code`
395 *
396 * @param handle Handle to queried Kinetics object.
397 * @returns Parent handle or -1 for exception handling.
398 */
399 int32_t kin_parentHandle(int32_t handle);
400
401 /**
402 * @}
403 */
404
405#ifdef __cplusplus
406}
407#endif
408
409#endif // CTKIN_H
int32_t kin_getDeltaGibbs(int32_t handle, int32_t deltaGLen, double *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
Definition ctkin.cpp:338
int32_t kin_setMultiplier(int32_t handle, int32_t i, double f)
Set the multiplier for reaction i to f.
Definition ctkin.cpp:282
int32_t kin_del(int32_t handle)
Destructor; required by some APIs although object is managed by Solution.
Definition ctkin.cpp:403
int32_t kin_reaction(int32_t handle, int32_t i)
Return the Reaction object for reaction.
Definition ctkin.cpp:69
int32_t kin_nPhases(int32_t handle)
The number of phases participating in the reaction mechanism.
Definition ctkin.cpp:82
int32_t kin_reactionPhase(int32_t handle)
Return pointer to phase where the reactions occur.
Definition ctkin.cpp:105
double kin_productStoichCoeff(int32_t handle, int32_t k, int32_t i)
Stoichiometric coefficient of species k as a product in reaction i.
Definition ctkin.cpp:146
int32_t kin_getEquilibriumConstants(int32_t handle, int32_t kcLen, double *kc)
Return a vector of Equilibrium constants.
Definition ctkin.cpp:195
int32_t kin_getRevRatesOfProgress(int32_t handle, int32_t revROPLen, double *revROP)
Return the Reverse rates of progress of the reactions.
Definition ctkin.cpp:169
int32_t kin_getDestructionRates(int32_t handle, int32_t ddotLen, double *ddot)
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
Definition ctkin.cpp:246
int32_t kin_advanceCoverages(int32_t handle, double tstep)
Advance the surface coverages in time.
Definition ctkin.cpp:314
int32_t kin_phase(int32_t handle, int32_t n)
Return pointer to phase associated with Kinetics by index.
Definition ctkin.cpp:92
int32_t kin_getRevRateConstants(int32_t handle, int32_t krevLen, double *krev, int32_t doIrreversible)
Return the reverse rate constants.
Definition ctkin.cpp:221
int32_t kin_getDeltaEntropy(int32_t handle, int32_t deltaSLen, double *deltaS)
Return the vector of values for the reactions change in entropy.
Definition ctkin.cpp:351
int32_t kin_speciesIndex(int32_t handle, const char *nm)
This routine will look up a species number based on the input string nm.
Definition ctkin.cpp:304
int32_t kin_getDeltaEnthalpy(int32_t handle, int32_t deltaHLen, double *deltaH)
Return the vector of values for the reactions change in enthalpy.
Definition ctkin.cpp:325
int32_t kin_getCreationRates(int32_t handle, int32_t cdotLen, double *cdot)
Species creation rates [kmol/m^3/s or kmol/m^2/s].
Definition ctkin.cpp:233
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.
Definition ctkin.cpp:116
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.
Definition ctkin.cpp:364
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.
Definition ctkin.cpp:377
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].
Definition ctkin.cpp:259
double kin_reactantStoichCoeff(int32_t handle, int32_t k, int32_t i)
Stoichiometric coefficient of species k as a reactant in reaction i.
Definition ctkin.cpp:136
int32_t kin_getFwdRatesOfProgress(int32_t handle, int32_t fwdROPLen, double *fwdROP)
Return the forward rates of progress of the reactions.
Definition ctkin.cpp:156
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.
Definition ctkin.cpp:390
int32_t kin_getType(int32_t handle, int32_t bufLen, char *buf)
Identifies the Kinetics manager type.
Definition ctkin.cpp:47
int32_t kin_getNetRatesOfProgress(int32_t handle, int32_t netROPLen, double *netROP)
Net rates of progress.
Definition ctkin.cpp:182
int32_t kin_isReversible(int32_t handle, int32_t i)
True if reaction i has been declared to be reversible.
Definition ctkin.cpp:293
int32_t kin_parentHandle(int32_t handle)
Return handle to parent of Kinetics object.
Definition ctkin.cpp:421
int32_t kin_nTotalSpecies(int32_t handle)
The total number of species in all phases participating in the kinetics mechanism.
Definition ctkin.cpp:126
int32_t kin_nReactions(int32_t handle)
Number of reactions in the reaction mechanism.
Definition ctkin.cpp:59
int32_t kin_getFwdRateConstants(int32_t handle, int32_t kfwdLen, double *kfwd)
Return the forward rate constants.
Definition ctkin.cpp:208
int32_t kin_cabinetSize()
Return size of Kinetics storage.
Definition ctkin.cpp:409
double kin_multiplier(int32_t handle, int32_t i)
The current value of the multiplier for reaction i.
Definition ctkin.cpp:272