Commit 9b72d82c authored by markus's avatar markus
Browse files

add suggestion for ventilation class structure

parent 618fc312
from dataclasses import dataclass
from abc import abstractmethod
import numpy as np
@dataclass(frozen=True)
class Ventilation:
@abstractmethod
def air_exchange(self, room, time: float) -> float:
pass
@dataclass(frozen=True)
class PeriodicWindow(Ventilation):
period: int
duration: int
inside_temp: float
outside_temp: float
window_height: float
opening_length: float
cd_b: float
def air_exchange(self, room, time: float) -> float:
if time % self.period < (self.period - self.duration):
return 0
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))
@dataclass(frozen=True)
class PeriodicHEPA(Ventilation):
period: int
duration: int
q_air_mech: int
def air_exchange(self, room, time: float) -> float:
if time % self.period < (self.period - self.duration):
return 0
return self.q_air_mech / room.volume
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment