Skip to content

Commit d0e1816

Browse files
committed
use rigorous VLE
1 parent 114515c commit d0e1816

5 files changed

Lines changed: 25 additions & 6 deletions

File tree

biosteam/_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ def _mass_and_energy_balance_specifications_table(self):
14811481
return df
14821482

14831483
def results(self, with_units=True, include_utilities=True,
1484-
include_total_cost=True, include_installed_cost=False,
1484+
include_total_cost=True, include_installed_cost=True,
14851485
include_zeros=True, external_utilities=None, key_hook=None,
14861486
basis=None):
14871487
"""

biosteam/units/aerated_bioreactor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ def load_auxiliaries(self):
325325
)
326326

327327
def _run_vent(self, vent, effluent):
328-
vent.receive_vent(effluent, energy_balance=False, ideal=True)
328+
stream = bst.MultiStream.from_streams([effluent, vent])
329+
stream.vle(T=stream.T, P=stream.P)
329330

330331
def _run(self):
331332
air = self.air
@@ -767,7 +768,8 @@ def load_auxiliaries(self):
767768
)
768769

769770
def _run_vent(self, vent, effluent):
770-
vent.receive_vent(effluent, energy_balance=False, ideal=True)
771+
stream = bst.MultiStream.from_streams([effluent, vent])
772+
stream.vle(T=stream.T, P=stream.P)
771773

772774
def get_SURs(self, effluent):
773775
F_vol = effluent.ivol['Water'] # m3 / hr

biosteam/units/anaerobic_bioreactor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
& Ng, M. K. (2017). Product and Process Design Principles. Wiley.
1717
1818
"""
19+
import biosteam as bst
1920
from .abstract_stirred_tank_reactor import AbstractStirredTankReactor
2021

2122
__all__ = (
@@ -190,7 +191,8 @@ def vent(self):
190191

191192
def _run_vent(self, vent, effluent):
192193
vent.phase = 'g'
193-
vent.receive_vent(effluent, energy_balance=False, ideal=True)
194+
stream = bst.MultiStream.from_streams([effluent, vent])
195+
stream.vle(T=stream.T, P=stream.P)
194196

195197
def _run(self):
196198
vent, effluent = self.outs

biosteam/units/nrel_bioreactor.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from math import ceil
4848
from scipy.integrate import odeint
4949
from thermosteam.reaction import Reaction, ParallelReaction
50+
import biosteam as bst
5051

5152
__all__ = (
5253
'NRELAnaerobicBatchBioreactor',
@@ -130,7 +131,8 @@ def _get_design_info(self):
130131
('Working volume fraction', self.V_wf, ''))
131132

132133
def _init(self, tau=None, N=None, V_max=None, T=305.15, P=101325,
133-
Nmin=2, Nmax=36, loading_time=None):
134+
Nmin=2, Nmax=36, loading_time=None, reactions=None,
135+
tau_0=None, V_wf=None):
134136
self._N = N; self._V_max = V_max
135137

136138
#: [float] Reaction time [hr].
@@ -158,6 +160,12 @@ def _init(self, tau=None, N=None, V_max=None, T=305.15, P=101325,
158160
#: If not given, it will assume each vessel is constantly being filled.
159161
self.loading_time = loading_time
160162

163+
#: [Reaction|ReactionSystem] Stoichiomentric reactions.
164+
self.reactions = reactions
165+
166+
if tau_0 is not None: self.tau_0 = tau_0
167+
if V_wf is not None: self.V_wf = V_wf
168+
161169
def _setup(self):
162170
super()._setup()
163171
vent, effluent = self.outs
@@ -210,6 +218,13 @@ def tau(self):
210218
def tau(self, tau):
211219
self._tau = tau
212220

221+
def _run(self):
222+
vent, effluent = self.outs
223+
effluent.mix_from(self.ins)
224+
self.reactions(effluent)
225+
stream = bst.MultiStream.from_streams([effluent, vent])
226+
stream.vle(T=stream.T, P=stream.P)
227+
213228
def _design(self):
214229
effluent = self.effluent
215230
v_0 = effluent.F_vol

0 commit comments

Comments
 (0)