Cantera  3.2.0a4
Loading...
Searching...
No Matches
ctdomain.h
Go to the documentation of this file.
1/**
2 * CTDOMAIN - Generated CLib %Cantera interface library.
3 *
4 * @file ctdomain.h
5 *
6 * Generated CLib API for %Cantera's Domain1D 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 CTDOMAIN_H
25#define CTDOMAIN_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31 /**
32 * @defgroup CAPIctdomain ctdomain Library
33 * Generated CLib API for %Cantera's Domain1D 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 CAPIctdomain
43 * @{
44 */
45
46 /**
47 * Create a Flow1D object of the specified type.
48 *
49 * Wraps C++ constructor: `shared_ptr<Flow1D> newFlow1D(const string&, shared_ptr<Solution>, const string&)`
50 *
51 * @param domainType string identifying domain type.
52 * @param solution Integer handle to Solution object. Solution holding ThermoPhase, Kinetics and Transport objects.
53 * @param id string identifier describing domain. If omitted, id defaults to the domain type identifier.
54 * @returns Handle to stored Flow1D object or -1 for exception handling.
55 */
56 int32_t domain_newFlow1D(const char* domainType, int32_t solution, const char* id);
57
58 /**
59 * Create a Boundary1D object of the specified type.
60 *
61 * Wraps C++ constructor: `shared_ptr<Boundary1D> newBoundary1D(const string&, shared_ptr<Solution>, const string&)`
62 *
63 * @param domainType string identifying domain type.
64 * @param solution Integer handle to Solution object. Solution holding ThermoPhase, Kinetics and Transport objects.
65 * @param id string identifier describing domain. If omitted, id defaults to the domain type identifier.
66 * @returns Handle to stored Boundary1D object or -1 for exception handling.
67 */
68 int32_t domain_newBoundary1D(const char* domainType, int32_t solution, const char* id);
69
70 /**
71 * String indicating the domain implemented.
72 *
73 * Wraps C++ getter: `string Domain1D::type()`
74 *
75 * @param handle Handle to queried Domain1D object.
76 * @param[in] bufLen Length of reserved array.
77 * @param[out] buf Returned string value.
78 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
79 */
80 int32_t domain_type(int32_t handle, int32_t bufLen, char* buf);
81
82 /**
83 * Returns the index of the solution vector, which corresponds to component n at grid point j.
84 *
85 * Wraps C++ method: `size_t Domain1D::index(size_t, size_t)`
86 *
87 * @param handle Handle to queried Domain1D object.
88 * @param n component index
89 * @param j grid point index
90 */
91 int32_t domain_index(int32_t handle, int32_t n, int32_t j);
92
93 /**
94 * Number of components at each grid point.
95 *
96 * Wraps C++ getter: `size_t Domain1D::nComponents()`
97 *
98 * @param handle Handle to queried Domain1D object.
99 */
100 int32_t domain_nComponents(int32_t handle);
101
102 /**
103 * Number of grid points in this domain.
104 *
105 * Wraps C++ getter: `size_t Domain1D::nPoints()`
106 *
107 * @param handle Handle to queried Domain1D object.
108 */
109 int32_t domain_nPoints(int32_t handle);
110
111 /**
112 * Name of component `n`. May be overloaded.
113 *
114 * Wraps C++ method: `virtual string Domain1D::componentName(size_t)`
115 *
116 * @param handle Handle to queried Domain1D object.
117 * @param n Undocumented.
118 * @param[in] bufLen Length of reserved array.
119 * @param[out] buf Returned string value.
120 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
121 */
122 int32_t domain_componentName(int32_t handle, int32_t n, int32_t bufLen, char* buf);
123
124 /**
125 * Index of component with name `name`.
126 *
127 * Wraps C++ method: `virtual size_t Domain1D::componentIndex(const string&)`
128 *
129 * @param handle Handle to queried Domain1D object.
130 * @param name name of component
131 */
132 int32_t domain_componentIndex(int32_t handle, const char* name);
133
134 /**
135 * Set a single component value at a boundary.
136 *
137 * Wraps C++ method: `virtual double Domain1D::value(const string&)`
138 *
139 * @param handle Handle to queried Domain1D object.
140 * @param component Name of the component.
141 */
142 double domain_value(int32_t handle, const char* component);
143
144 /**
145 * Set a single component value in a flow domain or at a boundary.
146 *
147 * Wraps C++ method: `virtual void Domain1D::setValue(const string&, double)`
148 *
149 * @param handle Handle to queried Domain1D object.
150 * @param component Name of the component.
151 * @param value Value of the component.
152 */
153 int32_t domain_setValue(int32_t handle, const char* component, double value);
154
155 /**
156 * Retrieve component values.
157 *
158 * Wraps C++ method: `vector<double> Domain1D::values(const string&)`
159 *
160 * @param handle Handle to queried Domain1D object.
161 * @param component Name of the component.
162 * @param[in] bufLen Length of reserved array.
163 * @param[out] buf Returned array value.
164 * @returns Actual length of value array or -1 for exception handling.
165 */
166 int32_t domain_values(int32_t handle, const char* component, int32_t bufLen, double* buf);
167
168 /**
169 * Specify component values.
170 *
171 * Wraps C++ method: `virtual void Domain1D::setValues(const string&, const vector<double>&)`
172 *
173 * @param handle Handle to queried Domain1D object.
174 * @param component Name of the component.
175 * @param[in] valuesLen Length of vector reserved for values.
176 * @param[in] values Vector of length nPoints() containing values at grid points.
177 */
178 int32_t domain_setValues(int32_t handle, const char* component, int32_t valuesLen, const double* values);
179
180 /**
181 * Retrieve internal work array values for a component.
182 *
183 * Wraps C++ method: `vector<double> Domain1D::residuals(const string&)`
184 *
185 * @param handle Handle to queried Domain1D object.
186 * @param component Name of the component.
187 * @param[in] bufLen Length of reserved array.
188 * @param[out] buf Returned array value.
189 * @returns Actual length of value array or -1 for exception handling.
190 */
191 int32_t domain_residuals(int32_t handle, const char* component, int32_t bufLen, double* buf);
192
193 /**
194 * Specify a profile for a component.
195 *
196 * Wraps C++ method: `virtual void Domain1D::setProfile(const string&, const vector<double>&, const vector<double>&)`
197 *
198 * @param handle Handle to queried Domain1D object.
199 * @param component Undocumented.
200 * @param[in] posLen Length of vector reserved for pos.
201 * @param pos Undocumented.
202 * @param[in] valuesLen Length of vector reserved for values.
203 * @param values Undocumented.
204 */
205 int32_t domain_setProfile(int32_t handle, const char* component, int32_t posLen, const double* pos, int32_t valuesLen, const double* values);
206
207 /**
208 * Specify a flat profile for a component.
209 *
210 * Wraps C++ method: `virtual void Domain1D::setFlatProfile(const string&, double)`
211 *
212 * @param handle Handle to queried Domain1D object.
213 * @param component Name of the component.
214 * @param value Constant value.
215 */
216 int32_t domain_setFlatProfile(int32_t handle, const char* component, double value);
217
218 /**
219 * Set the upper and lower bounds for a solution component, n.
220 *
221 * Wraps C++ method: `void Domain1D::setBounds(size_t, double, double)`
222 *
223 * @param handle Handle to queried Domain1D object.
224 * @param n solution component index
225 * @param lower lower bound on component n
226 * @param upper upper bound on component n
227 */
228 int32_t domain_setBounds(int32_t handle, int32_t n, double lower, double upper);
229
230 /**
231 * Lower bound on the nth component.
232 *
233 * Wraps C++ method: `double Domain1D::lowerBound(size_t)`
234 *
235 * @param handle Handle to queried Domain1D object.
236 * @param n Undocumented.
237 */
238 double domain_lowerBound(int32_t handle, int32_t n);
239
240 /**
241 * Upper bound on the nth component.
242 *
243 * Wraps C++ method: `double Domain1D::upperBound(size_t)`
244 *
245 * @param handle Handle to queried Domain1D object.
246 * @param n Undocumented.
247 */
248 double domain_upperBound(int32_t handle, int32_t n);
249
250 /**
251 * Set tolerances for steady-state mode.
252 *
253 * Wraps C++ method: `void Domain1D::setSteadyTolerances(double, double, size_t)`
254 *
255 * @param handle Handle to queried Domain1D object.
256 * @param rtol Relative tolerance
257 * @param atol Absolute tolerance
258 * @param n component index these tolerances apply to. If set to -1 (the default), these tolerances will be applied to all solution components.
259 */
260 int32_t domain_setSteadyTolerances(int32_t handle, double rtol, double atol, int32_t n);
261
262 /**
263 * Set tolerances for time-stepping mode.
264 *
265 * Wraps C++ method: `void Domain1D::setTransientTolerances(double, double, size_t)`
266 *
267 * @param handle Handle to queried Domain1D object.
268 * @param rtol Relative tolerance
269 * @param atol Absolute tolerance
270 * @param n component index these tolerances apply to. If set to -1 (the default), these tolerances will be applied to all solution components.
271 */
272 int32_t domain_setTransientTolerances(int32_t handle, double rtol, double atol, int32_t n);
273
274 /**
275 * Relative tolerance of the nth component.
276 *
277 * Wraps C++ method: `double Domain1D::rtol(size_t)`
278 *
279 * @param handle Handle to queried Domain1D object.
280 * @param n Undocumented.
281 */
282 double domain_rtol(int32_t handle, int32_t n);
283
284 /**
285 * Absolute tolerance of the nth component.
286 *
287 * Wraps C++ method: `double Domain1D::atol(size_t)`
288 *
289 * @param handle Handle to queried Domain1D object.
290 * @param n Undocumented.
291 */
292 double domain_atol(int32_t handle, int32_t n);
293
294 /**
295 * Set up initial grid.
296 *
297 * Wraps C++ setter: `void Domain1D::setupGrid(const vector<double>&)`
298 *
299 * @param handle Handle to queried Domain1D object.
300 * @param[in] gridLen Length of vector reserved for grid.
301 * @param grid Undocumented.
302 */
303 int32_t domain_setupGrid(int32_t handle, int32_t gridLen, const double* grid);
304
305 /**
306 * Set up uniform grid.
307 *
308 * Wraps C++ method: `void Domain1D::setupUniformGrid(size_t, double, double)`
309 *
310 * @param handle Handle to queried Domain1D object.
311 * @param points Number of grid points
312 * @param length Length of domain
313 * @param start Start position of domain (default=0.)
314 */
315 int32_t domain_setupUniformGrid(int32_t handle, int32_t points, double length, double start);
316
317 /**
318 * Specify an identifying tag for this domain.
319 *
320 * Wraps C++ setter: `void Domain1D::setID(const string&)`
321 *
322 * @param handle Handle to queried Domain1D object.
323 * @param s Undocumented.
324 */
325 int32_t domain_setID(int32_t handle, const char* s);
326
327 /**
328 * Access the array of grid coordinates [m].
329 *
330 * Wraps C++ getter: `vector<double>& Domain1D::grid()`
331 *
332 * @param handle Handle to queried Domain1D object.
333 * @param[in] bufLen Length of reserved array.
334 * @param[out] buf Returned array value.
335 * @returns Actual length of value array or -1 for exception handling.
336 */
337 int32_t domain_grid(int32_t handle, int32_t bufLen, double* buf);
338
339 /**
340 * Set the total mass flow rate [kg/m²/s].
341 *
342 * Wraps C++ setter: `virtual void Boundary1D::setMdot(double)`
343 *
344 * @param handle Handle to queried Boundary1D object.
345 * @param mdot Undocumented.
346 */
347 int32_t bdry_setMdot(int32_t handle, double mdot);
348
349 /**
350 * Set the temperature.
351 *
352 * Wraps C++ setter: `virtual void Boundary1D::setTemperature(double)`
353 *
354 * @param handle Handle to queried Boundary1D object.
355 * @param t Undocumented.
356 */
357 int32_t bdry_setTemperature(int32_t handle, double t);
358
359 /**
360 * Set tangential velocity gradient [1/s] at this boundary.
361 *
362 * Wraps C++ setter: `virtual void Boundary1D::setSpreadRate(double)`
363 *
364 * @param handle Handle to queried Boundary1D object.
365 * @param V0 Undocumented.
366 */
367 int32_t bdry_setSpreadRate(int32_t handle, double V0);
368
369 /**
370 * Set the mole fractions by specifying a string.
371 *
372 * Wraps C++ setter: `virtual void Boundary1D::setMoleFractions(const string&)`
373 *
374 * @param handle Handle to queried Boundary1D object.
375 * @param xin Undocumented.
376 */
377 int32_t bdry_setMoleFractions(int32_t handle, const char* xin);
378
379 /**
380 * The total mass flow rate [kg/m2/s].
381 *
382 * Wraps C++ getter: `virtual double Boundary1D::mdot()`
383 *
384 * @param handle Handle to queried Boundary1D object.
385 */
386 double bdry_mdot(int32_t handle);
387
388 /**
389 * Temperature [K].
390 *
391 * Wraps C++ getter: `virtual double Boundary1D::temperature()`
392 *
393 * @param handle Handle to queried Boundary1D object.
394 */
395 double bdry_temperature(int32_t handle);
396
397 /**
398 * Tangential velocity gradient [1/s] at this boundary.
399 *
400 * Wraps C++ getter: `virtual double Boundary1D::spreadRate()`
401 *
402 * @param handle Handle to queried Boundary1D object.
403 */
404 double bdry_spreadRate(int32_t handle);
405
406 /**
407 * Mass fraction of species k.
408 *
409 * Wraps C++ method: `virtual double Boundary1D::massFraction(size_t)`
410 *
411 * @param handle Handle to queried Boundary1D object.
412 * @param k Undocumented.
413 */
414 double bdry_massFraction(int32_t handle, int32_t k);
415
416 /**
417 * Set transport model to existing instance.
418 *
419 * Wraps C++ setter: `virtual void Domain1D::setTransport(shared_ptr<Transport>)`
420 *
421 * @param handle Handle to queried Domain1D object.
422 * @param trans Integer handle to Transport object. Undocumented.
423 */
424 int32_t domain_setTransport(int32_t handle, int32_t trans);
425
426 /**
427 * Enable thermal diffusion, also known as Soret diffusion.
428 *
429 * Wraps C++ setter: `void Flow1D::enableSoret(bool)`
430 *
431 * @param handle Handle to queried Flow1D object.
432 * @param withSoret Undocumented.
433 */
434 int32_t flow_enableSoret(int32_t handle, int32_t withSoret);
435
436 /**
437 * Set the pressure.
438 *
439 * Wraps C++ setter: `void Flow1D::setPressure(double)`
440 *
441 * @param handle Handle to queried Flow1D object.
442 * @param p Undocumented.
443 */
444 int32_t flow_setPressure(int32_t handle, double p);
445
446 /**
447 * The current pressure [Pa].
448 *
449 * Wraps C++ getter: `double Flow1D::pressure()`
450 *
451 * @param handle Handle to queried Flow1D object.
452 */
453 double flow_pressure(int32_t handle);
454
455 /**
456 * Sometimes it is desired to carry out the simulation using a specified temperature profile, rather than computing it by solving the energy equation.
457 *
458 * Wraps C++ method: `void Flow1D::setFixedTempProfile(vector<double>&, vector<double>&)`
459 *
460 * @param handle Handle to queried Flow1D object.
461 * @param[in] zfixedLen Length of vector reserved for zfixed.
462 * @param zfixed Undocumented.
463 * @param[in] tfixedLen Length of vector reserved for tfixed.
464 * @param tfixed Undocumented.
465 */
466 int32_t flow_setFixedTempProfile(int32_t handle, int32_t zfixedLen, double* zfixed, int32_t tfixedLen, double* tfixed);
467
468 /**
469 * Specify that the energy equation should be solved at point `j`.
470 *
471 * Wraps C++ setter: `void Flow1D::solveEnergyEqn(size_t)`
472 *
473 * @param handle Handle to queried Flow1D object.
474 * @param j Point at which to enable the energy equation. `npos` means all points.
475 */
476 int32_t flow_solveEnergyEqn(int32_t handle, int32_t j);
477
478 /**
479 * Set whether to solve the equations for the surface species coverages.
480 *
481 * Wraps C++ setter: `void ReactingSurf1D::enableCoverageEquations(bool)`
482 *
483 * @param handle Handle to queried ReactingSurf1D object.
484 * @param docov Undocumented.
485 */
486 int32_t reactingsurf_enableCoverageEquations(int32_t handle, int32_t docov);
487
488 /**
489 * Delete Domain1D object.
490 *
491 * Wraps C++ destructor: `undefined`
492 *
493 * @param handle Handle to Domain1D object.
494 * @returns Zero for success and -1 for exception handling.
495 */
496 int32_t domain_del(int32_t handle);
497
498 /**
499 * Return size of Domain1D storage.
500 *
501 * Wraps C++ reserved CLib function: `custom code`
502 *
503 * @returns Size or -1 for exception handling.
504 */
505 int32_t domain_cabinetSize();
506
507 /**
508 * @}
509 */
510
511#ifdef __cplusplus
512}
513#endif
514
515#endif // CTDOMAIN_H
int32_t domain_cabinetSize()
Return size of Domain1D storage.
Definition ctdomain.cpp:514
double bdry_spreadRate(int32_t handle)
Tangential velocity gradient [1/s] at this boundary.
Definition ctdomain.cpp:403
double domain_rtol(int32_t handle, int32_t n)
Relative tolerance of the nth component.
Definition ctdomain.cpp:271
double domain_atol(int32_t handle, int32_t n)
Absolute tolerance of the nth component.
Definition ctdomain.cpp:281
int32_t domain_setupUniformGrid(int32_t handle, int32_t points, double length, double start)
Set up uniform grid.
Definition ctdomain.cpp:303
double bdry_temperature(int32_t handle)
Temperature [K].
Definition ctdomain.cpp:393
int32_t domain_grid(int32_t handle, int32_t bufLen, double *buf)
Access the array of grid coordinates [m].
Definition ctdomain.cpp:325
int32_t domain_componentName(int32_t handle, int32_t n, int32_t bufLen, char *buf)
Name of component n.
Definition ctdomain.cpp:115
int32_t domain_setProfile(int32_t handle, const char *component, int32_t posLen, const double *pos, int32_t valuesLen, const double *values)
Specify a profile for a component.
Definition ctdomain.cpp:194
int32_t flow_enableSoret(int32_t handle, int32_t withSoret)
Enable thermal diffusion, also known as Soret diffusion.
Definition ctdomain.cpp:434
double domain_value(int32_t handle, const char *component)
Set a single component value at a boundary.
Definition ctdomain.cpp:137
int32_t flow_solveEnergyEqn(int32_t handle, int32_t j)
Specify that the energy equation should be solved at point j.
Definition ctdomain.cpp:480
int32_t domain_setID(int32_t handle, const char *s)
Specify an identifying tag for this domain.
Definition ctdomain.cpp:314
int32_t domain_nPoints(int32_t handle)
Number of grid points in this domain.
Definition ctdomain.cpp:105
double domain_upperBound(int32_t handle, int32_t n)
Upper bound on the nth component.
Definition ctdomain.cpp:239
int32_t domain_setTransientTolerances(int32_t handle, double rtol, double atol, int32_t n)
Set tolerances for time-stepping mode.
Definition ctdomain.cpp:260
int32_t domain_setValues(int32_t handle, const char *component, int32_t valuesLen, const double *values)
Specify component values.
Definition ctdomain.cpp:170
int32_t bdry_setSpreadRate(int32_t handle, double V0)
Set tangential velocity gradient [1/s] at this boundary.
Definition ctdomain.cpp:361
int32_t flow_setFixedTempProfile(int32_t handle, int32_t zfixedLen, double *zfixed, int32_t tfixedLen, double *tfixed)
Sometimes it is desired to carry out the simulation using a specified temperature profile,...
Definition ctdomain.cpp:467
int32_t domain_residuals(int32_t handle, const char *component, int32_t bufLen, double *buf)
Retrieve internal work array values for a component.
Definition ctdomain.cpp:182
double bdry_mdot(int32_t handle)
The total mass flow rate [kg/m2/s].
Definition ctdomain.cpp:383
int32_t domain_setupGrid(int32_t handle, int32_t gridLen, const double *grid)
Set up initial grid.
Definition ctdomain.cpp:291
int32_t domain_del(int32_t handle)
Delete Domain1D object.
Definition ctdomain.cpp:503
int32_t domain_setValue(int32_t handle, const char *component, double value)
Set a single component value in a flow domain or at a boundary.
Definition ctdomain.cpp:147
int32_t domain_newBoundary1D(const char *domainType, int32_t solution, const char *id)
Create a Boundary1D object of the specified type.
Definition ctdomain.cpp:63
int32_t domain_nComponents(int32_t handle)
Number of components at each grid point.
Definition ctdomain.cpp:95
double bdry_massFraction(int32_t handle, int32_t k)
Mass fraction of species k.
Definition ctdomain.cpp:413
int32_t reactingsurf_enableCoverageEquations(int32_t handle, int32_t docov)
Set whether to solve the equations for the surface species coverages.
Definition ctdomain.cpp:491
int32_t domain_index(int32_t handle, int32_t n, int32_t j)
Returns the index of the solution vector, which corresponds to component n at grid point j.
Definition ctdomain.cpp:85
int32_t bdry_setTemperature(int32_t handle, double t)
Set the temperature.
Definition ctdomain.cpp:350
double domain_lowerBound(int32_t handle, int32_t n)
Lower bound on the nth component.
Definition ctdomain.cpp:229
int32_t domain_setTransport(int32_t handle, int32_t trans)
Set transport model to existing instance.
Definition ctdomain.cpp:423
int32_t domain_type(int32_t handle, int32_t bufLen, char *buf)
String indicating the domain implemented.
Definition ctdomain.cpp:73
int32_t domain_values(int32_t handle, const char *component, int32_t bufLen, double *buf)
Retrieve component values.
Definition ctdomain.cpp:158
int32_t flow_setPressure(int32_t handle, double p)
Set the pressure.
Definition ctdomain.cpp:446
int32_t bdry_setMoleFractions(int32_t handle, const char *xin)
Set the mole fractions by specifying a string.
Definition ctdomain.cpp:372
int32_t domain_newFlow1D(const char *domainType, int32_t solution, const char *id)
Create a Flow1D object of the specified type.
Definition ctdomain.cpp:53
int32_t domain_setSteadyTolerances(int32_t handle, double rtol, double atol, int32_t n)
Set tolerances for steady-state mode.
Definition ctdomain.cpp:249
double flow_pressure(int32_t handle)
The current pressure [Pa].
Definition ctdomain.cpp:457
int32_t bdry_setMdot(int32_t handle, double mdot)
Set the total mass flow rate [kg/m²/s].
Definition ctdomain.cpp:339
int32_t domain_componentIndex(int32_t handle, const char *name)
Index of component with name name.
Definition ctdomain.cpp:127
int32_t domain_setFlatProfile(int32_t handle, const char *component, double value)
Specify a flat profile for a component.
Definition ctdomain.cpp:207
int32_t domain_setBounds(int32_t handle, int32_t n, double lower, double upper)
Set the upper and lower bounds for a solution component, n.
Definition ctdomain.cpp:218