move window parameters to Ventilation

This commit is contained in:
markus 2020-10-20 16:10:52 +02:00
parent 496f2d2a81
commit 5fbda6afe3
2 changed files with 11 additions and 10 deletions

View file

@ -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))

View file

@ -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)),