Skip to content

Commit

Permalink
Predefined mixtures work with State class ; closes #697
Browse files Browse the repository at this point in the history
  • Loading branch information
ibell committed Jun 12, 2015
1 parent e68463f commit 4ca1a5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wrappers/Python/CoolProp/CoolProp.pyx
Expand Up @@ -530,6 +530,7 @@ cdef class State:

cdef object _Fluid = Fluid
cdef object _backend = backend
cdef bint set_fractions = False
new_fluid = []
fracs = []
if '[' in _Fluid and ']' in _Fluid:
Expand All @@ -539,11 +540,11 @@ cdef class State:
new_fluid.append(fluid)
fracs.append(float(frac.strip(']')))
_Fluid = '&'.join(new_fluid)
else:
fracs = [1]
set_fractions = True

self.pAS = AbstractState(_backend, _Fluid)
self.pAS.set_mole_fractions(fracs)
if set_fractions:
self.pAS.set_mole_fractions(fracs)

cpdef update_ph(self, double p, double h):
"""
Expand Down

0 comments on commit 4ca1a5e

Please sign in to comment.