Cantera
Loading...
Searching...
No Matches
ctthermo.cpp
Go to the documentation of this file.
1/**
2 * CTTHERMO - Generated CLib %Cantera interface library.
3 *
4 * @file ctthermo.cpp
5 *
6 * Generated CLib API for Cantera's ThermoPhase class.
7 *
8 * This file was generated by sourcegen. It will be re-generated by the
9 * %Cantera build process. Do not manually edit.
10 *
11 * @warning This module is an experimental part of the %Cantera API and
12 * may be changed without notice.
13 */
14
15// This file is part of Cantera. See License.txt in the top-level directory or
16// at https://cantera.org/license.txt for license and copyright information.
17
18#include "clib_utils.h"
20
24
25using namespace Cantera;
26
27//! @cond
28//! Cabinet type definitions will be ignored by Doxygen
29
30// Define Cabinet<ThermoPhase> (single-instance object)
31typedef Cabinet<ThermoPhase> ThermoPhaseCabinet;
32template<> ThermoPhaseCabinet* ThermoPhaseCabinet::s_storage = 0; // initialized here
33
34//! @endcond
35
36extern "C" {
37
38 int32_t thermo_name(int32_t handle, int32_t bufLen, char* buf)
39 {
40 // getter: string Phase::name()
41 try {
42 string out = ThermoPhaseCabinet::as<Phase>(handle)->name();
43 copyString(out, buf, bufLen);
44 return int(out.size()) + 1;
45 } catch (...) {
46 return handleAllExceptions(-1, ERR);
47 }
48 }
49
50 int32_t thermo_setName(int32_t handle, const char* nm)
51 {
52 // setter: void Phase::setName(const string&)
53 try {
54 ThermoPhaseCabinet::as<Phase>(handle)->setName(nm);
55 return 0;
56 } catch (...) {
57 return handleAllExceptions(-1, ERR);
58 }
59 }
60
61 int32_t thermo_type(int32_t handle, int32_t bufLen, char* buf)
62 {
63 // getter: string ThermoPhase::type()
64 try {
65 string out = ThermoPhaseCabinet::at(handle)->type();
66 copyString(out, buf, bufLen);
67 return int(out.size()) + 1;
68 } catch (...) {
69 return handleAllExceptions(-1, ERR);
70 }
71 }
72
73 int32_t thermo_nElements(int32_t handle)
74 {
75 // size getter: size_t Phase::nElements()
76 try {
77 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->nElements());
78 } catch (...) {
79 return handleAllExceptions(ERR, ERR);
80 }
81 }
82
83 int32_t thermo_nSpecies(int32_t handle)
84 {
85 // size getter: size_t Phase::nSpecies()
86 try {
87 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->nSpecies());
88 } catch (...) {
89 return handleAllExceptions(ERR, ERR);
90 }
91 }
92
93 double thermo_temperature(int32_t handle)
94 {
95 // getter: double Phase::temperature()
96 try {
97 return ThermoPhaseCabinet::as<Phase>(handle)->temperature();
98 } catch (...) {
99 return handleAllExceptions(DERR, DERR);
100 }
101 }
102
103 int32_t thermo_setTemperature(int32_t handle, double temp)
104 {
105 // setter: virtual void Phase::setTemperature(double)
106 try {
107 ThermoPhaseCabinet::as<Phase>(handle)->setTemperature(temp);
108 return 0;
109 } catch (...) {
110 return handleAllExceptions(-1, ERR);
111 }
112 }
113
114 double thermo_pressure(int32_t handle)
115 {
116 // getter: virtual double Phase::pressure()
117 try {
118 return ThermoPhaseCabinet::as<Phase>(handle)->pressure();
119 } catch (...) {
120 return handleAllExceptions(DERR, DERR);
121 }
122 }
123
124 int32_t thermo_setPressure(int32_t handle, double p)
125 {
126 // setter: virtual void Phase::setPressure(double)
127 try {
128 ThermoPhaseCabinet::as<Phase>(handle)->setPressure(p);
129 return 0;
130 } catch (...) {
131 return handleAllExceptions(-1, ERR);
132 }
133 }
134
135 double thermo_density(int32_t handle)
136 {
137 // getter: virtual double Phase::density()
138 try {
139 return ThermoPhaseCabinet::as<Phase>(handle)->density();
140 } catch (...) {
141 return handleAllExceptions(DERR, DERR);
142 }
143 }
144
145 int32_t thermo_setDensity(int32_t handle, const double density_)
146 {
147 // setter: virtual void Phase::setDensity(const double)
148 try {
149 ThermoPhaseCabinet::as<Phase>(handle)->setDensity(density_);
150 return 0;
151 } catch (...) {
152 return handleAllExceptions(-1, ERR);
153 }
154 }
155
156 double thermo_molarDensity(int32_t handle)
157 {
158 // getter: virtual double Phase::molarDensity()
159 try {
160 return ThermoPhaseCabinet::as<Phase>(handle)->molarDensity();
161 } catch (...) {
162 return handleAllExceptions(DERR, DERR);
163 }
164 }
165
166 double thermo_meanMolecularWeight(int32_t handle)
167 {
168 // getter: double Phase::meanMolecularWeight()
169 try {
170 return ThermoPhaseCabinet::as<Phase>(handle)->meanMolecularWeight();
171 } catch (...) {
172 return handleAllExceptions(DERR, DERR);
173 }
174 }
175
176 double thermo_moleFraction(int32_t handle, int32_t k)
177 {
178 // method: double Phase::moleFraction(size_t)
179 try {
180 return ThermoPhaseCabinet::as<Phase>(handle)->moleFraction(k);
181 } catch (...) {
182 return handleAllExceptions(DERR, DERR);
183 }
184 }
185
186 double thermo_massFraction(int32_t handle, int32_t k)
187 {
188 // method: double Phase::massFraction(size_t)
189 try {
190 return ThermoPhaseCabinet::as<Phase>(handle)->massFraction(k);
191 } catch (...) {
192 return handleAllExceptions(DERR, DERR);
193 }
194 }
195
196 int32_t thermo_getMoleFractions(int32_t handle, int32_t xLen, double* x)
197 {
198 // array getter: void Phase::getMoleFractions(span<double>)
199 try {
200 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
201 if (static_cast<size_t>(xLen) < obj->nSpecies()) {
202 throw ArraySizeError("thermo_getMoleFractions", xLen, obj->nSpecies());
203 }
204 span<double> x_(x, xLen);
205 obj->getMoleFractions(x_);
206 return 0;
207 } catch (...) {
208 return handleAllExceptions(-1, ERR);
209 }
210 }
211
212 int32_t thermo_getMassFractions(int32_t handle, int32_t yLen, double* y)
213 {
214 // array getter: void Phase::getMassFractions(span<double>)
215 try {
216 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
217 if (static_cast<size_t>(yLen) < obj->nSpecies()) {
218 throw ArraySizeError("thermo_getMassFractions", yLen, obj->nSpecies());
219 }
220 span<double> y_(y, yLen);
221 obj->getMassFractions(y_);
222 return 0;
223 } catch (...) {
224 return handleAllExceptions(-1, ERR);
225 }
226 }
227
228 int32_t thermo_setMoleFractions(int32_t handle, int32_t xLen, const double* x)
229 {
230 // setter: virtual void Phase::setMoleFractions(span<const double>)
231 try {
232 span<const double> x_(x, xLen);
233 ThermoPhaseCabinet::as<Phase>(handle)->setMoleFractions(x_);
234 return 0;
235 } catch (...) {
236 return handleAllExceptions(-1, ERR);
237 }
238 }
239
240 int32_t thermo_setMassFractions(int32_t handle, int32_t yLen, const double* y)
241 {
242 // setter: virtual void Phase::setMassFractions(span<const double>)
243 try {
244 span<const double> y_(y, yLen);
245 ThermoPhaseCabinet::as<Phase>(handle)->setMassFractions(y_);
246 return 0;
247 } catch (...) {
248 return handleAllExceptions(-1, ERR);
249 }
250 }
251
252 int32_t thermo_setMoleFractionsByName(int32_t handle, const char* x)
253 {
254 // setter: void Phase::setMoleFractionsByName(const string&)
255 try {
256 ThermoPhaseCabinet::as<Phase>(handle)->setMoleFractionsByName(x);
257 return 0;
258 } catch (...) {
259 return handleAllExceptions(-1, ERR);
260 }
261 }
262
263 int32_t thermo_setMassFractionsByName(int32_t handle, const char* x)
264 {
265 // setter: void Phase::setMassFractionsByName(const string&)
266 try {
267 ThermoPhaseCabinet::as<Phase>(handle)->setMassFractionsByName(x);
268 return 0;
269 } catch (...) {
270 return handleAllExceptions(-1, ERR);
271 }
272 }
273
274 int32_t thermo_atomicWeights(int32_t handle, int32_t bufLen, double* buf)
275 {
276 // array getter: span<const double> Phase::atomicWeights()
277 try {
278 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
279 if (static_cast<size_t>(bufLen) < obj->nElements()) {
280 throw ArraySizeError("thermo_atomicWeights", bufLen, obj->nElements());
281 }
282 span<const double> out = obj->atomicWeights();
283 std::copy(out.begin(), out.end(), buf);
284 return int(out.size());
285 } catch (...) {
286 return handleAllExceptions(-1, ERR);
287 }
288 }
289
290 int32_t thermo_getMolecularWeights(int32_t handle, int32_t weightsLen, double* weights)
291 {
292 // array getter: void Phase::getMolecularWeights(span<double>)
293 try {
294 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
295 if (static_cast<size_t>(weightsLen) < obj->nSpecies()) {
296 throw ArraySizeError("thermo_getMolecularWeights", weightsLen, obj->nSpecies());
297 }
298 span<double> weights_(weights, weightsLen);
299 obj->getMolecularWeights(weights_);
300 return 0;
301 } catch (...) {
302 return handleAllExceptions(-1, ERR);
303 }
304 }
305
306 int32_t thermo_getCharges(int32_t handle, int32_t chargesLen, double* charges)
307 {
308 // array getter: void Phase::getCharges(span<double>)
309 try {
310 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
311 if (static_cast<size_t>(chargesLen) < obj->nElements()) {
312 throw ArraySizeError("thermo_getCharges", chargesLen, obj->nElements());
313 }
314 span<double> charges_(charges, chargesLen);
315 obj->getCharges(charges_);
316 return 0;
317 } catch (...) {
318 return handleAllExceptions(-1, ERR);
319 }
320 }
321
322 int32_t thermo_elementName(int32_t handle, int32_t m, int32_t bufLen, char* buf)
323 {
324 // method: string Phase::elementName(size_t)
325 try {
326 string out = ThermoPhaseCabinet::as<Phase>(handle)->elementName(m);
327 copyString(out, buf, bufLen);
328 return int(out.size()) + 1;
329 } catch (...) {
330 return handleAllExceptions(-1, ERR);
331 }
332 }
333
334 int32_t thermo_speciesName(int32_t handle, int32_t k, int32_t bufLen, char* buf)
335 {
336 // method: string Phase::speciesName(size_t)
337 try {
338 string out = ThermoPhaseCabinet::as<Phase>(handle)->speciesName(k);
339 copyString(out, buf, bufLen);
340 return int(out.size()) + 1;
341 } catch (...) {
342 return handleAllExceptions(-1, ERR);
343 }
344 }
345
346 int32_t thermo_elementIndex(int32_t handle, const char* name)
347 {
348 // method: custom code
349 try {
350 // *************** begin custom code ***************
351 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->elementIndex(name, true));
352 // **************** end custom code ****************
353 } catch (...) {
354 return handleAllExceptions(-1, ERR);
355 }
356 }
357
358 int32_t thermo_speciesIndex(int32_t handle, const char* name)
359 {
360 // method: custom code
361 try {
362 // *************** begin custom code ***************
363 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->speciesIndex(name, true));
364 // **************** end custom code ****************
365 } catch (...) {
366 return handleAllExceptions(-1, ERR);
367 }
368 }
369
370 double thermo_nAtoms(int32_t handle, int32_t k, int32_t m)
371 {
372 // method: double Phase::nAtoms(size_t, size_t)
373 try {
374 return ThermoPhaseCabinet::as<Phase>(handle)->nAtoms(k, m);
375 } catch (...) {
376 return handleAllExceptions(DERR, DERR);
377 }
378 }
379
380 int32_t thermo_addElement(int32_t handle, const char* symbol, double weight, int32_t atomicNumber, double entropy298, int32_t elem_type)
381 {
382 // size getter: size_t Phase::addElement(const string&, double, int, double, int)
383 try {
384 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->addElement(symbol, weight, atomicNumber, entropy298, elem_type));
385 } catch (...) {
386 return handleAllExceptions(ERR, ERR);
387 }
388 }
389
390 double thermo_refPressure(int32_t handle)
391 {
392 // getter: virtual double ThermoPhase::refPressure()
393 try {
394 return ThermoPhaseCabinet::at(handle)->refPressure();
395 } catch (...) {
396 return handleAllExceptions(DERR, DERR);
397 }
398 }
399
400 double thermo_minTemp(int32_t handle, int32_t k)
401 {
402 // method: virtual double ThermoPhase::minTemp(size_t)
403 try {
404 return ThermoPhaseCabinet::at(handle)->minTemp(k);
405 } catch (...) {
406 return handleAllExceptions(DERR, DERR);
407 }
408 }
409
410 double thermo_maxTemp(int32_t handle, int32_t k)
411 {
412 // method: virtual double ThermoPhase::maxTemp(size_t)
413 try {
414 return ThermoPhaseCabinet::at(handle)->maxTemp(k);
415 } catch (...) {
416 return handleAllExceptions(DERR, DERR);
417 }
418 }
419
420 double thermo_enthalpy_mole(int32_t handle)
421 {
422 // getter: virtual double ThermoPhase::enthalpy_mole()
423 try {
424 return ThermoPhaseCabinet::at(handle)->enthalpy_mole();
425 } catch (...) {
426 return handleAllExceptions(DERR, DERR);
427 }
428 }
429
430 double thermo_enthalpy_mass(int32_t handle)
431 {
432 // getter: double ThermoPhase::enthalpy_mass()
433 try {
434 return ThermoPhaseCabinet::at(handle)->enthalpy_mass();
435 } catch (...) {
436 return handleAllExceptions(DERR, DERR);
437 }
438 }
439
440 double thermo_entropy_mole(int32_t handle)
441 {
442 // getter: virtual double ThermoPhase::entropy_mole()
443 try {
444 return ThermoPhaseCabinet::at(handle)->entropy_mole();
445 } catch (...) {
446 return handleAllExceptions(DERR, DERR);
447 }
448 }
449
450 double thermo_entropy_mass(int32_t handle)
451 {
452 // getter: double ThermoPhase::entropy_mass()
453 try {
454 return ThermoPhaseCabinet::at(handle)->entropy_mass();
455 } catch (...) {
456 return handleAllExceptions(DERR, DERR);
457 }
458 }
459
460 double thermo_intEnergy_mole(int32_t handle)
461 {
462 // getter: virtual double ThermoPhase::intEnergy_mole()
463 try {
464 return ThermoPhaseCabinet::at(handle)->intEnergy_mole();
465 } catch (...) {
466 return handleAllExceptions(DERR, DERR);
467 }
468 }
469
470 double thermo_intEnergy_mass(int32_t handle)
471 {
472 // getter: double ThermoPhase::intEnergy_mass()
473 try {
474 return ThermoPhaseCabinet::at(handle)->intEnergy_mass();
475 } catch (...) {
476 return handleAllExceptions(DERR, DERR);
477 }
478 }
479
480 double thermo_gibbs_mole(int32_t handle)
481 {
482 // getter: virtual double ThermoPhase::gibbs_mole()
483 try {
484 return ThermoPhaseCabinet::at(handle)->gibbs_mole();
485 } catch (...) {
486 return handleAllExceptions(DERR, DERR);
487 }
488 }
489
490 double thermo_gibbs_mass(int32_t handle)
491 {
492 // getter: double ThermoPhase::gibbs_mass()
493 try {
494 return ThermoPhaseCabinet::at(handle)->gibbs_mass();
495 } catch (...) {
496 return handleAllExceptions(DERR, DERR);
497 }
498 }
499
500 double thermo_cp_mole(int32_t handle)
501 {
502 // getter: virtual double ThermoPhase::cp_mole()
503 try {
504 return ThermoPhaseCabinet::at(handle)->cp_mole();
505 } catch (...) {
506 return handleAllExceptions(DERR, DERR);
507 }
508 }
509
510 double thermo_cp_mass(int32_t handle)
511 {
512 // getter: double ThermoPhase::cp_mass()
513 try {
514 return ThermoPhaseCabinet::at(handle)->cp_mass();
515 } catch (...) {
516 return handleAllExceptions(DERR, DERR);
517 }
518 }
519
520 double thermo_cv_mole(int32_t handle)
521 {
522 // getter: virtual double ThermoPhase::cv_mole()
523 try {
524 return ThermoPhaseCabinet::at(handle)->cv_mole();
525 } catch (...) {
526 return handleAllExceptions(DERR, DERR);
527 }
528 }
529
530 double thermo_cv_mass(int32_t handle)
531 {
532 // getter: double ThermoPhase::cv_mass()
533 try {
534 return ThermoPhaseCabinet::at(handle)->cv_mass();
535 } catch (...) {
536 return handleAllExceptions(DERR, DERR);
537 }
538 }
539
540 int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double* mu)
541 {
542 // array getter: virtual void ThermoPhase::getChemPotentials(span<double>)
543 try {
544 auto& obj = ThermoPhaseCabinet::at(handle);
545 // no size checking specified
546 span<double> mu_(mu, muLen);
547 obj->getChemPotentials(mu_);
548 return 0;
549 } catch (...) {
550 return handleAllExceptions(-1, ERR);
551 }
552 }
553
554 int32_t thermo_getElectrochemPotentials(int32_t handle, int32_t muLen, double* mu)
555 {
556 // array getter: void ThermoPhase::getElectrochemPotentials(span<double>)
557 try {
558 auto& obj = ThermoPhaseCabinet::at(handle);
559 // no size checking specified
560 span<double> mu_(mu, muLen);
561 obj->getElectrochemPotentials(mu_);
562 return 0;
563 } catch (...) {
564 return handleAllExceptions(-1, ERR);
565 }
566 }
567
568 double thermo_electricPotential(int32_t handle)
569 {
570 // getter: double ThermoPhase::electricPotential()
571 try {
572 return ThermoPhaseCabinet::at(handle)->electricPotential();
573 } catch (...) {
574 return handleAllExceptions(DERR, DERR);
575 }
576 }
577
578 int32_t thermo_setElectricPotential(int32_t handle, double v)
579 {
580 // setter: void ThermoPhase::setElectricPotential(double)
581 try {
582 ThermoPhaseCabinet::at(handle)->setElectricPotential(v);
583 return 0;
584 } catch (...) {
585 return handleAllExceptions(-1, ERR);
586 }
587 }
588
589 double thermo_thermalExpansionCoeff(int32_t handle)
590 {
591 // getter: virtual double ThermoPhase::thermalExpansionCoeff()
592 try {
593 return ThermoPhaseCabinet::at(handle)->thermalExpansionCoeff();
594 } catch (...) {
595 return handleAllExceptions(DERR, DERR);
596 }
597 }
598
599 double thermo_isothermalCompressibility(int32_t handle)
600 {
601 // getter: virtual double ThermoPhase::isothermalCompressibility()
602 try {
603 return ThermoPhaseCabinet::at(handle)->isothermalCompressibility();
604 } catch (...) {
605 return handleAllExceptions(DERR, DERR);
606 }
607 }
608
609 double thermo_internalPressure(int32_t handle)
610 {
611 // getter: virtual double ThermoPhase::internalPressure()
612 try {
613 return ThermoPhaseCabinet::at(handle)->internalPressure();
614 } catch (...) {
615 return handleAllExceptions(DERR, DERR);
616 }
617 }
618
619 int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double* hbar)
620 {
621 // array getter: virtual void ThermoPhase::getPartialMolarEnthalpies(span<double>)
622 try {
623 auto& obj = ThermoPhaseCabinet::at(handle);
624 // no size checking specified
625 span<double> hbar_(hbar, hbarLen);
626 obj->getPartialMolarEnthalpies(hbar_);
627 return 0;
628 } catch (...) {
629 return handleAllExceptions(-1, ERR);
630 }
631 }
632
633 int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double* sbar)
634 {
635 // array getter: virtual void ThermoPhase::getPartialMolarEntropies(span<double>)
636 try {
637 auto& obj = ThermoPhaseCabinet::at(handle);
638 // no size checking specified
639 span<double> sbar_(sbar, sbarLen);
640 obj->getPartialMolarEntropies(sbar_);
641 return 0;
642 } catch (...) {
643 return handleAllExceptions(-1, ERR);
644 }
645 }
646
647 int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double* ubar)
648 {
649 // array getter: virtual void ThermoPhase::getPartialMolarIntEnergies(span<double>)
650 try {
651 auto& obj = ThermoPhaseCabinet::at(handle);
652 // no size checking specified
653 span<double> ubar_(ubar, ubarLen);
654 obj->getPartialMolarIntEnergies(ubar_);
655 return 0;
656 } catch (...) {
657 return handleAllExceptions(-1, ERR);
658 }
659 }
660
661 int32_t thermo_getPartialMolarIntEnergies_TV(int32_t handle, int32_t utildeLen, double* utilde)
662 {
663 // array getter: virtual void ThermoPhase::getPartialMolarIntEnergies_TV(span<double>)
664 try {
665 auto& obj = ThermoPhaseCabinet::at(handle);
666 // no size checking specified
667 span<double> utilde_(utilde, utildeLen);
668 obj->getPartialMolarIntEnergies_TV(utilde_);
669 return 0;
670 } catch (...) {
671 return handleAllExceptions(-1, ERR);
672 }
673 }
674
675 int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double* cpbar)
676 {
677 // array getter: virtual void ThermoPhase::getPartialMolarCp(span<double>)
678 try {
679 auto& obj = ThermoPhaseCabinet::at(handle);
680 // no size checking specified
681 span<double> cpbar_(cpbar, cpbarLen);
682 obj->getPartialMolarCp(cpbar_);
683 return 0;
684 } catch (...) {
685 return handleAllExceptions(-1, ERR);
686 }
687 }
688
689 int32_t thermo_getPartialMolarCv_TV(int32_t handle, int32_t cvtildeLen, double* cvtilde)
690 {
691 // array getter: virtual void ThermoPhase::getPartialMolarCv_TV(span<double>)
692 try {
693 auto& obj = ThermoPhaseCabinet::at(handle);
694 // no size checking specified
695 span<double> cvtilde_(cvtilde, cvtildeLen);
696 obj->getPartialMolarCv_TV(cvtilde_);
697 return 0;
698 } catch (...) {
699 return handleAllExceptions(-1, ERR);
700 }
701 }
702
703 int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double* vbar)
704 {
705 // array getter: virtual void ThermoPhase::getPartialMolarVolumes(span<double>)
706 try {
707 auto& obj = ThermoPhaseCabinet::at(handle);
708 // no size checking specified
709 span<double> vbar_(vbar, vbarLen);
710 obj->getPartialMolarVolumes(vbar_);
711 return 0;
712 } catch (...) {
713 return handleAllExceptions(-1, ERR);
714 }
715 }
716
717 int32_t thermo_getEnthalpy_RT(int32_t handle, int32_t hrtLen, double* hrt)
718 {
719 // array getter: virtual void ThermoPhase::getEnthalpy_RT(span<double>)
720 try {
721 auto& obj = ThermoPhaseCabinet::at(handle);
722 // no size checking specified
723 span<double> hrt_(hrt, hrtLen);
724 obj->getEnthalpy_RT(hrt_);
725 return 0;
726 } catch (...) {
727 return handleAllExceptions(-1, ERR);
728 }
729 }
730
731 int32_t thermo_getEntropy_R(int32_t handle, int32_t srLen, double* sr)
732 {
733 // array getter: virtual void ThermoPhase::getEntropy_R(span<double>)
734 try {
735 auto& obj = ThermoPhaseCabinet::at(handle);
736 // no size checking specified
737 span<double> sr_(sr, srLen);
738 obj->getEntropy_R(sr_);
739 return 0;
740 } catch (...) {
741 return handleAllExceptions(-1, ERR);
742 }
743 }
744
745 int32_t thermo_getGibbs_RT(int32_t handle, int32_t grtLen, double* grt)
746 {
747 // array getter: virtual void ThermoPhase::getGibbs_RT(span<double>)
748 try {
749 auto& obj = ThermoPhaseCabinet::at(handle);
750 // no size checking specified
751 span<double> grt_(grt, grtLen);
752 obj->getGibbs_RT(grt_);
753 return 0;
754 } catch (...) {
755 return handleAllExceptions(-1, ERR);
756 }
757 }
758
759 int32_t thermo_getIntEnergy_RT(int32_t handle, int32_t urtLen, double* urt)
760 {
761 // array getter: virtual void ThermoPhase::getIntEnergy_RT(span<double>)
762 try {
763 auto& obj = ThermoPhaseCabinet::at(handle);
764 // no size checking specified
765 span<double> urt_(urt, urtLen);
766 obj->getIntEnergy_RT(urt_);
767 return 0;
768 } catch (...) {
769 return handleAllExceptions(-1, ERR);
770 }
771 }
772
773 int32_t thermo_getCp_R(int32_t handle, int32_t cprLen, double* cpr)
774 {
775 // array getter: virtual void ThermoPhase::getCp_R(span<double>)
776 try {
777 auto& obj = ThermoPhaseCabinet::at(handle);
778 // no size checking specified
779 span<double> cpr_(cpr, cprLen);
780 obj->getCp_R(cpr_);
781 return 0;
782 } catch (...) {
783 return handleAllExceptions(-1, ERR);
784 }
785 }
786
787 int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x)
788 {
789 // method: virtual void ThermoPhase::setState_TPX(double, double, span<const double>)
790 try {
791 span<const double> x_(x, xLen);
792 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x_);
793 return 0;
794 } catch (...) {
795 return handleAllExceptions(-1, ERR);
796 }
797 }
798
799 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x)
800 {
801 // method: virtual void ThermoPhase::setState_TPX(double, double, const string&)
802 try {
803 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x);
804 return 0;
805 } catch (...) {
806 return handleAllExceptions(-1, ERR);
807 }
808 }
809
810 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y)
811 {
812 // method: virtual void ThermoPhase::setState_TPY(double, double, span<const double>)
813 try {
814 span<const double> y_(y, yLen);
815 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y_);
816 return 0;
817 } catch (...) {
818 return handleAllExceptions(-1, ERR);
819 }
820 }
821
822 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y)
823 {
824 // method: virtual void ThermoPhase::setState_TPY(double, double, const string&)
825 try {
826 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y);
827 return 0;
828 } catch (...) {
829 return handleAllExceptions(-1, ERR);
830 }
831 }
832
833 int32_t thermo_setState_TP(int32_t handle, double t, double p)
834 {
835 // method: virtual void ThermoPhase::setState_TP(double, double)
836 try {
837 ThermoPhaseCabinet::at(handle)->setState_TP(t, p);
838 return 0;
839 } catch (...) {
840 return handleAllExceptions(-1, ERR);
841 }
842 }
843
844 int32_t thermo_setState_TD(int32_t handle, double t, double rho)
845 {
846 // method: virtual void Phase::setState_TD(double, double)
847 try {
848 ThermoPhaseCabinet::as<Phase>(handle)->setState_TD(t, rho);
849 return 0;
850 } catch (...) {
851 return handleAllExceptions(-1, ERR);
852 }
853 }
854
855 int32_t thermo_setState_DP(int32_t handle, double rho, double p)
856 {
857 // method: virtual void ThermoPhase::setState_DP(double, double)
858 try {
859 ThermoPhaseCabinet::at(handle)->setState_DP(rho, p);
860 return 0;
861 } catch (...) {
862 return handleAllExceptions(-1, ERR);
863 }
864 }
865
866 int32_t thermo_setState_HP(int32_t handle, double h, double p)
867 {
868 // method: virtual void ThermoPhase::setState_HP(double, double)
869 try {
870 ThermoPhaseCabinet::at(handle)->setState_HP(h, p);
871 return 0;
872 } catch (...) {
873 return handleAllExceptions(-1, ERR);
874 }
875 }
876
877 int32_t thermo_setState_UV(int32_t handle, double u, double v)
878 {
879 // method: virtual void ThermoPhase::setState_UV(double, double)
880 try {
881 ThermoPhaseCabinet::at(handle)->setState_UV(u, v);
882 return 0;
883 } catch (...) {
884 return handleAllExceptions(-1, ERR);
885 }
886 }
887
888 int32_t thermo_setState_SV(int32_t handle, double s, double v)
889 {
890 // method: virtual void ThermoPhase::setState_SV(double, double)
891 try {
892 ThermoPhaseCabinet::at(handle)->setState_SV(s, v);
893 return 0;
894 } catch (...) {
895 return handleAllExceptions(-1, ERR);
896 }
897 }
898
899 int32_t thermo_setState_SP(int32_t handle, double s, double p)
900 {
901 // method: virtual void ThermoPhase::setState_SP(double, double)
902 try {
903 ThermoPhaseCabinet::at(handle)->setState_SP(s, p);
904 return 0;
905 } catch (...) {
906 return handleAllExceptions(-1, ERR);
907 }
908 }
909
910 int32_t thermo_setState_ST(int32_t handle, double s, double t)
911 {
912 // method: virtual void ThermoPhase::setState_ST(double, double)
913 try {
914 ThermoPhaseCabinet::at(handle)->setState_ST(s, t);
915 return 0;
916 } catch (...) {
917 return handleAllExceptions(-1, ERR);
918 }
919 }
920
921 int32_t thermo_setState_TV(int32_t handle, double t, double v)
922 {
923 // method: virtual void ThermoPhase::setState_TV(double, double)
924 try {
925 ThermoPhaseCabinet::at(handle)->setState_TV(t, v);
926 return 0;
927 } catch (...) {
928 return handleAllExceptions(-1, ERR);
929 }
930 }
931
932 int32_t thermo_setState_PV(int32_t handle, double p, double v)
933 {
934 // method: virtual void ThermoPhase::setState_PV(double, double)
935 try {
936 ThermoPhaseCabinet::at(handle)->setState_PV(p, v);
937 return 0;
938 } catch (...) {
939 return handleAllExceptions(-1, ERR);
940 }
941 }
942
943 int32_t thermo_setState_UP(int32_t handle, double u, double p)
944 {
945 // method: virtual void ThermoPhase::setState_UP(double, double)
946 try {
947 ThermoPhaseCabinet::at(handle)->setState_UP(u, p);
948 return 0;
949 } catch (...) {
950 return handleAllExceptions(-1, ERR);
951 }
952 }
953
954 int32_t thermo_setState_VH(int32_t handle, double v, double h)
955 {
956 // method: virtual void ThermoPhase::setState_VH(double, double)
957 try {
958 ThermoPhaseCabinet::at(handle)->setState_VH(v, h);
959 return 0;
960 } catch (...) {
961 return handleAllExceptions(-1, ERR);
962 }
963 }
964
965 int32_t thermo_setState_TH(int32_t handle, double t, double h)
966 {
967 // method: virtual void ThermoPhase::setState_TH(double, double)
968 try {
969 ThermoPhaseCabinet::at(handle)->setState_TH(t, h);
970 return 0;
971 } catch (...) {
972 return handleAllExceptions(-1, ERR);
973 }
974 }
975
976 int32_t thermo_setState_SH(int32_t handle, double s, double h)
977 {
978 // method: virtual void ThermoPhase::setState_SH(double, double)
979 try {
980 ThermoPhaseCabinet::at(handle)->setState_SH(s, h);
981 return 0;
982 } catch (...) {
983 return handleAllExceptions(-1, ERR);
984 }
985 }
986
987 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)
988 {
989 // method: void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)
990 try {
991 ThermoPhaseCabinet::at(handle)->equilibrate(XY, solver, rtol, max_steps, max_iter, estimate_equil);
992 return 0;
993 } catch (...) {
994 return handleAllExceptions(-1, ERR);
995 }
996 }
997
998 double thermo_critTemperature(int32_t handle)
999 {
1000 // getter: virtual double ThermoPhase::critTemperature()
1001 try {
1002 return ThermoPhaseCabinet::at(handle)->critTemperature();
1003 } catch (...) {
1004 return handleAllExceptions(DERR, DERR);
1005 }
1006 }
1007
1008 double thermo_critPressure(int32_t handle)
1009 {
1010 // getter: virtual double ThermoPhase::critPressure()
1011 try {
1012 return ThermoPhaseCabinet::at(handle)->critPressure();
1013 } catch (...) {
1014 return handleAllExceptions(DERR, DERR);
1015 }
1016 }
1017
1018 double thermo_critDensity(int32_t handle)
1019 {
1020 // getter: virtual double ThermoPhase::critDensity()
1021 try {
1022 return ThermoPhaseCabinet::at(handle)->critDensity();
1023 } catch (...) {
1024 return handleAllExceptions(DERR, DERR);
1025 }
1026 }
1027
1028 double thermo_vaporFraction(int32_t handle)
1029 {
1030 // getter: virtual double ThermoPhase::vaporFraction()
1031 try {
1032 return ThermoPhaseCabinet::at(handle)->vaporFraction();
1033 } catch (...) {
1034 return handleAllExceptions(DERR, DERR);
1035 }
1036 }
1037
1038 double thermo_satTemperature(int32_t handle, double p)
1039 {
1040 // method: virtual double ThermoPhase::satTemperature(double)
1041 try {
1042 return ThermoPhaseCabinet::at(handle)->satTemperature(p);
1043 } catch (...) {
1044 return handleAllExceptions(DERR, DERR);
1045 }
1046 }
1047
1048 double thermo_satPressure(int32_t handle, double t)
1049 {
1050 // method: virtual double ThermoPhase::satPressure(double)
1051 try {
1052 return ThermoPhaseCabinet::at(handle)->satPressure(t);
1053 } catch (...) {
1054 return handleAllExceptions(DERR, DERR);
1055 }
1056 }
1057
1058 int32_t thermo_setState_Psat(int32_t handle, double p, double x)
1059 {
1060 // method: virtual void ThermoPhase::setState_Psat(double, double)
1061 try {
1062 ThermoPhaseCabinet::at(handle)->setState_Psat(p, x);
1063 return 0;
1064 } catch (...) {
1065 return handleAllExceptions(-1, ERR);
1066 }
1067 }
1068
1069 int32_t thermo_setState_Tsat(int32_t handle, double t, double x)
1070 {
1071 // method: virtual void ThermoPhase::setState_Tsat(double, double)
1072 try {
1073 ThermoPhaseCabinet::at(handle)->setState_Tsat(t, x);
1074 return 0;
1075 } catch (...) {
1076 return handleAllExceptions(-1, ERR);
1077 }
1078 }
1079
1080 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta)
1081 {
1082 // array getter: void SurfPhase::getCoverages(span<double>)
1083 try {
1084 auto obj = ThermoPhaseCabinet::as<SurfPhase>(handle);
1085 // no size checking specified
1086 span<double> theta_(theta, thetaLen);
1087 obj->getCoverages(theta_);
1088 return 0;
1089 } catch (...) {
1090 return handleAllExceptions(-1, ERR);
1091 }
1092 }
1093
1094 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta)
1095 {
1096 // setter: void SurfPhase::setCoverages(span<const double>)
1097 try {
1098 span<const double> theta_(theta, thetaLen);
1099 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoverages(theta_);
1100 return 0;
1101 } catch (...) {
1102 return handleAllExceptions(-1, ERR);
1103 }
1104 }
1105
1106 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c)
1107 {
1108 // array getter: virtual void Phase::getConcentrations(span<double>)
1109 try {
1110 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
1111 // no size checking specified
1112 span<double> c_(c, cLen);
1113 obj->getConcentrations(c_);
1114 return 0;
1115 } catch (...) {
1116 return handleAllExceptions(-1, ERR);
1117 }
1118 }
1119
1120 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc)
1121 {
1122 // setter: virtual void Phase::setConcentrations(span<const double>)
1123 try {
1124 span<const double> conc_(conc, concLen);
1125 ThermoPhaseCabinet::as<Phase>(handle)->setConcentrations(conc_);
1126 return 0;
1127 } catch (...) {
1128 return handleAllExceptions(-1, ERR);
1129 }
1130 }
1131
1132 double surf_siteDensity(int32_t handle)
1133 {
1134 // getter: double SurfPhase::siteDensity()
1135 try {
1136 return ThermoPhaseCabinet::as<SurfPhase>(handle)->siteDensity();
1137 } catch (...) {
1138 return handleAllExceptions(DERR, DERR);
1139 }
1140 }
1141
1142 int32_t surf_setSiteDensity(int32_t handle, double n0)
1143 {
1144 // setter: void SurfPhase::setSiteDensity(double)
1145 try {
1146 ThermoPhaseCabinet::as<SurfPhase>(handle)->setSiteDensity(n0);
1147 return 0;
1148 } catch (...) {
1149 return handleAllExceptions(-1, ERR);
1150 }
1151 }
1152
1153 int32_t surf_setCoveragesByName(int32_t handle, const char* cov)
1154 {
1155 // setter: void SurfPhase::setCoveragesByName(const string&)
1156 try {
1157 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoveragesByName(cov);
1158 return 0;
1159 } catch (...) {
1160 return handleAllExceptions(-1, ERR);
1161 }
1162 }
1163
1164 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp)
1165 {
1166 // method: void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)
1167 try {
1168 ThermoPhaseCabinet::at(handle)->setEquivalenceRatio(phi, fuelComp, oxComp);
1169 return 0;
1170 } catch (...) {
1171 return handleAllExceptions(-1, ERR);
1172 }
1173 }
1174
1175 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf)
1176 {
1177 // method: virtual string ThermoPhase::report(bool, double)
1178 try {
1179 bool show_thermo_ = (show_thermo != 0);
1180 string out = ThermoPhaseCabinet::at(handle)->report(show_thermo_, threshold);
1181 copyString(out, buf, bufLen);
1182 return int(out.size()) + 1;
1183 } catch (...) {
1184 return handleAllExceptions(-1, ERR);
1185 }
1186 }
1187
1188 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold)
1189 {
1190 // method: custom code
1191 try {
1192 // *************** begin custom code ***************
1193 bool show = (showThermo != 0);
1194 writelog(ThermoPhaseCabinet::at(handle)->report(show, threshold));
1195 return 0;
1196 // **************** end custom code ****************
1197 } catch (...) {
1198 return handleAllExceptions(-1, ERR);
1199 }
1200 }
1201
1202 int32_t thermo_del(int32_t handle)
1203 {
1204 // destructor
1205 try {
1206 ThermoPhaseCabinet::del(handle);
1207 return 0;
1208 } catch (...) {
1209 return handleAllExceptions(-1, ERR);
1210 }
1211 }
1212
1214 {
1215 // reserved CLib function: custom code
1216 try {
1217 // *************** begin custom code ***************
1218 return ThermoPhaseCabinet::size();
1219 // **************** end custom code ****************
1220 } catch (...) {
1221 return handleAllExceptions(-1, ERR);
1222 }
1223 }
1224
1225} // extern "C"
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Array size error.
Template for classes to hold pointers to objects.
Definition Cabinet.h:51
CTTHERMO - Generated CLib Cantera interface library.
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:954
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:745
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
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:731
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:844
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:910
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:976
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:965
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:899
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:759
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:921
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: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:799
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:932
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:866
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:810
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:987
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:998
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:787
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.
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_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:717
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:943
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.
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:855
int32_t thermo_setState_TP(int32_t handle, double t, double p)
Set the temperature (K) and pressure (Pa).
Definition ctthermo.cpp:833
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:822
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_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:773
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:877
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:888
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
size_t copyString(const string &source, char *dest, size_t length)
Copy the contents of a string into a char array of a given length.
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
Definition global.h:171
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.
Definition clib_utils.h:32
Contains declarations for string manipulation functions within Cantera.