From 9ed87e857c94815b5fb49bd8c7369c2219af56cc Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Wed, 8 Oct 2014 12:42:15 +0000 Subject: [PATCH] [Cython] Allow None when setting the quality of a PureFluid Allow None as an option for the quality as well as the temperature and pressure when setting the state of a PureFluid. Completes r3213. --- interfaces/cython/cantera/thermo.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/cantera/thermo.pyx b/interfaces/cython/cantera/thermo.pyx index df15b5a59..cccb0d71c 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -921,7 +921,8 @@ cdef class PureFluid(ThermoPhase): return self.T, self.X def __set__(self, values): T = values[0] if values[0] is not None else self.T - self.thermo.setState_Tsat(T, values[1]) + X = values[1] if values[1] is not None else self.X + self.thermo.setState_Tsat(T, X) property PX: """Get/Set the pressure and vapor fraction of a two-phase state.""" @@ -929,4 +930,5 @@ cdef class PureFluid(ThermoPhase): return self.P, self.X def __set__(self, values): P = values[0] if values[0] is not None else self.P - self.thermo.setState_Psat(P, values[1]) + X = values[1] if values[1] is not None else self.X + self.thermo.setState_Psat(P, X)