Skip to content

Commit

Permalink
Merge pull request #132 from AguaClara/plant
Browse files Browse the repository at this point in the history
Set initial Plant ent tank a_ratio to arbitrary number >1
  • Loading branch information
oliver-leung authored Dec 1, 2018
2 parents 15d8532 + 93cde3d commit af05d18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions aguaclara/design/floc.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def vel_grad_avg(self):
:rtype: float * 1 / second
"""
return ((con.GRAVITY * self.HL) /
(pc.nu(self.temp) * self.GT)).to(u.s ** -1)
(pc.nu(self.temp) * self.GT)).to(u.s ** -1)

@property
def retention_time(self):
Expand Down Expand Up @@ -275,10 +275,10 @@ def baffle_s(self):
:returns: Minimum number of expansions/baffle space
:rtype: int
"""

return ((self.BAFFLE_K /
(2 * self.expansion_h_max * (self.vel_grad_avg ** 2) * pc.nu(self.temp))) ** (1/3) *
self.q / ha.HUMAN_W_MIN).to(u.cm)
(2 * self.expansion_h_max * (self.vel_grad_avg ** 2) * pc.nu(self.temp))) ** (1/3) *
self.q / ha.HUMAN_W_MIN).to(u.cm)

@property
def obstacle_n(self):
Expand Down
16 changes: 7 additions & 9 deletions aguaclara/design/plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ def ent_tank_a(self):
"""
# first guess planview area
a_new = 1 * u.m**2
a_ratio = 0
a_ratio = 2 # set to >1+tolerance to start while loop
tolerance = 0.01

a_floc_pv = (
self.floc.vol /
(self.floc.END_WATER_H + (self.floc.HL / 2))
)
while a_ratio > (1 + tolerance):
a_et_pv = a_new
a_floc_pv = (
self.floc.vol /
(self.floc.END_WATER_HEIGHT + (self.floc.HL / 2))
)
a_etf_pv = a_et_pv + a_floc_pv

w_tot = a_etf_pv / self.floc.l_sed_max
w_tot = a_etf_pv / self.floc.sed_tank_l_max
w_chan = w_tot / self.floc.channel_n

a_new = self.floc.L_MAX * w_chan
a_new = self.floc.l_max_vol * w_chan
a_ratio = a_new / a_et_pv
return a_new
2 changes: 1 addition & 1 deletion tests/design/test_plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def setUp(self):
self.plant = Plant()

def test_vel_grad_avg(self):
self.assertAlmostEqual(self.plant.ent_tank_a, 1 * (u.m ** 2), 0.001)
self.assertAlmostEqual(self.plant.ent_tank_a, 1.1457647546752496 * (u.m ** 2), 3)

0 comments on commit af05d18

Please sign in to comment.