CoolProp  6.6.0
An open-source fluid property and humid air property database
pybind11_interface.cxx
Go to the documentation of this file.
1 #ifdef PYBIND11
2 
3 # include "CoolProp.h"
4 # include "AbstractState.h"
5 # include "Configuration.h"
6 # include "HumidAirProp.h"
7 # include "DataStructures.h"
9 
10 # include <pybind11/pybind11.h>
11 # include <pybind11/stl.h>
12 namespace py = pybind11;
13 
14 CoolProp::AbstractState* factory(const std::string& backend, const std::string& fluid_names) {
15  return CoolProp::AbstractState::factory(backend, fluid_names);
16 }
17 
18 void init_CoolProp(py::module& m) {
19  using namespace CoolProp;
20 
21  py::class_<SimpleState>(m, "SimpleState")
22  .def(py::init<>())
23  .def_readwrite("T", &SimpleState::T)
24  .def_readwrite("p", &SimpleState::p)
25  .def_readwrite("rhomolar", &SimpleState::rhomolar);
26 
27  py::class_<GuessesStructure>(m, "GuessesStructure")
28  .def(py::init<>())
29  .def_readwrite("T", &GuessesStructure::T)
30  .def_readwrite("p", &GuessesStructure::p)
31  .def_readwrite("rhomolar", &GuessesStructure::rhomolar)
32  .def_readwrite("hmolar", &GuessesStructure::hmolar)
33  .def_readwrite("smolar", &GuessesStructure::smolar)
34  .def_readwrite("rhomolar_liq", &GuessesStructure::rhomolar_liq)
35  .def_readwrite("rhomolar_vap", &GuessesStructure::rhomolar_vap)
36  .def_readwrite("x", &GuessesStructure::x)
37  .def_readwrite("y", &GuessesStructure::y)
38  .def("clear", &GuessesStructure::clear);
39 
40  py::class_<CriticalState, SimpleState>(m, "CriticalState").def_readwrite("stable", &CriticalState::stable);
41 
42  py::class_<PhaseEnvelopeData>(m, "PhaseEnvelopeData")
43  .def_readwrite("K", &PhaseEnvelopeData::K)
44  .def_readwrite("lnK", &PhaseEnvelopeData::lnK)
45  .def_readwrite("x", &PhaseEnvelopeData::x)
46  .def_readwrite("y", &PhaseEnvelopeData::y)
47  .def_readwrite("T", &PhaseEnvelopeData::T)
48  .def_readwrite("p", &PhaseEnvelopeData::p)
49  .def_readwrite("lnT", &PhaseEnvelopeData::lnT)
50  .def_readwrite("lnp", &PhaseEnvelopeData::lnp)
51  .def_readwrite("rhomolar_liq", &PhaseEnvelopeData::rhomolar_liq)
52  .def_readwrite("rhomolar_vap", &PhaseEnvelopeData::rhomolar_vap)
53  .def_readwrite("lnrhomolar_liq", &PhaseEnvelopeData::lnrhomolar_liq)
54  .def_readwrite("lnrhomolar_vap", &PhaseEnvelopeData::lnrhomolar_vap)
55  .def_readwrite("hmolar_liq", &PhaseEnvelopeData::hmolar_liq)
56  .def_readwrite("hmolar_vap", &PhaseEnvelopeData::hmolar_vap)
57  .def_readwrite("smolar_liq", &PhaseEnvelopeData::smolar_liq)
58  .def_readwrite("smolar_vap", &PhaseEnvelopeData::smolar_vap)
59  .def_readwrite("Q", &PhaseEnvelopeData::Q)
60  .def_readwrite("cpmolar_liq", &PhaseEnvelopeData::cpmolar_liq)
61  .def_readwrite("cpmolar_vap", &PhaseEnvelopeData::cpmolar_vap)
62  .def_readwrite("cvmolar_liq", &PhaseEnvelopeData::cvmolar_liq)
63  .def_readwrite("cvmolar_vap", &PhaseEnvelopeData::cvmolar_vap)
64  .def_readwrite("viscosity_liq", &PhaseEnvelopeData::viscosity_liq)
65  .def_readwrite("viscosity_vap", &PhaseEnvelopeData::viscosity_vap)
66  .def_readwrite("conductivity_liq", &PhaseEnvelopeData::conductivity_liq)
67  .def_readwrite("conductivity_vap", &PhaseEnvelopeData::conductivity_vap)
68  .def_readwrite("speed_sound_vap", &PhaseEnvelopeData::speed_sound_vap);
69 
70  // See http://stackoverflow.com/a/148610 and http://stackoverflow.com/questions/147267/easy-way-to-use-variables-of-enum-types-as-string-in-c#202511
71  py::enum_<configuration_keys>(m, "configuration_keys")
72 # define X(Enum, String, Default, Desc) .value(String, configuration_keys::Enum)
74 # undef X
75  .export_values();
76 
77  py::enum_<parameters>(m, "parameters")
78  .value("igas_constant", parameters::igas_constant)
79  .value("imolar_mass", parameters::imolar_mass)
80  .value("iacentric_factor", parameters::iacentric_factor)
81  .value("irhomolar_reducing", parameters::irhomolar_reducing)
82  .value("irhomolar_critical", parameters::irhomolar_critical)
83  .value("iT_reducing", parameters::iT_reducing)
84  .value("iT_critical", parameters::iT_critical)
85  .value("irhomass_reducing", parameters::irhomass_reducing)
86  .value("irhomass_critical", parameters::irhomass_critical)
87  .value("iP_critical", parameters::iP_critical)
88  .value("iP_reducing", parameters::iP_reducing)
89  .value("iT_triple", parameters::iT_triple)
90  .value("iP_triple", parameters::iP_triple)
91  .value("iT_min", parameters::iT_min)
92  .value("iT_max", parameters::iT_max)
93  .value("iP_max", parameters::iP_max)
94  .value("iP_min", parameters::iP_min)
95  .value("idipole_moment", parameters::idipole_moment)
96  .value("iT", parameters::iT)
97  .value("iP", parameters::iP)
98  .value("iQ", parameters::iQ)
99  .value("iTau", parameters::iTau)
100  .value("iDelta", parameters::iDelta)
101  .value("iDmolar", parameters::iDmolar)
102  .value("iHmolar", parameters::iHmolar)
103  .value("iSmolar", parameters::iSmolar)
104  .value("iCpmolar", parameters::iCpmolar)
105  .value("iCp0molar", parameters::iCp0molar)
106  .value("iCvmolar", parameters::iCvmolar)
107  .value("iUmolar", parameters::iUmolar)
108  .value("iGmolar", parameters::iGmolar)
109  .value("iHelmholtzmolar", parameters::iHelmholtzmolar)
110  .value("iSmolar_residual", parameters::iSmolar_residual)
111  .value("iHmolar_residual", parameters::iHmolar_residual)
112  .value("iGmolar_residual", parameters::iGmolar_residual)
113  .value("iDmass", parameters::iDmass)
114  .value("iHmass", parameters::iHmass)
115  .value("iSmass", parameters::iSmass)
116  .value("iCpmass", parameters::iCpmass)
117  .value("iCp0mass", parameters::iCp0mass)
118  .value("iCvmass", parameters::iCvmass)
119  .value("iUmass", parameters::iUmass)
120  .value("iGmass", parameters::iGmass)
121  .value("iHelmholtzmass", parameters::iHelmholtzmass)
122  .value("iviscosity", parameters::iviscosity)
123  .value("iconductivity", parameters::iconductivity)
124  .value("isurface_tension", parameters::isurface_tension)
125  .value("iPrandtl", parameters::iPrandtl)
126  .value("ispeed_sound", parameters::ispeed_sound)
127  .value("iisothermal_compressibility", parameters::iisothermal_compressibility)
128  .value("iisobaric_expansion_coefficient", parameters::iisobaric_expansion_coefficient)
129  .value("ifundamental_derivative_of_gas_dynamics", parameters::ifundamental_derivative_of_gas_dynamics)
130  .value("ialphar", parameters::ialphar)
131  .value("idalphar_ddelta_consttau", parameters::idalphar_ddelta_consttau)
132  .value("idalpha0_dtau_constdelta", parameters::idalpha0_dtau_constdelta)
133  .value("iBvirial", parameters::iBvirial)
134  .value("iCvirial", parameters::iCvirial)
135  .value("idBvirial_dT", parameters::idBvirial_dT)
136  .value("idCvirial_dT", parameters::idCvirial_dT)
137  .value("iZ", parameters::iZ)
138  .value("iPIP", parameters::iPIP)
139  .value("ifraction_min", parameters::ifraction_min)
140  .value("ifraction_max", parameters::ifraction_max)
141  .value("iT_freeze", parameters::iT_freeze)
142  .value("iGWP20", parameters::iGWP20)
143  .value("iGWP100", parameters::iGWP100)
144  .value("iGWP500", parameters::iGWP500)
145  .value("iFH", parameters::iFH)
146  .value("iHH", parameters::iHH)
147  .value("iPH", parameters::iPH)
148  .value("iODP", parameters::iODP)
149  .value("iPhase", parameters::iPhase)
150  .value("iundefined_parameter", parameters::iundefined_parameter)
151  .export_values();
152 
153  py::enum_<input_pairs>(m, "input_pairs")
154  .value("QT_INPUTS", input_pairs::QT_INPUTS)
155  .value("PQ_INPUTS", input_pairs::PQ_INPUTS)
156  .value("QSmolar_INPUTS", input_pairs::QSmolar_INPUTS)
157  .value("QSmass_INPUTS", input_pairs::QSmass_INPUTS)
158  .value("HmolarQ_INPUTS", input_pairs::HmolarQ_INPUTS)
159  .value("HmassQ_INPUTS", input_pairs::HmassQ_INPUTS)
160  .value("DmolarQ_INPUTS", input_pairs::DmolarQ_INPUTS)
161  .value("DmassQ_INPUTS", input_pairs::DmassQ_INPUTS)
162  .value("PT_INPUTS", input_pairs::PT_INPUTS)
163  .value("DmassT_INPUTS", input_pairs::DmassT_INPUTS)
164  .value("DmolarT_INPUTS", input_pairs::DmolarT_INPUTS)
165  .value("HmolarT_INPUTS", input_pairs::HmolarT_INPUTS)
166  .value("HmassT_INPUTS", input_pairs::HmassT_INPUTS)
167  .value("SmolarT_INPUTS", input_pairs::SmolarT_INPUTS)
168  .value("SmassT_INPUTS", input_pairs::SmassT_INPUTS)
169  .value("TUmolar_INPUTS", input_pairs::TUmolar_INPUTS)
170  .value("TUmass_INPUTS", input_pairs::TUmass_INPUTS)
171  .value("DmassP_INPUTS", input_pairs::DmassP_INPUTS)
172  .value("DmolarP_INPUTS", input_pairs::DmolarP_INPUTS)
173  .value("HmassP_INPUTS", input_pairs::HmassP_INPUTS)
174  .value("HmolarP_INPUTS", input_pairs::HmolarP_INPUTS)
175  .value("PSmass_INPUTS", input_pairs::PSmass_INPUTS)
176  .value("PSmolar_INPUTS", input_pairs::PSmolar_INPUTS)
177  .value("PUmass_INPUTS", input_pairs::PUmass_INPUTS)
178  .value("PUmolar_INPUTS", input_pairs::PUmolar_INPUTS)
179  .value("HmassSmass_INPUTS", input_pairs::HmassSmass_INPUTS)
180  .value("HmolarSmolar_INPUTS", input_pairs::HmolarSmolar_INPUTS)
181  .value("SmassUmass_INPUTS", input_pairs::SmassUmass_INPUTS)
182  .value("SmolarUmolar_INPUTS", input_pairs::SmolarUmolar_INPUTS)
183  .value("DmassHmass_INPUTS", input_pairs::DmassHmass_INPUTS)
184  .value("DmolarHmolar_INPUTS", input_pairs::DmolarHmolar_INPUTS)
185  .value("DmassSmass_INPUTS", input_pairs::DmassSmass_INPUTS)
186  .value("DmolarSmolar_INPUTS", input_pairs::DmolarSmolar_INPUTS)
187  .value("DmassUmass_INPUTS", input_pairs::DmassUmass_INPUTS)
188  .value("DmolarUmolar_INPUTS", input_pairs::DmolarUmolar_INPUTS)
189  .export_values();
190 
191  py::enum_<phases>(m, "phases")
192  .value("iphase_liquid", phases::iphase_liquid)
193  .value("iphase_supercritical", phases::iphase_supercritical)
194  .value("iphase_supercritical_gas", phases::iphase_supercritical_gas)
195  .value("iphase_supercritical_liquid", phases::iphase_supercritical_liquid)
196  .value("iphase_critical_point", phases::iphase_critical_point)
197  .value("iphase_gas", phases::iphase_gas)
198  .value("iphase_twophase", phases::iphase_twophase)
199  .value("iphase_unknown", phases::iphase_unknown)
200  .export_values();
201 
202  py::class_<AbstractState>(m, "_AbstractState")
203  .def("set_T", &AbstractState::set_T)
204  .def("backend_name", &AbstractState::backend_name)
205  .def("using_mole_fractions", &AbstractState::using_mole_fractions)
206  .def("using_mass_fractions", &AbstractState::using_mass_fractions)
207  .def("using_volu_fractions", &AbstractState::using_volu_fractions)
208  .def("set_mole_fractions", &AbstractState::set_mole_fractions)
209  .def("set_mass_fractions", &AbstractState::set_mass_fractions)
210  .def("set_volu_fractions", &AbstractState::set_volu_fractions)
211  .def("mole_fractions_liquid", &AbstractState::mole_fractions_liquid)
212  .def("mole_fractions_liquid_double", &AbstractState::mole_fractions_liquid_double)
213  .def("mole_fractions_vapor", &AbstractState::mole_fractions_vapor)
214  .def("mole_fractions_vapor_double", &AbstractState::mole_fractions_vapor_double)
215  .def("get_mole_fractions", &AbstractState::get_mole_fractions)
216  .def("get_mass_fractions", &AbstractState::get_mass_fractions)
217  .def("update", &AbstractState::update)
218  .def("update_with_guesses", &AbstractState::update_with_guesses)
219  .def("available_in_high_level", &AbstractState::available_in_high_level)
220  .def("fluid_param_string", &AbstractState::fluid_param_string)
221  .def("fluid_names", &AbstractState::fluid_names)
222  .def("set_binary_interaction_double", (void (AbstractState::*)(const std::string&, const std::string&, const std::string&, const double))
224  .def("set_binary_interaction_double", (void (AbstractState::*)(const std::size_t, const std::size_t, const std::string&, const double))
226  .def("set_binary_interaction_string", (void (AbstractState::*)(const std::string&, const std::string&, const std::string&, const std::string&))
228  .def("set_binary_interaction_string", (void (AbstractState::*)(const std::size_t, const std::size_t, const std::string&, const std::string&))
230  .def("get_binary_interaction_double",
231  (double (AbstractState::*)(const std::string&, const std::string&, const std::string&)) & AbstractState::get_binary_interaction_double)
232  .def("get_binary_interaction_double",
233  (double (AbstractState::*)(const std::size_t, const std::size_t, const std::string&)) & AbstractState::get_binary_interaction_double)
234  .def("get_binary_interaction_string", &AbstractState::get_binary_interaction_string)
235  .def("apply_simple_mixing_rule", &AbstractState::apply_simple_mixing_rule)
236  .def("set_fluid_parameter_double", &AbstractState::set_fluid_parameter_double)
237  .def("clear", &AbstractState::clear)
238  .def("get_reducing_state", &AbstractState::get_reducing_state)
239  .def("get_state", &AbstractState::get_state)
240  .def("Tmin", &AbstractState::Tmin)
241  .def("Tmax", &AbstractState::Tmax)
242  .def("pmax", &AbstractState::pmax)
243  .def("Ttriple", &AbstractState::Ttriple)
244  .def("phase", &AbstractState::phase)
245  .def("specify_phase", &AbstractState::specify_phase)
246  .def("unspecify_phase", &AbstractState::unspecify_phase)
247  .def("T_critical", &AbstractState::T_critical)
248  .def("p_critical", &AbstractState::p_critical)
249  .def("rhomolar_critical", &AbstractState::rhomolar_critical)
250  .def("rhomass_critical", &AbstractState::rhomass_critical)
251  .def("all_critical_points", &AbstractState::all_critical_points)
252  .def("build_spinodal", &AbstractState::build_spinodal)
253  .def("get_spinodal_data", &AbstractState::get_spinodal_data)
254  .def("criticality_contour_values",
255  [](AbstractState& AS) {
256  double L, M;
258  return py::make_tuple(L, M);
259  })
260  .def("tangent_plane_distance", &AbstractState::tangent_plane_distance)
261  .def("T_reducing", &AbstractState::T_reducing)
262  .def("rhomolar_reducing", &AbstractState::rhomolar_reducing)
263  .def("rhomass_reducing", &AbstractState::rhomass_reducing)
264  .def("p_triple", &AbstractState::p_triple)
265  .def("name", &AbstractState::name)
266  .def("dipole_moment", &AbstractState::dipole_moment)
267  .def("keyed_output", &AbstractState::keyed_output)
268  .def("trivial_keyed_output", &AbstractState::trivial_keyed_output)
269  .def("saturated_liquid_keyed_output", &AbstractState::saturated_liquid_keyed_output)
270  .def("saturated_vapor_keyed_output", &AbstractState::saturated_vapor_keyed_output)
271  .def("T", &AbstractState::T)
272  .def("rhomolar", &AbstractState::rhomolar)
273  .def("rhomass", &AbstractState::rhomass)
274  .def("p", &AbstractState::p)
275  .def("Q", &AbstractState::Q)
276  .def("tau", &AbstractState::tau)
277  .def("delta", &AbstractState::delta)
278  .def("molar_mass", &AbstractState::molar_mass)
279  .def("acentric_factor", &AbstractState::acentric_factor)
280  .def("gas_constant", &AbstractState::gas_constant)
281  .def("Bvirial", &AbstractState::Bvirial)
282  .def("dBvirial_dT", &AbstractState::dBvirial_dT)
283  .def("Cvirial", &AbstractState::Cvirial)
284  .def("dCvirial_dT", &AbstractState::dCvirial_dT)
285  .def("compressibility_factor", &AbstractState::compressibility_factor)
286  .def("hmolar", &AbstractState::hmolar)
287  .def("hmass", &AbstractState::hmass)
288  .def("hmolar_excess", &AbstractState::hmolar_excess)
289  .def("hmass_excess", &AbstractState::hmass_excess)
290  .def("smolar", &AbstractState::smolar)
291  .def("smass", &AbstractState::smass)
292  .def("smolar_excess", &AbstractState::smolar_excess)
293  .def("smass_excess", &AbstractState::smass_excess)
294  .def("umolar", &AbstractState::umolar)
295  .def("umass", &AbstractState::umass)
296  .def("umolar_excess", &AbstractState::umolar_excess)
297  .def("umass_excess", &AbstractState::umass_excess)
298  .def("cpmolar", &AbstractState::cpmolar)
299  .def("cpmass", &AbstractState::cpmass)
300  .def("cp0molar", &AbstractState::cp0molar)
301  .def("cp0mass", &AbstractState::cp0mass)
302  .def("cvmolar", &AbstractState::cvmolar)
303  .def("cvmass", &AbstractState::cvmass)
304  .def("gibbsmolar", &AbstractState::gibbsmolar)
305  .def("gibbsmass", &AbstractState::gibbsmass)
306  .def("gibbsmolar_excess", &AbstractState::gibbsmolar_excess)
307  .def("gibbsmass_excess", &AbstractState::gibbsmass_excess)
308  .def("helmholtzmolar", &AbstractState::helmholtzmolar)
309  .def("helmholtzmass", &AbstractState::helmholtzmass)
310  .def("helmholtzmolar_excess", &AbstractState::helmholtzmolar_excess)
311  .def("helmholtzmass_excess", &AbstractState::helmholtzmass_excess)
312  .def("volumemolar_excess", &AbstractState::volumemolar_excess)
313  .def("volumemass_excess", &AbstractState::volumemass_excess)
314  .def("speed_sound", &AbstractState::speed_sound)
315  .def("isothermal_compressibility", &AbstractState::isothermal_compressibility)
316  .def("isobaric_expansion_coefficient", &AbstractState::isobaric_expansion_coefficient)
317  .def("fugacity_coefficient", &AbstractState::fugacity_coefficient)
318  .def("fugacity", &AbstractState::fugacity)
319  .def("chemical_potential", &AbstractState::chemical_potential)
320  .def("fundamental_derivative_of_gas_dynamics", &AbstractState::fundamental_derivative_of_gas_dynamics)
321  .def("PIP", &AbstractState::PIP)
322  .def("true_critical_point", &AbstractState::true_critical_point)
323  .def("ideal_curve",
324  [](AbstractState& AS, const std::string& name) {
325  std::vector<double> T, p;
326  AS.ideal_curve(name, T, p);
327  return py::make_tuple(T, p);
328  })
329  .def("first_partial_deriv", &AbstractState::first_partial_deriv)
330  .def("second_partial_deriv", &AbstractState::second_partial_deriv)
331  .def("first_saturation_deriv", &AbstractState::first_saturation_deriv)
332  .def("second_saturation_deriv", &AbstractState::second_saturation_deriv)
333  .def("first_two_phase_deriv", &AbstractState::first_two_phase_deriv)
334  .def("second_two_phase_deriv", &AbstractState::second_two_phase_deriv)
335  .def("first_two_phase_deriv_splined", &AbstractState::first_two_phase_deriv_splined)
336  .def("build_phase_envelope", &AbstractState::build_phase_envelope)
337  .def("get_phase_envelope_data", &AbstractState::get_phase_envelope_data)
338  .def("has_melting_line", &AbstractState::has_melting_line)
339  .def("melting_line", &AbstractState::melting_line)
340  .def("saturation_ancillary", &AbstractState::saturation_ancillary)
341  .def("viscosity", &AbstractState::viscosity)
342  .def("viscosity_contributions", &AbstractState::viscosity_contributions)
343  .def("conductivity", &AbstractState::conductivity)
344  .def("conductivity_contributions", &AbstractState::conductivity_contributions)
345  .def("surface_tension", &AbstractState::surface_tension)
346  .def("Prandtl", &AbstractState::Prandtl)
347  .def("conformal_state", &AbstractState::conformal_state)
348  .def("change_EOS", &AbstractState::change_EOS)
349  .def("alpha0", &AbstractState::alpha0)
350  .def("dalpha0_dDelta", &AbstractState::dalpha0_dDelta)
351  .def("dalpha0_dTau", &AbstractState::dalpha0_dTau)
352  .def("d2alpha0_dDelta2", &AbstractState::d2alpha0_dDelta2)
353  .def("d2alpha0_dDelta_dTau", &AbstractState::d2alpha0_dDelta_dTau)
354  .def("d2alpha0_dTau2", &AbstractState::d2alpha0_dTau2)
355  .def("d3alpha0_dTau3", &AbstractState::d3alpha0_dTau3)
356  .def("d3alpha0_dDelta_dTau2", &AbstractState::d3alpha0_dDelta_dTau2)
357  .def("d3alpha0_dDelta2_dTau", &AbstractState::d3alpha0_dDelta2_dTau)
358  .def("d3alpha0_dDelta3", &AbstractState::d3alpha0_dDelta3)
359  .def("alphar", &AbstractState::alphar)
360  .def("dalphar_dDelta", &AbstractState::dalphar_dDelta)
361  .def("dalphar_dTau", &AbstractState::dalphar_dTau)
362  .def("d2alphar_dDelta2", &AbstractState::d2alphar_dDelta2)
363  .def("d2alphar_dDelta_dTau", &AbstractState::d2alphar_dDelta_dTau)
364  .def("d2alphar_dTau2", &AbstractState::d2alphar_dTau2)
365  .def("d3alphar_dDelta3", &AbstractState::d3alphar_dDelta3)
366  .def("d3alphar_dDelta2_dTau", &AbstractState::d3alphar_dDelta2_dTau)
367  .def("d3alphar_dDelta_dTau2", &AbstractState::d3alphar_dDelta_dTau2)
368  .def("d3alphar_dTau3", &AbstractState::d3alphar_dTau3)
369  .def("d4alphar_dDelta4", &AbstractState::d4alphar_dDelta4)
370  .def("d4alphar_dDelta3_dTau", &AbstractState::d4alphar_dDelta3_dTau)
371  .def("d4alphar_dDelta2_dTau2", &AbstractState::d4alphar_dDelta2_dTau2)
372  .def("d4alphar_dDelta_dTau3", &AbstractState::d4alphar_dDelta_dTau3)
373  .def("d4alphar_dTau4", &AbstractState::d4alphar_dTau4);
374 
375  m.def("AbstractState", &factory);
376 
377  m.def("get_config_as_json_string", &get_config_as_json_string);
378  m.def("set_config_as_json_string", &set_config_as_json_string);
379  m.def("config_key_description", (std::string(*)(configuration_keys)) & config_key_description);
380  m.def("config_key_description", (std::string(*)(const std::string&)) & config_key_description);
381  m.def("set_config_string", &set_config_string);
382  m.def("set_config_double", &set_config_double);
383  m.def("set_departure_functions", &set_departure_functions);
384  m.def("set_config_bool", &set_config_bool);
385  m.def("get_config_string", &get_config_string);
386  m.def("get_config_double", &get_config_double);
387  m.def("get_config_bool", &get_config_bool);
388  m.def("get_parameter_information", &get_parameter_information);
389  m.def("get_parameter_index", &get_parameter_index);
390  m.def("get_phase_index", &get_phase_index);
391  m.def("is_trivial_parameter", &is_trivial_parameter);
392  m.def("generate_update_pair", &generate_update_pair<double>);
393  m.def("Props1SI", &Props1SI);
394  m.def("PropsSI", &PropsSI);
395  m.def("PhaseSI", &PhaseSI);
396  m.def("PropsSImulti", &PropsSImulti);
397  m.def("get_global_param_string", &get_global_param_string);
398  m.def("get_debug_level", &get_debug_level);
399  m.def("set_debug_level", &set_debug_level);
400  m.def("get_fluid_param_string", &get_fluid_param_string);
401  m.def("extract_backend", &extract_backend);
402  m.def("extract_fractions", &extract_fractions);
403  m.def("set_reference_stateS", &set_reference_stateS);
404  m.def("set_reference_stateD", &set_reference_stateD);
405  m.def("saturation_ancillary", &saturation_ancillary);
406  m.def("add_fluids_as_JSON", &add_fluids_as_JSON);
407  m.def("HAPropsSI", &HumidAir::HAPropsSI);
408  m.def("HAProps", &HumidAir::HAProps);
409  m.def("HAProps_Aux", [](std::string out_string, double T, double p, double psi_w) {
410  char units[1000];
411  double out = HumidAir::HAProps_Aux(out_string.c_str(), T, p, psi_w, units);
412  return py::make_tuple(out, std::string(units));
413  });
414  m.def("cair_sat", &HumidAir::cair_sat);
415  m.def("get_mixture_binary_pair_data", &get_mixture_binary_pair_data);
416  m.def("set_mixture_binary_pair_data", &set_mixture_binary_pair_data);
417  m.def("apply_simple_mixing_rule", &apply_simple_mixing_rule);
418 }
419 
420 # if defined(COOLPROP_PYBIND11_MODULE)
421 PYBIND11_PLUGIN(CoolProp) {
422  py::module m("CoolProp", "CoolProp module");
423 
424  init_CoolProp(m);
425 
426  return m.ptr();
427 }
428 # endif
429 
430 #endif