Skip to content

Commit

Permalink
Merge pull request #205 from BioSTEAMDevelopmentGroup/QoL_STR_changes
Browse files Browse the repository at this point in the history
Add parameter N_reactors to StirredTankReactor and enable passing RGBn tuples as arguments for color_wheel in plot_spearman_2d
  • Loading branch information
yoelcortes committed Jun 21, 2024
2 parents 25e0a96 + 83d3290 commit 2252866
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion biosteam/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ def plot_spearman_2d(rhos, top=None, name=None, color_wheel=None, index=None,
Spearman's rank correlation coefficients to be plotted.
top=None : float, optional
Number of parameters to plot (from highest values).
color_wheel=None: Iterable, optional
Iterable of colorpalette.Color objects or RGBn values.
Returns
-------
Expand All @@ -687,7 +689,9 @@ def plot_spearman_2d(rhos, top=None, name=None, color_wheel=None, index=None,
if not color_wheel: color_wheel = CABBI_colors.wheel()
fig, ax = plt.subplots()
for i, rho in enumerate(rhos):
plot_spearman_1d(rho, color=color_wheel[N - i - 1].RGBn, s=s, offset=i,
color = color_wheel[N - i - 1]
if hasattr(color, 'RGBn'): color = color.RGBn
plot_spearman_1d(rho, color=color, s=s, offset=i,
fig=fig, ax=ax, style=False, sort=False, top=None)
# Plot central line
yranges = [(s/2 + s*i - 1., 1.) for i in range(len(rhos[0]))]
Expand Down
6 changes: 3 additions & 3 deletions biosteam/units/stirred_tank_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class StirredTankReactor(PressureVessel, Unit, isabstract=True):
Defaults to `continuous`.
tau_0 :
Cleaning and unloading time (if batch mode). Defaults to 3 hr.
N_reactors :
Number of reactors.
Notes
-----
The recirculation loop takes into account the required flow rate needed to
Expand Down Expand Up @@ -274,7 +275,6 @@ def _design(self):
P_pascal = (self.P if self.P else self.outs[0].P)
P_psi = P_pascal * 0.000145038 # Pa to psi
length_to_diameter = self.length_to_diameter

if self.batch:
v_0 = ins_F_vol
tau = self.tau
Expand All @@ -297,7 +297,7 @@ def _design(self):
else:
V_reactor = V_total / N
Design['Reactor volume'] = V_reactor
self.N_reactors = N
D = cylinder_diameter_from_volume(V_reactor, self.length_to_diameter)
D *= 3.28084 # Convert from m to ft
L = D * length_to_diameter
Expand Down

0 comments on commit 2252866

Please sign in to comment.