Add room system for ventilation loss calculation

This commit is contained in:
2026-06-09 14:23:59 +02:00
parent a3c507b909
commit 5a9ff39eec
+46
View File
@@ -0,0 +1,46 @@
from dataclasses import dataclass
from enum import Enum, auto
class RoomKind(Enum):
# Wet rooms
OPEN_KITCHEN = auto()
KITCHEN = auto()
TOILET = auto()
OTHER_WET = auto()
# dry rooms
LIVING_ROOM = auto()
OTHER_DRY = auto()
# https://belglas.com/wp-content/uploads/2016/04/ventilatiedocumentresidentieel.pdf
_RANGES = {
RoomKind.OPEN_KITCHEN: (75, float("inf")),
RoomKind.KITCHEN: (50, 75),
RoomKind.TOILET: (25, 25),
RoomKind.OTHER_WET: (50, 75),
RoomKind.LIVING_ROOM: (75, 150),
RoomKind.OTHER_DRY: (25, 72),
}
def _clamp(x, low, high):
return min(max(x, low), high)
@dataclass
class Room:
kind: RoomKind
area: float
@property
def is_wet(self) -> bool:
return self.kind not in {RoomKind.LIVING_ROOM, RoomKind.OTHER_DRY}
@property
def flow_rate(self) -> float:
if self.kind == RoomKind.TOILET:
return 25
rate = 3.6 * self.area
return _clamp(rate, *_RANGES[self.kind])