Zero removal rate case (mainly for CO2 concentration with no ventilation)
- Implement the right equation when
RR=0
in_ConcentrationmodelBase._normed_concentration
: instead of
# If RR is 0, conc_limit does not play a role but its computation
# would raise an error -> we set it to zero.
try:
conc_limit = self._normed_concentration_limit(next_state_change_time)
except ZeroDivisionError:
conc_limit = 0.
t_last_state_change = self.last_state_change(time)
conc_at_last_state_change = self._normed_concentration_cached(t_last_state_change)
delta_time = time - t_last_state_change
fac = np.exp(-RR * delta_time)
return conc_limit * (1 - fac) + conc_at_last_state_change * fac
we should put something like:
conc_at_last_state_change = self._normed_concentration_cached(t_last_state_change)
t_last_state_change = self.last_state_change(time)
delta_time = time - t_last_state_change
if RR != 0.:
conc_limit = self._normed_concentration_limit(next_state_change_time)
fac = np.exp(-RR * delta_time)
return conc_limit * (1 - fac) + conc_at_last_state_change * fac
else:
# If RR is 0, the concentration is linear with time.
return delta_time/self.room.volume + conc_at_last_state_change
(and create some corresponding tests - checking in particular that the value of the CO2 concentration when decreasing the ventilation rate to a very small value, gets close to the value at exactly zero).
- Then, we can remove the minimum
1e-6
ACH residual ventilation value inCO2ConcentrationModel
.
Edited by Nicolas Mounet