From 0830bbb0cb9cae389f52471c2f4339da5ad3529a Mon Sep 17 00:00:00 2001 From: Aaron Yao-Smith Date: Sat, 1 Dec 2018 14:54:06 -0500 Subject: [PATCH 1/2] Set initial Plant ent tank a_ratio to arbitrary number >1 Also fixed Plant naming to keep up with new floc stuff --- aguaclara/design/floc.py | 8 ++++---- aguaclara/design/plant.py | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/aguaclara/design/floc.py b/aguaclara/design/floc.py index 8605deab..c97aef8f 100644 --- a/aguaclara/design/floc.py +++ b/aguaclara/design/floc.py @@ -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): @@ -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): diff --git a/aguaclara/design/plant.py b/aguaclara/design/plant.py index 30f8f854..876efdb5 100644 --- a/aguaclara/design/plant.py +++ b/aguaclara/design/plant.py @@ -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 From 47d697cc591da59204bc82c5a1db54974bbc1bab Mon Sep 17 00:00:00 2001 From: Oliver Leung Date: Sat, 1 Dec 2018 15:21:51 -0500 Subject: [PATCH 2/2] Fix pytest --- tests/design/test_plant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/design/test_plant.py b/tests/design/test_plant.py index 0f1ef1b3..7b26649f 100644 --- a/tests/design/test_plant.py +++ b/tests/design/test_plant.py @@ -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) \ No newline at end of file + self.assertAlmostEqual(self.plant.ent_tank_a, 1.1457647546752496 * (u.m ** 2), 3)