From 465192dcce98e30eca8280f412a794507786b532 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Mon, 6 Jul 2026 13:06:03 -0400 Subject: [PATCH 1/2] fix bug for when `loading_time` is None but `N_reactors` is given --- biosteam/units/design_tools/batch.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/biosteam/units/design_tools/batch.py b/biosteam/units/design_tools/batch.py index 71409ae6..aac6ecca 100644 --- a/biosteam/units/design_tools/batch.py +++ b/biosteam/units/design_tools/batch.py @@ -182,6 +182,15 @@ def f(tau_loading): # Time required to load a reactor tau_loading = V_i / F_vol + + # Total volume of all reactors, assuming no downtime + V_T = F_vol * (tau_reaction + tau_cleaning) / (1 - 1 / N_reactors) + + # Volume of an individual reactor + V_i = V_T / N_reactors + + # Time required to load a reactor + tau_loading = V_i / F_vol else: tau_loading = loading_time From b40addda610d60968960f423bca862ce059fff2f Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Mon, 6 Jul 2026 13:19:01 -0400 Subject: [PATCH 2/2] remove redundant lines --- biosteam/units/design_tools/batch.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/biosteam/units/design_tools/batch.py b/biosteam/units/design_tools/batch.py index aac6ecca..3a726303 100644 --- a/biosteam/units/design_tools/batch.py +++ b/biosteam/units/design_tools/batch.py @@ -173,15 +173,6 @@ def f(tau_loading): N_reactors = ceil(F_vol * (tau_reaction + tau_cleaning + tau_loading) / (V_max * V_wf)) V_T = F_vol * (tau_reaction + tau_cleaning + tau_loading) V_i = V_T / N_reactors - - # Total volume of all reactors, assuming no downtime - V_T = F_vol * (tau_reaction + tau_cleaning) / (1 - 1 / N_reactors) - - # Volume of an individual reactor - V_i = V_T / N_reactors - - # Time required to load a reactor - tau_loading = V_i / F_vol # Total volume of all reactors, assuming no downtime V_T = F_vol * (tau_reaction + tau_cleaning) / (1 - 1 / N_reactors)