From d1246c463e2e5635891a86852ba079a6f8ee183e Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Wed, 4 Nov 2020 22:54:51 +0100 Subject: [PATCH] Replacing inside and outside temperature by piecewise constant functions, in WindowOpening class (models.py) --- cara/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cara/models.py b/cara/models.py index cec5f9c6..7ea4668e 100644 --- a/cara/models.py +++ b/cara/models.py @@ -174,8 +174,8 @@ class WindowOpening(Ventilation): #: The interval in which the window is open. active: Interval - inside_temp: float #: The temperature inside the room (Kelvin) - outside_temp: float #: The temperature outside of the window (Kelvin) + inside_temp: PiecewiseconstantFunction #: The temperature inside the room (Kelvin) + outside_temp: PiecewiseconstantFunction #: The temperature outside of the window (Kelvin) window_height: float #: The height of the window @@ -190,7 +190,8 @@ class WindowOpening(Ventilation): # Reminder, no dependence on time in the resulting calculation. - temp_delta = abs(self.inside_temp - self.outside_temp) / self.outside_temp + temp_delta = abs(self.inside_temp.value(time) - + self.outside_temp.value(time)) / self.outside_temp.value(time) root = np.sqrt(9.81 * self.window_height * temp_delta) return (3600 / (3 * room.volume)) * self.cd_b * self.window_height * self.opening_length * root