Skip to content

Commit

Permalink
more flexible coding on Reactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yalinli2 committed Oct 17, 2024
1 parent 9b531df commit bcfdc1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qsdsan/sanunits/_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ def _design(self):
# if auxiliary, in our system, only K/O drum whose N, and V are provided
# do not need to deal with self.F_vol_in (auxiliary unit has trouble doing this)
ins_F_vol = self.F_vol_in
cmps = self.components
gas_IDs = [i.ID for i in cmps if i.locked_state=='g']
sol_IDs = [i.ID for i in cmps if i.locked_state=='s']
for i in range(len(self.ins)):
ins_F_vol -= (self.ins[i].ivol['H2'] +\
self.ins[i].ivol['CHG_catalyst'] +\
self.ins[i].ivol['HT_catalyst'] +\
self.ins[i].ivol['HC_catalyst'])
# not include gas (e.g. H2)
ins_F_vol -= sum(self.ins[i].ivol[gas_IDs])
ins_F_vol -= sum(self.ins[i].ivol[sol_IDs])
# not include gas (e.g. H2) and solids (e.g., catalysts)
V_total = ins_F_vol * self.tau / self.V_wf
P = self.P * _Pa_to_psi # Pa to psi
length_to_diameter = self.length_to_diameter
Expand Down

1 comment on commit bcfdc1a

@yalinli2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes only led to small changes in the HTL module (within the error):

old values:
Image

compared to (new values):

df1.values
Out[2]: array([  3.2  ,   4.267,  60.272, 411.282])

df2.values
Out[3]: array([  3.745,  37.851,  46.447, 292.984])

df3.values
Out[4]: array([  2.559, -35.28 ,  69.92 , 493.845])

Please sign in to comment.