added calculation of flow rate in L/s

This commit is contained in:
lrdossan 2024-08-22 13:04:02 +01:00
parent bea7edb048
commit 9103831a17
4 changed files with 28 additions and 9 deletions

View file

@ -301,8 +301,12 @@ function displayFittingData(json_response) {
String(json_response["exhalation_rate"].toFixed(2)) +
" m³/h"
);
let ventilation_table =
"<tr><th>Time (HH:MM)</th><th>ACH value (h⁻¹)</th><th>Flow rate (L/s/person)</th></tr>";
let ventilation_table = `<tr>
<th>Time (HH:MM)</th>
<th>ACH value (h¹)</th>
<th>Flow rate (L/s)</th>
<th>Flow rate (L/s/person)</th>
</tr>`;
json_response["ventilation_values"].forEach((CO2_val, index) => {
let transition_times = displayTransitionTimesHourFormat(
json_response["transition_times"][index],
@ -312,6 +316,7 @@ function displayFittingData(json_response) {
ventilation_table += `<tr>
<td>${transition_times}</td>
<td>${CO2_val.toPrecision(2)}</td>
<td>${json_response['ventilation_ls_values'][index].toPrecision(2)}</td>
<td>${json_response['ventilation_lsp_values'][index].toPrecision(2)}</td>
</tr>`;
});

View file

@ -364,9 +364,12 @@
<input type="text" class="form-control" id="fitting_ventilation_states" name="fitting_ventilation_states" placeholder="e.g. [8.5, 10, 11.5, 17]" form="not-submitted"><br>
</div>
<strong>Room data:</strong>
<div class="form-group row">
<div class="col-sm-5"><label class="col-form-label">Maximum number of occupants:</label></div>
<div class="col-sm-7 align-self-center"><input type="number" id="room_capacity" class="form-control" name="room_capacity" placeholder="Number" min=1 form="not-submitted"></div>
<div class="form-group">
<label class="col-form-label" for="room_capacity">Maximum occupation design limit:</label>
<div data-tooltip="The maximum number of occupaants selected for the design of the building/room. What is typically shown in architectural design drawings.">
<span class="tooltip_text">?</span>
</div>
<input type="number" id="room_capacity" class="form-control col-sm-7" name="room_capacity" placeholder="Number" min=1 form="not-submitted">
</div>
</div>

View file

@ -541,14 +541,21 @@
{% endif %}
<li><p class="data_text">From Fitting:
{% if form.ventilation_type == "from_fitting" %}
Yes
Yes</p></li>
<table class="w-25 mt-3 ml-4" border="1">
<tr><th> Time (HH:MM)</th><th>ACH value (h⁻¹)</th></tr>
<tr>
<th> Time (HH:MM)</th>
<th>ACH value (h⁻¹)</th>
<th>Flow rate (L/s)</th>
<th>Flow rate (L/s/person)</th>
</tr>
{% for ventilation in form.CO2_fitting_result['ventilation_values'] %}
{% set transition_time = form.CO2_fitting_result['transition_times'] %}
<tr>
<td>{{ transition_time[loop.index - 1] | hour_format }} - {{ transition_time[loop.index] | hour_format }}</td>
<td>{{ ventilation | float_format }} </td>
<td>{{ form.CO2_fitting_result['ventilation_ls_values'][loop.index - 1] | float_format }} </td>
<td>{{ form.CO2_fitting_result['ventilation_lsp_values'][loop.index - 1] | float_format }} </td>
</tr>
{% endfor %}
</table>

View file

@ -1593,13 +1593,17 @@ class CO2DataModel:
)
the_predictive_CO2 = self.CO2_concentrations_from_params(the_CO2_concentration_model)
# Ventilation in L/s/person
vent_volume_liter_person = [vent / 3600 * self.room_volume / self.room_capacity * 1000
# Ventilation in L/s
vent_volume_liter = [vent / 3600 * self.room_volume * 1000
for vent in ventilation_values] # 1m^3 = 1000L
# Ventilation in L/s/person
vent_volume_liter_person = [vent / self.room_capacity for vent in vent_volume_liter]
return {
"exhalation_rate": exhalation_rate,
"ventilation_values": list(ventilation_values),
"ventilation_ls_values": vent_volume_liter,
"ventilation_lsp_values": vent_volume_liter_person,
'predictive_CO2': list(the_predictive_CO2)
}