Cantera
Loading...
Searching...
No Matches
ctthermo.h
Go to the documentation of this file.
1/**
2 * CTTHERMO - Generated CLib %Cantera interface library.
3 *
4 * @file ctthermo.h
5 *
6 * Generated CLib API for %Cantera's ThermoPhase 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 CTTHERMO_H
25#define CTTHERMO_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 CAPIctthermo ctthermo Library
35 * Generated CLib API for %Cantera's ThermoPhase 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 CAPIctthermo
45 * @{
46 */
47
48 /**
49 * Return the name of the phase.
50 *
51 * Wraps C++ getter: `string Phase::name()`
52 *
53 * @param handle Handle to queried Phase object.
54 * @param[in] bufLen Length of reserved array.
55 * @param[out] buf Returned string value.
56 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
57 */
58 int32_t thermo_name(int32_t handle, int32_t bufLen, char* buf);
59
60 /**
61 * Sets the string name for the phase.
62 *
63 * Wraps C++ setter: `void Phase::setName(const string&)`
64 *
65 * @param handle Handle to queried Phase object.
66 * @param nm String name of the phase
67 */
68 int32_t thermo_setName(int32_t handle, const char* nm);
69
70 /**
71 * String indicating the thermodynamic model implemented.
72 *
73 * Wraps C++ getter: `string ThermoPhase::type()`
74 *
75 * @param handle Handle to queried ThermoPhase 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 thermo_type(int32_t handle, int32_t bufLen, char* buf);
81
82 /**
83 * Number of elements.
84 *
85 * Wraps C++ getter: `size_t Phase::nElements()`
86 *
87 * @param handle Handle to queried Phase object.
88 */
89 int32_t thermo_nElements(int32_t handle);
90
91 /**
92 * Returns the number of species in the phase.
93 *
94 * Wraps C++ getter: `size_t Phase::nSpecies()`
95 *
96 * @param handle Handle to queried Phase object.
97 */
98 int32_t thermo_nSpecies(int32_t handle);
99
100 /**
101 * Temperature (K).
102 *
103 * Wraps C++ getter: `double Phase::temperature()`
104 *
105 * @param handle Handle to queried Phase object.
106 */
107 double thermo_temperature(int32_t handle);
108
109 /**
110 * Set the internally stored temperature of the phase (K).
111 *
112 * Wraps C++ setter: `virtual void Phase::setTemperature(double)`
113 *
114 * @param handle Handle to queried Phase object.
115 * @param temp Temperature in Kelvin
116 */
117 int32_t thermo_setTemperature(int32_t handle, double temp);
118
119 /**
120 * Return the thermodynamic pressure (Pa).
121 *
122 * Wraps C++ getter: `virtual double Phase::pressure()`
123 *
124 * @param handle Handle to queried Phase object.
125 */
126 double thermo_pressure(int32_t handle);
127
128 /**
129 * Set the internally stored pressure (Pa) at constant temperature and composition.
130 *
131 * Wraps C++ setter: `virtual void Phase::setPressure(double)`
132 *
133 * @param handle Handle to queried Phase object.
134 * @param p input Pressure (Pa)
135 */
136 int32_t thermo_setPressure(int32_t handle, double p);
137
138 /**
139 * Density (kg/m^3).
140 *
141 * Wraps C++ getter: `virtual double Phase::density()`
142 *
143 * @param handle Handle to queried Phase object.
144 */
145 double thermo_density(int32_t handle);
146
147 /**
148 * Set the internally stored density (kg/m^3) of the phase.
149 *
150 * Wraps C++ setter: `virtual void Phase::setDensity(const double)`
151 *
152 * @param handle Handle to queried Phase object.
153 * @param[in] density_ density (kg/m^3).
154 */
155 int32_t thermo_setDensity(int32_t handle, const double density_);
156
157 /**
158 * Molar density (kmol/m^3).
159 *
160 * Wraps C++ getter: `virtual double Phase::molarDensity()`
161 *
162 * @param handle Handle to queried Phase object.
163 */
164 double thermo_molarDensity(int32_t handle);
165
166 /**
167 * The mean molecular weight. Units: (kg/kmol).
168 *
169 * Wraps C++ getter: `double Phase::meanMolecularWeight()`
170 *
171 * @param handle Handle to queried Phase object.
172 */
173 double thermo_meanMolecularWeight(int32_t handle);
174
175 /**
176 * Return the mole fraction of a single species.
177 *
178 * Wraps C++ method: `double Phase::moleFraction(size_t)`
179 *
180 * @param handle Handle to queried Phase object.
181 * @param k species index
182 */
183 double thermo_moleFraction(int32_t handle, int32_t k);
184
185 /**
186 * Return the mass fraction of a single species.
187 *
188 * Wraps C++ method: `double Phase::massFraction(size_t)`
189 *
190 * @param handle Handle to queried Phase object.
191 * @param k species index
192 */
193 double thermo_massFraction(int32_t handle, int32_t k);
194
195 /**
196 * Get the species mole fraction vector.
197 *
198 * Wraps C++ getter: `void Phase::getMoleFractions(span<double>)`
199 *
200 * Uses:
201 * - `size_t Phase::nSpecies()`
202 *
203 * @param handle Handle to queried Phase object.
204 * @param[in] xLen Length of vector reserved for x.
205 * @param x On return, x contains the mole fractions. Must have a size greater than or equal to the number of species.
206 */
207 int32_t thermo_getMoleFractions(int32_t handle, int32_t xLen, double* x);
208
209 /**
210 * Get the species mass fractions.
211 *
212 * Wraps C++ getter: `void Phase::getMassFractions(span<double>)`
213 *
214 * Uses:
215 * - `size_t Phase::nSpecies()`
216 *
217 * @param handle Handle to queried Phase object.
218 * @param[in] yLen Length of vector reserved for y.
219 * @param[out] y Array of mass fractions, length nSpecies()
220 */
221 int32_t thermo_getMassFractions(int32_t handle, int32_t yLen, double* y);
222
223 /**
224 * Set the mole fractions to the specified values.
225 *
226 * Wraps C++ setter: `virtual void Phase::setMoleFractions(span<const double>)`
227 *
228 * Uses:
229 * - `size_t Phase::nSpecies()`
230 *
231 * @param handle Handle to queried Phase object.
232 * @param[in] xLen Length of vector reserved for x.
233 * @param x Array of unnormalized mole fraction values (input). Must have a size greater than or equal to the number of species, m_kk.
234 */
235 int32_t thermo_setMoleFractions(int32_t handle, int32_t xLen, const double* x);
236
237 /**
238 * Set the mass fractions to the specified values and normalize them.
239 *
240 * Wraps C++ setter: `virtual void Phase::setMassFractions(span<const double>)`
241 *
242 * Uses:
243 * - `size_t Phase::nSpecies()`
244 *
245 * @param handle Handle to queried Phase object.
246 * @param[in] yLen Length of vector reserved for y.
247 * @param[in] y Array of unnormalized mass fraction values. Length must be greater than or equal to the number of species. The Phase object will normalize this vector before storing its contents.
248 */
249 int32_t thermo_setMassFractions(int32_t handle, int32_t yLen, const double* y);
250
251 /**
252 * Set the mole fractions of a group of species by name.
253 *
254 * Wraps C++ setter: `void Phase::setMoleFractionsByName(const string&)`
255 *
256 * @param handle Handle to queried Phase object.
257 * @param x string x in the form of a composition map
258 */
259 int32_t thermo_setMoleFractionsByName(int32_t handle, const char* x);
260
261 /**
262 * Set the species mass fractions by name.
263 *
264 * Wraps C++ setter: `void Phase::setMassFractionsByName(const string&)`
265 *
266 * @param handle Handle to queried Phase object.
267 * @param x String containing a composition map
268 */
269 int32_t thermo_setMassFractionsByName(int32_t handle, const char* x);
270
271 /**
272 * Return a read-only reference to the vector of atomic weights.
273 *
274 * Wraps C++ getter: `span<const double> Phase::atomicWeights()`
275 *
276 * Uses:
277 * - `size_t Phase::nElements()`
278 *
279 * @param handle Handle to queried Phase object.
280 * @param[in] bufLen Length of reserved array.
281 * @param[out] buf Returned array value.
282 * @returns Actual length of value array or -1 for exception handling.
283 */
284 int32_t thermo_atomicWeights(int32_t handle, int32_t bufLen, double* buf);
285
286 /**
287 * Atomic weight of element m.
288 *
289 * Wraps C++ method: `double Phase::atomicWeight(size_t)`
290 *
291 * @param handle Handle to queried Phase object.
292 * @param m Element index
293 */
294 double thermo_atomicWeight(int32_t handle, int32_t m);
295
296 /**
297 * Elemental mass fraction of element m.
298 *
299 * Wraps C++ method: `double Phase::elementalMassFraction(const size_t)`
300 *
301 * @param handle Handle to queried Phase object.
302 * @param[in] m Index of the element within the phase. If m is outside the valid range, an exception will be thrown.
303 */
304 double thermo_elementalMassFraction(int32_t handle, const int32_t m);
305
306 /**
307 * Elemental mole fraction of element m.
308 *
309 * Wraps C++ method: `double Phase::elementalMoleFraction(const size_t)`
310 *
311 * @param handle Handle to queried Phase object.
312 * @param[in] m Index of the element within the phase. If m is outside the valid range, an exception will be thrown.
313 */
314 double thermo_elementalMoleFraction(int32_t handle, const int32_t m);
315
316 /**
317 * Copy the vector of molecular weights into array weights.
318 *
319 * Wraps C++ getter: `void Phase::getMolecularWeights(span<double>)`
320 *
321 * Uses:
322 * - `size_t Phase::nSpecies()`
323 *
324 * @param handle Handle to queried Phase object.
325 * @param[in] weightsLen Length of vector reserved for weights.
326 * @param weights Output array of molecular weights (kg/kmol)
327 */
328 int32_t thermo_getMolecularWeights(int32_t handle, int32_t weightsLen, double* weights);
329
330 /**
331 * Copy the vector of species charges into array charges.
332 *
333 * Wraps C++ getter: `void Phase::getCharges(span<double>)`
334 *
335 * Uses:
336 * - `size_t Phase::nElements()`
337 *
338 * @param handle Handle to queried Phase object.
339 * @param[in] chargesLen Length of vector reserved for charges.
340 * @param charges Output array of species charges (elem. charge)
341 */
342 int32_t thermo_getCharges(int32_t handle, int32_t chargesLen, double* charges);
343
344 /**
345 * Name of the element with index m.
346 *
347 * Wraps C++ method: `string Phase::elementName(size_t)`
348 *
349 * @param handle Handle to queried Phase object.
350 * @param m Element index.
351 * @param[in] bufLen Length of reserved array.
352 * @param[out] buf Returned string value.
353 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
354 */
355 int32_t thermo_elementName(int32_t handle, int32_t m, int32_t bufLen, char* buf);
356
357 /**
358 * Name of the species with index k.
359 *
360 * Wraps C++ method: `string Phase::speciesName(size_t)`
361 *
362 * @param handle Handle to queried Phase object.
363 * @param k index of the species
364 * @param[in] bufLen Length of reserved array.
365 * @param[out] buf Returned string value.
366 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
367 */
368 int32_t thermo_speciesName(int32_t handle, int32_t k, int32_t bufLen, char* buf);
369
370 /**
371 * Return the index of element named 'name'.
372 *
373 * Wraps C++ method: `custom code`
374 *
375 * Uses:
376 * - ` elementIndex(const string&, bool)`
377 *
378 * @param handle Handle to queried Phase object.
379 * @param name Name of the element
380 */
381 int32_t thermo_elementIndex(int32_t handle, const char* name);
382
383 /**
384 * Returns the index of a species named 'name' within the Phase object.
385 *
386 * Wraps C++ method: `custom code`
387 *
388 * Uses:
389 * - ` speciesIndex(const string&, bool)`
390 *
391 * @param handle Handle to queried Phase object.
392 * @param name String name of the species. It may also be in the form phaseName:speciesName
393 */
394 int32_t thermo_speciesIndex(int32_t handle, const char* name);
395
396 /**
397 * Number of atoms of element `m` in species `k`.
398 *
399 * Wraps C++ method: `double Phase::nAtoms(size_t, size_t)`
400 *
401 * @param handle Handle to queried Phase object.
402 * @param k species index
403 * @param m element index
404 */
405 double thermo_nAtoms(int32_t handle, int32_t k, int32_t m);
406
407 /**
408 * Add an element.
409 *
410 * Wraps C++ method: `size_t Phase::addElement(const string&, double, int, double, int)`
411 *
412 * @param handle Handle to queried Phase object.
413 * @param symbol Atomic symbol string.
414 * @param weight Atomic mass in amu.
415 * @param atomicNumber Atomic number of the element (unitless)
416 * @param entropy298 Entropy of the element at 298 K and 1 bar in its most stable form. The default is the value ENTROPY298_UNKNOWN, which is interpreted as an unknown, and if used will cause Cantera to throw an error.
417 * @param elem_type Specifies the type of the element constraint equation. This defaults to CT_ELEM_TYPE_ABSPOS, that is, an element.
418 */
419 int32_t thermo_addElement(int32_t handle, const char* symbol, double weight, int32_t atomicNumber, double entropy298, int32_t elem_type);
420
421 /**
422 * Returns the reference pressure in Pa.
423 *
424 * Wraps C++ getter: `virtual double ThermoPhase::refPressure()`
425 *
426 * @param handle Handle to queried ThermoPhase object.
427 */
428 double thermo_refPressure(int32_t handle);
429
430 /**
431 * Minimum temperature for which the thermodynamic data for the species or phase are valid.
432 *
433 * Wraps C++ method: `virtual double ThermoPhase::minTemp(size_t)`
434 *
435 * @param handle Handle to queried ThermoPhase object.
436 * @param k index of the species. Default is -1, which will return the max of the min value over all species.
437 */
438 double thermo_minTemp(int32_t handle, int32_t k);
439
440 /**
441 * Maximum temperature for which the thermodynamic data for the species are valid.
442 *
443 * Wraps C++ method: `virtual double ThermoPhase::maxTemp(size_t)`
444 *
445 * @param handle Handle to queried ThermoPhase object.
446 * @param k index of the species. Default is -1, which will return the min of the max value over all species.
447 */
448 double thermo_maxTemp(int32_t handle, int32_t k);
449
450 /**
451 * Molar enthalpy. Units: J/kmol.
452 *
453 * Wraps C++ getter: `virtual double ThermoPhase::enthalpy_mole()`
454 *
455 * @param handle Handle to queried ThermoPhase object.
456 */
457 double thermo_enthalpy_mole(int32_t handle);
458
459 /**
460 * Specific enthalpy. Units: J/kg.
461 *
462 * Wraps C++ getter: `double ThermoPhase::enthalpy_mass()`
463 *
464 * @param handle Handle to queried ThermoPhase object.
465 */
466 double thermo_enthalpy_mass(int32_t handle);
467
468 /**
469 * Molar entropy. Units: J/kmol/K.
470 *
471 * Wraps C++ getter: `virtual double ThermoPhase::entropy_mole()`
472 *
473 * @param handle Handle to queried ThermoPhase object.
474 */
475 double thermo_entropy_mole(int32_t handle);
476
477 /**
478 * Specific entropy. Units: J/kg/K.
479 *
480 * Wraps C++ getter: `double ThermoPhase::entropy_mass()`
481 *
482 * @param handle Handle to queried ThermoPhase object.
483 */
484 double thermo_entropy_mass(int32_t handle);
485
486 /**
487 * Molar internal energy. Units: J/kmol.
488 *
489 * Wraps C++ getter: `virtual double ThermoPhase::intEnergy_mole()`
490 *
491 * @param handle Handle to queried ThermoPhase object.
492 */
493 double thermo_intEnergy_mole(int32_t handle);
494
495 /**
496 * Specific internal energy. Units: J/kg.
497 *
498 * Wraps C++ getter: `double ThermoPhase::intEnergy_mass()`
499 *
500 * @param handle Handle to queried ThermoPhase object.
501 */
502 double thermo_intEnergy_mass(int32_t handle);
503
504 /**
505 * Molar Gibbs function. Units: J/kmol.
506 *
507 * Wraps C++ getter: `virtual double ThermoPhase::gibbs_mole()`
508 *
509 * @param handle Handle to queried ThermoPhase object.
510 */
511 double thermo_gibbs_mole(int32_t handle);
512
513 /**
514 * Specific Gibbs function. Units: J/kg.
515 *
516 * Wraps C++ getter: `double ThermoPhase::gibbs_mass()`
517 *
518 * @param handle Handle to queried ThermoPhase object.
519 */
520 double thermo_gibbs_mass(int32_t handle);
521
522 /**
523 * Molar heat capacity at constant pressure and composition [J/kmol/K].
524 *
525 * Wraps C++ getter: `virtual double ThermoPhase::cp_mole()`
526 *
527 * @param handle Handle to queried ThermoPhase object.
528 */
529 double thermo_cp_mole(int32_t handle);
530
531 /**
532 * Specific heat at constant pressure and composition [J/kg/K].
533 *
534 * Wraps C++ getter: `double ThermoPhase::cp_mass()`
535 *
536 * @param handle Handle to queried ThermoPhase object.
537 */
538 double thermo_cp_mass(int32_t handle);
539
540 /**
541 * Molar heat capacity at constant volume and composition [J/kmol/K].
542 *
543 * Wraps C++ getter: `virtual double ThermoPhase::cv_mole()`
544 *
545 * @param handle Handle to queried ThermoPhase object.
546 */
547 double thermo_cv_mole(int32_t handle);
548
549 /**
550 * Specific heat at constant volume and composition [J/kg/K].
551 *
552 * Wraps C++ getter: `double ThermoPhase::cv_mass()`
553 *
554 * @param handle Handle to queried ThermoPhase object.
555 */
556 double thermo_cv_mass(int32_t handle);
557
558 /**
559 * Get the species chemical potentials. Units: J/kmol.
560 *
561 * Wraps C++ getter: `virtual void ThermoPhase::getChemPotentials(span<double>)`
562 *
563 * @param handle Handle to queried ThermoPhase object.
564 * @param[in] muLen Length of vector reserved for mu.
565 * @param mu Output vector of species chemical potentials. Length: m_kk. Units: J/kmol
566 */
567 int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double* mu);
568
569 /**
570 * Get the species electrochemical potentials.
571 *
572 * Wraps C++ getter: `void ThermoPhase::getElectrochemPotentials(span<double>)`
573 *
574 * @param handle Handle to queried ThermoPhase object.
575 * @param[in] muLen Length of vector reserved for mu.
576 * @param mu Output vector of species electrochemical potentials. Length: m_kk. Units: J/kmol
577 */
578 int32_t thermo_getElectrochemPotentials(int32_t handle, int32_t muLen, double* mu);
579
580 /**
581 * Returns the electric potential of this phase (V).
582 *
583 * Wraps C++ getter: `double ThermoPhase::electricPotential()`
584 *
585 * @param handle Handle to queried ThermoPhase object.
586 */
587 double thermo_electricPotential(int32_t handle);
588
589 /**
590 * Set the electric potential of this phase (V).
591 *
592 * Wraps C++ setter: `void ThermoPhase::setElectricPotential(double)`
593 *
594 * @param handle Handle to queried ThermoPhase object.
595 * @param v Input value of the electric potential in Volts
596 */
597 int32_t thermo_setElectricPotential(int32_t handle, double v);
598
599 /**
600 * Return the volumetric thermal expansion coefficient. Units: 1/K.
601 *
602 * Wraps C++ getter: `virtual double ThermoPhase::thermalExpansionCoeff()`
603 *
604 * @param handle Handle to queried ThermoPhase object.
605 */
606 double thermo_thermalExpansionCoeff(int32_t handle);
607
608 /**
609 * Returns the isothermal compressibility. Units: 1/Pa.
610 *
611 * Wraps C++ getter: `virtual double ThermoPhase::isothermalCompressibility()`
612 *
613 * @param handle Handle to queried ThermoPhase object.
614 */
615 double thermo_isothermalCompressibility(int32_t handle);
616
617 /**
618 * Return the internal pressure [Pa].
619 *
620 * Wraps C++ getter: `virtual double ThermoPhase::internalPressure()`
621 *
622 * @param handle Handle to queried ThermoPhase object.
623 */
624 double thermo_internalPressure(int32_t handle);
625
626 /**
627 * Returns an array of partial molar enthalpies for the species in the mixture.
628 *
629 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarEnthalpies(span<double>)`
630 *
631 * @param handle Handle to queried ThermoPhase object.
632 * @param[in] hbarLen Length of vector reserved for hbar.
633 * @param hbar Output vector of species partial molar enthalpies. Length: m_kk. units are J/kmol.
634 */
635 int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double* hbar);
636
637 /**
638 * Returns an array of partial molar entropies of the species in the solution.
639 *
640 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarEntropies(span<double>)`
641 *
642 * @param handle Handle to queried ThermoPhase object.
643 * @param[in] sbarLen Length of vector reserved for sbar.
644 * @param sbar Output vector of species partial molar entropies. Length = m_kk. units are J/kmol/K.
645 */
646 int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double* sbar);
647
648 /**
649 * Return an array of partial molar internal energies for the species in the mixture.
650 *
651 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarIntEnergies(span<double>)`
652 *
653 * @param handle Handle to queried ThermoPhase object.
654 * @param[in] ubarLen Length of vector reserved for ubar.
655 * @param ubar Output vector of species partial molar internal energies. Length = m_kk. units are J/kmol.
656 */
657 int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double* ubar);
658
659 /**
660 * Return an array of partial molar internal energies at constant temperature and volume [J/kmol].
661 *
662 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarIntEnergies_TV(span<double>)`
663 *
664 * @param handle Handle to queried ThermoPhase object.
665 * @param[in] utildeLen Length of vector reserved for utilde.
666 * @param utilde Undocumented.
667 */
668 int32_t thermo_getPartialMolarIntEnergies_TV(int32_t handle, int32_t utildeLen, double* utilde);
669
670 /**
671 * Return an array of partial molar heat capacities for the species in the mixture.
672 *
673 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarCp(span<double>)`
674 *
675 * @param handle Handle to queried ThermoPhase object.
676 * @param[in] cpbarLen Length of vector reserved for cpbar.
677 * @param cpbar Output vector of species partial molar heat capacities at constant pressure. Length = m_kk. units are J/kmol/K.
678 */
679 int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double* cpbar);
680
681 /**
682 * Return an array of species molar heat capacities associated with the constant-volume partial molar internal energies [J/kmol/K].
683 *
684 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarCv_TV(span<double>)`
685 *
686 * @param handle Handle to queried ThermoPhase object.
687 * @param[in] cvtildeLen Length of vector reserved for cvtilde.
688 * @param cvtilde Undocumented.
689 */
690 int32_t thermo_getPartialMolarCv_TV(int32_t handle, int32_t cvtildeLen, double* cvtilde);
691
692 /**
693 * Return an array of partial molar volumes for the species in the mixture.
694 *
695 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarVolumes(span<double>)`
696 *
697 * @param handle Handle to queried ThermoPhase object.
698 * @param[in] vbarLen Length of vector reserved for vbar.
699 * @param vbar Output vector of species partial molar volumes. Length = m_kk. units are m^3/kmol.
700 */
701 int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double* vbar);
702
703 /**
704 * Get the nondimensional Enthalpy functions for the species at their standard states at the current *T* and *P* of the solution.
705 *
706 * Wraps C++ getter: `virtual void ThermoPhase::getEnthalpy_RT(span<double>)`
707 *
708 * @param handle Handle to queried ThermoPhase object.
709 * @param[in] hrtLen Length of vector reserved for hrt.
710 * @param hrt Output vector of nondimensional standard state enthalpies. Length: m_kk.
711 */
712 int32_t thermo_getEnthalpy_RT(int32_t handle, int32_t hrtLen, double* hrt);
713
714 /**
715 * Get the array of nondimensional Entropy functions for the standard state species at the current *T* and *P* of the solution.
716 *
717 * Wraps C++ getter: `virtual void ThermoPhase::getEntropy_R(span<double>)`
718 *
719 * @param handle Handle to queried ThermoPhase object.
720 * @param[in] srLen Length of vector reserved for sr.
721 * @param sr Output vector of nondimensional standard state entropies. Length: m_kk.
722 */
723 int32_t thermo_getEntropy_R(int32_t handle, int32_t srLen, double* sr);
724
725 /**
726 * Get the nondimensional Gibbs functions for the species in their standard states at the current *T* and *P* of the solution.
727 *
728 * Wraps C++ getter: `virtual void ThermoPhase::getGibbs_RT(span<double>)`
729 *
730 * @param handle Handle to queried ThermoPhase object.
731 * @param[in] grtLen Length of vector reserved for grt.
732 * @param grt Output vector of nondimensional standard state Gibbs free energies. Length: m_kk.
733 */
734 int32_t thermo_getGibbs_RT(int32_t handle, int32_t grtLen, double* grt);
735
736 /**
737 * Returns the vector of nondimensional Internal Energies of the standard state species at the current *T* and *P* of the solution.
738 *
739 * Wraps C++ getter: `virtual void ThermoPhase::getIntEnergy_RT(span<double>)`
740 *
741 * @param handle Handle to queried ThermoPhase object.
742 * @param[in] urtLen Length of vector reserved for urt.
743 * @param urt output vector of nondimensional standard state internal energies of the species. Length: m_kk.
744 */
745 int32_t thermo_getIntEnergy_RT(int32_t handle, int32_t urtLen, double* urt);
746
747 /**
748 * Get the nondimensional Heat Capacities at constant pressure for the species standard states at the current *T* and *P* of the solution.
749 *
750 * Wraps C++ getter: `virtual void ThermoPhase::getCp_R(span<double>)`
751 *
752 * @param handle Handle to queried ThermoPhase object.
753 * @param[in] cprLen Length of vector reserved for cpr.
754 * @param cpr Output vector of nondimensional standard state heat capacities. Length: m_kk.
755 */
756 int32_t thermo_getCp_R(int32_t handle, int32_t cprLen, double* cpr);
757
758 /**
759 * Set the temperature (K), pressure (Pa), and mole fractions.
760 *
761 * Wraps C++ method: `virtual void ThermoPhase::setState_TPX(double, double, span<const double>)`
762 *
763 * @param handle Handle to queried ThermoPhase object.
764 * @param t Temperature (K)
765 * @param p Pressure (Pa)
766 * @param[in] xLen Length of vector reserved for x.
767 * @param x Vector of mole fractions. Length is equal to m_kk.
768 */
769 int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x);
770
771 /**
772 * Set the temperature (K), pressure (Pa), and mole fractions.
773 *
774 * Wraps C++ method: `virtual void ThermoPhase::setState_TPX(double, double, const string&)`
775 *
776 * @param handle Handle to queried ThermoPhase object.
777 * @param t Temperature (K)
778 * @param p Pressure (Pa)
779 * @param x String containing a composition map of the mole fractions. Species not in the composition map are assumed to have zero mole fraction
780 */
781 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x);
782
783 /**
784 * Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
785 *
786 * Wraps C++ method: `virtual void ThermoPhase::setState_TPY(double, double, span<const double>)`
787 *
788 * @param handle Handle to queried ThermoPhase object.
789 * @param t Temperature (K)
790 * @param p Pressure (Pa)
791 * @param[in] yLen Length of vector reserved for y.
792 * @param y Vector of mass fractions. Length is equal to m_kk.
793 */
794 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y);
795
796 /**
797 * Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
798 *
799 * Wraps C++ method: `virtual void ThermoPhase::setState_TPY(double, double, const string&)`
800 *
801 * @param handle Handle to queried ThermoPhase object.
802 * @param t Temperature (K)
803 * @param p Pressure (Pa)
804 * @param y String containing a composition map of the mass fractions. Species not in the composition map are assumed to have zero mass fraction
805 */
806 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y);
807
808 /**
809 * Set the temperature (K) and pressure (Pa).
810 *
811 * Wraps C++ method: `virtual void ThermoPhase::setState_TP(double, double)`
812 *
813 * @param handle Handle to queried ThermoPhase object.
814 * @param t Temperature (K)
815 * @param p Pressure (Pa)
816 */
817 int32_t thermo_setState_TP(int32_t handle, double t, double p);
818
819 /**
820 * Set the internally stored temperature (K) and density (kg/m^3).
821 *
822 * Wraps C++ method: `virtual void Phase::setState_TD(double, double)`
823 *
824 * @param handle Handle to queried Phase object.
825 * @param t Temperature in kelvin
826 * @param rho Density (kg/m^3)
827 */
828 int32_t thermo_setState_TD(int32_t handle, double t, double rho);
829
830 /**
831 * Set the density (kg/m**3) and pressure (Pa) at constant composition.
832 *
833 * Wraps C++ method: `virtual void ThermoPhase::setState_DP(double, double)`
834 *
835 * @param handle Handle to queried ThermoPhase object.
836 * @param rho Density (kg/m^3)
837 * @param p Pressure (Pa)
838 */
839 int32_t thermo_setState_DP(int32_t handle, double rho, double p);
840
841 /**
842 * Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
843 *
844 * Wraps C++ method: `virtual void ThermoPhase::setState_HP(double, double)`
845 *
846 * @param handle Handle to queried ThermoPhase object.
847 * @param h Specific enthalpy (J/kg)
848 * @param p Pressure (Pa)
849 */
850 int32_t thermo_setState_HP(int32_t handle, double h, double p);
851
852 /**
853 * Set the specific internal energy (J/kg) and specific volume (m^3/kg).
854 *
855 * Wraps C++ method: `virtual void ThermoPhase::setState_UV(double, double)`
856 *
857 * @param handle Handle to queried ThermoPhase object.
858 * @param u specific internal energy (J/kg)
859 * @param v specific volume (m^3/kg).
860 */
861 int32_t thermo_setState_UV(int32_t handle, double u, double v);
862
863 /**
864 * Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
865 *
866 * Wraps C++ method: `virtual void ThermoPhase::setState_SV(double, double)`
867 *
868 * @param handle Handle to queried ThermoPhase object.
869 * @param s specific entropy (J/kg/K)
870 * @param v specific volume (m^3/kg).
871 */
872 int32_t thermo_setState_SV(int32_t handle, double s, double v);
873
874 /**
875 * Set the specific entropy (J/kg/K) and pressure (Pa).
876 *
877 * Wraps C++ method: `virtual void ThermoPhase::setState_SP(double, double)`
878 *
879 * @param handle Handle to queried ThermoPhase object.
880 * @param s specific entropy (J/kg/K)
881 * @param p specific pressure (Pa).
882 */
883 int32_t thermo_setState_SP(int32_t handle, double s, double p);
884
885 /**
886 * Set the specific entropy (J/kg/K) and temperature (K).
887 *
888 * Wraps C++ method: `virtual void ThermoPhase::setState_ST(double, double)`
889 *
890 * @param handle Handle to queried ThermoPhase object.
891 * @param s specific entropy (J/kg/K)
892 * @param t temperature (K)
893 */
894 int32_t thermo_setState_ST(int32_t handle, double s, double t);
895
896 /**
897 * Set the temperature (K) and specific volume (m^3/kg).
898 *
899 * Wraps C++ method: `virtual void ThermoPhase::setState_TV(double, double)`
900 *
901 * @param handle Handle to queried ThermoPhase object.
902 * @param t temperature (K)
903 * @param v specific volume (m^3/kg)
904 */
905 int32_t thermo_setState_TV(int32_t handle, double t, double v);
906
907 /**
908 * Set the pressure (Pa) and specific volume (m^3/kg).
909 *
910 * Wraps C++ method: `virtual void ThermoPhase::setState_PV(double, double)`
911 *
912 * @param handle Handle to queried ThermoPhase object.
913 * @param p pressure (Pa)
914 * @param v specific volume (m^3/kg)
915 */
916 int32_t thermo_setState_PV(int32_t handle, double p, double v);
917
918 /**
919 * Set the specific internal energy (J/kg) and pressure (Pa).
920 *
921 * Wraps C++ method: `virtual void ThermoPhase::setState_UP(double, double)`
922 *
923 * @param handle Handle to queried ThermoPhase object.
924 * @param u specific internal energy (J/kg)
925 * @param p pressure (Pa)
926 */
927 int32_t thermo_setState_UP(int32_t handle, double u, double p);
928
929 /**
930 * Set the specific volume (m^3/kg) and the specific enthalpy (J/kg).
931 *
932 * Wraps C++ method: `virtual void ThermoPhase::setState_VH(double, double)`
933 *
934 * @param handle Handle to queried ThermoPhase object.
935 * @param v specific volume (m^3/kg)
936 * @param h specific enthalpy (J/kg)
937 */
938 int32_t thermo_setState_VH(int32_t handle, double v, double h);
939
940 /**
941 * Set the temperature (K) and the specific enthalpy (J/kg).
942 *
943 * Wraps C++ method: `virtual void ThermoPhase::setState_TH(double, double)`
944 *
945 * @param handle Handle to queried ThermoPhase object.
946 * @param t temperature (K)
947 * @param h specific enthalpy (J/kg)
948 */
949 int32_t thermo_setState_TH(int32_t handle, double t, double h);
950
951 /**
952 * Set the specific entropy (J/kg/K) and the specific enthalpy (J/kg).
953 *
954 * Wraps C++ method: `virtual void ThermoPhase::setState_SH(double, double)`
955 *
956 * @param handle Handle to queried ThermoPhase object.
957 * @param s specific entropy (J/kg/K)
958 * @param h specific enthalpy (J/kg)
959 */
960 int32_t thermo_setState_SH(int32_t handle, double s, double h);
961
962 /**
963 * Equilibrate a ThermoPhase object.
964 *
965 * Wraps C++ method: `void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)`
966 *
967 * @param handle Handle to queried ThermoPhase object.
968 * @param XY String representation of what two properties are being held constant
969 * @param solver Name of the solver to be used to equilibrate the phase. If solver = 'element_potential', the ChemEquil element potential solver will be used. If solver = 'vcs', the VCS solver will be used. If solver = 'gibbs', the MultiPhaseEquil solver will be used. If solver = 'auto', the solvers will be tried in order if the initial solver(s) fail.
970 * @param rtol Relative tolerance
971 * @param max_steps Maximum number of steps to take to find the solution
972 * @param max_iter For the 'gibbs' and 'vcs' solvers, this is the maximum number of outer temperature or pressure iterations to take when T and/or P is not held fixed.
973 * @param estimate_equil For MultiPhaseEquil solver, an integer indicating whether the solver should estimate its own initial condition. If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition. If 1, the initial mole fraction vector is used if the element abundances are satisfied. If -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
974 */
975 int32_t thermo_equilibrate(int32_t handle, const char* XY, const char* solver, double rtol, int32_t max_steps, int32_t max_iter, int32_t estimate_equil);
976
977 /**
978 * Critical temperature (K).
979 *
980 * Wraps C++ getter: `virtual double ThermoPhase::critTemperature()`
981 *
982 * @param handle Handle to queried ThermoPhase object.
983 */
984 double thermo_critTemperature(int32_t handle);
985
986 /**
987 * Critical pressure (Pa).
988 *
989 * Wraps C++ getter: `virtual double ThermoPhase::critPressure()`
990 *
991 * @param handle Handle to queried ThermoPhase object.
992 */
993 double thermo_critPressure(int32_t handle);
994
995 /**
996 * Critical density (kg/m3).
997 *
998 * Wraps C++ getter: `virtual double ThermoPhase::critDensity()`
999 *
1000 * @param handle Handle to queried ThermoPhase object.
1001 */
1002 double thermo_critDensity(int32_t handle);
1003
1004 /**
1005 * Return the fraction of vapor at the current conditions.
1006 *
1007 * Wraps C++ getter: `virtual double ThermoPhase::vaporFraction()`
1008 *
1009 * @param handle Handle to queried ThermoPhase object.
1010 */
1011 double thermo_vaporFraction(int32_t handle);
1012
1013 /**
1014 * Return the saturation temperature given the pressure.
1015 *
1016 * Wraps C++ method: `virtual double ThermoPhase::satTemperature(double)`
1017 *
1018 * @param handle Handle to queried ThermoPhase object.
1019 * @param p Pressure (Pa)
1020 */
1021 double thermo_satTemperature(int32_t handle, double p);
1022
1023 /**
1024 * Return the saturation pressure given the temperature.
1025 *
1026 * Wraps C++ method: `virtual double ThermoPhase::satPressure(double)`
1027 *
1028 * @param handle Handle to queried ThermoPhase object.
1029 * @param t Temperature (Kelvin)
1030 */
1031 double thermo_satPressure(int32_t handle, double t);
1032
1033 /**
1034 * Set the state to a saturated system at a particular pressure.
1035 *
1036 * Wraps C++ method: `virtual void ThermoPhase::setState_Psat(double, double)`
1037 *
1038 * @param handle Handle to queried ThermoPhase object.
1039 * @param p Pressure (Pa)
1040 * @param x Fraction of vapor
1041 */
1042 int32_t thermo_setState_Psat(int32_t handle, double p, double x);
1043
1044 /**
1045 * Set the state to a saturated system at a particular temperature.
1046 *
1047 * Wraps C++ method: `virtual void ThermoPhase::setState_Tsat(double, double)`
1048 *
1049 * @param handle Handle to queried ThermoPhase object.
1050 * @param t Temperature (kelvin)
1051 * @param x Fraction of vapor
1052 */
1053 int32_t thermo_setState_Tsat(int32_t handle, double t, double x);
1054
1055 /**
1056 * Return a vector of surface coverages.
1057 *
1058 * Wraps C++ getter: `void SurfPhase::getCoverages(span<double>)`
1059 *
1060 * @param handle Handle to queried SurfPhase object.
1061 * @param[in] thetaLen Length of vector reserved for theta.
1062 * @param theta Array theta must be at least as long as the number of species.
1063 */
1064 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta);
1065
1066 /**
1067 * Set the surface site fractions to a specified state.
1068 *
1069 * Wraps C++ setter: `void SurfPhase::setCoverages(span<const double>)`
1070 *
1071 * @param handle Handle to queried SurfPhase object.
1072 * @param[in] thetaLen Length of vector reserved for theta.
1073 * @param theta This is the surface site fraction for the kth species in the surface phase. This is a dimensionless quantity.
1074 */
1075 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta);
1076
1077 /**
1078 * Set the surface site fractions to a specified state.
1079 *
1080 * Wraps C++ setter: `void SurfPhase::setCoveragesNoNorm(span<const double>)`
1081 *
1082 * @param handle Handle to queried SurfPhase object.
1083 * @param[in] thetaLen Length of vector reserved for theta.
1084 * @param theta This is the surface site fraction for the kth species in the surface phase. This is a dimensionless quantity.
1085 */
1086 int32_t surf_setCoveragesNoNorm(int32_t handle, int32_t thetaLen, const double* theta);
1087
1088 /**
1089 * Get the species concentrations (kmol/m^3).
1090 *
1091 * Wraps C++ getter: `virtual void Phase::getConcentrations(span<double>)`
1092 *
1093 * @param handle Handle to queried Phase object.
1094 * @param[in] cLen Length of vector reserved for c.
1095 * @param[out] c The vector of species concentrations. Units are kmol/m^3. The length of the vector must be greater than or equal to the number of species within the phase.
1096 */
1097 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c);
1098
1099 /**
1100 * Set the concentrations to the specified values within the phase.
1101 *
1102 * Wraps C++ setter: `virtual void Phase::setConcentrations(span<const double>)`
1103 *
1104 * @param handle Handle to queried Phase object.
1105 * @param[in] concLen Length of vector reserved for conc.
1106 * @param[in] conc Array of concentrations in dimensional units. For bulk phases c[k] is the concentration of the kth species in kmol/m3. For surface phases, c[k] is the concentration in kmol/m2. The length of the vector is the number of species in the phase.
1107 */
1108 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc);
1109
1110 /**
1111 * Returns the site density.
1112 *
1113 * Wraps C++ getter: `double SurfPhase::siteDensity()`
1114 *
1115 * @param handle Handle to queried SurfPhase object.
1116 */
1117 double surf_siteDensity(int32_t handle);
1118
1119 /**
1120 * Set the site density of the surface phase (kmol m-2).
1121 *
1122 * Wraps C++ setter: `void SurfPhase::setSiteDensity(double)`
1123 *
1124 * @param handle Handle to queried SurfPhase object.
1125 * @param n0 Site density of the surface phase (kmol m-2)
1126 */
1127 int32_t surf_setSiteDensity(int32_t handle, double n0);
1128
1129 /**
1130 * Set the coverages from a string of colon-separated name:value pairs.
1131 *
1132 * Wraps C++ setter: `void SurfPhase::setCoveragesByName(const string&)`
1133 *
1134 * @param handle Handle to queried SurfPhase object.
1135 * @param cov String containing colon-separated name:value pairs
1136 */
1137 int32_t surf_setCoveragesByName(int32_t handle, const char* cov);
1138
1139 /**
1140 * Set the mixture composition according to the equivalence ratio.
1141 *
1142 * Wraps C++ method: `void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)`
1143 *
1144 * @param handle Handle to queried ThermoPhase object.
1145 * @param phi equivalence ratio
1146 * @param fuelComp composition of the fuel
1147 * @param oxComp composition of the oxidizer
1148 */
1149 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp);
1150
1151 /**
1152 * Compute the equivalence ratio for the current mixture from available oxygen and required oxygen.
1153 *
1154 * Wraps C++ getter: `double ThermoPhase::equivalenceRatio()`
1155 *
1156 * @param handle Handle to queried ThermoPhase object.
1157 */
1158 double thermo_equivalenceRatio(int32_t handle);
1159
1160 /**
1161 * returns a summary of the state of the phase as a string
1162 *
1163 * Wraps C++ method: `virtual string ThermoPhase::report(bool, double)`
1164 *
1165 * @param handle Handle to queried ThermoPhase object.
1166 * @param show_thermo If true, extra information is printed out about the thermodynamic state of the system.
1167 * @param threshold Show information about species with mole fractions greater than *threshold*.
1168 * @param[in] bufLen Length of reserved array.
1169 * @param[out] buf Returned string value.
1170 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
1171 */
1172 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf);
1173
1174 /**
1175 * Print a summary of the state of the phase to the logger.
1176 *
1177 * Wraps C++ method: `custom code`
1178 *
1179 * Uses:
1180 * - `virtual string ThermoPhase::report(bool, double)`
1181 *
1182 * @param handle Handle to queried ThermoPhase object.
1183 * @param showThermo If true, extra information is printed out about the thermodynamic state of the system.
1184 * @param threshold Show information about species with mole fractions greater than
1185 * @returns Zero for success or -1 for exception handling.
1186 */
1187 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold);
1188
1189 /**
1190 * Delete ThermoPhase object.
1191 *
1192 * Wraps C++ destructor: `undefined`
1193 *
1194 * @param handle Handle to ThermoPhase object.
1195 * @returns Zero for success and -1 for exception handling.
1196 */
1197 int32_t thermo_del(int32_t handle);
1198
1199 /**
1200 * Return size of ThermoPhase storage.
1201 *
1202 * Wraps C++ reserved CLib function: `custom code`
1203 *
1204 * @returns Size or -1 for exception handling.
1205 */
1206 int32_t thermo_cabinetSize();
1207
1208 /**
1209 * @}
1210 */
1211
1212#ifdef __cplusplus
1213}
1214#endif
1215
1216#endif // CTTHERMO_H
double thermo_satTemperature(int32_t handle, double p)
Return the saturation temperature given the pressure.
int32_t thermo_setState_VH(int32_t handle, double v, double h)
Set the specific volume (m^3/kg) and the specific enthalpy (J/kg).
Definition ctthermo.cpp:984
double thermo_elementalMoleFraction(int32_t handle, const int32_t m)
Elemental mole fraction of element m.
Definition ctthermo.cpp:310
int32_t thermo_getGibbs_RT(int32_t handle, int32_t grtLen, double *grt)
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Definition ctthermo.cpp:775
int32_t surf_setCoveragesByName(int32_t handle, const char *cov)
Set the coverages from a string of colon-separated name:value pairs.
int32_t thermo_getPartialMolarCv_TV(int32_t handle, int32_t cvtildeLen, double *cvtilde)
Return an array of species molar heat capacities associated with the constant-volume partial molar in...
Definition ctthermo.cpp:719
int32_t thermo_speciesIndex(int32_t handle, const char *name)
Returns the index of a species named 'name' within the Phase object.
Definition ctthermo.cpp:388
int32_t thermo_speciesName(int32_t handle, int32_t k, int32_t bufLen, char *buf)
Name of the species with index k.
Definition ctthermo.cpp:364
int32_t thermo_getEntropy_R(int32_t handle, int32_t srLen, double *sr)
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition ctthermo.cpp:761
double thermo_cv_mole(int32_t handle)
Molar heat capacity at constant volume and composition [J/kmol/K].
Definition ctthermo.cpp:550
int32_t thermo_setState_TD(int32_t handle, double t, double rho)
Set the internally stored temperature (K) and density (kg/m^3).
Definition ctthermo.cpp:874
double thermo_intEnergy_mass(int32_t handle)
Specific internal energy.
Definition ctthermo.cpp:500
int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double *c)
Get the species concentrations (kmol/m^3).
int32_t thermo_getMoleFractions(int32_t handle, int32_t xLen, double *x)
Get the species mole fraction vector.
Definition ctthermo.cpp:196
int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double *theta)
Set the surface site fractions to a specified state.
int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold)
Print a summary of the state of the phase to the logger.
double thermo_cp_mass(int32_t handle)
Specific heat at constant pressure and composition [J/kg/K].
Definition ctthermo.cpp:540
int32_t thermo_setMassFractions(int32_t handle, int32_t yLen, const double *y)
Set the mass fractions to the specified values and normalize them.
Definition ctthermo.cpp:240
int32_t thermo_setState_ST(int32_t handle, double s, double t)
Set the specific entropy (J/kg/K) and temperature (K).
Definition ctthermo.cpp:940
double thermo_internalPressure(int32_t handle)
Return the internal pressure [Pa].
Definition ctthermo.cpp:639
int32_t thermo_setTemperature(int32_t handle, double temp)
Set the internally stored temperature of the phase (K).
Definition ctthermo.cpp:103
double thermo_maxTemp(int32_t handle, int32_t k)
Maximum temperature for which the thermodynamic data for the species are valid.
Definition ctthermo.cpp:440
double thermo_pressure(int32_t handle)
Return the thermodynamic pressure (Pa).
Definition ctthermo.cpp:114
double thermo_density(int32_t handle)
Density (kg/m^3).
Definition ctthermo.cpp:135
int32_t thermo_getElectrochemPotentials(int32_t handle, int32_t muLen, double *mu)
Get the species electrochemical potentials.
Definition ctthermo.cpp:584
double thermo_enthalpy_mole(int32_t handle)
Molar enthalpy.
Definition ctthermo.cpp:450
int32_t thermo_setState_SH(int32_t handle, double s, double h)
Set the specific entropy (J/kg/K) and the specific enthalpy (J/kg).
int32_t thermo_setMoleFractionsByName(int32_t handle, const char *x)
Set the mole fractions of a group of species by name.
Definition ctthermo.cpp:252
double thermo_cv_mass(int32_t handle)
Specific heat at constant volume and composition [J/kg/K].
Definition ctthermo.cpp:560
int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char *buf)
returns a summary of the state of the phase as a string
int32_t thermo_setState_TH(int32_t handle, double t, double h)
Set the temperature (K) and the specific enthalpy (J/kg).
Definition ctthermo.cpp:995
int32_t thermo_del(int32_t handle)
Delete ThermoPhase object.
int32_t thermo_setState_SP(int32_t handle, double s, double p)
Set the specific entropy (J/kg/K) and pressure (Pa).
Definition ctthermo.cpp:929
int32_t thermo_getIntEnergy_RT(int32_t handle, int32_t urtLen, double *urt)
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Definition ctthermo.cpp:789
int32_t thermo_setState_TV(int32_t handle, double t, double v)
Set the temperature (K) and specific volume (m^3/kg).
Definition ctthermo.cpp:951
double thermo_vaporFraction(int32_t handle)
Return the fraction of vapor at the current conditions.
int32_t thermo_addElement(int32_t handle, const char *symbol, double weight, int32_t atomicNumber, double entropy298, int32_t elem_type)
Add an element.
Definition ctthermo.cpp:410
int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double *ubar)
Return an array of partial molar internal energies for the species in the mixture.
Definition ctthermo.cpp:677
double thermo_massFraction(int32_t handle, int32_t k)
Return the mass fraction of a single species.
Definition ctthermo.cpp:186
double thermo_gibbs_mole(int32_t handle)
Molar Gibbs function.
Definition ctthermo.cpp:510
int32_t surf_setCoveragesNoNorm(int32_t handle, int32_t thetaLen, const double *theta)
Set the surface site fractions to a specified state.
int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double *theta)
Return a vector of surface coverages.
int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char *x)
Set the temperature (K), pressure (Pa), and mole fractions.
Definition ctthermo.cpp:829
double thermo_critDensity(int32_t handle)
Critical density (kg/m3).
int32_t thermo_nElements(int32_t handle)
Number of elements.
Definition ctthermo.cpp:73
double thermo_meanMolecularWeight(int32_t handle)
The mean molecular weight.
Definition ctthermo.cpp:166
int32_t thermo_setState_Tsat(int32_t handle, double t, double x)
Set the state to a saturated system at a particular temperature.
int32_t thermo_setState_PV(int32_t handle, double p, double v)
Set the pressure (Pa) and specific volume (m^3/kg).
Definition ctthermo.cpp:962
double thermo_enthalpy_mass(int32_t handle)
Specific enthalpy.
Definition ctthermo.cpp:460
int32_t thermo_elementIndex(int32_t handle, const char *name)
Return the index of element named 'name'.
Definition ctthermo.cpp:376
int32_t thermo_type(int32_t handle, int32_t bufLen, char *buf)
String indicating the thermodynamic model implemented.
Definition ctthermo.cpp:61
int32_t thermo_nSpecies(int32_t handle)
Returns the number of species in the phase.
Definition ctthermo.cpp:83
double surf_siteDensity(int32_t handle)
Returns the site density.
double thermo_entropy_mass(int32_t handle)
Specific entropy.
Definition ctthermo.cpp:480
int32_t thermo_setName(int32_t handle, const char *nm)
Sets the string name for the phase.
Definition ctthermo.cpp:50
int32_t thermo_getCharges(int32_t handle, int32_t chargesLen, double *charges)
Copy the vector of species charges into array charges.
Definition ctthermo.cpp:336
int32_t thermo_setState_HP(int32_t handle, double h, double p)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
Definition ctthermo.cpp:896
int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double *y)
Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
Definition ctthermo.cpp:840
int32_t thermo_equilibrate(int32_t handle, const char *XY, const char *solver, double rtol, int32_t max_steps, int32_t max_iter, int32_t estimate_equil)
Equilibrate a ThermoPhase object.
double thermo_elementalMassFraction(int32_t handle, const int32_t m)
Elemental mass fraction of element m.
Definition ctthermo.cpp:300
double thermo_intEnergy_mole(int32_t handle)
Molar internal energy.
Definition ctthermo.cpp:490
double thermo_critTemperature(int32_t handle)
Critical temperature (K).
int32_t thermo_name(int32_t handle, int32_t bufLen, char *buf)
Return the name of the phase.
Definition ctthermo.cpp:38
int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double *x)
Set the temperature (K), pressure (Pa), and mole fractions.
Definition ctthermo.cpp:817
int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double *mu)
Get the species chemical potentials.
Definition ctthermo.cpp:570
double thermo_electricPotential(int32_t handle)
Returns the electric potential of this phase (V).
Definition ctthermo.cpp:598
int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double *hbar)
Returns an array of partial molar enthalpies for the species in the mixture.
Definition ctthermo.cpp:649
int32_t thermo_setState_Psat(int32_t handle, double p, double x)
Set the state to a saturated system at a particular pressure.
double thermo_refPressure(int32_t handle)
Returns the reference pressure in Pa.
Definition ctthermo.cpp:420
int32_t thermo_cabinetSize()
Return size of ThermoPhase storage.
double thermo_atomicWeight(int32_t handle, int32_t m)
Atomic weight of element m.
Definition ctthermo.cpp:290
double thermo_isothermalCompressibility(int32_t handle)
Returns the isothermal compressibility.
Definition ctthermo.cpp:629
int32_t thermo_getEnthalpy_RT(int32_t handle, int32_t hrtLen, double *hrt)
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition ctthermo.cpp:747
int32_t thermo_setPressure(int32_t handle, double p)
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition ctthermo.cpp:124
double thermo_gibbs_mass(int32_t handle)
Specific Gibbs function.
Definition ctthermo.cpp:520
double thermo_moleFraction(int32_t handle, int32_t k)
Return the mole fraction of a single species.
Definition ctthermo.cpp:176
int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double *cpbar)
Return an array of partial molar heat capacities for the species in the mixture.
Definition ctthermo.cpp:705
int32_t thermo_setState_UP(int32_t handle, double u, double p)
Set the specific internal energy (J/kg) and pressure (Pa).
Definition ctthermo.cpp:973
int32_t thermo_getPartialMolarIntEnergies_TV(int32_t handle, int32_t utildeLen, double *utilde)
Return an array of partial molar internal energies at constant temperature and volume [J/kmol].
Definition ctthermo.cpp:691
double thermo_molarDensity(int32_t handle)
Molar density (kmol/m^3).
Definition ctthermo.cpp:156
double thermo_minTemp(int32_t handle, int32_t k)
Minimum temperature for which the thermodynamic data for the species or phase are valid.
Definition ctthermo.cpp:430
double thermo_equivalenceRatio(int32_t handle)
Compute the equivalence ratio for the current mixture from available oxygen and required oxygen.
int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char *fuelComp, const char *oxComp)
Set the mixture composition according to the equivalence ratio.
int32_t thermo_setMassFractionsByName(int32_t handle, const char *x)
Set the species mass fractions by name.
Definition ctthermo.cpp:263
double thermo_satPressure(int32_t handle, double t)
Return the saturation pressure given the temperature.
int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double *vbar)
Return an array of partial molar volumes for the species in the mixture.
Definition ctthermo.cpp:733
double thermo_thermalExpansionCoeff(int32_t handle)
Return the volumetric thermal expansion coefficient.
Definition ctthermo.cpp:619
int32_t thermo_setState_DP(int32_t handle, double rho, double p)
Set the density (kg/m**3) and pressure (Pa) at constant composition.
Definition ctthermo.cpp:885
int32_t thermo_setState_TP(int32_t handle, double t, double p)
Set the temperature (K) and pressure (Pa).
Definition ctthermo.cpp:863
double thermo_critPressure(int32_t handle)
Critical pressure (Pa).
int32_t thermo_atomicWeights(int32_t handle, int32_t bufLen, double *buf)
Return a read-only reference to the vector of atomic weights.
Definition ctthermo.cpp:274
int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char *y)
Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
Definition ctthermo.cpp:852
int32_t thermo_setMoleFractions(int32_t handle, int32_t xLen, const double *x)
Set the mole fractions to the specified values.
Definition ctthermo.cpp:228
int32_t thermo_getMassFractions(int32_t handle, int32_t yLen, double *y)
Get the species mass fractions.
Definition ctthermo.cpp:212
int32_t thermo_elementName(int32_t handle, int32_t m, int32_t bufLen, char *buf)
Name of the element with index m.
Definition ctthermo.cpp:352
double thermo_temperature(int32_t handle)
Temperature (K).
Definition ctthermo.cpp:93
double thermo_cp_mole(int32_t handle)
Molar heat capacity at constant pressure and composition [J/kmol/K].
Definition ctthermo.cpp:530
int32_t thermo_setDensity(int32_t handle, const double density_)
Set the internally stored density (kg/m^3) of the phase.
Definition ctthermo.cpp:145
int32_t thermo_getCp_R(int32_t handle, int32_t cprLen, double *cpr)
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Definition ctthermo.cpp:803
int32_t thermo_getMolecularWeights(int32_t handle, int32_t weightsLen, double *weights)
Copy the vector of molecular weights into array weights.
Definition ctthermo.cpp:320
int32_t surf_setSiteDensity(int32_t handle, double n0)
Set the site density of the surface phase (kmol m-2).
int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double *sbar)
Returns an array of partial molar entropies of the species in the solution.
Definition ctthermo.cpp:663
double thermo_entropy_mole(int32_t handle)
Molar entropy.
Definition ctthermo.cpp:470
int32_t thermo_setElectricPotential(int32_t handle, double v)
Set the electric potential of this phase (V).
Definition ctthermo.cpp:608
int32_t thermo_setState_UV(int32_t handle, double u, double v)
Set the specific internal energy (J/kg) and specific volume (m^3/kg).
Definition ctthermo.cpp:907
int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double *conc)
Set the concentrations to the specified values within the phase.
int32_t thermo_setState_SV(int32_t handle, double s, double v)
Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
Definition ctthermo.cpp:918
double thermo_nAtoms(int32_t handle, int32_t k, int32_t m)
Number of atoms of element m in species k.
Definition ctthermo.cpp:400