Merge branch 'develop/exp_aerosols_order' into 'master'
Fix the implementation of models.Expiration Closes #24 See merge request cara/cara!13
This commit is contained in:
commit
0d195cb4ce
2 changed files with 11 additions and 4 deletions
|
|
@ -221,11 +221,9 @@ class Expiration:
|
|||
def volume(diameter):
|
||||
return (4 * np.pi * (diameter/2)**3) / 3
|
||||
total = 0
|
||||
for i, (diameter, factor) in enumerate(zip(self.particle_sizes, self.ejection_factor)):
|
||||
for diameter, factor in zip(self.particle_sizes, self.ejection_factor):
|
||||
contribution = volume(diameter) * factor
|
||||
if i >= 2:
|
||||
# TODO: It is probably the case that this term comes from the
|
||||
# particle diameter, rather than arbitrary position in a sequence...
|
||||
if diameter >= 3e-4:
|
||||
contribution = contribution * (1 - mask.exhale_efficiency)
|
||||
total += contribution
|
||||
return total
|
||||
|
|
|
|||
|
|
@ -139,3 +139,12 @@ def test_periodic_hepa(baseline_periodic_hepa, baseline_room):
|
|||
aes = [baseline_periodic_hepa.air_exchange(baseline_room, t) for t in ts]
|
||||
answers = [0, rate, rate, 0, 0, 0, rate, 0, 0]
|
||||
npt.assert_allclose(aes, answers, rtol=1e-5)
|
||||
|
||||
|
||||
def test_expiration_aerosols():
|
||||
mask = models.Mask.types['Type I']
|
||||
exp1 = models.Expiration((0.751, 0.139, 0.0139, 0.059),
|
||||
particle_sizes = (0.8e-4, 1.8e-4, 3.5e-4, 5.5e-4))
|
||||
exp2 = models.Expiration((0.059, 0.0139, 0.751, 0.139),
|
||||
particle_sizes = (5.5e-4, 3.5e-4, 0.8e-4, 1.8e-4))
|
||||
npt.assert_allclose(exp1.aerosols(mask), exp2.aerosols(mask), rtol=1e-5)
|
||||
|
|
|
|||
Loading…
Reference in a new issue