@@ -20,6 +20,50 @@ void py_export_Mixture(py::module &m) {
20
20
py::class_<Mutation::Mixture>(m, " Mixture" )
21
21
.def (py::init<Mutation::MixtureOptions>())
22
22
.def (py::init<std::string &>())
23
+
24
+ .def (" NA" ,
25
+ [](const Mutation::Mixture &self) {
26
+ return Mutation::NA;
27
+ },
28
+ " Returns the Avogadro's number (molecule/mol)."
29
+ )
30
+
31
+ .def (" KB" ,
32
+ [](const Mutation::Mixture &self) {
33
+ return Mutation::KB;
34
+ },
35
+ " Returns the Boltzmann's constant (J/molecule-K)" )
36
+
37
+ .def (" RU" ,
38
+ [](const Mutation::Mixture &self) {
39
+ return Mutation::RU;
40
+ },
41
+ " Returns the Universal Gas constant (J/mole-K)" )
42
+
43
+ .def (" HP" ,
44
+ [](const Mutation::Mixture &self) {
45
+ return Mutation::HP;
46
+ },
47
+ " Returns the Planck's constant (J-s)" )
48
+
49
+ .def (" C0" ,
50
+ [](const Mutation::Mixture &self) {
51
+ return Mutation::C0;
52
+ },
53
+ " Returns the Speed of light in vacuum (m/s)" )
54
+
55
+ .def (" ONEATM" ,
56
+ [](const Mutation::Mixture &self) {
57
+ return Mutation::ONEATM;
58
+ },
59
+ " Returns the 1 atm in Pa" )
60
+
61
+ .def (" SB" ,
62
+ [](const Mutation::Mixture &self) {
63
+ return Mutation::SB;
64
+ },
65
+ " Returns the Stefan-Boltzmann constant (W/m^2-K^4)" )
66
+
23
67
.def (" nElements" , &Mutation::Mixture::nElements,
24
68
" Returns the number of elements considered in the mixture." )
25
69
@@ -380,7 +424,7 @@ void py_export_Mixture(py::module &m) {
380
424
" elemental mole fractions. "
381
425
" If the mole fractions are not given, then the default fractions are "
382
426
" used." )
383
- .def (
427
+ .def (
384
428
" speciesHOverRT" ,
385
429
[](const Mutation::Mixture &self) {
386
430
std::vector<double > h_i (self.nSpecies ());
@@ -400,16 +444,6 @@ void py_export_Mixture(py::module &m) {
400
444
" Returns the unitless vector of species enthalpies \f $ H_i / R_u T "
401
445
" \f $." )
402
446
403
- .def (
404
- " speciesCpOverR" ,
405
- [](const Mutation::Mixture &self) {
406
- std::vector<double > h_i (self.nSpecies ());
407
- self.speciesCpOverR (h_i.data ());
408
- return py::array (py::cast (h_i));
409
- },
410
- " Returns the unitless vector of species specific heat at constant pressure \f $ Cp_i / R_u "
411
- " \f $." )
412
-
413
447
.def (" mixtureHMole" ,
414
448
static_cast <double (Mutation::Mixture::*)(void ) const >(
415
449
&Mutation::Mixture::mixtureHMole),
@@ -508,6 +542,26 @@ void py_export_Mixture(py::module &m) {
508
542
},
509
543
" Converts species mass to elemental mass fraction." )
510
544
545
+ .def (
546
+ " convert_xe_to_ye" ,
547
+ [](const Mutation::Mixture &self, std::vector<double > x) {
548
+ std::vector<double > y (self.nElements ());
549
+ self.Mutation ::Mixture::Thermodynamics::convert<
550
+ Mutation::Thermodynamics::XE_TO_YE>(x.data (), y.data ());
551
+ return py::array (py::cast (y));
552
+ },
553
+ " Converts elemental mole fraction to elemental mass fractions." )
554
+
555
+ .def (
556
+ " convert_ye_to_xe" ,
557
+ [](const Mutation::Mixture &self, std::vector<double > x) {
558
+ std::vector<double > y (self.nElements ());
559
+ self.Mutation ::Mixture::Thermodynamics::convert<
560
+ Mutation::Thermodynamics::YE_TO_XE>(x.data (), y.data ());
561
+ return py::array (py::cast (y));
562
+ },
563
+ " Converts elemental mass fraction to elemental mole fractions." )
564
+
511
565
.def (" dRhodP" , &Mutation::Mixture::dRhodP,
512
566
" Returns the density derivative with respect to pressure for the "
513
567
" current equilibrium state." )
@@ -810,5 +864,38 @@ void py_export_Mixture(py::module &m) {
810
864
return py::array (py::cast (cv_i));
811
865
},
812
866
" Fills the constant volume specific heat according to the used "
813
- " StateModel" );
867
+ " StateModel" )
868
+
869
+
870
+ .def (
871
+ " getGibbsMass" ,
872
+ [](const Mutation::Mixture &self) {
873
+ Eigen::ArrayXd gibbs_i (self.nSpecies ());
874
+ self.Mutation ::Mixture::speciesGOverRT (gibbs_i.data ());
875
+ gibbs_i*=self.T ()* Mutation::RU/self.speciesMw ();
876
+ return py::array (py::cast (gibbs_i));;
877
+ },
878
+ " Return an array of gibbs free energy for each species per unit mass" )
879
+
880
+ .def (
881
+ " getGibbsMass" ,
882
+ [](const Mutation::Mixture &self, double T, double P) {
883
+ Eigen::ArrayXd gibbs_i (self.nSpecies ());
884
+ self.Mutation ::Mixture::speciesGOverRT (T, P, gibbs_i.data ());
885
+ gibbs_i*=T* Mutation::RU/self.speciesMw ();
886
+ return py::array (py::cast (gibbs_i));;
887
+ },
888
+ " Return an array of gibbs free energy for each species per unit mass" )
889
+
890
+ .def (
891
+ " getSTGibbsMass" ,
892
+ [](const Mutation::Mixture &self, double T) {
893
+ Eigen::ArrayXd gibbs_i (self.nSpecies ());
894
+ self.Mutation ::Mixture::speciesSTGOverRT (T, gibbs_i.data ());
895
+ gibbs_i*=T* Mutation::RU/self.speciesMw ();
896
+ return py::array (py::cast (gibbs_i));;
897
+ },
898
+ " Return an array of gibbs free energy for each species per unit mass at standard pressure" )
899
+
900
+ ;
814
901
}
0 commit comments