PhaseDiagram(
[
State(eos, temperature, pressure=p, moles=feed).tp_flash()
for p in pressure
if not State(eos, temperature, pressure=p, moles=feed).is_stable()
]
)
From the resulting PhaseDiagram object, the properties can then be obtained without having to write loops.
Similar to that StateVec is exposed in Python and gets a corresponding constructor, that can be used like this:
StateVec([State(eos, temperature, pressure=p, moles=feed) for p in pressure])
Other smaller changes:
PhaseDiagram "inherits" the const generic that indicates the number of phases from PhaseEquilibrium. It was a somewhat unnecessary limitation, that could make future additions breaking changes. In Python PhaseDiagram is still fixed to 2 phases and there is currently no analog to ThreePhaseEquilibrium as it isn't needed.
StateVec::moles is added as an additional getter. A small inconvenience: At this point it is not possible to index SIArray2s in Python.
This allows code like
From the resulting
PhaseDiagram
object, the properties can then be obtained without having to write loops.Similar to that
StateVec
is exposed in Python and gets a corresponding constructor, that can be used like this:Other smaller changes:
PhaseDiagram
"inherits" the const generic that indicates the number of phases fromPhaseEquilibrium
. It was a somewhat unnecessary limitation, that could make future additions breaking changes. In PythonPhaseDiagram
is still fixed to 2 phases and there is currently no analog toThreePhaseEquilibrium
as it isn't needed.StateVec::moles
is added as an additional getter. A small inconvenience: At this point it is not possible to indexSIArray2
s in Python.