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