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