| 1261 | */ |
| 1262 | } |
| 1263 | void SimModel::ventilationCalc(const Vector& v_Th_avg, const Vector& v_Tc_avg, double frac_hrs_wk_day, Vector& v_Hve_ht, Vector& v_Hve_cl) const { |
| 1264 | double vent_zone_height = std::max(0.1, structure->buildingHeight()); |
| 1265 | double qv_supp = ventilation->supplyRate() / structure->floorArea() / 3.6; |
| 1266 | double qv_ext = -(qv_supp - ventilation->supplyDifference() / structure->floorArea() / 3.6); |
| 1267 | double qv_comb = 0; |
| 1268 | double qv_diff = qv_supp + qv_ext + qv_comb; |
| 1269 | double vent_ht_recov = ventilation->heatRecoveryEfficiency(); |
| 1270 | double vent_outdoor_frac = 1 - ventilation->exhaustAirRecirculated(); |
| 1271 | double tot_env_A = sum(structure->wallArea()) + sum(structure->windowArea()); |
| 1272 | /* |
| 1273 | |
| 1274 | %% Ventilation |
| 1275 | % required energy for mechanical ventilation based on source EN ISO 13789 |
| 1276 | % C.3, C.5 and EN 15242:2007 6.7 and EN ISO 13790 Sec 9.2 |
| 1277 | |
| 1278 | vent_zone_height=max(0.1, In.stories*In.ftof); % Ventilztion Zone Height (m) with a minimum of 0.1 m |
| 1279 | |
| 1280 | qv_supp=In.vent_supply_rate./In.cond_flr_area./3.6; %vent_supply_rate m3/h/m2 (input is in in L/s) |
| 1281 | qv_ext=-(qv_supp-In.vent_supply_diff./In.cond_flr_area./3.6); %vent exhaust rate m3/h/m2, negative indicates out of building |
| 1282 | |
| 1283 | qv_comb = 0 ; % combustion appliance ventilation rate - not implemented yet but will be impt for restaurants |
| 1284 | qv_diff=qv_supp + qv_ext + qv_comb; % difference between air intake and air exhaust including combustion exhaust |
| 1285 | |
| 1286 | vent_ht_recov=In.vent_heat_recovery; %vent_heat_recovery_eff |
| 1287 | vent_outdoor_frac=1-In.vent_recirc_fraction; % fctrl_vent_recirculation |
| 1288 | |
| 1289 | % infilatration source EN 15242:2007 Sec 6.7 direct method |
| 1290 | tot_env_A=sum(In.wall_area)+sum(In.win_area); |
| 1291 | */ |
| 1292 | double n_p_exp = 0.65; |
| 1293 | /// \todo Note: v_Q75pa, aka infiltrationRate(), is never being calculated or set, so it is, at least in some cases, a |
| 1294 | /// random value (now that the matrices are properly initialized to 0). So when it goes to 0, the rest |
| 1295 | /// of the model goes to infinity for the HVAC calculations. |
| 1296 | /// I'm setting it to non-zero here |
| 1297 | double v_Q75pa = structure->infiltrationRate(); |
| 1298 | if (v_Q75pa == 0) { |
| 1299 | v_Q75pa = 0.00000000001; // this might be a vestige of the rmeove of the "epsilon" code in the translator |
| 1300 | } |
| 1301 | |
| 1302 | double floorArea = structure->floorArea(); |
| 1303 | double v_Q4pa = v_Q75pa * tot_env_A / floorArea * (std::pow((4.0 / 75.0), n_p_exp)); |
| 1304 | |
| 1305 | #ifdef DEBUG_ISO_MODEL_SIMULATION |
| 1306 | LOG(Trace, "v_Q4pa " << v_Q4pa << " v_Q75pa " << v_Q75pa << " tot_env_A " << tot_env_A << " floorArea: " << floorArea << " n_p_exp " << n_p_exp); |
| 1307 | #endif |
| 1308 | |
| 1309 | double n_zone_frac = 0.7; |
| 1310 | double h_stack = n_zone_frac * vent_zone_height; |
| 1311 | double n_stack_exp = 0.667; //% reset the pressure exponent to 0.667 for this part of the calc |
| 1312 | double n_stack_coeff = 0.0146; |
| 1313 | Vector dbtDiff = dif(location->weather()->mdbt(), v_Th_avg); |
| 1314 | printVector("dbtDiff", dbtDiff); |
| 1315 | Vector dbtDiffAbs = abs(dbtDiff); |
| 1316 | printVector("dbtDiffAbs", dbtDiffAbs); |
| 1317 | Vector dbtHStack = mult(dbtDiffAbs, h_stack); |
| 1318 | printVector("dbtHstack", dbtHStack); |
| 1319 | Vector dbtPowered = pow(dbtHStack, n_stack_exp); |
| 1320 | printVector("dbtPowered", dbtPowered); |
nothing calls this directly
no test coverage detected