diff --git a/biosteam/units/phase_equilibrium.py b/biosteam/units/phase_equilibrium.py index 8d9e3583..66a7f81f 100644 --- a/biosteam/units/phase_equilibrium.py +++ b/biosteam/units/phase_equilibrium.py @@ -516,7 +516,7 @@ def _set_arrays(self, IDs, **kwargs): def _get_activity_model(self): chemicals = self.chemicals - index = chemicals.get_lle_indices(sum([i.mol for i in self.outs]).nonzero_keys()) + index = chemicals.get_lle_indices(sum([i.mol for i in self.ins]).nonzero_keys()) chemicals = chemicals.tuple lle_chemicals = [chemicals[i] for i in index] return self.thermo.Gamma(lle_chemicals), [i.ID for i in lle_chemicals], index @@ -544,6 +544,7 @@ def _run_decoupled_Kgamma(self, P=None): # Psuedo-equilibrium index, = np.where(good) IDs = [IDs[i] for i in index] gamma_y = [gamma_y[i] for i in index] + K = [K[i] for i in index] self._set_arrays(IDs, gamma_y=gamma_y, K=K) def _run_decoupled_B(self, stacklevel=1): # Flash Rashford-Rice diff --git a/biosteam/units/stirred_tank_reactor.py b/biosteam/units/stirred_tank_reactor.py index c983e6b8..ad02fcd1 100644 --- a/biosteam/units/stirred_tank_reactor.py +++ b/biosteam/units/stirred_tank_reactor.py @@ -229,6 +229,9 @@ class StirredTankReactor(PressureVessel, Unit, isabstract=True): #: Default cleaning and unloading time (hr). tau_0_default: Optional[float] = 3 + #: Whether to default operation in batch mode or continuous + batch_default = False + @property def effluent(self): return self.outs[-1] @@ -263,7 +266,7 @@ def _init( self.vessel_material = 'Stainless steel 316' if vessel_material is None else vessel_material self.vessel_type = 'Vertical' if vessel_type is None else vessel_type self.tau_0 = self.tau_0_default if tau_0 is None else tau_0 - self.batch = batch + self.batch = self.batch_default if batch is None else batch self.load_auxiliaries() def load_auxiliaries(self): @@ -422,6 +425,7 @@ class AeratedBioreactor(StirredTankReactor): T_default = 273.15 + 32 P_default = 101325 kW_per_m3_default = 0.2955 # Reaction in homogeneous liquid; reference [1] + batch_default = True def _init( self, reactions, theta_O2=0.5, Q_O2_consumption=None, @@ -702,6 +706,7 @@ class GasFedBioreactor(StirredTankReactor): T_default = 273.15 + 32 P_default = 101325 kW_per_m3_default = 0.2955 # Reaction in homogeneous liquid + batch_default = True def _init(self, reactions, gas_substrates, titer, backward_reactions, diff --git a/thermosteam b/thermosteam index 4e6914d8..ee76d72b 160000 --- a/thermosteam +++ b/thermosteam @@ -1 +1 @@ -Subproject commit 4e6914d8ae58a0e375aa88d190bac6af5ee05285 +Subproject commit ee76d72b83706210e3d85cff02e5749f45eeccdf