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 int32_t thermo_getPartialMolarEnthalpies(int32_t handle, int32_t hbarLen, double* hbar)
610 {
611 // array getter: virtual void ThermoPhase::getPartialMolarEnthalpies(span<double>)
612 try {
613 auto& obj = ThermoPhaseCabinet::at(handle);
614 // no size checking specified
615 span<double> hbar_(hbar, hbarLen);
616 obj->getPartialMolarEnthalpies(hbar_);
617 return 0;
618 } catch (...) {
619 return handleAllExceptions(-1, ERR);
620 }
621 }
622
623 int32_t thermo_getPartialMolarEntropies(int32_t handle, int32_t sbarLen, double* sbar)
624 {
625 // array getter: virtual void ThermoPhase::getPartialMolarEntropies(span<double>)
626 try {
627 auto& obj = ThermoPhaseCabinet::at(handle);
628 // no size checking specified
629 span<double> sbar_(sbar, sbarLen);
630 obj->getPartialMolarEntropies(sbar_);
631 return 0;
632 } catch (...) {
633 return handleAllExceptions(-1, ERR);
634 }
635 }
636
637 int32_t thermo_getPartialMolarIntEnergies(int32_t handle, int32_t ubarLen, double* ubar)
638 {
639 // array getter: virtual void ThermoPhase::getPartialMolarIntEnergies(span<double>)
640 try {
641 auto& obj = ThermoPhaseCabinet::at(handle);
642 // no size checking specified
643 span<double> ubar_(ubar, ubarLen);
644 obj->getPartialMolarIntEnergies(ubar_);
645 return 0;
646 } catch (...) {
647 return handleAllExceptions(-1, ERR);
648 }
649 }
650
651 int32_t thermo_getPartialMolarCp(int32_t handle, int32_t cpbarLen, double* cpbar)
652 {
653 // array getter: virtual void ThermoPhase::getPartialMolarCp(span<double>)
654 try {
655 auto& obj = ThermoPhaseCabinet::at(handle);
656 // no size checking specified
657 span<double> cpbar_(cpbar, cpbarLen);
658 obj->getPartialMolarCp(cpbar_);
659 return 0;
660 } catch (...) {
661 return handleAllExceptions(-1, ERR);
662 }
663 }
664
665 int32_t thermo_getPartialMolarVolumes(int32_t handle, int32_t vbarLen, double* vbar)
666 {
667 // array getter: virtual void ThermoPhase::getPartialMolarVolumes(span<double>)
668 try {
669 auto& obj = ThermoPhaseCabinet::at(handle);
670 // no size checking specified
671 span<double> vbar_(vbar, vbarLen);
672 obj->getPartialMolarVolumes(vbar_);
673 return 0;
674 } catch (...) {
675 return handleAllExceptions(-1, ERR);
676 }
677 }
678
679 int32_t thermo_setState_TPX(int32_t handle, double t, double p, int32_t xLen, const double* x)
680 {
681 // method: virtual void ThermoPhase::setState_TPX(double, double, span<const double>)
682 try {
683 span<const double> x_(x, xLen);
684 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x_);
685 return 0;
686 } catch (...) {
687 return handleAllExceptions(-1, ERR);
688 }
689 }
690
691 int32_t thermo_setState_TPX_byName(int32_t handle, double t, double p, const char* x)
692 {
693 // method: virtual void ThermoPhase::setState_TPX(double, double, const string&)
694 try {
695 ThermoPhaseCabinet::at(handle)->setState_TPX(t, p, x);
696 return 0;
697 } catch (...) {
698 return handleAllExceptions(-1, ERR);
699 }
700 }
701
702 int32_t thermo_setState_TPY(int32_t handle, double t, double p, int32_t yLen, const double* y)
703 {
704 // method: virtual void ThermoPhase::setState_TPY(double, double, span<const double>)
705 try {
706 span<const double> y_(y, yLen);
707 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y_);
708 return 0;
709 } catch (...) {
710 return handleAllExceptions(-1, ERR);
711 }
712 }
713
714 int32_t thermo_setState_TPY_byName(int32_t handle, double t, double p, const char* y)
715 {
716 // method: virtual void ThermoPhase::setState_TPY(double, double, const string&)
717 try {
718 ThermoPhaseCabinet::at(handle)->setState_TPY(t, p, y);
719 return 0;
720 } catch (...) {
721 return handleAllExceptions(-1, ERR);
722 }
723 }
724
725 int32_t thermo_setState_TP(int32_t handle, double t, double p)
726 {
727 // method: virtual void ThermoPhase::setState_TP(double, double)
728 try {
729 ThermoPhaseCabinet::at(handle)->setState_TP(t, p);
730 return 0;
731 } catch (...) {
732 return handleAllExceptions(-1, ERR);
733 }
734 }
735
736 int32_t thermo_setState_TD(int32_t handle, double t, double rho)
737 {
738 // method: void Phase::setState_TD(double, double)
739 try {
740 ThermoPhaseCabinet::as<Phase>(handle)->setState_TD(t, rho);
741 return 0;
742 } catch (...) {
743 return handleAllExceptions(-1, ERR);
744 }
745 }
746
747 int32_t thermo_setState_DP(int32_t handle, double rho, double p)
748 {
749 // method: virtual void ThermoPhase::setState_DP(double, double)
750 try {
751 ThermoPhaseCabinet::at(handle)->setState_DP(rho, p);
752 return 0;
753 } catch (...) {
754 return handleAllExceptions(-1, ERR);
755 }
756 }
757
758 int32_t thermo_setState_HP(int32_t handle, double h, double p)
759 {
760 // method: virtual void ThermoPhase::setState_HP(double, double)
761 try {
762 ThermoPhaseCabinet::at(handle)->setState_HP(h, p);
763 return 0;
764 } catch (...) {
765 return handleAllExceptions(-1, ERR);
766 }
767 }
768
769 int32_t thermo_setState_UV(int32_t handle, double u, double v)
770 {
771 // method: virtual void ThermoPhase::setState_UV(double, double)
772 try {
773 ThermoPhaseCabinet::at(handle)->setState_UV(u, v);
774 return 0;
775 } catch (...) {
776 return handleAllExceptions(-1, ERR);
777 }
778 }
779
780 int32_t thermo_setState_SV(int32_t handle, double s, double v)
781 {
782 // method: virtual void ThermoPhase::setState_SV(double, double)
783 try {
784 ThermoPhaseCabinet::at(handle)->setState_SV(s, v);
785 return 0;
786 } catch (...) {
787 return handleAllExceptions(-1, ERR);
788 }
789 }
790
791 int32_t thermo_setState_SP(int32_t handle, double s, double p)
792 {
793 // method: virtual void ThermoPhase::setState_SP(double, double)
794 try {
795 ThermoPhaseCabinet::at(handle)->setState_SP(s, p);
796 return 0;
797 } catch (...) {
798 return handleAllExceptions(-1, ERR);
799 }
800 }
801
802 int32_t thermo_setState_ST(int32_t handle, double s, double t)
803 {
804 // method: virtual void ThermoPhase::setState_ST(double, double)
805 try {
806 ThermoPhaseCabinet::at(handle)->setState_ST(s, t);
807 return 0;
808 } catch (...) {
809 return handleAllExceptions(-1, ERR);
810 }
811 }
812
813 int32_t thermo_setState_TV(int32_t handle, double t, double v)
814 {
815 // method: virtual void ThermoPhase::setState_TV(double, double)
816 try {
817 ThermoPhaseCabinet::at(handle)->setState_TV(t, v);
818 return 0;
819 } catch (...) {
820 return handleAllExceptions(-1, ERR);
821 }
822 }
823
824 int32_t thermo_setState_PV(int32_t handle, double p, double v)
825 {
826 // method: virtual void ThermoPhase::setState_PV(double, double)
827 try {
828 ThermoPhaseCabinet::at(handle)->setState_PV(p, v);
829 return 0;
830 } catch (...) {
831 return handleAllExceptions(-1, ERR);
832 }
833 }
834
835 int32_t thermo_setState_UP(int32_t handle, double u, double p)
836 {
837 // method: virtual void ThermoPhase::setState_UP(double, double)
838 try {
839 ThermoPhaseCabinet::at(handle)->setState_UP(u, p);
840 return 0;
841 } catch (...) {
842 return handleAllExceptions(-1, ERR);
843 }
844 }
845
846 int32_t thermo_setState_VH(int32_t handle, double v, double h)
847 {
848 // method: virtual void ThermoPhase::setState_VH(double, double)
849 try {
850 ThermoPhaseCabinet::at(handle)->setState_VH(v, h);
851 return 0;
852 } catch (...) {
853 return handleAllExceptions(-1, ERR);
854 }
855 }
856
857 int32_t thermo_setState_TH(int32_t handle, double t, double h)
858 {
859 // method: virtual void ThermoPhase::setState_TH(double, double)
860 try {
861 ThermoPhaseCabinet::at(handle)->setState_TH(t, h);
862 return 0;
863 } catch (...) {
864 return handleAllExceptions(-1, ERR);
865 }
866 }
867
868 int32_t thermo_setState_SH(int32_t handle, double s, double h)
869 {
870 // method: virtual void ThermoPhase::setState_SH(double, double)
871 try {
872 ThermoPhaseCabinet::at(handle)->setState_SH(s, h);
873 return 0;
874 } catch (...) {
875 return handleAllExceptions(-1, ERR);
876 }
877 }
878
879 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)
880 {
881 // method: void ThermoPhase::equilibrate(const string&, const string&, double, int, int, int)
882 try {
883 ThermoPhaseCabinet::at(handle)->equilibrate(XY, solver, rtol, max_steps, max_iter, estimate_equil);
884 return 0;
885 } catch (...) {
886 return handleAllExceptions(-1, ERR);
887 }
888 }
889
890 double thermo_critTemperature(int32_t handle)
891 {
892 // getter: virtual double ThermoPhase::critTemperature()
893 try {
894 return ThermoPhaseCabinet::at(handle)->critTemperature();
895 } catch (...) {
896 return handleAllExceptions(DERR, DERR);
897 }
898 }
899
900 double thermo_critPressure(int32_t handle)
901 {
902 // getter: virtual double ThermoPhase::critPressure()
903 try {
904 return ThermoPhaseCabinet::at(handle)->critPressure();
905 } catch (...) {
906 return handleAllExceptions(DERR, DERR);
907 }
908 }
909
910 double thermo_critDensity(int32_t handle)
911 {
912 // getter: virtual double ThermoPhase::critDensity()
913 try {
914 return ThermoPhaseCabinet::at(handle)->critDensity();
915 } catch (...) {
916 return handleAllExceptions(DERR, DERR);
917 }
918 }
919
920 double thermo_vaporFraction(int32_t handle)
921 {
922 // getter: virtual double ThermoPhase::vaporFraction()
923 try {
924 return ThermoPhaseCabinet::at(handle)->vaporFraction();
925 } catch (...) {
926 return handleAllExceptions(DERR, DERR);
927 }
928 }
929
930 double thermo_satTemperature(int32_t handle, double p)
931 {
932 // method: virtual double ThermoPhase::satTemperature(double)
933 try {
934 return ThermoPhaseCabinet::at(handle)->satTemperature(p);
935 } catch (...) {
936 return handleAllExceptions(DERR, DERR);
937 }
938 }
939
940 double thermo_satPressure(int32_t handle, double t)
941 {
942 // method: virtual double ThermoPhase::satPressure(double)
943 try {
944 return ThermoPhaseCabinet::at(handle)->satPressure(t);
945 } catch (...) {
946 return handleAllExceptions(DERR, DERR);
947 }
948 }
949
950 int32_t thermo_setState_Psat(int32_t handle, double p, double x)
951 {
952 // method: virtual void ThermoPhase::setState_Psat(double, double)
953 try {
954 ThermoPhaseCabinet::at(handle)->setState_Psat(p, x);
955 return 0;
956 } catch (...) {
957 return handleAllExceptions(-1, ERR);
958 }
959 }
960
961 int32_t thermo_setState_Tsat(int32_t handle, double t, double x)
962 {
963 // method: virtual void ThermoPhase::setState_Tsat(double, double)
964 try {
965 ThermoPhaseCabinet::at(handle)->setState_Tsat(t, x);
966 return 0;
967 } catch (...) {
968 return handleAllExceptions(-1, ERR);
969 }
970 }
971
972 int32_t surf_getCoverages(int32_t handle, int32_t thetaLen, double* theta)
973 {
974 // array getter: void SurfPhase::getCoverages(span<double>)
975 try {
976 auto obj = ThermoPhaseCabinet::as<SurfPhase>(handle);
977 // no size checking specified
978 span<double> theta_(theta, thetaLen);
979 obj->getCoverages(theta_);
980 return 0;
981 } catch (...) {
982 return handleAllExceptions(-1, ERR);
983 }
984 }
985
986 int32_t surf_setCoverages(int32_t handle, int32_t thetaLen, const double* theta)
987 {
988 // setter: void SurfPhase::setCoverages(span<const double>)
989 try {
990 span<const double> theta_(theta, thetaLen);
991 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoverages(theta_);
992 return 0;
993 } catch (...) {
994 return handleAllExceptions(-1, ERR);
995 }
996 }
997
998 int32_t thermo_getConcentrations(int32_t handle, int32_t cLen, double* c)
999 {
1000 // array getter: virtual void Phase::getConcentrations(span<double>)
1001 try {
1002 auto obj = ThermoPhaseCabinet::as<Phase>(handle);
1003 // no size checking specified
1004 span<double> c_(c, cLen);
1005 obj->getConcentrations(c_);
1006 return 0;
1007 } catch (...) {
1008 return handleAllExceptions(-1, ERR);
1009 }
1010 }
1011
1012 int32_t thermo_setConcentrations(int32_t handle, int32_t concLen, const double* conc)
1013 {
1014 // setter: virtual void Phase::setConcentrations(span<const double>)
1015 try {
1016 span<const double> conc_(conc, concLen);
1017 ThermoPhaseCabinet::as<Phase>(handle)->setConcentrations(conc_);
1018 return 0;
1019 } catch (...) {
1020 return handleAllExceptions(-1, ERR);
1021 }
1022 }
1023
1024 double surf_siteDensity(int32_t handle)
1025 {
1026 // getter: double SurfPhase::siteDensity()
1027 try {
1028 return ThermoPhaseCabinet::as<SurfPhase>(handle)->siteDensity();
1029 } catch (...) {
1030 return handleAllExceptions(DERR, DERR);
1031 }
1032 }
1033
1034 int32_t surf_setSiteDensity(int32_t handle, double n0)
1035 {
1036 // setter: void SurfPhase::setSiteDensity(double)
1037 try {
1038 ThermoPhaseCabinet::as<SurfPhase>(handle)->setSiteDensity(n0);
1039 return 0;
1040 } catch (...) {
1041 return handleAllExceptions(-1, ERR);
1042 }
1043 }
1044
1045 int32_t surf_setCoveragesByName(int32_t handle, const char* cov)
1046 {
1047 // setter: void SurfPhase::setCoveragesByName(const string&)
1048 try {
1049 ThermoPhaseCabinet::as<SurfPhase>(handle)->setCoveragesByName(cov);
1050 return 0;
1051 } catch (...) {
1052 return handleAllExceptions(-1, ERR);
1053 }
1054 }
1055
1056 int32_t thermo_setEquivalenceRatio(int32_t handle, double phi, const char* fuelComp, const char* oxComp)
1057 {
1058 // method: void ThermoPhase::setEquivalenceRatio(double, const string&, const string&)
1059 try {
1060 ThermoPhaseCabinet::at(handle)->setEquivalenceRatio(phi, fuelComp, oxComp);
1061 return 0;
1062 } catch (...) {
1063 return handleAllExceptions(-1, ERR);
1064 }
1065 }
1066
1067 int32_t thermo_report(int32_t handle, int32_t show_thermo, double threshold, int32_t bufLen, char* buf)
1068 {
1069 // method: virtual string ThermoPhase::report(bool, double)
1070 try {
1071 bool show_thermo_ = (show_thermo != 0);
1072 string out = ThermoPhaseCabinet::at(handle)->report(show_thermo_, threshold);
1073 copyString(out, buf, bufLen);
1074 return int(out.size()) + 1;
1075 } catch (...) {
1076 return handleAllExceptions(-1, ERR);
1077 }
1078 }
1079
1080 int32_t thermo_print(int32_t handle, int32_t showThermo, double threshold)
1081 {
1082 // method: custom code
1083 try {
1084 // *************** begin custom code ***************
1085 bool show = (showThermo != 0);
1086 writelog(ThermoPhaseCabinet::at(handle)->report(show, threshold));
1087 return 0;
1088 // **************** end custom code ****************
1089 } catch (...) {
1090 return handleAllExceptions(-1, ERR);
1091 }
1092 }
1093
1094 int32_t thermo_del(int32_t handle)
1095 {
1096 // destructor
1097 try {
1098 ThermoPhaseCabinet::del(handle);
1099 return 0;
1100 } catch (...) {
1101 return handleAllExceptions(-1, ERR);
1102 }
1103 }
1104
1106 {
1107 // reserved CLib function: custom code
1108 try {
1109 // *************** begin custom code ***************
1110 return ThermoPhaseCabinet::size();
1111 // **************** end custom code ****************
1112 } catch (...) {
1113 return handleAllExceptions(-1, ERR);
1114 }
1115 }
1116
1117} // 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:930
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:846
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: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:736
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).
Definition ctthermo.cpp:998
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:986
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:802
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:868
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:857
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:791
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:813
double thermo_vaporFraction(int32_t handle)
Return the fraction of vapor at the current conditions.
Definition ctthermo.cpp:920
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:637
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.
Definition ctthermo.cpp:972
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:691
double thermo_critDensity(int32_t handle)
Critical density (kg/m3).
Definition ctthermo.cpp:910
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:961
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:824
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:758
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:702
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:879
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:890
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:679
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: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:950
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:651
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:835
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:940
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:665
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:747
int32_t thermo_setState_TP(int32_t handle, double t, double p)
Set the temperature (K) and pressure (Pa)
Definition ctthermo.cpp:725
double thermo_critPressure(int32_t handle)
Critical pressure (Pa).
Definition ctthermo.cpp:900
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:714
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:623
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:769
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:780
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.