Added default frequency of 1 hour for window opening

This commit is contained in:
Luis Aleixo 2022-06-13 10:50:54 +02:00
parent 0fc28f129b
commit f5ef650cea
6 changed files with 21 additions and 33 deletions

View file

@ -71,7 +71,6 @@ class FormData:
virus_type: str
volume_type: str
windows_duration: float
windows_frequency: float
window_height: float
window_type: str
window_width: float
@ -129,7 +128,6 @@ class FormData:
'window_height': 0.,
'window_width': 0.,
'windows_duration': 0.,
'windows_frequency': 0.,
'windows_number': 0,
'window_opening_regime': 'windows_open_permanently',
'short_range_option': 'short_range_no',
@ -324,11 +322,11 @@ class FormData:
return outside_temp
def ventilation(self) -> models._VentilationBase:
always_on = models.PeriodicInterval(period=120, duration=120)
always_on = models.PeriodicInterval(period=60, duration=60)
# Initializes a ventilation instance as a window if 'natural_ventilation' is selected, or as a HEPA-filter otherwise
if self.ventilation_type == 'natural_ventilation':
if self.window_opening_regime == 'windows_open_periodically':
window_interval = models.PeriodicInterval(self.windows_frequency, self.windows_duration, min(self.infected_start, self.exposed_start)/60)
window_interval = models.PeriodicInterval(60, self.windows_duration, min(self.infected_start, self.exposed_start)/60)
else:
window_interval = always_on
@ -717,7 +715,6 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]:
'virus_type': 'SARS_CoV_2',
'volume_type': 'room_volume_explicit',
'windows_duration': '',
'windows_frequency': '',
'window_height': '2',
'window_type': 'window_sliding',
'window_width': '2',

View file

@ -125,7 +125,6 @@ function require_natural_ventilation(option) {
if (!option) {
require_input_field("#window_width", option);
require_input_field("#windows_duration", option);
require_input_field("#windows_frequency", option);
}
}
@ -146,9 +145,7 @@ function require_air_supply(option) {
function require_venting(option) {
require_input_field("#windows_duration", option);
require_input_field("#windows_frequency", option);
set_disabled_status("#windows_duration", !option);
set_disabled_status("#windows_frequency", !option);
}
function require_lunch(id, option) {
@ -404,14 +401,13 @@ function validate_form(form) {
}
});
//Validate window venting duration < venting frequency
//Validate window venting duration > 60 minutes.
if (!$("#windows_duration").hasClass("disabled")) {
var windowsDurationObj = document.getElementById("windows_duration");
var windowsFrequencyObj = document.getElementById("windows_frequency");
removeErrorFor(windowsFrequencyObj);
removeErrorFor(windowsDurationObj);
if (parseInt(windowsDurationObj.value) >= parseInt(windowsFrequencyObj.value)) {
insertErrorFor(windowsFrequencyObj, "Duration >= Frequency");
if (parseInt(windowsDurationObj.value) > 60.) {
insertErrorFor(windowsDurationObj, "Duration > 60 minutes.");
submit = false;
}
}

View file

@ -237,9 +237,8 @@
</div>
<div class="form-group row">
<span class="tabbed center_radio"><input type="radio" id="windows_open_periodically" name="window_opening_regime" value="windows_open_periodically" onclick="require_fields(this)"></span>
<label for="windows_open_periodically" class="col-form-label ml-2 mr-2">Periodically:</label><br>
<input type="number" step="any" id="windows_duration" class="non_zero disabled form-control col-sm-4" name="windows_duration" placeholder="Duration (min)" min="1" data-has-radio="#windows_open_periodically">
<input type="number" step="any" id="windows_frequency" class="non_zero disabled form-control col-sm-4" name="windows_frequency" placeholder="Frequency (min)" min="1" data-has-radio="#windows_open_periodically">
<label for="windows_open_periodically" class="col-form-label ml-2 mr-2">Periodically (open minutes per hour):</label><br>
<input type="number" step="any" id="windows_duration" class="non_zero disabled form-control col-sm-4 ml-2 mr-2" name="windows_duration" placeholder="Duration (min)" min="1" data-has-radio="#windows_open_periodically">
</div>
<br>
</div>
@ -575,7 +574,7 @@
<b>Ventilation data:</b> <br>
<ul>
<li>Mechanical ventilation = the HVAC supply of fresh air. Check the flow rates with the concerned technical department.</li>
<li>Natural ventilation = the type of window opening. The opening distance is between the fixed frame and movable part when open (commonly used values are window height of 1.6m and window opening between 0.15m and 0.6m). In case of periodic opening, specify the duration (e.g. for 10 min) and frequency (e.g. every 60 min).</li>
<li>Natural ventilation = the type of window opening. The opening distance is between the fixed frame and movable part when open (commonly used values are window height of 1.6m and window opening between 0.15m and 0.6m). In case of periodic opening, specify the duration (e.g. 10 min) per hour.</li>
<li>HEPA filtration = the air flow of the device. The following values are based on the different fan velocities of a specific commercial device proposed by the HSE Unit:</li>
<ul>
<li>Level 6 (max) = 430 m<sup>3</sup>/h (noisy),</li>

View file

@ -325,8 +325,7 @@
<li><p class="data_subtext">Opening distance: {{ form.opening_distance }} m</p></li>
<li><p class="data_subtext">Windows open:
{% if form.window_opening_regime == "windows_open_periodically" %}
Periodically for {{ form.windows_duration | readable_minutes}}
every {{ form.windows_frequency | readable_minutes}}
Periodically for {{ form.windows_duration | readable_minutes}} every 1 hour.
{% elif form.window_opening_regime == "windows_open_permanently" %}
Permanently
{% endif %}

View file

@ -95,7 +95,7 @@ If there are multiple windows of different sizes, you should take an average.</p
If you open the window at different distances throughout the day, choose an average value.</p>
<p>When using natural ventilation, the circulation of air is simulated as a function of the difference between the temperature inside the room and the outside air temperature. The average outdoor temperature for each hour of the day has been computed for every month of the year based on historical data for Geneva, Switzerland.
It is therefore very important to enter the correct time and date in the event data section.
Finally, you must specify if the windows are open permanently (at all the times), or periodically (in intervals for a certain duration and frequency - both in minutes) - e.g. open the window for 10 minutes (duration) every 60 minutes (frequency).</p>
Finally, you must specify if the windows are open permanently (at all the times), or periodically (in intervals for a certain duration per hour - in minutes) - e.g. open the window for 10 minutes (duration) every 1 hour.</p>
<br>
<h4>No ventilation</h4>
<br>

View file

@ -45,8 +45,7 @@ def test_blend_expiration(mask_type):
def test_ventilation_slidingwindow(baseline_form: model_generator.FormData):
baseline_form.ventilation_type = 'natural_ventilation'
baseline_form.windows_duration = 10
baseline_form.windows_frequency = 120
baseline_form.windows_duration = 5
baseline_form.window_opening_regime = 'windows_open_periodically'
baseline_form.window_type = 'window_sliding'
baseline_form.event_month = 'December'
@ -59,13 +58,13 @@ def test_ventilation_slidingwindow(baseline_form: model_generator.FormData):
assert isinstance(baseline_window, models.SlidingWindow)
window = models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10, start=9),
active=models.PeriodicInterval(period=60, duration=5, start=9),
outside_temp=baseline_window.outside_temp,
window_height=1.6, opening_length=0.6,
)
ach = models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
active=models.PeriodicInterval(period=60, duration=60),
air_exch=0.25,
)
ventilation = models.MultipleVentilation((window, ach))
@ -75,8 +74,7 @@ def test_ventilation_slidingwindow(baseline_form: model_generator.FormData):
def test_ventilation_hingedwindow(baseline_form: model_generator.FormData):
baseline_form.ventilation_type = 'natural_ventilation'
baseline_form.windows_duration = 10
baseline_form.windows_frequency = 120
baseline_form.windows_duration = 5
baseline_form.window_opening_regime = 'windows_open_periodically'
baseline_form.window_type = 'window_hinged'
baseline_form.event_month = 'December'
@ -90,12 +88,12 @@ def test_ventilation_hingedwindow(baseline_form: model_generator.FormData):
assert isinstance(baseline_window, models.HingedWindow)
window = models.HingedWindow(
active=models.PeriodicInterval(period=120, duration=10, start=9),
active=models.PeriodicInterval(period=60, duration=5, start=9),
outside_temp=baseline_window.outside_temp,
window_height=1.6, window_width=1., opening_length=0.6,
)
ach = models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
active=models.PeriodicInterval(period=60, duration=60),
air_exch=0.25,
)
ventilation = models.MultipleVentilation((window, ach))
@ -135,8 +133,7 @@ def test_ventilation_airchanges(baseline_form: model_generator.FormData):
def test_ventilation_window_hepa(baseline_form: model_generator.FormData):
baseline_form.ventilation_type = 'natural_ventilation'
baseline_form.windows_duration = 10
baseline_form.windows_frequency = 120
baseline_form.windows_duration = 5
baseline_form.window_opening_regime = 'windows_open_periodically'
baseline_form.event_month = 'December'
baseline_form.window_height = 1.6
@ -150,16 +147,16 @@ def test_ventilation_window_hepa(baseline_form: model_generator.FormData):
# Now build the equivalent ventilation instance directly, and compare.
window = models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10, start=9),
active=models.PeriodicInterval(period=60, duration=5, start=9),
outside_temp=baseline_window.outside_temp,
window_height=1.6, opening_length=0.6,
)
hepa = models.HEPAFilter(
active=models.PeriodicInterval(period=120, duration=120),
active=models.PeriodicInterval(period=60, duration=60),
q_air_mech=250.,
)
ach = models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
active=models.PeriodicInterval(period=60, duration=60),
air_exch=0.25,
)
ventilation = models.MultipleVentilation((window, hepa, ach))