Cantera  3.2.0a4
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#ifdef __cplusplus
28extern "C" {
29#endif
30
31 /**
32 * @defgroup CAPIctreactor ctreactor Library
33 * Generated CLib API for %Cantera's ReactorBase 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 CAPIctreactor
43 * @{
44 */
45
46 /**
47 * Create a ReactorBase object of the specified type and contents.
48 *
49 * Wraps C++ constructor: `shared_ptr<ReactorBase> newReactorBase(const string&, shared_ptr<Solution>, bool, const string&)`
50 *
51 * @param model Undocumented.
52 * @param contents Integer handle to Solution object. Undocumented.
53 * @param clone Undocumented.
54 * @param name Undocumented.
55 * @returns Handle to stored ReactorBase object or -1 for exception handling.
56 */
57 int32_t reactor_new(const char* model, int32_t contents, int32_t clone, const char* name);
58
59 /**
60 * Create a ReactorSurface object with the specified contents and adjacent reactors participating in surface reactions.
61 *
62 * Wraps C++ constructor: `shared_ptr<ReactorSurface> newReactorSurface(shared_ptr<Solution>, const vector<shared_ptr<ReactorBase>>&, bool, const string&)`
63 *
64 * @param contents Integer handle to Solution object. Solution (Interface) object to model the thermodynamic properties and reactions occurring in the reactor
65 * @param[in] reactorsLen Length of array reserved for reactors.
66 * @param reactors Memory holding ReactorBase objects. List of Reactors adjacent to this surface, whose contents participate in reactions occurring on this surface.
67 * @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.
68 * @param name Name of the reactor surface.
69 * @returns Handle to stored ReactorSurface object or -1 for exception handling.
70 */
71 int32_t reactor_newSurface(int32_t contents, int32_t reactorsLen, const int32_t* reactors, int32_t clone, const char* name);
72
73 /**
74 * String indicating the reactor model implemented.
75 *
76 * Wraps C++ getter: `virtual string ReactorBase::type()`
77 *
78 * @param handle Handle to queried ReactorBase object.
79 * @param[in] bufLen Length of reserved array.
80 * @param[out] buf Returned string value.
81 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
82 */
83 int32_t reactor_type(int32_t handle, int32_t bufLen, char* buf);
84
85 /**
86 * Return the name of this reactor.
87 *
88 * Wraps C++ getter: `string ReactorBase::name()`
89 *
90 * @param handle Handle to queried ReactorBase object.
91 * @param[in] bufLen Length of reserved array.
92 * @param[out] buf Returned string value.
93 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
94 */
95 int32_t reactor_name(int32_t handle, int32_t bufLen, char* buf);
96
97 /**
98 * Set the name of this reactor.
99 *
100 * Wraps C++ setter: `void ReactorBase::setName(const string&)`
101 *
102 * @param handle Handle to queried ReactorBase object.
103 * @param name Undocumented.
104 */
105 int32_t reactor_setName(int32_t handle, const char* name);
106
107 /**
108 * Access the Solution object used to represent the contents of this reactor.
109 *
110 * Wraps C++ accessor: `shared_ptr<Solution> ReactorBase::contents4()`
111 *
112 * @param handle Handle to queried ReactorBase object.
113 * @returns Handle to stored Solution object or -1 for exception handling.
114 */
115 int32_t reactor_contents(int32_t handle);
116
117 /**
118 * Set the initial reactor volume.
119 *
120 * Wraps C++ setter: `virtual void ReactorBase::setInitialVolume(double)`
121 *
122 * @param handle Handle to queried ReactorBase object.
123 * @param vol Undocumented.
124 */
125 int32_t reactor_setInitialVolume(int32_t handle, double vol);
126
127 /**
128 * Enable or disable changes in reactor composition due to chemical reactions.
129 *
130 * Wraps C++ setter: `virtual void ReactorBase::setChemistry(bool)`
131 *
132 * @param handle Handle to queried ReactorBase object.
133 * @param cflag Undocumented.
134 */
135 int32_t reactor_setChemistry(int32_t handle, int32_t cflag);
136
137 /**
138 * Set the energy equation on or off.
139 *
140 * Wraps C++ setter: `virtual void ReactorBase::setEnergy(int)`
141 *
142 * @param handle Handle to queried ReactorBase object.
143 * @param eflag Undocumented.
144 */
145 int32_t reactor_setEnergy(int32_t handle, int32_t eflag);
146
147 /**
148 * Returns the mass (kg) of the reactor's contents.
149 *
150 * Wraps C++ getter: `double ReactorBase::mass()`
151 *
152 * @param handle Handle to queried ReactorBase object.
153 */
154 double reactor_mass(int32_t handle);
155
156 /**
157 * Returns the current volume (m^3) of the reactor.
158 *
159 * Wraps C++ getter: `double ReactorBase::volume()`
160 *
161 * @param handle Handle to queried ReactorBase object.
162 */
163 double reactor_volume(int32_t handle);
164
165 /**
166 * Returns the current density (kg/m^3) of the reactor's contents.
167 *
168 * Wraps C++ getter: `double ReactorBase::density()`
169 *
170 * @param handle Handle to queried ReactorBase object.
171 */
172 double reactor_density(int32_t handle);
173
174 /**
175 * Returns the current temperature (K) of the reactor's contents.
176 *
177 * Wraps C++ getter: `double ReactorBase::temperature()`
178 *
179 * @param handle Handle to queried ReactorBase object.
180 */
181 double reactor_temperature(int32_t handle);
182
183 /**
184 * Returns the current enthalpy (J/kg) of the reactor's contents.
185 *
186 * Wraps C++ getter: `double ReactorBase::enthalpy_mass()`
187 *
188 * @param handle Handle to queried ReactorBase object.
189 */
190 double reactor_enthalpy_mass(int32_t handle);
191
192 /**
193 * Returns the current internal energy (J/kg) of the reactor's contents.
194 *
195 * Wraps C++ getter: `double ReactorBase::intEnergy_mass()`
196 *
197 * @param handle Handle to queried ReactorBase object.
198 */
199 double reactor_intEnergy_mass(int32_t handle);
200
201 /**
202 * Returns the current pressure (Pa) of the reactor.
203 *
204 * Wraps C++ getter: `double ReactorBase::pressure()`
205 *
206 * @param handle Handle to queried ReactorBase object.
207 */
208 double reactor_pressure(int32_t handle);
209
210 /**
211 * Return the mass fraction of the *k*-th species.
212 *
213 * Wraps C++ method: `double ReactorBase::massFraction(size_t)`
214 *
215 * @param handle Handle to queried ReactorBase object.
216 * @param k Undocumented.
217 */
218 double reactor_massFraction(int32_t handle, int32_t k);
219
220 /**
221 * Number of sensitivity parameters associated with this reactor.
222 *
223 * Wraps C++ getter: `virtual size_t ReactorBase::nSensParams()`
224 *
225 * @param handle Handle to queried ReactorBase object.
226 */
227 int32_t reactor_nSensParams(int32_t handle);
228
229 /**
230 * Add a sensitivity parameter associated with the reaction number *rxn*
231 *
232 * Wraps C++ setter: `virtual void ReactorBase::addSensitivityReaction(size_t)`
233 *
234 * @param handle Handle to queried ReactorBase object.
235 * @param rxn Undocumented.
236 */
237 int32_t reactor_addSensitivityReaction(int32_t handle, int32_t rxn);
238
239 /**
240 * Add a ReactorSurface object to a Reactor object.
241 *
242 * Wraps C++ setter: `void ReactorBase::addSurface(shared_ptr<ReactorBase>)`
243 *
244 * @param handle Handle to queried ReactorBase object.
245 * @param surf Integer handle to ReactorBase object. Undocumented.
246 */
247 int32_t reactor_addSurface(int32_t handle, int32_t surf);
248
249 /**
250 * Set the mass flow rate through the reactor [kg/s].
251 *
252 * Wraps C++ setter: `void FlowReactor::setMassFlowRate(double)`
253 *
254 * @param handle Handle to queried FlowReactor object.
255 * @param mdot Undocumented.
256 */
257 int32_t reactor_setMassFlowRate(int32_t handle, double mdot);
258
259 /**
260 * The cross-sectional area of the reactor [m^2].
261 *
262 * Wraps C++ getter: `double FlowReactor::area()`
263 *
264 * @param handle Handle to queried FlowReactor object.
265 */
266 double reactor_area(int32_t handle);
267
268 /**
269 * Sets the area of the reactor [m^2].
270 *
271 * Wraps C++ setter: `void FlowReactor::setArea(double)`
272 *
273 * @param handle Handle to queried FlowReactor object.
274 * @param area Undocumented.
275 */
276 int32_t reactor_setArea(int32_t handle, double area);
277
278 /**
279 * Delete ReactorBase object.
280 *
281 * Wraps C++ destructor: `undefined`
282 *
283 * @param handle Handle to ReactorBase object.
284 * @returns Zero for success and -1 for exception handling.
285 */
286 int32_t reactor_del(int32_t handle);
287
288 /**
289 * Return size of ReactorBase storage.
290 *
291 * Wraps C++ reserved CLib function: `custom code`
292 *
293 * @returns Size or -1 for exception handling.
294 */
295 int32_t reactor_cabinetSize();
296
297 /**
298 * @}
299 */
300
301#ifdef __cplusplus
302}
303#endif
304
305#endif // CTREACTOR_H
int32_t reactor_nSensParams(int32_t handle)
Number of sensitivity parameters associated with 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_enthalpy_mass(int32_t handle)
Returns the current enthalpy (J/kg) of the reactor's contents.
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.
int32_t reactor_newSurface(int32_t contents, 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_contents(int32_t handle)
Access the Solution object used to represent the contents of this reactor.
double reactor_mass(int32_t handle)
Returns the mass (kg) of the reactor's contents.
int32_t reactor_setArea(int32_t handle, double area)
Sets the area of the reactor [m^2].
int32_t reactor_setMassFlowRate(int32_t handle, double mdot)
Set the mass flow rate through the reactor [kg/s].
double reactor_area(int32_t handle)
The cross-sectional area of the reactor [m^2].
int32_t reactor_setEnergy(int32_t handle, int32_t eflag)
Set the energy equation on or off.
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.
int32_t reactor_setChemistry(int32_t handle, int32_t cflag)
Enable or disable changes in reactor composition due to chemical reactions.
double reactor_massFraction(int32_t handle, int32_t k)
Return the mass fraction of the k-th species.
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
int32_t reactor_new(const char *model, int32_t contents, int32_t clone, const char *name)
Create a ReactorBase object of the specified type and contents.
Definition ctreactor.cpp:46
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_cabinetSize()
Return size of ReactorBase storage.