From 7c60182142e4ee9be69000091c7a0d452170180d Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Wed, 8 Oct 2014 12:37:41 +0000 Subject: [PATCH] Allow None when setting the state of a PureFluid Allow None as an option when setting the temperature and quality or pressure and quality of a PureFluid. This mimics similar functionality for Solutions. --- 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 2a3cee2e1..df15b5a59 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -920,11 +920,13 @@ cdef class PureFluid(ThermoPhase): def __get__(self): return self.T, self.X def __set__(self, values): - self.thermo.setState_Tsat(values[0], values[1]) + T = values[0] if values[0] is not None else self.T + self.thermo.setState_Tsat(T, values[1]) property PX: """Get/Set the pressure and vapor fraction of a two-phase state.""" def __get__(self): return self.P, self.X def __set__(self, values): - self.thermo.setState_Psat(values[0], values[1]) + P = values[0] if values[0] is not None else self.P + self.thermo.setState_Psat(P, values[1])