Cantera  3.2.0a5
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(double* const)
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 obj->getMoleFractions(x);
205 return 0;
206 } catch (...) {
207 return handleAllExceptions(-1, ERR);
208 }
209 }
210
211 int32_t thermo_getMassFractions(int32_t handle, int32_t yLen, double* y)
212 {
213 // array getter: void Phase::getMassFractions(double* const)
214 try {
215 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
216 if (static_cast<size_t>(yLen) < obj->nSpecies()) {
217 throw ArraySizeError("thermo_getMassFractions", yLen, obj->nSpecies());
218 }
219 obj->getMassFractions(y);
220 return 0;
221 } catch (...) {
222 return handleAllExceptions(-1, ERR);
223 }
224 }
225
226 int32_t thermo_setMoleFractions(int32_t handle, int32_t xLen, const double* x)
227 {
228 // array setter: virtual void Phase::setMoleFractions(const double* const)
229 try {
230 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
231 if (static_cast<size_t>(xLen) < obj->nSpecies()) {
232 throw ArraySizeError("thermo_setMoleFractions", xLen, obj->nSpecies());
233 }
234 obj->setMoleFractions(x);
235 return 0;
236 } catch (...) {
237 return handleAllExceptions(-1, ERR);
238 }
239 }
240
241 int32_t thermo_setMassFractions(int32_t handle, int32_t yLen, const double* y)
242 {
243 // array setter: virtual void Phase::setMassFractions(const double* const)
244 try {
245 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
246 if (static_cast<size_t>(yLen) < obj->nSpecies()) {
247 throw ArraySizeError("thermo_setMassFractions", yLen, obj->nSpecies());
248 }
249 obj->setMassFractions(y);
250 return 0;
251 } catch (...) {
252 return handleAllExceptions(-1, ERR);
253 }
254 }
255
256 int32_t thermo_setMoleFractionsByName(int32_t handle, const char* x)
257 {
258 // setter: void Phase::setMoleFractionsByName(const string&)
259 try {
260 ThermoPhaseCabinet::as<Phase>(handle)->setMoleFractionsByName(x);
261 return 0;
262 } catch (...) {
263 return handleAllExceptions(-1, ERR);
264 }
265 }
266
267 int32_t thermo_setMassFractionsByName(int32_t handle, const char* x)
268 {
269 // setter: void Phase::setMassFractionsByName(const string&)
270 try {
271 ThermoPhaseCabinet::as<Phase>(handle)->setMassFractionsByName(x);
272 return 0;
273 } catch (...) {
274 return handleAllExceptions(-1, ERR);
275 }
276 }
277
278 int32_t thermo_atomicWeights(int32_t handle, int32_t bufLen, double* buf)
279 {
280 // array getter: const vector<double>& Phase::atomicWeights()
281 try {
282 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
283 if (static_cast<size_t>(bufLen) < obj->nElements()) {
284 throw ArraySizeError("thermo_atomicWeights", bufLen, obj->nElements());
285 }
286 const vector<double>& out = obj->atomicWeights();
287 std::copy(out.begin(), out.end(), buf);
288 return int(out.size());
289 } catch (...) {
290 return handleAllExceptions(-1, ERR);
291 }
292 }
293
294 int32_t thermo_getMolecularWeights(int32_t handle, int32_t weightsLen, double* weights)
295 {
296 // array getter: void Phase::getMolecularWeights(double*)
297 try {
298 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
299 if (static_cast<size_t>(weightsLen) < obj->nSpecies()) {
300 throw ArraySizeError("thermo_getMolecularWeights", weightsLen, obj->nSpecies());
301 }
302 obj->getMolecularWeights(weights);
303 return 0;
304 } catch (...) {
305 return handleAllExceptions(-1, ERR);
306 }
307 }
308
309 int32_t thermo_getCharges(int32_t handle, int32_t chargesLen, double* charges)
310 {
311 // array getter: void Phase::getCharges(double*)
312 try {
313 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
314 if (static_cast<size_t>(chargesLen) < obj->nElements()) {
315 throw ArraySizeError("thermo_getCharges", chargesLen, obj->nElements());
316 }
317 obj->getCharges(charges);
318 return 0;
319 } catch (...) {
320 return handleAllExceptions(-1, ERR);
321 }
322 }
323
324 int32_t thermo_elementName(int32_t handle, int32_t m, int32_t bufLen, char* buf)
325 {
326 // method: string Phase::elementName(size_t)
327 try {
328 string out = ThermoPhaseCabinet::as<Phase>(handle)->elementName(m);
329 copyString(out, buf, bufLen);
330 return int(out.size()) + 1;
331 } catch (...) {
332 return handleAllExceptions(-1, ERR);
333 }
334 }
335
336 int32_t thermo_speciesName(int32_t handle, int32_t k, int32_t bufLen, char* buf)
337 {
338 // method: string Phase::speciesName(size_t)
339 try {
340 string out = ThermoPhaseCabinet::as<Phase>(handle)->speciesName(k);
341 copyString(out, buf, bufLen);
342 return int(out.size()) + 1;
343 } catch (...) {
344 return handleAllExceptions(-1, ERR);
345 }
346 }
347
348 int32_t thermo_elementIndex(int32_t handle, const char* name)
349 {
350 // method: custom code
351 try {
352 // *************** begin custom code ***************
353 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->elementIndex(name, true));
354 // **************** end custom code ****************
355 } catch (...) {
356 return handleAllExceptions(-1, ERR);
357 }
358 }
359
360 int32_t thermo_speciesIndex(int32_t handle, const char* name)
361 {
362 // method: custom code
363 try {
364 // *************** begin custom code ***************
365 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->speciesIndex(name, true));
366 // **************** end custom code ****************
367 } catch (...) {
368 return handleAllExceptions(-1, ERR);
369 }
370 }
371
372 double thermo_nAtoms(int32_t handle, int32_t k, int32_t m)
373 {
374 // method: double Phase::nAtoms(size_t, size_t)
375 try {
376 return ThermoPhaseCabinet::as<Phase>(handle)->nAtoms(k, m);
377 } catch (...) {
378 return handleAllExceptions(DERR, DERR);
379 }
380 }
381
382 int32_t thermo_addElement(int32_t handle, const char* symbol, double weight, int32_t atomicNumber, double entropy298, int32_t elem_type)
383 {
384 // size getter: size_t Phase::addElement(const string&, double, int, double, int)
385 try {
386 return static_cast<int32_t>(ThermoPhaseCabinet::as<Phase>(handle)->addElement(symbol, weight, atomicNumber, entropy298, elem_type));
387 } catch (...) {
388 return handleAllExceptions(ERR, ERR);
389 }
390 }
391
392 double thermo_refPressure(int32_t handle)
393 {
394 // getter: virtual double ThermoPhase::refPressure()
395 try {
396 return ThermoPhaseCabinet::at(handle)->refPressure();
397 } catch (...) {
398 return handleAllExceptions(DERR, DERR);
399 }
400 }
401
402 double thermo_minTemp(int32_t handle, int32_t k)
403 {
404 // method: virtual double ThermoPhase::minTemp(size_t)
405 try {
406 return ThermoPhaseCabinet::at(handle)->minTemp(k);
407 } catch (...) {
408 return handleAllExceptions(DERR, DERR);
409 }
410 }
411
412 double thermo_maxTemp(int32_t handle, int32_t k)
413 {
414 // method: virtual double ThermoPhase::maxTemp(size_t)
415 try {
416 return ThermoPhaseCabinet::at(handle)->maxTemp(k);
417 } catch (...) {
418 return handleAllExceptions(DERR, DERR);
419 }
420 }
421
422 double thermo_enthalpy_mole(int32_t handle)
423 {
424 // getter: virtual double ThermoPhase::enthalpy_mole()
425 try {
426 return ThermoPhaseCabinet::at(handle)->enthalpy_mole();
427 } catch (...) {
428 return handleAllExceptions(DERR, DERR);
429 }
430 }
431
432 double thermo_enthalpy_mass(int32_t handle)
433 {
434 // getter: double ThermoPhase::enthalpy_mass()
435 try {
436 return ThermoPhaseCabinet::at(handle)->enthalpy_mass();
437 } catch (...) {
438 return handleAllExceptions(DERR, DERR);
439 }
440 }
441
442 double thermo_entropy_mole(int32_t handle)
443 {
444 // getter: virtual double ThermoPhase::entropy_mole()
445 try {
446 return ThermoPhaseCabinet::at(handle)->entropy_mole();
447 } catch (...) {
448 return handleAllExceptions(DERR, DERR);
449 }
450 }
451
452 double thermo_entropy_mass(int32_t handle)
453 {
454 // getter: double ThermoPhase::entropy_mass()
455 try {
456 return ThermoPhaseCabinet::at(handle)->entropy_mass();
457 } catch (...) {
458 return handleAllExceptions(DERR, DERR);
459 }
460 }
461
462 double thermo_intEnergy_mole(int32_t handle)
463 {
464 // getter: virtual double ThermoPhase::intEnergy_mole()
465 try {
466 return ThermoPhaseCabinet::at(handle)->intEnergy_mole();
467 } catch (...) {
468 return handleAllExceptions(DERR, DERR);
469 }
470 }
471
472 double thermo_intEnergy_mass(int32_t handle)
473 {
474 // getter: double ThermoPhase::intEnergy_mass()
475 try {
476 return ThermoPhaseCabinet::at(handle)->intEnergy_mass();
477 } catch (...) {
478 return handleAllExceptions(DERR, DERR);
479 }
480 }
481
482 double thermo_gibbs_mole(int32_t handle)
483 {
484 // getter: virtual double ThermoPhase::gibbs_mole()
485 try {
486 return ThermoPhaseCabinet::at(handle)->gibbs_mole();
487 } catch (...) {
488 return handleAllExceptions(DERR, DERR);
489 }
490 }
491
492 double thermo_gibbs_mass(int32_t handle)
493 {
494 // getter: double ThermoPhase::gibbs_mass()
495 try {
496 return ThermoPhaseCabinet::at(handle)->gibbs_mass();
497 } catch (...) {
498 return handleAllExceptions(DERR, DERR);
499 }
500 }
501
502 double thermo_cp_mole(int32_t handle)
503 {
504 // getter: virtual double ThermoPhase::cp_mole()
505 try {
506 return ThermoPhaseCabinet::at(handle)->cp_mole();
507 } catch (...) {
508 return handleAllExceptions(DERR, DERR);
509 }
510 }
511
512 double thermo_cp_mass(int32_t handle)
513 {
514 // getter: double ThermoPhase::cp_mass()
515 try {
516 return ThermoPhaseCabinet::at(handle)->cp_mass();
517 } catch (...) {
518 return handleAllExceptions(DERR, DERR);
519 }
520 }
521
522 double thermo_cv_mole(int32_t handle)
523 {
524 // getter: virtual double ThermoPhase::cv_mole()
525 try {
526 return ThermoPhaseCabinet::at(handle)->cv_mole();
527 } catch (...) {
528 return handleAllExceptions(DERR, DERR);
529 }
530 }
531
532 double thermo_cv_mass(int32_t handle)
533 {
534 // getter: double ThermoPhase::cv_mass()
535 try {
536 return ThermoPhaseCabinet::at(handle)->cv_mass();
537 } catch (...) {
538 return handleAllExceptions(DERR, DERR);
539 }
540 }
541
542 int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double* mu)
543 {
544 // array getter: virtual void ThermoPhase::getChemPotentials(double*)
545 try {
546 auto& obj = ThermoPhaseCabinet::at(handle);
547 // no size checking specified
548 obj->getChemPotentials(mu);
549 return 0;
550 } catch (...) {
551 return handleAllExceptions(-1, ERR);
552 }
553 }
554
555 int32_t thermo_getElectrochemPotentials(int32_t handle, int32_t muLen, double* mu)
556 {
557 // array getter: void ThermoPhase::getElectrochemPotentials(double*)
558 try {
559 auto& obj = ThermoPhaseCabinet::at(handle);
560 // no size checking specified
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 int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double* hbar)
610 {
611 // array getter: virtual void ThermoPhase::getPartialMolarEnthalpies(double*)
612 try {
613 auto& obj = ThermoPhaseCabinet::at(handle);
614 // no size checking specified
615 obj->getPartialMolarEnthalpies(hbar);
616 return 0;
617 } catch (...) {
618 return handleAllExceptions(-1, ERR);
619 }
620 }
621
622 int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double* sbar)
623 {
624 // array getter: virtual void ThermoPhase::getPartialMolarEntropies(double*)
625 try {
626 auto& obj = ThermoPhaseCabinet::at(handle);
627 // no size checking specified
628 obj->getPartialMolarEntropies(sbar);
629 return 0;
630 } catch (...) {
631 return handleAllExceptions(-1, ERR);
632 }
633 }
634
635 int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double* ubar)
636 {
637 // array getter: virtual void ThermoPhase::getPartialMolarIntEnergies(double*)
638 try {
639 auto& obj = ThermoPhaseCabinet::at(handle);
640 // no size checking specified
641 obj->getPartialMolarIntEnergies(ubar);
642 return 0;
643 } catch (...) {
644 return handleAllExceptions(-1, ERR);
645 }
646 }
647
648 int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double* cpbar)
649 {
650 // array getter: virtual void ThermoPhase::getPartialMolarCp(double*)
651 try {
652 auto& obj = ThermoPhaseCabinet::at(handle);
653 // no size checking specified
654 obj->getPartialMolarCp(cpbar);
655 return 0;
656 } catch (...) {
657 return handleAllExceptions(-1, ERR);
658 }
659 }
660
661 int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double* vbar)
662 {
663 // array getter: virtual void ThermoPhase::getPartialMolarVolumes(double*)
664 try {
665 auto& obj = ThermoPhaseCabinet::at(handle);
666 // no size checking specified
667 obj->getPartialMolarVolumes(vbar);
668 return 0;
669 } catch (...) {
670 return handleAllExceptions(-1, ERR);
671 }
672 }
673
674 int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x)
675 {
676 // method: virtual void ThermoPhase::setState_TPX(double, double, const double*)
677 try {
678 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x);
679 return 0;
680 } catch (...) {
681 return handleAllExceptions(-1, ERR);
682 }
683 }
684
685 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x)
686 {
687 // method: virtual void ThermoPhase::setState_TPX(double, double, const string&)
688 try {
689 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x);
690 return 0;
691 } catch (...) {
692 return handleAllExceptions(-1, ERR);
693 }
694 }
695
696 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y)
697 {
698 // method: virtual void ThermoPhase::setState_TPY(double, double, const double*)
699 try {
700 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y);
701 return 0;
702 } catch (...) {
703 return handleAllExceptions(-1, ERR);
704 }
705 }
706
707 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y)
708 {
709 // method: virtual void ThermoPhase::setState_TPY(double, double, const string&)
710 try {
711 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y);
712 return 0;
713 } catch (...) {
714 return handleAllExceptions(-1, ERR);
715 }
716 }
717
718 int32_t thermo_setState_TP(int32_t handle, double t, double p)
719 {
720 // method: virtual void ThermoPhase::setState_TP(double, double)
721 try {
722 ThermoPhaseCabinet::at(handle)->setState_TP(t, p);
723 return 0;
724 } catch (...) {
725 return handleAllExceptions(-1, ERR);
726 }
727 }
728
729 int32_t thermo_setState_TD(int32_t handle, double t, double rho)
730 {
731 // method: void Phase::setState_TD(double, double)
732 try {
733 ThermoPhaseCabinet::as<Phase>(handle)->setState_TD(t, rho);
734 return 0;
735 } catch (...) {
736 return handleAllExceptions(-1, ERR);
737 }
738 }
739
740 int32_t thermo_setState_DP(int32_t handle, double rho, double p)
741 {
742 // method: virtual void ThermoPhase::setState_DP(double, double)
743 try {
744 ThermoPhaseCabinet::at(handle)->setState_DP(rho, p);
745 return 0;
746 } catch (...) {
747 return handleAllExceptions(-1, ERR);
748 }
749 }
750
751 int32_t thermo_setState_HP(int32_t handle, double h, double p)
752 {
753 // method: virtual void ThermoPhase::setState_HP(double, double)
754 try {
755 ThermoPhaseCabinet::at(handle)->setState_HP(h, p);
756 return 0;
757 } catch (...) {
758 return handleAllExceptions(-1, ERR);
759 }
760 }
761
762 int32_t thermo_setState_UV(int32_t handle, double u, double v)
763 {
764 // method: virtual void ThermoPhase::setState_UV(double, double)
765 try {
766 ThermoPhaseCabinet::at(handle)->setState_UV(u, v);
767 return 0;
768 } catch (...) {
769 return handleAllExceptions(-1, ERR);
770 }
771 }
772
773 int32_t thermo_setState_SV(int32_t handle, double s, double v)
774 {
775 // method: virtual void ThermoPhase::setState_SV(double, double)
776 try {
777 ThermoPhaseCabinet::at(handle)->setState_SV(s, v);
778 return 0;
779 } catch (...) {
780 return handleAllExceptions(-1, ERR);
781 }
782 }
783
784 int32_t thermo_setState_SP(int32_t handle, double s, double p)
785 {
786 // method: virtual void ThermoPhase::setState_SP(double, double)
787 try {
788 ThermoPhaseCabinet::at(handle)->setState_SP(s, p);
789 return 0;
790 } catch (...) {
791 return handleAllExceptions(-1, ERR);
792 }
793 }
794
795 int32_t thermo_setState_ST(int32_t handle, double s, double t)
796 {
797 // method: virtual void ThermoPhase::setState_ST(double, double)
798 try {
799 ThermoPhaseCabinet::at(handle)->setState_ST(s, t);
800 return 0;
801 } catch (...) {
802 return handleAllExceptions(-1, ERR);
803 }
804 }
805
806 int32_t thermo_setState_TV(int32_t handle, double t, double v)
807 {
808 // method: virtual void ThermoPhase::setState_TV(double, double)
809 try {
810 ThermoPhaseCabinet::at(handle)->setState_TV(t, v);
811 return 0;
812 } catch (...) {
813 return handleAllExceptions(-1, ERR);
814 }
815 }
816
817 int32_t thermo_setState_PV(int32_t handle, double p, double v)
818 {
819 // method: virtual void ThermoPhase::setState_PV(double, double)
820 try {
821 ThermoPhaseCabinet::at(handle)->setState_PV(p, v);
822 return 0;
823 } catch (...) {
824 return handleAllExceptions(-1, ERR);
825 }
826 }
827
828 int32_t thermo_setState_UP(int32_t handle, double u, double p)
829 {
830 // method: virtual void ThermoPhase::setState_UP(double, double)
831 try {
832 ThermoPhaseCabinet::at(handle)->setState_UP(u, p);
833 return 0;
834 } catch (...) {
835 return handleAllExceptions(-1, ERR);
836 }
837 }
838
839 int32_t thermo_setState_VH(int32_t handle, double v, double h)
840 {
841 // method: virtual void ThermoPhase::setState_VH(double, double)
842 try {
843 ThermoPhaseCabinet::at(handle)->setState_VH(v, h);
844 return 0;
845 } catch (...) {
846 return handleAllExceptions(-1, ERR);
847 }
848 }
849
850 int32_t thermo_setState_TH(int32_t handle, double t, double h)
851 {
852 // method: virtual void ThermoPhase::setState_TH(double, double)
853 try {
854 ThermoPhaseCabinet::at(handle)->setState_TH(t, h);
855 return 0;
856 } catch (...) {
857 return handleAllExceptions(-1, ERR);
858 }
859 }
860
861 int32_t thermo_setState_SH(int32_t handle, double s, double h)
862 {
863 // method: virtual void ThermoPhase::setState_SH(double, double)
864 try {
865 ThermoPhaseCabinet::at(handle)->setState_SH(s, h);
866 return 0;
867 } catch (...) {
868 return handleAllExceptions(-1, ERR);
869 }
870 }
871
872 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)
873 {
874 // method: void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)
875 try {
876 ThermoPhaseCabinet::at(handle)->equilibrate(XY, solver, rtol, max_steps, max_iter, estimate_equil);
877 return 0;
878 } catch (...) {
879 return handleAllExceptions(-1, ERR);
880 }
881 }
882
883 double thermo_critTemperature(int32_t handle)
884 {
885 // getter: virtual double ThermoPhase::critTemperature()
886 try {
887 return ThermoPhaseCabinet::at(handle)->critTemperature();
888 } catch (...) {
889 return handleAllExceptions(DERR, DERR);
890 }
891 }
892
893 double thermo_critPressure(int32_t handle)
894 {
895 // getter: virtual double ThermoPhase::critPressure()
896 try {
897 return ThermoPhaseCabinet::at(handle)->critPressure();
898 } catch (...) {
899 return handleAllExceptions(DERR, DERR);
900 }
901 }
902
903 double thermo_critDensity(int32_t handle)
904 {
905 // getter: virtual double ThermoPhase::critDensity()
906 try {
907 return ThermoPhaseCabinet::at(handle)->critDensity();
908 } catch (...) {
909 return handleAllExceptions(DERR, DERR);
910 }
911 }
912
913 double thermo_vaporFraction(int32_t handle)
914 {
915 // getter: virtual double ThermoPhase::vaporFraction()
916 try {
917 return ThermoPhaseCabinet::at(handle)->vaporFraction();
918 } catch (...) {
919 return handleAllExceptions(DERR, DERR);
920 }
921 }
922
923 double thermo_satTemperature(int32_t handle, double p)
924 {
925 // method: virtual double ThermoPhase::satTemperature(double)
926 try {
927 return ThermoPhaseCabinet::at(handle)->satTemperature(p);
928 } catch (...) {
929 return handleAllExceptions(DERR, DERR);
930 }
931 }
932
933 double thermo_satPressure(int32_t handle, double t)
934 {
935 // method: virtual double ThermoPhase::satPressure(double)
936 try {
937 return ThermoPhaseCabinet::at(handle)->satPressure(t);
938 } catch (...) {
939 return handleAllExceptions(DERR, DERR);
940 }
941 }
942
943 int32_t thermo_setState_Psat(int32_t handle, double p, double x)
944 {
945 // method: virtual void ThermoPhase::setState_Psat(double, double)
946 try {
947 ThermoPhaseCabinet::at(handle)->setState_Psat(p, x);
948 return 0;
949 } catch (...) {
950 return handleAllExceptions(-1, ERR);
951 }
952 }
953
954 int32_t thermo_setState_Tsat(int32_t handle, double t, double x)
955 {
956 // method: virtual void ThermoPhase::setState_Tsat(double, double)
957 try {
958 ThermoPhaseCabinet::at(handle)->setState_Tsat(t, x);
959 return 0;
960 } catch (...) {
961 return handleAllExceptions(-1, ERR);
962 }
963 }
964
965 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta)
966 {
967 // array getter: void SurfPhase::getCoverages(double*)
968 try {
969 auto obj = ThermoPhaseCabinet::as<SurfPhase>(handle);
970 // no size checking specified
971 obj->getCoverages(theta);
972 return 0;
973 } catch (...) {
974 return handleAllExceptions(-1, ERR);
975 }
976 }
977
978 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta)
979 {
980 // array setter: void SurfPhase::setCoverages(const double*)
981 try {
982 auto obj = ThermoPhaseCabinet::as<SurfPhase>(handle);
983 // no size checking specified
984 obj->setCoverages(theta);
985 return 0;
986 } catch (...) {
987 return handleAllExceptions(-1, ERR);
988 }
989 }
990
991 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c)
992 {
993 // array getter: virtual void Phase::getConcentrations(double* const)
994 try {
995 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
996 // no size checking specified
997 obj->getConcentrations(c);
998 return 0;
999 } catch (...) {
1000 return handleAllExceptions(-1, ERR);
1001 }
1002 }
1003
1004 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc)
1005 {
1006 // array setter: virtual void Phase::setConcentrations(const double* const)
1007 try {
1008 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
1009 // no size checking specified
1010 obj->setConcentrations(conc);
1011 return 0;
1012 } catch (...) {
1013 return handleAllExceptions(-1, ERR);
1014 }
1015 }
1016
1017 double surf_siteDensity(int32_t handle)
1018 {
1019 // getter: double SurfPhase::siteDensity()
1020 try {
1021 return ThermoPhaseCabinet::as<SurfPhase>(handle)->siteDensity();
1022 } catch (...) {
1023 return handleAllExceptions(DERR, DERR);
1024 }
1025 }
1026
1027 int32_t surf_setSiteDensity(int32_t handle, double n0)
1028 {
1029 // setter: void SurfPhase::setSiteDensity(double)
1030 try {
1031 ThermoPhaseCabinet::as<SurfPhase>(handle)->setSiteDensity(n0);
1032 return 0;
1033 } catch (...) {
1034 return handleAllExceptions(-1, ERR);
1035 }
1036 }
1037
1038 int32_t surf_setCoveragesByName(int32_t handle, const char* cov)
1039 {
1040 // setter: void SurfPhase::setCoveragesByName(const string&)
1041 try {
1042 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoveragesByName(cov);
1043 return 0;
1044 } catch (...) {
1045 return handleAllExceptions(-1, ERR);
1046 }
1047 }
1048
1049 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp)
1050 {
1051 // method: void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)
1052 try {
1053 ThermoPhaseCabinet::at(handle)->setEquivalenceRatio(phi, fuelComp, oxComp);
1054 return 0;
1055 } catch (...) {
1056 return handleAllExceptions(-1, ERR);
1057 }
1058 }
1059
1060 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf)
1061 {
1062 // method: virtual string ThermoPhase::report(bool, double)
1063 try {
1064 bool show_thermo_ = (show_thermo != 0);
1065 string out = ThermoPhaseCabinet::at(handle)->report(show_thermo_, threshold);
1066 copyString(out, buf, bufLen);
1067 return int(out.size()) + 1;
1068 } catch (...) {
1069 return handleAllExceptions(-1, ERR);
1070 }
1071 }
1072
1073 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold)
1074 {
1075 // method: custom code
1076 try {
1077 // *************** begin custom code ***************
1078 bool show = (showThermo != 0);
1079 writelog(ThermoPhaseCabinet::at(handle)->report(show, threshold));
1080 return 0;
1081 // **************** end custom code ****************
1082 } catch (...) {
1083 return handleAllExceptions(-1, ERR);
1084 }
1085 }
1086
1087 int32_t thermo_del(int32_t handle)
1088 {
1089 // destructor
1090 try {
1091 ThermoPhaseCabinet::del(handle);
1092 return 0;
1093 } catch (...) {
1094 return handleAllExceptions(-1, ERR);
1095 }
1096 }
1097
1099 {
1100 // reserved CLib function: custom code
1101 try {
1102 // *************** begin custom code ***************
1103 return ThermoPhaseCabinet::size();
1104 // **************** end custom code ****************
1105 } catch (...) {
1106 return handleAllExceptions(-1, ERR);
1107 }
1108 }
1109
1110} // 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:923
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:839
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_speciesIndex(int32_t handle, const char *name)
Returns the index of a species named 'name' within the Phase object.
Definition ctthermo.cpp:360
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:336
double thermo_cv_mole(int32_t handle)
Molar heat capacity at constant volume.
Definition ctthermo.cpp:522
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:729
double thermo_intEnergy_mass(int32_t handle)
Specific internal energy.
Definition ctthermo.cpp:472
int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double *c)
Get the species concentrations (kmol/m^3).
Definition ctthermo.cpp:991
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.
Definition ctthermo.cpp:978
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.
Definition ctthermo.cpp:512
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:241
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:795
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:412
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:555
double thermo_enthalpy_mole(int32_t handle)
Molar enthalpy.
Definition ctthermo.cpp:422
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:861
int32_t thermo_setMoleFractionsByName(int32_t handle, const char *x)
Set the mole fractions of a group of species by name.
Definition ctthermo.cpp:256
double thermo_cv_mass(int32_t handle)
Specific heat at constant volume.
Definition ctthermo.cpp:532
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:850
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:784
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:806
double thermo_vaporFraction(int32_t handle)
Return the fraction of vapor at the current conditions.
Definition ctthermo.cpp:913
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:382
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:635
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:482
int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double *theta)
Return a vector of surface coverages.
Definition ctthermo.cpp:965
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:685
double thermo_critDensity(int32_t handle)
Critical density (kg/m3).
Definition ctthermo.cpp:903
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:954
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:817
double thermo_enthalpy_mass(int32_t handle)
Specific enthalpy.
Definition ctthermo.cpp:432
int32_t thermo_elementIndex(int32_t handle, const char *name)
Return the index of element named 'name'.
Definition ctthermo.cpp:348
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:452
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:309
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:751
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:696
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:872
double thermo_intEnergy_mole(int32_t handle)
Molar internal energy.
Definition ctthermo.cpp:462
double thermo_critTemperature(int32_t handle)
Critical temperature (K).
Definition ctthermo.cpp:883
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:674
int32_t thermo_getChemPotentials(int32_t handle, int32_t muLen, double *mu)
Get the species chemical potentials.
Definition ctthermo.cpp:542
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:609
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:943
double thermo_refPressure(int32_t handle)
Returns the reference pressure in Pa.
Definition ctthermo.cpp:392
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:492
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:648
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:828
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:402
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:267
double thermo_satPressure(int32_t handle, double t)
Return the saturation pressure given the temperature.
Definition ctthermo.cpp:933
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:661
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:740
int32_t thermo_setState_TP(int32_t handle, double t, double p)
Set the temperature (K) and pressure (Pa)
Definition ctthermo.cpp:718
double thermo_critPressure(int32_t handle)
Critical pressure (Pa).
Definition ctthermo.cpp:893
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:278
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:707
int32_t thermo_setMoleFractions(int32_t handle, int32_t xLen, const double *x)
Set the mole fractions to the specified values.
Definition ctthermo.cpp:226
int32_t thermo_getMassFractions(int32_t handle, int32_t yLen, double *y)
Get the species mass fractions.
Definition ctthermo.cpp:211
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:324
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.
Definition ctthermo.cpp:502
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:294
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:622
double thermo_entropy_mole(int32_t handle)
Molar entropy.
Definition ctthermo.cpp:442
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:762
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:773
double thermo_nAtoms(int32_t handle, int32_t k, int32_t m)
Number of atoms of element m in species k.
Definition ctthermo.cpp:372
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:176
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.