10 # include <pybind11/pybind11.h>
11 # include <pybind11/stl.h>
12 namespace py = pybind11;
18 void init_CoolProp(py::module& m) {
21 py::class_<SimpleState>(m,
"SimpleState")
27 py::class_<GuessesStructure>(m,
"GuessesStructure")
40 py::class_<CriticalState, SimpleState>(m,
"CriticalState").def_readwrite(
"stable", &
CriticalState::stable);
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);
71 py::enum_<configuration_keys>(m,
"configuration_keys")
72 # define X(Enum, String, Default, Desc) .value(String, configuration_keys::Enum)
77 py::enum_<parameters>(m,
"parameters")
153 py::enum_<input_pairs>(m,
"input_pairs")
191 py::enum_<phases>(m,
"phases")
202 py::class_<AbstractState>(m,
"_AbstractState")
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",
232 .def(
"get_binary_interaction_double",
254 .def(
"criticality_contour_values",
258 return py::make_tuple(L, M);
325 std::vector<double> T, p;
327 return py::make_tuple(T, p);
375 m.def(
"AbstractState", &factory);
392 m.def(
"generate_update_pair", &generate_update_pair<double>);
409 m.def(
"HAProps_Aux", [](std::string out_string,
double T,
double p,
double psi_w) {
412 return py::make_tuple(out, std::string(units));
420 # if defined(COOLPROP_PYBIND11_MODULE)
422 py::module m(
"CoolProp",
"CoolProp module");