diff --git a/cara/models.py b/cara/models.py index 032f8782..ae858f50 100644 --- a/cara/models.py +++ b/cara/models.py @@ -12,12 +12,6 @@ class Room: # The total volume of the room volume: int - # The height of the window in the room (assumes one window) - window_height: float - - # The length of the opening-gap when the window is open - opening_length: float - @dataclass(frozen=True) class Ventilation: @@ -42,6 +36,12 @@ class PeriodicWindow(Ventilation): inside_temp: float outside_temp: float + # The height of the window + window_height: float + + # The length of the opening-gap when the window is open + opening_length: float + # TODO: Figure out what this coefficient represents cd_b: float @@ -52,8 +52,8 @@ class PeriodicWindow(Ventilation): if time % self.period < (self.period - self.duration): return 0 - return ((3600 / (3 * room.volume)) * self.cd_b * room.window_height * - room.opening_length * np.sqrt(9.81 * room.window_height * (abs(self.inside_temp - self.outside_temp)) + return ((3600 / (3 * room.volume)) * self.cd_b * self.window_height * + self.opening_length * np.sqrt(9.81 * self.window_height * (abs(self.inside_temp - self.outside_temp)) / self.outside_temp)) diff --git a/cara/tests/test_known_quantities.py b/cara/tests/test_known_quantities.py index b9440bf6..847e1646 100644 --- a/cara/tests/test_known_quantities.py +++ b/cara/tests/test_known_quantities.py @@ -25,8 +25,9 @@ def test_no_mask_emission_rate(baseline_model): @pytest.fixture def baseline_model(): model = models.Model( - room=models.Room(volume=75, window_height=1.6, opening_length=0.6), - ventilation=models.PeriodicWindow(period=120, duration=120, inside_temp=293, outside_temp=283, cd_b=0.6), + room=models.Room(volume=75), + ventilation=models.PeriodicWindow(period=120, duration=120, inside_temp=293, outside_temp=283, cd_b=0.6, + window_height=1.6, opening_length=0.6), infected=models.InfectedPerson( virus=models.Virus.types['SARS_CoV_2'], present_times=((0, 4), (5, 8)),