Cantera  4.0.0a1
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 * Copy the vector of molecular weights into array weights.
288 *
289 * Wraps C++ getter: `void Phase::getMolecularWeights(span<double>)`
290 *
291 * Uses:
292 * - `size_t Phase::nSpecies()`
293 *
294 * @param handle Handle to queried Phase object.
295 * @param[in] weightsLen Length of vector reserved for weights.
296 * @param weights Output array of molecular weights (kg/kmol)
297 */
298 int32_t thermo_getMolecularWeights(int32_t handle, int32_t weightsLen, double* weights);
299
300 /**
301 * Copy the vector of species charges into array charges.
302 *
303 * Wraps C++ getter: `void Phase::getCharges(span<double>)`
304 *
305 * Uses:
306 * - `size_t Phase::nElements()`
307 *
308 * @param handle Handle to queried Phase object.
309 * @param[in] chargesLen Length of vector reserved for charges.
310 * @param charges Output array of species charges (elem. charge)
311 */
312 int32_t thermo_getCharges(int32_t handle, int32_t chargesLen, double* charges);
313
314 /**
315 * Name of the element with index m.
316 *
317 * Wraps C++ method: `string Phase::elementName(size_t)`
318 *
319 * @param handle Handle to queried Phase object.
320 * @param m Element index.
321 * @param[in] bufLen Length of reserved array.
322 * @param[out] buf Returned string value.
323 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
324 */
325 int32_t thermo_elementName(int32_t handle, int32_t m, int32_t bufLen, char* buf);
326
327 /**
328 * Name of the species with index k.
329 *
330 * Wraps C++ method: `string Phase::speciesName(size_t)`
331 *
332 * @param handle Handle to queried Phase object.
333 * @param k index of the species
334 * @param[in] bufLen Length of reserved array.
335 * @param[out] buf Returned string value.
336 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
337 */
338 int32_t thermo_speciesName(int32_t handle, int32_t k, int32_t bufLen, char* buf);
339
340 /**
341 * Return the index of element named 'name'.
342 *
343 * Wraps C++ method: `custom code`
344 *
345 * Uses:
346 * - ` elementIndex(const string&, bool)`
347 *
348 * @param handle Handle to queried Phase object.
349 * @param name Name of the element
350 */
351 int32_t thermo_elementIndex(int32_t handle, const char* name);
352
353 /**
354 * Returns the index of a species named 'name' within the Phase object.
355 *
356 * Wraps C++ method: `custom code`
357 *
358 * Uses:
359 * - ` speciesIndex(const string&, bool)`
360 *
361 * @param handle Handle to queried Phase object.
362 * @param name String name of the species. It may also be in the form phaseName:speciesName
363 */
364 int32_t thermo_speciesIndex(int32_t handle, const char* name);
365
366 /**
367 * Number of atoms of element `m` in species `k`.
368 *
369 * Wraps C++ method: `double Phase::nAtoms(size_t, size_t)`
370 *
371 * @param handle Handle to queried Phase object.
372 * @param k species index
373 * @param m element index
374 */
375 double thermo_nAtoms(int32_t handle, int32_t k, int32_t m);
376
377 /**
378 * Add an element.
379 *
380 * Wraps C++ method: `size_t Phase::addElement(const string&, double, int, double, int)`
381 *
382 * @param handle Handle to queried Phase object.
383 * @param symbol Atomic symbol string.
384 * @param weight Atomic mass in amu.
385 * @param atomicNumber Atomic number of the element (unitless)
386 * @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.
387 * @param elem_type Specifies the type of the element constraint equation. This defaults to CT_ELEM_TYPE_ABSPOS, that is, an element.
388 */
389 int32_t thermo_addElement(int32_t handle, const char* symbol, double weight, int32_t atomicNumber, double entropy298, int32_t elem_type);
390
391 /**
392 * Returns the reference pressure in Pa.
393 *
394 * Wraps C++ getter: `virtual double ThermoPhase::refPressure()`
395 *
396 * @param handle Handle to queried ThermoPhase object.
397 */
398 double thermo_refPressure(int32_t handle);
399
400 /**
401 * Minimum temperature for which the thermodynamic data for the species or phase are valid.
402 *
403 * Wraps C++ method: `virtual double ThermoPhase::minTemp(size_t)`
404 *
405 * @param handle Handle to queried ThermoPhase object.
406 * @param k index of the species. Default is -1, which will return the max of the min value over all species.
407 */
408 double thermo_minTemp(int32_t handle, int32_t k);
409
410 /**
411 * Maximum temperature for which the thermodynamic data for the species are valid.
412 *
413 * Wraps C++ method: `virtual double ThermoPhase::maxTemp(size_t)`
414 *
415 * @param handle Handle to queried ThermoPhase object.
416 * @param k index of the species. Default is -1, which will return the min of the max value over all species.
417 */
418 double thermo_maxTemp(int32_t handle, int32_t k);
419
420 /**
421 * Molar enthalpy. Units: J/kmol.
422 *
423 * Wraps C++ getter: `virtual double ThermoPhase::enthalpy_mole()`
424 *
425 * @param handle Handle to queried ThermoPhase object.
426 */
427 double thermo_enthalpy_mole(int32_t handle);
428
429 /**
430 * Specific enthalpy. Units: J/kg.
431 *
432 * Wraps C++ getter: `double ThermoPhase::enthalpy_mass()`
433 *
434 * @param handle Handle to queried ThermoPhase object.
435 */
436 double thermo_enthalpy_mass(int32_t handle);
437
438 /**
439 * Molar entropy. Units: J/kmol/K.
440 *
441 * Wraps C++ getter: `virtual double ThermoPhase::entropy_mole()`
442 *
443 * @param handle Handle to queried ThermoPhase object.
444 */
445 double thermo_entropy_mole(int32_t handle);
446
447 /**
448 * Specific entropy. Units: J/kg/K.
449 *
450 * Wraps C++ getter: `double ThermoPhase::entropy_mass()`
451 *
452 * @param handle Handle to queried ThermoPhase object.
453 */
454 double thermo_entropy_mass(int32_t handle);
455
456 /**
457 * Molar internal energy. Units: J/kmol.
458 *
459 * Wraps C++ getter: `virtual double ThermoPhase::intEnergy_mole()`
460 *
461 * @param handle Handle to queried ThermoPhase object.
462 */
463 double thermo_intEnergy_mole(int32_t handle);
464
465 /**
466 * Specific internal energy. Units: J/kg.
467 *
468 * Wraps C++ getter: `double ThermoPhase::intEnergy_mass()`
469 *
470 * @param handle Handle to queried ThermoPhase object.
471 */
472 double thermo_intEnergy_mass(int32_t handle);
473
474 /**
475 * Molar Gibbs function. Units: J/kmol.
476 *
477 * Wraps C++ getter: `virtual double ThermoPhase::gibbs_mole()`
478 *
479 * @param handle Handle to queried ThermoPhase object.
480 */
481 double thermo_gibbs_mole(int32_t handle);
482
483 /**
484 * Specific Gibbs function. Units: J/kg.
485 *
486 * Wraps C++ getter: `double ThermoPhase::gibbs_mass()`
487 *
488 * @param handle Handle to queried ThermoPhase object.
489 */
490 double thermo_gibbs_mass(int32_t handle);
491
492 /**
493 * Molar heat capacity at constant pressure and composition [J/kmol/K].
494 *
495 * Wraps C++ getter: `virtual double ThermoPhase::cp_mole()`
496 *
497 * @param handle Handle to queried ThermoPhase object.
498 */
499 double thermo_cp_mole(int32_t handle);
500
501 /**
502 * Specific heat at constant pressure and composition [J/kg/K].
503 *
504 * Wraps C++ getter: `double ThermoPhase::cp_mass()`
505 *
506 * @param handle Handle to queried ThermoPhase object.
507 */
508 double thermo_cp_mass(int32_t handle);
509
510 /**
511 * Molar heat capacity at constant volume and composition [J/kmol/K].
512 *
513 * Wraps C++ getter: `virtual double ThermoPhase::cv_mole()`
514 *
515 * @param handle Handle to queried ThermoPhase object.
516 */
517 double thermo_cv_mole(int32_t handle);
518
519 /**
520 * Specific heat at constant volume and composition [J/kg/K].
521 *
522 * Wraps C++ getter: `double ThermoPhase::cv_mass()`
523 *
524 * @param handle Handle to queried ThermoPhase object.
525 */
526 double thermo_cv_mass(int32_t handle);
527
528 /**
529 * Get the species chemical potentials. Units: J/kmol.
530 *
531 * Wraps C++ getter: `virtual void ThermoPhase::getChemPotentials(span<double>)`
532 *
533 * @param handle Handle to queried ThermoPhase object.
534 * @param[in] muLen Length of vector reserved for mu.
535 * @param mu Output vector of species chemical potentials. Length: m_kk. Units: J/kmol
536 */
537 int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double* mu);
538
539 /**
540 * Get the species electrochemical potentials.
541 *
542 * Wraps C++ getter: `void ThermoPhase::getElectrochemPotentials(span<double>)`
543 *
544 * @param handle Handle to queried ThermoPhase object.
545 * @param[in] muLen Length of vector reserved for mu.
546 * @param mu Output vector of species electrochemical potentials. Length: m_kk. Units: J/kmol
547 */
548 int32_t thermo_getElectrochemPotentials(int32_t handle, int32_t muLen, double* mu);
549
550 /**
551 * Returns the electric potential of this phase (V).
552 *
553 * Wraps C++ getter: `double ThermoPhase::electricPotential()`
554 *
555 * @param handle Handle to queried ThermoPhase object.
556 */
557 double thermo_electricPotential(int32_t handle);
558
559 /**
560 * Set the electric potential of this phase (V).
561 *
562 * Wraps C++ setter: `void ThermoPhase::setElectricPotential(double)`
563 *
564 * @param handle Handle to queried ThermoPhase object.
565 * @param v Input value of the electric potential in Volts
566 */
567 int32_t thermo_setElectricPotential(int32_t handle, double v);
568
569 /**
570 * Return the volumetric thermal expansion coefficient. Units: 1/K.
571 *
572 * Wraps C++ getter: `virtual double ThermoPhase::thermalExpansionCoeff()`
573 *
574 * @param handle Handle to queried ThermoPhase object.
575 */
576 double thermo_thermalExpansionCoeff(int32_t handle);
577
578 /**
579 * Returns the isothermal compressibility. Units: 1/Pa.
580 *
581 * Wraps C++ getter: `virtual double ThermoPhase::isothermalCompressibility()`
582 *
583 * @param handle Handle to queried ThermoPhase object.
584 */
585 double thermo_isothermalCompressibility(int32_t handle);
586
587 /**
588 * Return the internal pressure [Pa].
589 *
590 * Wraps C++ getter: `virtual double ThermoPhase::internalPressure()`
591 *
592 * @param handle Handle to queried ThermoPhase object.
593 */
594 double thermo_internalPressure(int32_t handle);
595
596 /**
597 * Returns an array of partial molar enthalpies for the species in the mixture.
598 *
599 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarEnthalpies(span<double>)`
600 *
601 * @param handle Handle to queried ThermoPhase object.
602 * @param[in] hbarLen Length of vector reserved for hbar.
603 * @param hbar Output vector of species partial molar enthalpies. Length: m_kk. units are J/kmol.
604 */
605 int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double* hbar);
606
607 /**
608 * Returns an array of partial molar entropies of the species in the solution.
609 *
610 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarEntropies(span<double>)`
611 *
612 * @param handle Handle to queried ThermoPhase object.
613 * @param[in] sbarLen Length of vector reserved for sbar.
614 * @param sbar Output vector of species partial molar entropies. Length = m_kk. units are J/kmol/K.
615 */
616 int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double* sbar);
617
618 /**
619 * Return an array of partial molar internal energies for the species in the mixture.
620 *
621 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarIntEnergies(span<double>)`
622 *
623 * @param handle Handle to queried ThermoPhase object.
624 * @param[in] ubarLen Length of vector reserved for ubar.
625 * @param ubar Output vector of species partial molar internal energies. Length = m_kk. units are J/kmol.
626 */
627 int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double* ubar);
628
629 /**
630 * Return an array of partial molar internal energies at constant temperature and volume [J/kmol].
631 *
632 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarIntEnergies_TV(span<double>)`
633 *
634 * @param handle Handle to queried ThermoPhase object.
635 * @param[in] utildeLen Length of vector reserved for utilde.
636 * @param utilde Undocumented.
637 */
638 int32_t thermo_getPartialMolarIntEnergies_TV(int32_t handle, int32_t utildeLen, double* utilde);
639
640 /**
641 * Return an array of partial molar heat capacities for the species in the mixture.
642 *
643 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarCp(span<double>)`
644 *
645 * @param handle Handle to queried ThermoPhase object.
646 * @param[in] cpbarLen Length of vector reserved for cpbar.
647 * @param cpbar Output vector of species partial molar heat capacities at constant pressure. Length = m_kk. units are J/kmol/K.
648 */
649 int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double* cpbar);
650
651 /**
652 * Return an array of species molar heat capacities associated with the constant-volume partial molar internal energies [J/kmol/K].
653 *
654 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarCv_TV(span<double>)`
655 *
656 * @param handle Handle to queried ThermoPhase object.
657 * @param[in] cvtildeLen Length of vector reserved for cvtilde.
658 * @param cvtilde Undocumented.
659 */
660 int32_t thermo_getPartialMolarCv_TV(int32_t handle, int32_t cvtildeLen, double* cvtilde);
661
662 /**
663 * Return an array of partial molar volumes for the species in the mixture.
664 *
665 * Wraps C++ getter: `virtual void ThermoPhase::getPartialMolarVolumes(span<double>)`
666 *
667 * @param handle Handle to queried ThermoPhase object.
668 * @param[in] vbarLen Length of vector reserved for vbar.
669 * @param vbar Output vector of species partial molar volumes. Length = m_kk. units are m^3/kmol.
670 */
671 int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double* vbar);
672
673 /**
674 * Set the temperature (K), pressure (Pa), and mole fractions.
675 *
676 * Wraps C++ method: `virtual void ThermoPhase::setState_TPX(double, double, span<const double>)`
677 *
678 * @param handle Handle to queried ThermoPhase object.
679 * @param t Temperature (K)
680 * @param p Pressure (Pa)
681 * @param[in] xLen Length of vector reserved for x.
682 * @param x Vector of mole fractions. Length is equal to m_kk.
683 */
684 int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x);
685
686 /**
687 * Set the temperature (K), pressure (Pa), and mole fractions.
688 *
689 * Wraps C++ method: `virtual void ThermoPhase::setState_TPX(double, double, const string&)`
690 *
691 * @param handle Handle to queried ThermoPhase object.
692 * @param t Temperature (K)
693 * @param p Pressure (Pa)
694 * @param x String containing a composition map of the mole fractions. Species not in the composition map are assumed to have zero mole fraction
695 */
696 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x);
697
698 /**
699 * Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
700 *
701 * Wraps C++ method: `virtual void ThermoPhase::setState_TPY(double, double, span<const double>)`
702 *
703 * @param handle Handle to queried ThermoPhase object.
704 * @param t Temperature (K)
705 * @param p Pressure (Pa)
706 * @param[in] yLen Length of vector reserved for y.
707 * @param y Vector of mass fractions. Length is equal to m_kk.
708 */
709 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y);
710
711 /**
712 * Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
713 *
714 * Wraps C++ method: `virtual void ThermoPhase::setState_TPY(double, double, const string&)`
715 *
716 * @param handle Handle to queried ThermoPhase object.
717 * @param t Temperature (K)
718 * @param p Pressure (Pa)
719 * @param y String containing a composition map of the mass fractions. Species not in the composition map are assumed to have zero mass fraction
720 */
721 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y);
722
723 /**
724 * Set the temperature (K) and pressure (Pa)
725 *
726 * Wraps C++ method: `virtual void ThermoPhase::setState_TP(double, double)`
727 *
728 * @param handle Handle to queried ThermoPhase object.
729 * @param t Temperature (K)
730 * @param p Pressure (Pa)
731 */
732 int32_t thermo_setState_TP(int32_t handle, double t, double p);
733
734 /**
735 * Set the internally stored temperature (K) and density (kg/m^3)
736 *
737 * Wraps C++ method: `void Phase::setState_TD(double, double)`
738 *
739 * @param handle Handle to queried Phase object.
740 * @param t Temperature in kelvin
741 * @param rho Density (kg/m^3)
742 */
743 int32_t thermo_setState_TD(int32_t handle, double t, double rho);
744
745 /**
746 * Set the density (kg/m**3) and pressure (Pa) at constant composition.
747 *
748 * Wraps C++ method: `virtual void ThermoPhase::setState_DP(double, double)`
749 *
750 * @param handle Handle to queried ThermoPhase object.
751 * @param rho Density (kg/m^3)
752 * @param p Pressure (Pa)
753 */
754 int32_t thermo_setState_DP(int32_t handle, double rho, double p);
755
756 /**
757 * Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
758 *
759 * Wraps C++ method: `virtual void ThermoPhase::setState_HP(double, double)`
760 *
761 * @param handle Handle to queried ThermoPhase object.
762 * @param h Specific enthalpy (J/kg)
763 * @param p Pressure (Pa)
764 */
765 int32_t thermo_setState_HP(int32_t handle, double h, double p);
766
767 /**
768 * Set the specific internal energy (J/kg) and specific volume (m^3/kg).
769 *
770 * Wraps C++ method: `virtual void ThermoPhase::setState_UV(double, double)`
771 *
772 * @param handle Handle to queried ThermoPhase object.
773 * @param u specific internal energy (J/kg)
774 * @param v specific volume (m^3/kg).
775 */
776 int32_t thermo_setState_UV(int32_t handle, double u, double v);
777
778 /**
779 * Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
780 *
781 * Wraps C++ method: `virtual void ThermoPhase::setState_SV(double, double)`
782 *
783 * @param handle Handle to queried ThermoPhase object.
784 * @param s specific entropy (J/kg/K)
785 * @param v specific volume (m^3/kg).
786 */
787 int32_t thermo_setState_SV(int32_t handle, double s, double v);
788
789 /**
790 * Set the specific entropy (J/kg/K) and pressure (Pa).
791 *
792 * Wraps C++ method: `virtual void ThermoPhase::setState_SP(double, double)`
793 *
794 * @param handle Handle to queried ThermoPhase object.
795 * @param s specific entropy (J/kg/K)
796 * @param p specific pressure (Pa).
797 */
798 int32_t thermo_setState_SP(int32_t handle, double s, double p);
799
800 /**
801 * Set the specific entropy (J/kg/K) and temperature (K).
802 *
803 * Wraps C++ method: `virtual void ThermoPhase::setState_ST(double, double)`
804 *
805 * @param handle Handle to queried ThermoPhase object.
806 * @param s specific entropy (J/kg/K)
807 * @param t temperature (K)
808 */
809 int32_t thermo_setState_ST(int32_t handle, double s, double t);
810
811 /**
812 * Set the temperature (K) and specific volume (m^3/kg).
813 *
814 * Wraps C++ method: `virtual void ThermoPhase::setState_TV(double, double)`
815 *
816 * @param handle Handle to queried ThermoPhase object.
817 * @param t temperature (K)
818 * @param v specific volume (m^3/kg)
819 */
820 int32_t thermo_setState_TV(int32_t handle, double t, double v);
821
822 /**
823 * Set the pressure (Pa) and specific volume (m^3/kg).
824 *
825 * Wraps C++ method: `virtual void ThermoPhase::setState_PV(double, double)`
826 *
827 * @param handle Handle to queried ThermoPhase object.
828 * @param p pressure (Pa)
829 * @param v specific volume (m^3/kg)
830 */
831 int32_t thermo_setState_PV(int32_t handle, double p, double v);
832
833 /**
834 * Set the specific internal energy (J/kg) and pressure (Pa).
835 *
836 * Wraps C++ method: `virtual void ThermoPhase::setState_UP(double, double)`
837 *
838 * @param handle Handle to queried ThermoPhase object.
839 * @param u specific internal energy (J/kg)
840 * @param p pressure (Pa)
841 */
842 int32_t thermo_setState_UP(int32_t handle, double u, double p);
843
844 /**
845 * Set the specific volume (m^3/kg) and the specific enthalpy (J/kg)
846 *
847 * Wraps C++ method: `virtual void ThermoPhase::setState_VH(double, double)`
848 *
849 * @param handle Handle to queried ThermoPhase object.
850 * @param v specific volume (m^3/kg)
851 * @param h specific enthalpy (J/kg)
852 */
853 int32_t thermo_setState_VH(int32_t handle, double v, double h);
854
855 /**
856 * Set the temperature (K) and the specific enthalpy (J/kg)
857 *
858 * Wraps C++ method: `virtual void ThermoPhase::setState_TH(double, double)`
859 *
860 * @param handle Handle to queried ThermoPhase object.
861 * @param t temperature (K)
862 * @param h specific enthalpy (J/kg)
863 */
864 int32_t thermo_setState_TH(int32_t handle, double t, double h);
865
866 /**
867 * Set the specific entropy (J/kg/K) and the specific enthalpy (J/kg)
868 *
869 * Wraps C++ method: `virtual void ThermoPhase::setState_SH(double, double)`
870 *
871 * @param handle Handle to queried ThermoPhase object.
872 * @param s specific entropy (J/kg/K)
873 * @param h specific enthalpy (J/kg)
874 */
875 int32_t thermo_setState_SH(int32_t handle, double s, double h);
876
877 /**
878 * Equilibrate a ThermoPhase object.
879 *
880 * Wraps C++ method: `void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)`
881 *
882 * @param handle Handle to queried ThermoPhase object.
883 * @param XY String representation of what two properties are being held constant
884 * @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.
885 * @param rtol Relative tolerance
886 * @param max_steps Maximum number of steps to take to find the solution
887 * @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.
888 * @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.
889 */
890 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);
891
892 /**
893 * Critical temperature (K).
894 *
895 * Wraps C++ getter: `virtual double ThermoPhase::critTemperature()`
896 *
897 * @param handle Handle to queried ThermoPhase object.
898 */
899 double thermo_critTemperature(int32_t handle);
900
901 /**
902 * Critical pressure (Pa).
903 *
904 * Wraps C++ getter: `virtual double ThermoPhase::critPressure()`
905 *
906 * @param handle Handle to queried ThermoPhase object.
907 */
908 double thermo_critPressure(int32_t handle);
909
910 /**
911 * Critical density (kg/m3).
912 *
913 * Wraps C++ getter: `virtual double ThermoPhase::critDensity()`
914 *
915 * @param handle Handle to queried ThermoPhase object.
916 */
917 double thermo_critDensity(int32_t handle);
918
919 /**
920 * Return the fraction of vapor at the current conditions.
921 *
922 * Wraps C++ getter: `virtual double ThermoPhase::vaporFraction()`
923 *
924 * @param handle Handle to queried ThermoPhase object.
925 */
926 double thermo_vaporFraction(int32_t handle);
927
928 /**
929 * Return the saturation temperature given the pressure.
930 *
931 * Wraps C++ method: `virtual double ThermoPhase::satTemperature(double)`
932 *
933 * @param handle Handle to queried ThermoPhase object.
934 * @param p Pressure (Pa)
935 */
936 double thermo_satTemperature(int32_t handle, double p);
937
938 /**
939 * Return the saturation pressure given the temperature.
940 *
941 * Wraps C++ method: `virtual double ThermoPhase::satPressure(double)`
942 *
943 * @param handle Handle to queried ThermoPhase object.
944 * @param t Temperature (Kelvin)
945 */
946 double thermo_satPressure(int32_t handle, double t);
947
948 /**
949 * Set the state to a saturated system at a particular pressure.
950 *
951 * Wraps C++ method: `virtual void ThermoPhase::setState_Psat(double, double)`
952 *
953 * @param handle Handle to queried ThermoPhase object.
954 * @param p Pressure (Pa)
955 * @param x Fraction of vapor
956 */
957 int32_t thermo_setState_Psat(int32_t handle, double p, double x);
958
959 /**
960 * Set the state to a saturated system at a particular temperature.
961 *
962 * Wraps C++ method: `virtual void ThermoPhase::setState_Tsat(double, double)`
963 *
964 * @param handle Handle to queried ThermoPhase object.
965 * @param t Temperature (kelvin)
966 * @param x Fraction of vapor
967 */
968 int32_t thermo_setState_Tsat(int32_t handle, double t, double x);
969
970 /**
971 * Return a vector of surface coverages.
972 *
973 * Wraps C++ getter: `void SurfPhase::getCoverages(span<double>)`
974 *
975 * @param handle Handle to queried SurfPhase object.
976 * @param[in] thetaLen Length of vector reserved for theta.
977 * @param theta Array theta must be at least as long as the number of species.
978 */
979 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta);
980
981 /**
982 * Set the surface site fractions to a specified state.
983 *
984 * Wraps C++ setter: `void SurfPhase::setCoverages(span<const double>)`
985 *
986 * @param handle Handle to queried SurfPhase object.
987 * @param[in] thetaLen Length of vector reserved for theta.
988 * @param theta This is the surface site fraction for the kth species in the surface phase. This is a dimensionless quantity.
989 */
990 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta);
991
992 /**
993 * Get the species concentrations (kmol/m^3).
994 *
995 * Wraps C++ getter: `virtual void Phase::getConcentrations(span<double>)`
996 *
997 * @param handle Handle to queried Phase object.
998 * @param[in] cLen Length of vector reserved for c.
999 * @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.
1000 */
1001 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c);
1002
1003 /**
1004 * Set the concentrations to the specified values within the phase.
1005 *
1006 * Wraps C++ setter: `virtual void Phase::setConcentrations(span<const double>)`
1007 *
1008 * @param handle Handle to queried Phase object.
1009 * @param[in] concLen Length of vector reserved for conc.
1010 * @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.
1011 */
1012 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc);
1013
1014 /**
1015 * Returns the site density.
1016 *
1017 * Wraps C++ getter: `double SurfPhase::siteDensity()`
1018 *
1019 * @param handle Handle to queried SurfPhase object.
1020 */
1021 double surf_siteDensity(int32_t handle);
1022
1023 /**
1024 * Set the site density of the surface phase (kmol m-2)
1025 *
1026 * Wraps C++ setter: `void SurfPhase::setSiteDensity(double)`
1027 *
1028 * @param handle Handle to queried SurfPhase object.
1029 * @param n0 Site density of the surface phase (kmol m-2)
1030 */
1031 int32_t surf_setSiteDensity(int32_t handle, double n0);
1032
1033 /**
1034 * Set the coverages from a string of colon-separated name:value pairs.
1035 *
1036 * Wraps C++ setter: `void SurfPhase::setCoveragesByName(const string&)`
1037 *
1038 * @param handle Handle to queried SurfPhase object.
1039 * @param cov String containing colon-separated name:value pairs
1040 */
1041 int32_t surf_setCoveragesByName(int32_t handle, const char* cov);
1042
1043 /**
1044 * Set the mixture composition according to the equivalence ratio.
1045 *
1046 * Wraps C++ method: `void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)`
1047 *
1048 * @param handle Handle to queried ThermoPhase object.
1049 * @param phi equivalence ratio
1050 * @param fuelComp composition of the fuel
1051 * @param oxComp composition of the oxidizer
1052 */
1053 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp);
1054
1055 /**
1056 * returns a summary of the state of the phase as a string
1057 *
1058 * Wraps C++ method: `virtual string ThermoPhase::report(bool, double)`
1059 *
1060 * @param handle Handle to queried ThermoPhase object.
1061 * @param show_thermo If true, extra information is printed out about the thermodynamic state of the system.
1062 * @param threshold Show information about species with mole fractions greater than *threshold*.
1063 * @param[in] bufLen Length of reserved array.
1064 * @param[out] buf Returned string value.
1065 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
1066 */
1067 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf);
1068
1069 /**
1070 * Print a summary of the state of the phase to the logger.
1071 *
1072 * Wraps C++ method: `custom code`
1073 *
1074 * Uses:
1075 * - `virtual string ThermoPhase::report(bool, double)`
1076 *
1077 * @param handle Handle to queried ThermoPhase object.
1078 * @param showThermo If true, extra information is printed out about the thermodynamic state of the system.
1079 * @param threshold Show information about species with mole fractions greater than
1080 * @returns Zero for success or -1 for exception handling.
1081 */
1082 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold);
1083
1084 /**
1085 * Delete ThermoPhase object.
1086 *
1087 * Wraps C++ destructor: `undefined`
1088 *
1089 * @param handle Handle to ThermoPhase object.
1090 * @returns Zero for success and -1 for exception handling.
1091 */
1092 int32_t thermo_del(int32_t handle);
1093
1094 /**
1095 * Return size of ThermoPhase storage.
1096 *
1097 * Wraps C++ reserved CLib function: `custom code`
1098 *
1099 * @returns Size or -1 for exception handling.
1100 */
1101 int32_t thermo_cabinetSize();
1102
1103 /**
1104 * @}
1105 */
1106
1107#ifdef __cplusplus
1108}
1109#endif
1110
1111#endif // CTTHERMO_H
double thermo_satTemperature(int32_t handle, double p)
Return the saturation temperature given the pressure.
Definition ctthermo.cpp:968
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:884
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:689
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:358
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:334
double thermo_cv_mole(int32_t handle)
Molar heat capacity at constant volume and composition [J/kmol/K].
Definition ctthermo.cpp:520
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:774
double thermo_intEnergy_mass(int32_t handle)
Specific internal energy.
Definition ctthermo.cpp:470
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:510
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:840
double thermo_internalPressure(int32_t handle)
Return the internal pressure [Pa].
Definition ctthermo.cpp:609
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:410
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:554
double thermo_enthalpy_mole(int32_t handle)
Molar enthalpy.
Definition ctthermo.cpp:420
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)
Definition ctthermo.cpp:906
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:530
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:895
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:829
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:851
double thermo_vaporFraction(int32_t handle)
Return the fraction of vapor at the current conditions.
Definition ctthermo.cpp:958
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:380
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:647
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:480
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:729
double thermo_critDensity(int32_t handle)
Critical density (kg/m3).
Definition ctthermo.cpp:948
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.
Definition ctthermo.cpp:999
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:862
double thermo_enthalpy_mass(int32_t handle)
Specific enthalpy.
Definition ctthermo.cpp:430
int32_t thermo_elementIndex(int32_t handle, const char *name)
Return the index of element named 'name'.
Definition ctthermo.cpp:346
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:450
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:306
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:796
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:740
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.
Definition ctthermo.cpp:917
double thermo_intEnergy_mole(int32_t handle)
Molar internal energy.
Definition ctthermo.cpp:460
double thermo_critTemperature(int32_t handle)
Critical temperature (K).
Definition ctthermo.cpp:928
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:717
int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double *mu)
Get the species chemical potentials.
Definition ctthermo.cpp:540
double thermo_electricPotential(int32_t handle)
Returns the electric potential of this phase (V).
Definition ctthermo.cpp:568
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:619
int32_t thermo_setState_Psat(int32_t handle, double p, double x)
Set the state to a saturated system at a particular pressure.
Definition ctthermo.cpp:988
double thermo_refPressure(int32_t handle)
Returns the reference pressure in Pa.
Definition ctthermo.cpp:390
int32_t thermo_cabinetSize()
Return size of ThermoPhase storage.
double thermo_isothermalCompressibility(int32_t handle)
Returns the isothermal compressibility.
Definition ctthermo.cpp:599
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:490
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:675
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:873
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:661
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:400
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.
Definition ctthermo.cpp:978
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:703
double thermo_thermalExpansionCoeff(int32_t handle)
Return the volumetric thermal expansion coefficient.
Definition ctthermo.cpp:589
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:785
int32_t thermo_setState_TP(int32_t handle, double t, double p)
Set the temperature (K) and pressure (Pa)
Definition ctthermo.cpp:763
double thermo_critPressure(int32_t handle)
Critical pressure (Pa).
Definition ctthermo.cpp:938
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:752
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:322
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:500
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_getMolecularWeights(int32_t handle, int32_t weightsLen, double *weights)
Copy the vector of molecular weights into array weights.
Definition ctthermo.cpp:290
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:633
double thermo_entropy_mole(int32_t handle)
Molar entropy.
Definition ctthermo.cpp:440
int32_t thermo_setElectricPotential(int32_t handle, double v)
Set the electric potential of this phase (V).
Definition ctthermo.cpp:578
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:807
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:818
double thermo_nAtoms(int32_t handle, int32_t k, int32_t m)
Number of atoms of element m in species k.
Definition ctthermo.cpp:370