From 25b1dc90f2b58308460b1412f294911e2b386ca1 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 5 Aug 2015 19:38:20 -0400 Subject: [PATCH] [Python] Set default constant property pair in Quantity.equilibrate --- interfaces/cython/cantera/composite.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interfaces/cython/cantera/composite.py b/interfaces/cython/cantera/composite.py index 6f50f842bd..f468dcd474 100644 --- a/interfaces/cython/cantera/composite.py +++ b/interfaces/cython/cantera/composite.py @@ -123,11 +123,14 @@ def gibbs(self): """ return self.mass * self.phase.gibbs_mass - def equilibrate(self, *args, **kwargs): + def equilibrate(self, XY=None, *args, **kwargs): """ - Set the state to equilibrium. See `ThermoPhase.equilibrate`. + Set the state to equilibrium. By default, the property pair + `self.constant` is held constant. See `ThermoPhase.equilibrate`. """ - self.phase.equilibrate(*args, **kwargs) + if XY is None: + XY = self.constant + self.phase.equilibrate(XY, *args, **kwargs) self.state = self._phase.TDY def __imul__(self, other):