Cantera  3.2.0a2
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
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
126 *
127 * Wraps C++ method: `virtual size_t Domain1D::componentIndex(const string&)`
128 *
129 * @param handle Handle to queried Domain1D object.
130 * @param name Undocumented.
131 */
132 int32_t domain_componentIndex(int32_t handle, const char* name);
133
134 /**
135 * Set the upper and lower bounds for a solution component, n.
136 *
137 * Wraps C++ method: `void Domain1D::setBounds(size_t, double, double)`
138 *
139 * @param handle Handle to queried Domain1D object.
140 * @param n solution component index
141 * @param lower lower bound on component n
142 * @param upper upper bound on component n
143 */
144 int32_t domain_setBounds(int32_t handle, int32_t n, double lower, double upper);
145
146 /**
147 * Lower bound on the nth component.
148 *
149 * Wraps C++ method: `double Domain1D::lowerBound(size_t)`
150 *
151 * @param handle Handle to queried Domain1D object.
152 * @param n Undocumented.
153 */
154 double domain_lowerBound(int32_t handle, int32_t n);
155
156 /**
157 * Upper bound on the nth component.
158 *
159 * Wraps C++ method: `double Domain1D::upperBound(size_t)`
160 *
161 * @param handle Handle to queried Domain1D object.
162 * @param n Undocumented.
163 */
164 double domain_upperBound(int32_t handle, int32_t n);
165
166 /**
167 * Set tolerances for steady-state mode.
168 *
169 * Wraps C++ method: `void Domain1D::setSteadyTolerances(double, double, size_t)`
170 *
171 * @param handle Handle to queried Domain1D object.
172 * @param rtol Relative tolerance
173 * @param atol Absolute tolerance
174 * @param n component index these tolerances apply to. If set to -1 (the default), these tolerances will be applied to all solution components.
175 */
176 int32_t domain_setSteadyTolerances(int32_t handle, double rtol, double atol, int32_t n);
177
178 /**
179 * Set tolerances for time-stepping mode.
180 *
181 * Wraps C++ method: `void Domain1D::setTransientTolerances(double, double, size_t)`
182 *
183 * @param handle Handle to queried Domain1D object.
184 * @param rtol Relative tolerance
185 * @param atol Absolute tolerance
186 * @param n component index these tolerances apply to. If set to -1 (the default), these tolerances will be applied to all solution components.
187 */
188 int32_t domain_setTransientTolerances(int32_t handle, double rtol, double atol, int32_t n);
189
190 /**
191 * Relative tolerance of the nth component.
192 *
193 * Wraps C++ method: `double Domain1D::rtol(size_t)`
194 *
195 * @param handle Handle to queried Domain1D object.
196 * @param n Undocumented.
197 */
198 double domain_rtol(int32_t handle, int32_t n);
199
200 /**
201 * Absolute tolerance of the nth component.
202 *
203 * Wraps C++ method: `double Domain1D::atol(size_t)`
204 *
205 * @param handle Handle to queried Domain1D object.
206 * @param n Undocumented.
207 */
208 double domain_atol(int32_t handle, int32_t n);
209
210 /**
211 * Set up initial grid.
212 *
213 * Wraps C++ setter: `void Domain1D::setupGrid(const vector<double>&)`
214 *
215 * @param handle Handle to queried Domain1D object.
216 * @param[in] gridLen Length of vector reserved for grid.
217 * @param grid Undocumented.
218 */
219 int32_t domain_setupGrid(int32_t handle, int32_t gridLen, const double* grid);
220
221 /**
222 * Set up uniform grid.
223 *
224 * Wraps C++ method: `void Domain1D::setupUniformGrid(size_t, double, double)`
225 *
226 * @param handle Handle to queried Domain1D object.
227 * @param points Number of grid points
228 * @param length Length of domain
229 * @param start Start position of domain (default=0.)
230 */
231 int32_t domain_setupUniformGrid(int32_t handle, int32_t points, double length, double start);
232
233 /**
234 * Specify an identifying tag for this domain.
235 *
236 * Wraps C++ setter: `void Domain1D::setID(const string&)`
237 *
238 * @param handle Handle to queried Domain1D object.
239 * @param s Undocumented.
240 */
241 int32_t domain_setID(int32_t handle, const char* s);
242
243 /**
244 * Access the array of grid coordinates [m].
245 *
246 * Wraps C++ getter: `vector<double>& Domain1D::grid()`
247 *
248 * @param handle Handle to queried Domain1D object.
249 * @param[in] bufLen Length of reserved array.
250 * @param[out] buf Returned array value.
251 * @returns Actual length of value array or -1 for exception handling.
252 */
253 int32_t domain_grid(int32_t handle, int32_t bufLen, double* buf);
254
255 /**
256 * Set the total mass flow rate [kg/m²/s].
257 *
258 * Wraps C++ setter: `virtual void Boundary1D::setMdot(double)`
259 *
260 * @param handle Handle to queried Boundary1D object.
261 * @param mdot Undocumented.
262 */
263 int32_t bdry_setMdot(int32_t handle, double mdot);
264
265 /**
266 * Set the temperature.
267 *
268 * Wraps C++ setter: `virtual void Boundary1D::setTemperature(double)`
269 *
270 * @param handle Handle to queried Boundary1D object.
271 * @param t Undocumented.
272 */
273 int32_t bdry_setTemperature(int32_t handle, double t);
274
275 /**
276 * Set tangential velocity gradient [1/s] at this boundary.
277 *
278 * Wraps C++ setter: `virtual void Boundary1D::setSpreadRate(double)`
279 *
280 * @param handle Handle to queried Boundary1D object.
281 * @param V0 Undocumented.
282 */
283 int32_t bdry_setSpreadRate(int32_t handle, double V0);
284
285 /**
286 * Set the mole fractions by specifying a string.
287 *
288 * Wraps C++ setter: `virtual void Boundary1D::setMoleFractions(const string&)`
289 *
290 * @param handle Handle to queried Boundary1D object.
291 * @param xin Undocumented.
292 */
293 int32_t bdry_setMoleFractions(int32_t handle, const char* xin);
294
295 /**
296 * The total mass flow rate [kg/m2/s].
297 *
298 * Wraps C++ getter: `virtual double Boundary1D::mdot()`
299 *
300 * @param handle Handle to queried Boundary1D object.
301 */
302 double bdry_mdot(int32_t handle);
303
304 /**
305 * Temperature [K].
306 *
307 * Wraps C++ getter: `virtual double Boundary1D::temperature()`
308 *
309 * @param handle Handle to queried Boundary1D object.
310 */
311 double bdry_temperature(int32_t handle);
312
313 /**
314 * Tangential velocity gradient [1/s] at this boundary.
315 *
316 * Wraps C++ getter: `virtual double Boundary1D::spreadRate()`
317 *
318 * @param handle Handle to queried Boundary1D object.
319 */
320 double bdry_spreadRate(int32_t handle);
321
322 /**
323 * Mass fraction of species k.
324 *
325 * Wraps C++ method: `virtual double Boundary1D::massFraction(size_t)`
326 *
327 * @param handle Handle to queried Boundary1D object.
328 * @param k Undocumented.
329 */
330 double bdry_massFraction(int32_t handle, int32_t k);
331
332 /**
333 * Set transport model to existing instance.
334 *
335 * Wraps C++ setter: `virtual void Domain1D::setTransport(shared_ptr<Transport>)`
336 *
337 * @param handle Handle to queried Domain1D object.
338 * @param trans Integer handle to Transport object. Undocumented.
339 */
340 int32_t domain_setTransport(int32_t handle, int32_t trans);
341
342 /**
343 * Enable thermal diffusion, also known as Soret diffusion.
344 *
345 * Wraps C++ setter: `void Flow1D::enableSoret(bool)`
346 *
347 * @param handle Handle to queried Flow1D object.
348 * @param withSoret Undocumented.
349 */
350 int32_t flow_enableSoret(int32_t handle, int32_t withSoret);
351
352 /**
353 * Set the pressure.
354 *
355 * Wraps C++ setter: `void Flow1D::setPressure(double)`
356 *
357 * @param handle Handle to queried Flow1D object.
358 * @param p Undocumented.
359 */
360 int32_t flow_setPressure(int32_t handle, double p);
361
362 /**
363 * The current pressure [Pa].
364 *
365 * Wraps C++ getter: `double Flow1D::pressure()`
366 *
367 * @param handle Handle to queried Flow1D object.
368 */
369 double flow_pressure(int32_t handle);
370
371 /**
372 * Sometimes it is desired to carry out the simulation using a specified temperature profile, rather than computing it by solving the energy equation.
373 *
374 * Wraps C++ method: `void Flow1D::setFixedTempProfile(vector<double>&, vector<double>&)`
375 *
376 * @param handle Handle to queried Flow1D object.
377 * @param[in] zfixedLen Length of vector reserved for zfixed.
378 * @param zfixed Undocumented.
379 * @param[in] tfixedLen Length of vector reserved for tfixed.
380 * @param tfixed Undocumented.
381 */
382 int32_t flow_setFixedTempProfile(int32_t handle, int32_t zfixedLen, double* zfixed, int32_t tfixedLen, double* tfixed);
383
384 /**
385 * Specify that the energy equation should be solved at point
386 *
387 * Wraps C++ setter: `void Flow1D::solveEnergyEqn(size_t)`
388 *
389 * @param handle Handle to queried Flow1D object.
390 * @param j Point at which to enable the energy equation.
391 */
392 int32_t flow_solveEnergyEqn(int32_t handle, int32_t j);
393
394 /**
395 * Set whether to solve the equations for the surface species coverages.
396 *
397 * Wraps C++ setter: `void ReactingSurf1D::enableCoverageEquations(bool)`
398 *
399 * @param handle Handle to queried ReactingSurf1D object.
400 * @param docov Undocumented.
401 */
402 int32_t reactingsurf_enableCoverageEquations(int32_t handle, int32_t docov);
403
404 /**
405 * Delete Domain1D object.
406 *
407 * Wraps C++ destructor: `undefined`
408 *
409 * @param handle Handle to Domain1D object.
410 * @returns Zero for success and -1 for exception handling.
411 */
412 int32_t domain_del(int32_t handle);
413
414 /**
415 * Return size of Domain1D storage.
416 *
417 * Wraps C++ reserved CLib function: `custom code`
418 *
419 * @returns Size or -1 for exception handling.
420 */
421 int32_t domain_cabinetSize();
422
423 /**
424 * Return handle to parent of Domain1D object.
425 *
426 * Wraps C++ reserved CLib function: `custom code`
427 *
428 * @param handle Handle to queried Domain1D object.
429 * @returns Parent handle or -1 for exception handling.
430 */
431 int32_t domain_parentHandle(int32_t handle);
432
433 /**
434 * @}
435 */
436
437#ifdef __cplusplus
438}
439#endif
440
441#endif // CTDOMAIN_H
int32_t domain_cabinetSize()
Return size of Domain1D storage.
Definition ctdomain.cpp:433
double bdry_spreadRate(int32_t handle)
Tangential velocity gradient [1/s] at this boundary.
Definition ctdomain.cpp:322
double domain_rtol(int32_t handle, int32_t n)
Relative tolerance of the nth component.
Definition ctdomain.cpp:190
double domain_atol(int32_t handle, int32_t n)
Absolute tolerance of the nth component.
Definition ctdomain.cpp:200
int32_t domain_setupUniformGrid(int32_t handle, int32_t points, double length, double start)
Set up uniform grid.
Definition ctdomain.cpp:222
double bdry_temperature(int32_t handle)
Temperature [K].
Definition ctdomain.cpp:312
int32_t domain_grid(int32_t handle, int32_t bufLen, double *buf)
Access the array of grid coordinates [m].
Definition ctdomain.cpp:244
int32_t domain_componentName(int32_t handle, int32_t n, int32_t bufLen, char *buf)
Name of component.
Definition ctdomain.cpp:115
int32_t flow_enableSoret(int32_t handle, int32_t withSoret)
Enable thermal diffusion, also known as Soret diffusion.
Definition ctdomain.cpp:353
int32_t flow_solveEnergyEqn(int32_t handle, int32_t j)
Specify that the energy equation should be solved at point.
Definition ctdomain.cpp:399
int32_t domain_setID(int32_t handle, const char *s)
Specify an identifying tag for this domain.
Definition ctdomain.cpp:233
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:158
int32_t domain_setTransientTolerances(int32_t handle, double rtol, double atol, int32_t n)
Set tolerances for time-stepping mode.
Definition ctdomain.cpp:179
int32_t bdry_setSpreadRate(int32_t handle, double V0)
Set tangential velocity gradient [1/s] at this boundary.
Definition ctdomain.cpp:280
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:386
double bdry_mdot(int32_t handle)
The total mass flow rate [kg/m2/s].
Definition ctdomain.cpp:302
int32_t domain_setupGrid(int32_t handle, int32_t gridLen, const double *grid)
Set up initial grid.
Definition ctdomain.cpp:210
int32_t domain_del(int32_t handle)
Delete Domain1D object.
Definition ctdomain.cpp:422
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:332
int32_t domain_parentHandle(int32_t handle)
Return handle to parent of Domain1D object.
Definition ctdomain.cpp:445
int32_t reactingsurf_enableCoverageEquations(int32_t handle, int32_t docov)
Set whether to solve the equations for the surface species coverages.
Definition ctdomain.cpp:410
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:269
double domain_lowerBound(int32_t handle, int32_t n)
Lower bound on the nth component.
Definition ctdomain.cpp:148
int32_t domain_setTransport(int32_t handle, int32_t trans)
Set transport model to existing instance.
Definition ctdomain.cpp:342
int32_t domain_type(int32_t handle, int32_t bufLen, char *buf)
String indicating the domain implemented.
Definition ctdomain.cpp:73
int32_t flow_setPressure(int32_t handle, double p)
Set the pressure.
Definition ctdomain.cpp:365
int32_t bdry_setMoleFractions(int32_t handle, const char *xin)
Set the mole fractions by specifying a string.
Definition ctdomain.cpp:291
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:168
double flow_pressure(int32_t handle)
The current pressure [Pa].
Definition ctdomain.cpp:376
int32_t bdry_setMdot(int32_t handle, double mdot)
Set the total mass flow rate [kg/m²/s].
Definition ctdomain.cpp:258
int32_t domain_componentIndex(int32_t handle, const char *name)
index of component with name
Definition ctdomain.cpp:127
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:137