Cantera  3.2.0a5
Loading...
Searching...
No Matches
interfaces/clib/include/cantera_clib/ctreactor.h
Go to the documentation of this file.
1/**
2 * CTREACTOR - Generated CLib %Cantera interface library.
3 *
4 * @file ctreactor.h
5 *
6 * Generated CLib API for %Cantera's ReactorBase 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 CTREACTOR_H
25#define CTREACTOR_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 CAPIctreactor ctreactor Library
35 * Generated CLib API for %Cantera's ReactorBase 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 CAPIctreactor
45 * @{
46 */
47
48 /**
49 * Create a ReactorBase object of the specified type and contents.
50 *
51 * Wraps C++ constructor: `shared_ptr<ReactorBase> newReactorBase(const string&, shared_ptr<Solution>, bool, const string&)`
52 *
53 * @param model Undocumented.
54 * @param phase Integer handle to Solution object. Undocumented.
55 * @param clone Undocumented.
56 * @param name Undocumented.
57 * @returns Handle to stored ReactorBase object or -1 for exception handling.
58 */
59 int32_t reactor_new(const char* model, int32_t phase, int32_t clone, const char* name);
60
61 /**
62 * Create a ReactorSurface object with the specified contents and adjacent reactors participating in surface reactions.
63 *
64 * Wraps C++ constructor: `shared_ptr<ReactorSurface> newReactorSurface(shared_ptr<Solution>, const vector<shared_ptr<ReactorBase>>&, bool, const string&)`
65 *
66 * @param phase Integer handle to Solution object. Solution (Interface) object to model the thermodynamic properties and reactions occurring in the reactor
67 * @param[in] reactorsLen Length of array reserved for reactors.
68 * @param reactors Memory holding ReactorBase objects. List of Reactors adjacent to this surface, whose contents participate in reactions occurring on this surface.
69 * @param clone Determines whether to clone `sol` so that the internal state of this surface is independent of the original Interface object and any Solution objects used by other reactors in the network except those in the `reactors` list.
70 * @param name Name of the reactor surface.
71 * @returns Handle to stored ReactorSurface object or -1 for exception handling.
72 */
73 int32_t reactor_newSurface(int32_t phase, int32_t reactorsLen, const int32_t* reactors, int32_t clone, const char* name);
74
75 /**
76 * String indicating the reactor model implemented.
77 *
78 * Wraps C++ getter: `virtual string ReactorBase::type()`
79 *
80 * @param handle Handle to queried ReactorBase object.
81 * @param[in] bufLen Length of reserved array.
82 * @param[out] buf Returned string value.
83 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
84 */
85 int32_t reactor_type(int32_t handle, int32_t bufLen, char* buf);
86
87 /**
88 * Return the name of this reactor.
89 *
90 * Wraps C++ getter: `string ReactorBase::name()`
91 *
92 * @param handle Handle to queried ReactorBase object.
93 * @param[in] bufLen Length of reserved array.
94 * @param[out] buf Returned string value.
95 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
96 */
97 int32_t reactor_name(int32_t handle, int32_t bufLen, char* buf);
98
99 /**
100 * Set the name of this reactor.
101 *
102 * Wraps C++ setter: `void ReactorBase::setName(const string&)`
103 *
104 * @param handle Handle to queried ReactorBase object.
105 * @param name Undocumented.
106 */
107 int32_t reactor_setName(int32_t handle, const char* name);
108
109 /**
110 * Access the Solution object used to represent the contents of this reactor.
111 *
112 * Wraps C++ accessor: `shared_ptr<Solution> ReactorBase::phase()`
113 *
114 * @param handle Handle to queried ReactorBase object.
115 * @returns Handle to stored Solution object or -1 for exception handling.
116 */
117 int32_t reactor_phase(int32_t handle);
118
119 /**
120 * Set the initial reactor volume.
121 *
122 * Wraps C++ setter: `virtual void ReactorBase::setInitialVolume(double)`
123 *
124 * @param handle Handle to queried ReactorBase object.
125 * @param vol Undocumented.
126 */
127 int32_t reactor_setInitialVolume(int32_t handle, double vol);
128
129 /**
130 * Returns an area associated with a reactor [m²].
131 *
132 * Wraps C++ getter: `virtual double ReactorBase::area()`
133 *
134 * @param handle Handle to queried ReactorBase object.
135 */
136 double reactor_area(int32_t handle);
137
138 /**
139 * Set an area associated with a reactor [m²].
140 *
141 * Wraps C++ setter: `virtual void ReactorBase::setArea(double)`
142 *
143 * @param handle Handle to queried ReactorBase object.
144 * @param a Undocumented.
145 */
146 int32_t reactor_setArea(int32_t handle, double a);
147
148 /**
149 * Returns `true` if changes in the reactor composition due to chemical reactions are enabled.
150 *
151 * Wraps C++ getter: `virtual bool ReactorBase::chemistryEnabled()`
152 *
153 * @param handle Handle to queried ReactorBase object.
154 */
155 int32_t reactor_chemistryEnabled(int32_t handle);
156
157 /**
158 * Enable or disable changes in reactor composition due to chemical reactions.
159 *
160 * Wraps C++ setter: `virtual void ReactorBase::setChemistryEnabled(bool)`
161 *
162 * @param handle Handle to queried ReactorBase object.
163 * @param cflag Undocumented.
164 */
165 int32_t reactor_setChemistryEnabled(int32_t handle, int32_t cflag);
166
167 /**
168 * Returns `true` if solution of the energy equation is enabled.
169 *
170 * Wraps C++ getter: `virtual bool ReactorBase::energyEnabled()`
171 *
172 * @param handle Handle to queried ReactorBase object.
173 */
174 int32_t reactor_energyEnabled(int32_t handle);
175
176 /**
177 * Set the energy equation on or off.
178 *
179 * Wraps C++ setter: `virtual void ReactorBase::setEnergyEnabled(bool)`
180 *
181 * @param handle Handle to queried ReactorBase object.
182 * @param eflag Undocumented.
183 */
184 int32_t reactor_setEnergyEnabled(int32_t handle, int32_t eflag);
185
186 /**
187 * Returns the mass (kg) of the reactor's contents.
188 *
189 * Wraps C++ getter: `double ReactorBase::mass()`
190 *
191 * @param handle Handle to queried ReactorBase object.
192 */
193 double reactor_mass(int32_t handle);
194
195 /**
196 * Returns the current volume (m^3) of the reactor.
197 *
198 * Wraps C++ getter: `double ReactorBase::volume()`
199 *
200 * @param handle Handle to queried ReactorBase object.
201 */
202 double reactor_volume(int32_t handle);
203
204 /**
205 * Returns the current density (kg/m^3) of the reactor's contents.
206 *
207 * Wraps C++ getter: `double ReactorBase::density()`
208 *
209 * @param handle Handle to queried ReactorBase object.
210 */
211 double reactor_density(int32_t handle);
212
213 /**
214 * Returns the current temperature (K) of the reactor's contents.
215 *
216 * Wraps C++ getter: `double ReactorBase::temperature()`
217 *
218 * @param handle Handle to queried ReactorBase object.
219 */
220 double reactor_temperature(int32_t handle);
221
222 /**
223 * Returns the current enthalpy (J/kg) of the reactor's contents.
224 *
225 * Wraps C++ getter: `double ReactorBase::enthalpy_mass()`
226 *
227 * @param handle Handle to queried ReactorBase object.
228 */
229 double reactor_enthalpy_mass(int32_t handle);
230
231 /**
232 * Returns the current internal energy (J/kg) of the reactor's contents.
233 *
234 * Wraps C++ getter: `double ReactorBase::intEnergy_mass()`
235 *
236 * @param handle Handle to queried ReactorBase object.
237 *
238 * @deprecated Per C++ annotation: To be removed after Cantera 3.2.
239 */
240 double reactor_intEnergy_mass(int32_t handle);
241
242 /**
243 * Returns the current pressure (Pa) of the reactor.
244 *
245 * Wraps C++ getter: `double ReactorBase::pressure()`
246 *
247 * @param handle Handle to queried ReactorBase object.
248 */
249 double reactor_pressure(int32_t handle);
250
251 /**
252 * Return the mass fraction of the *k*-th species.
253 *
254 * Wraps C++ method: `double ReactorBase::massFraction(size_t)`
255 *
256 * @param handle Handle to queried ReactorBase object.
257 * @param k Undocumented.
258 */
259 double reactor_massFraction(int32_t handle, int32_t k);
260
261 /**
262 * Return the vector of species mass fractions.
263 *
264 * Wraps C++ getter: `const double* ReactorBase::massFractions()`
265 *
266 * @param handle Handle to queried ReactorBase object.
267 * @param[in] bufLen Length of reserved array.
268 * @param[out] buf Returned array value.
269 * @returns Actual length of value array or -1 for exception handling.
270 */
271 int32_t reactor_massFractions(int32_t handle, int32_t bufLen, double* buf);
272
273 /**
274 * Number of sensitivity parameters associated with this reactor.
275 *
276 * Wraps C++ getter: `virtual size_t ReactorBase::nSensParams()`
277 *
278 * @param handle Handle to queried ReactorBase object.
279 */
280 int32_t reactor_nSensParams(int32_t handle);
281
282 /**
283 * Add a sensitivity parameter associated with the reaction number *rxn*
284 *
285 * Wraps C++ setter: `virtual void ReactorBase::addSensitivityReaction(size_t)`
286 *
287 * @param handle Handle to queried ReactorBase object.
288 * @param rxn Undocumented.
289 */
290 int32_t reactor_addSensitivityReaction(int32_t handle, int32_t rxn);
291
292 /**
293 * Add a ReactorSurface object to a Reactor object.
294 *
295 * Wraps C++ setter: `void ReactorBase::addSurface(shared_ptr<ReactorBase>)`
296 *
297 * @param handle Handle to queried ReactorBase object.
298 * @param surf Integer handle to ReactorBase object. Undocumented.
299 *
300 * @deprecated Per C++ annotation: Unused. To be removed after Cantera 3.2.
301 */
302 int32_t reactor_addSurface(int32_t handle, int32_t surf);
303
304 /**
305 * Mass flow rate through the reactor [kg/s].
306 *
307 * Wraps C++ getter: `double FlowReactor::massFlowRate()`
308 *
309 * @param handle Handle to queried FlowReactor object.
310 */
311 double reactor_massFlowRate(int32_t handle);
312
313 /**
314 * Set the mass flow rate through the reactor [kg/s].
315 *
316 * Wraps C++ setter: `void FlowReactor::setMassFlowRate(double)`
317 *
318 * @param handle Handle to queried FlowReactor object.
319 * @param mdot Undocumented.
320 */
321 int32_t reactor_setMassFlowRate(int32_t handle, double mdot);
322
323 /**
324 * Delete ReactorBase object.
325 *
326 * Wraps C++ destructor: `undefined`
327 *
328 * @param handle Handle to ReactorBase object.
329 * @returns Zero for success and -1 for exception handling.
330 */
331 int32_t reactor_del(int32_t handle);
332
333 /**
334 * Return size of ReactorBase storage.
335 *
336 * Wraps C++ reserved CLib function: `custom code`
337 *
338 * @returns Size or -1 for exception handling.
339 */
340 int32_t reactor_cabinetSize();
341
342 /**
343 * @}
344 */
345
346#ifdef __cplusplus
347}
348#endif
349
350#endif // CTREACTOR_H
int32_t reactor_nSensParams(int32_t handle)
Number of sensitivity parameters associated with this reactor.
int32_t reactor_phase(int32_t handle)
Access the Solution object used to represent the contents of this reactor.
double reactor_volume(int32_t handle)
Returns the current volume (m^3) of the reactor.
int32_t reactor_setName(int32_t handle, const char *name)
Set the name of this reactor.
Definition ctreactor.cpp:96
int32_t reactor_del(int32_t handle)
Delete ReactorBase object.
double reactor_massFlowRate(int32_t handle)
Mass flow rate through the reactor [kg/s].
double reactor_enthalpy_mass(int32_t handle)
Returns the current enthalpy (J/kg) of the reactor's contents.
int32_t reactor_energyEnabled(int32_t handle)
Returns true if solution of the energy equation is enabled.
int32_t reactor_setArea(int32_t handle, double a)
Set an area associated with a reactor [m²].
double reactor_pressure(int32_t handle)
Returns the current pressure (Pa) of the reactor.
int32_t reactor_addSurface(int32_t handle, int32_t surf)
Add a ReactorSurface object to a Reactor object.
double reactor_mass(int32_t handle)
Returns the mass (kg) of the reactor's contents.
int32_t reactor_new(const char *model, int32_t phase, int32_t clone, const char *name)
Create a ReactorBase object of the specified type and contents.
Definition ctreactor.cpp:46
int32_t reactor_massFractions(int32_t handle, int32_t bufLen, double *buf)
Return the vector of species mass fractions.
int32_t reactor_setMassFlowRate(int32_t handle, double mdot)
Set the mass flow rate through the reactor [kg/s].
int32_t reactor_setEnergyEnabled(int32_t handle, int32_t eflag)
Set the energy equation on or off.
int32_t reactor_chemistryEnabled(int32_t handle)
Returns true if changes in the reactor composition due to chemical reactions are enabled.
double reactor_area(int32_t handle)
Returns an area associated with a reactor [m²].
int32_t reactor_setInitialVolume(int32_t handle, double vol)
Set the initial reactor volume.
double reactor_temperature(int32_t handle)
Returns the current temperature (K) of the reactor's contents.
double reactor_massFraction(int32_t handle, int32_t k)
Return the mass fraction of the k-th species.
int32_t reactor_newSurface(int32_t phase, int32_t reactorsLen, const int32_t *reactors, int32_t clone, const char *name)
Create a ReactorSurface object with the specified contents and adjacent reactors participating in sur...
Definition ctreactor.cpp:57
double reactor_intEnergy_mass(int32_t handle)
Returns the current internal energy (J/kg) of the reactor's contents.
int32_t reactor_addSensitivityReaction(int32_t handle, int32_t rxn)
Add a sensitivity parameter associated with the reaction number rxn
double reactor_density(int32_t handle)
Returns the current density (kg/m^3) of the reactor's contents.
int32_t reactor_type(int32_t handle, int32_t bufLen, char *buf)
String indicating the reactor model implemented.
Definition ctreactor.cpp:72
int32_t reactor_name(int32_t handle, int32_t bufLen, char *buf)
Return the name of this reactor.
Definition ctreactor.cpp:84
int32_t reactor_setChemistryEnabled(int32_t handle, int32_t cflag)
Enable or disable changes in reactor composition due to chemical reactions.
int32_t reactor_cabinetSize()
Return size of ReactorBase storage.