Cantera  4.0.0a1
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_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x)
718 {
719 // method: virtual void ThermoPhase::setState_TPX(double, double, span<const double>)
720 try {
721 span<const double> x_(x, xLen);
722 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x_);
723 return 0;
724 } catch (...) {
725 return handleAllExceptions(-1, ERR);
726 }
727 }
728
729 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x)
730 {
731 // method: virtual void ThermoPhase::setState_TPX(double, double, const string&)
732 try {
733 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x);
734 return 0;
735 } catch (...) {
736 return handleAllExceptions(-1, ERR);
737 }
738 }
739
740 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y)
741 {
742 // method: virtual void ThermoPhase::setState_TPY(double, double, span<const double>)
743 try {
744 span<const double> y_(y, yLen);
745 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y_);
746 return 0;
747 } catch (...) {
748 return handleAllExceptions(-1, ERR);
749 }
750 }
751
752 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y)
753 {
754 // method: virtual void ThermoPhase::setState_TPY(double, double, const string&)
755 try {
756 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y);
757 return 0;
758 } catch (...) {
759 return handleAllExceptions(-1, ERR);
760 }
761 }
762
763 int32_t thermo_setState_TP(int32_t handle, double t, double p)
764 {
765 // method: virtual void ThermoPhase::setState_TP(double, double)
766 try {
767 ThermoPhaseCabinet::at(handle)->setState_TP(t, p);
768 return 0;
769 } catch (...) {
770 return handleAllExceptions(-1, ERR);
771 }
772 }
773
774 int32_t thermo_setState_TD(int32_t handle, double t, double rho)
775 {
776 // method: void Phase::setState_TD(double, double)
777 try {
778 ThermoPhaseCabinet::as<Phase>(handle)->setState_TD(t, rho);
779 return 0;
780 } catch (...) {
781 return handleAllExceptions(-1, ERR);
782 }
783 }
784
785 int32_t thermo_setState_DP(int32_t handle, double rho, double p)
786 {
787 // method: virtual void ThermoPhase::setState_DP(double, double)
788 try {
789 ThermoPhaseCabinet::at(handle)->setState_DP(rho, p);
790 return 0;
791 } catch (...) {
792 return handleAllExceptions(-1, ERR);
793 }
794 }
795
796 int32_t thermo_setState_HP(int32_t handle, double h, double p)
797 {
798 // method: virtual void ThermoPhase::setState_HP(double, double)
799 try {
800 ThermoPhaseCabinet::at(handle)->setState_HP(h, p);
801 return 0;
802 } catch (...) {
803 return handleAllExceptions(-1, ERR);
804 }
805 }
806
807 int32_t thermo_setState_UV(int32_t handle, double u, double v)
808 {
809 // method: virtual void ThermoPhase::setState_UV(double, double)
810 try {
811 ThermoPhaseCabinet::at(handle)->setState_UV(u, v);
812 return 0;
813 } catch (...) {
814 return handleAllExceptions(-1, ERR);
815 }
816 }
817
818 int32_t thermo_setState_SV(int32_t handle, double s, double v)
819 {
820 // method: virtual void ThermoPhase::setState_SV(double, double)
821 try {
822 ThermoPhaseCabinet::at(handle)->setState_SV(s, v);
823 return 0;
824 } catch (...) {
825 return handleAllExceptions(-1, ERR);
826 }
827 }
828
829 int32_t thermo_setState_SP(int32_t handle, double s, double p)
830 {
831 // method: virtual void ThermoPhase::setState_SP(double, double)
832 try {
833 ThermoPhaseCabinet::at(handle)->setState_SP(s, p);
834 return 0;
835 } catch (...) {
836 return handleAllExceptions(-1, ERR);
837 }
838 }
839
840 int32_t thermo_setState_ST(int32_t handle, double s, double t)
841 {
842 // method: virtual void ThermoPhase::setState_ST(double, double)
843 try {
844 ThermoPhaseCabinet::at(handle)->setState_ST(s, t);
845 return 0;
846 } catch (...) {
847 return handleAllExceptions(-1, ERR);
848 }
849 }
850
851 int32_t thermo_setState_TV(int32_t handle, double t, double v)
852 {
853 // method: virtual void ThermoPhase::setState_TV(double, double)
854 try {
855 ThermoPhaseCabinet::at(handle)->setState_TV(t, v);
856 return 0;
857 } catch (...) {
858 return handleAllExceptions(-1, ERR);
859 }
860 }
861
862 int32_t thermo_setState_PV(int32_t handle, double p, double v)
863 {
864 // method: virtual void ThermoPhase::setState_PV(double, double)
865 try {
866 ThermoPhaseCabinet::at(handle)->setState_PV(p, v);
867 return 0;
868 } catch (...) {
869 return handleAllExceptions(-1, ERR);
870 }
871 }
872
873 int32_t thermo_setState_UP(int32_t handle, double u, double p)
874 {
875 // method: virtual void ThermoPhase::setState_UP(double, double)
876 try {
877 ThermoPhaseCabinet::at(handle)->setState_UP(u, p);
878 return 0;
879 } catch (...) {
880 return handleAllExceptions(-1, ERR);
881 }
882 }
883
884 int32_t thermo_setState_VH(int32_t handle, double v, double h)
885 {
886 // method: virtual void ThermoPhase::setState_VH(double, double)
887 try {
888 ThermoPhaseCabinet::at(handle)->setState_VH(v, h);
889 return 0;
890 } catch (...) {
891 return handleAllExceptions(-1, ERR);
892 }
893 }
894
895 int32_t thermo_setState_TH(int32_t handle, double t, double h)
896 {
897 // method: virtual void ThermoPhase::setState_TH(double, double)
898 try {
899 ThermoPhaseCabinet::at(handle)->setState_TH(t, h);
900 return 0;
901 } catch (...) {
902 return handleAllExceptions(-1, ERR);
903 }
904 }
905
906 int32_t thermo_setState_SH(int32_t handle, double s, double h)
907 {
908 // method: virtual void ThermoPhase::setState_SH(double, double)
909 try {
910 ThermoPhaseCabinet::at(handle)->setState_SH(s, h);
911 return 0;
912 } catch (...) {
913 return handleAllExceptions(-1, ERR);
914 }
915 }
916
917 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)
918 {
919 // method: void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)
920 try {
921 ThermoPhaseCabinet::at(handle)->equilibrate(XY, solver, rtol, max_steps, max_iter, estimate_equil);
922 return 0;
923 } catch (...) {
924 return handleAllExceptions(-1, ERR);
925 }
926 }
927
928 double thermo_critTemperature(int32_t handle)
929 {
930 // getter: virtual double ThermoPhase::critTemperature()
931 try {
932 return ThermoPhaseCabinet::at(handle)->critTemperature();
933 } catch (...) {
934 return handleAllExceptions(DERR, DERR);
935 }
936 }
937
938 double thermo_critPressure(int32_t handle)
939 {
940 // getter: virtual double ThermoPhase::critPressure()
941 try {
942 return ThermoPhaseCabinet::at(handle)->critPressure();
943 } catch (...) {
944 return handleAllExceptions(DERR, DERR);
945 }
946 }
947
948 double thermo_critDensity(int32_t handle)
949 {
950 // getter: virtual double ThermoPhase::critDensity()
951 try {
952 return ThermoPhaseCabinet::at(handle)->critDensity();
953 } catch (...) {
954 return handleAllExceptions(DERR, DERR);
955 }
956 }
957
958 double thermo_vaporFraction(int32_t handle)
959 {
960 // getter: virtual double ThermoPhase::vaporFraction()
961 try {
962 return ThermoPhaseCabinet::at(handle)->vaporFraction();
963 } catch (...) {
964 return handleAllExceptions(DERR, DERR);
965 }
966 }
967
968 double thermo_satTemperature(int32_t handle, double p)
969 {
970 // method: virtual double ThermoPhase::satTemperature(double)
971 try {
972 return ThermoPhaseCabinet::at(handle)->satTemperature(p);
973 } catch (...) {
974 return handleAllExceptions(DERR, DERR);
975 }
976 }
977
978 double thermo_satPressure(int32_t handle, double t)
979 {
980 // method: virtual double ThermoPhase::satPressure(double)
981 try {
982 return ThermoPhaseCabinet::at(handle)->satPressure(t);
983 } catch (...) {
984 return handleAllExceptions(DERR, DERR);
985 }
986 }
987
988 int32_t thermo_setState_Psat(int32_t handle, double p, double x)
989 {
990 // method: virtual void ThermoPhase::setState_Psat(double, double)
991 try {
992 ThermoPhaseCabinet::at(handle)->setState_Psat(p, x);
993 return 0;
994 } catch (...) {
995 return handleAllExceptions(-1, ERR);
996 }
997 }
998
999 int32_t thermo_setState_Tsat(int32_t handle, double t, double x)
1000 {
1001 // method: virtual void ThermoPhase::setState_Tsat(double, double)
1002 try {
1003 ThermoPhaseCabinet::at(handle)->setState_Tsat(t, x);
1004 return 0;
1005 } catch (...) {
1006 return handleAllExceptions(-1, ERR);
1007 }
1008 }
1009
1010 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta)
1011 {
1012 // array getter: void SurfPhase::getCoverages(span<double>)
1013 try {
1014 auto obj = ThermoPhaseCabinet::as<SurfPhase>(handle);
1015 // no size checking specified
1016 span<double> theta_(theta, thetaLen);
1017 obj->getCoverages(theta_);
1018 return 0;
1019 } catch (...) {
1020 return handleAllExceptions(-1, ERR);
1021 }
1022 }
1023
1024 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta)
1025 {
1026 // setter: void SurfPhase::setCoverages(span<const double>)
1027 try {
1028 span<const double> theta_(theta, thetaLen);
1029 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoverages(theta_);
1030 return 0;
1031 } catch (...) {
1032 return handleAllExceptions(-1, ERR);
1033 }
1034 }
1035
1036 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c)
1037 {
1038 // array getter: virtual void Phase::getConcentrations(span<double>)
1039 try {
1040 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
1041 // no size checking specified
1042 span<double> c_(c, cLen);
1043 obj->getConcentrations(c_);
1044 return 0;
1045 } catch (...) {
1046 return handleAllExceptions(-1, ERR);
1047 }
1048 }
1049
1050 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc)
1051 {
1052 // setter: virtual void Phase::setConcentrations(span<const double>)
1053 try {
1054 span<const double> conc_(conc, concLen);
1055 ThermoPhaseCabinet::as<Phase>(handle)->setConcentrations(conc_);
1056 return 0;
1057 } catch (...) {
1058 return handleAllExceptions(-1, ERR);
1059 }
1060 }
1061
1062 double surf_siteDensity(int32_t handle)
1063 {
1064 // getter: double SurfPhase::siteDensity()
1065 try {
1066 return ThermoPhaseCabinet::as<SurfPhase>(handle)->siteDensity();
1067 } catch (...) {
1068 return handleAllExceptions(DERR, DERR);
1069 }
1070 }
1071
1072 int32_t surf_setSiteDensity(int32_t handle, double n0)
1073 {
1074 // setter: void SurfPhase::setSiteDensity(double)
1075 try {
1076 ThermoPhaseCabinet::as<SurfPhase>(handle)->setSiteDensity(n0);
1077 return 0;
1078 } catch (...) {
1079 return handleAllExceptions(-1, ERR);
1080 }
1081 }
1082
1083 int32_t surf_setCoveragesByName(int32_t handle, const char* cov)
1084 {
1085 // setter: void SurfPhase::setCoveragesByName(const string&)
1086 try {
1087 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoveragesByName(cov);
1088 return 0;
1089 } catch (...) {
1090 return handleAllExceptions(-1, ERR);
1091 }
1092 }
1093
1094 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp)
1095 {
1096 // method: void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)
1097 try {
1098 ThermoPhaseCabinet::at(handle)->setEquivalenceRatio(phi, fuelComp, oxComp);
1099 return 0;
1100 } catch (...) {
1101 return handleAllExceptions(-1, ERR);
1102 }
1103 }
1104
1105 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf)
1106 {
1107 // method: virtual string ThermoPhase::report(bool, double)
1108 try {
1109 bool show_thermo_ = (show_thermo != 0);
1110 string out = ThermoPhaseCabinet::at(handle)->report(show_thermo_, threshold);
1111 copyString(out, buf, bufLen);
1112 return int(out.size()) + 1;
1113 } catch (...) {
1114 return handleAllExceptions(-1, ERR);
1115 }
1116 }
1117
1118 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold)
1119 {
1120 // method: custom code
1121 try {
1122 // *************** begin custom code ***************
1123 bool show = (showThermo != 0);
1124 writelog(ThermoPhaseCabinet::at(handle)->report(show, threshold));
1125 return 0;
1126 // **************** end custom code ****************
1127 } catch (...) {
1128 return handleAllExceptions(-1, ERR);
1129 }
1130 }
1131
1132 int32_t thermo_del(int32_t handle)
1133 {
1134 // destructor
1135 try {
1136 ThermoPhaseCabinet::del(handle);
1137 return 0;
1138 } catch (...) {
1139 return handleAllExceptions(-1, ERR);
1140 }
1141 }
1142
1144 {
1145 // reserved CLib function: custom code
1146 try {
1147 // *************** begin custom code ***************
1148 return ThermoPhaseCabinet::size();
1149 // **************** end custom code ****************
1150 } catch (...) {
1151 return handleAllExceptions(-1, ERR);
1152 }
1153 }
1154
1155} // 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.
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
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.