Changeset 4687 for palm/trunk/SOURCE/indoor_model_mod.f90
- Timestamp:
- Sep 21, 2020 7:40:16 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/indoor_model_mod.f90
r4681 r4687 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix: values of theta_m_t_prev were not stored for individual surfaces and thus re-used by all 28 ! surfaces and buildings, which led to excessive indoor temperatures 29 ! 30 ! 4681 2020-09-16 10:23:06Z pavelkrc 27 31 ! Bugfix for implementation of downward surfaces 28 32 ! … … 126 130 ! @author Matthias Suehring 127 131 ! @author Sascha RiÃmann 132 ! @author Björn Maronga 128 133 ! 129 134 ! … … 144 149 !> @note How to write indoor temperature output to pt array? 145 150 !> 146 !> @bug <Enter known bugs here>151 !> @bug Calculation of iwghf_eb and iwghf_eb_window is faulty 147 152 !--------------------------------------------------------------------------------------------------! 148 153 MODULE indoor_model_mod … … 234 239 REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in !< mean building indoor temperature, height dependent 235 240 REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_l !< mean building indoor temperature on local subdomain, height dependent 241 REAL(wp), DIMENSION(:), ALLOCATABLE :: theta_m_t_prev_h !< [degree_C] value of theta_m_t from previous time step (horizontal) 242 REAL(wp), DIMENSION(:), ALLOCATABLE :: theta_m_t_prev_v !< [degree_C] value of theta_m_t from previous time step (vertical) 236 243 REAL(wp), DIMENSION(:), ALLOCATABLE :: volume !< total building volume, height dependent 237 244 REAL(wp), DIMENSION(:), ALLOCATABLE :: vol_frac !< fraction of local on total building volume, height dependent … … 319 326 REAL(wp) :: theta_air_set !< [degree_C] Setpoint_temperature for the room 320 327 REAL(wp) :: theta_m !< [degree_C} inner temperature of the RC-node 321 REAL(wp) :: theta_m_t !< [degree_C] (Fictive) component temperature timestep 322 REAL(wp) :: theta_m_t_prev !< [degree_C] (Fictive) component temperature previous timestep (do not change) 328 REAL(wp) :: theta_m_t !< [degree_C] (Fictive) component temperature during timestep 323 329 REAL(wp) :: theta_op !< [degree_C] operative temperature 324 330 REAL(wp) :: theta_s !< [degree_C] surface temperature of the RC-node … … 449 455 !--------------------------------------------------------------------------------------------------! 450 456 SUBROUTINE im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 451 near_facade_temperature, phi_hc_nd_dummy )457 near_facade_temperature, phi_hc_nd_dummy, theta_m_t_prev ) 452 458 453 459 INTEGER(iwp) :: i … … 458 464 REAL(wp) :: near_facade_temperature 459 465 REAL(wp) :: phi_hc_nd_dummy 466 REAL(wp), INTENT(IN) :: theta_m_t_prev 460 467 ! 461 468 !-- Calculation of total mass specific thermal load (internal and external) … … 468 475 ) !< [degree_C] Eq. (C.5) 469 476 ! 470 !-- Calculation of component temperature at factualtimestep477 !-- Calculation of component temperature at current timestep 471 478 theta_m_t = ( ( theta_m_t_prev & 472 479 * ( ( c_m / 3600.0_wp ) - 0.5_wp * ( h_t_3 + h_t_wm ) ) & … … 476 483 ) !< [degree_C] Eq. (C.4) 477 484 ! 478 !-- Calculation of mean inner temperature for the RC-node in actualtimestep485 !-- Calculation of mean inner temperature for the RC-node in current timestep 479 486 theta_m = ( theta_m_t + theta_m_t_prev ) * 0.5_wp !< [degree_C] Eq. (C.9) 480 487 481 488 ! 482 !-- Calculation of mean surface temperature of the RC-node in actualtimestep489 !-- Calculation of mean surface temperature of the RC-node in current timestep 483 490 theta_s = ( ( h_t_ms * theta_m + phi_st + h_t_es * pt(k,j,i) & 484 491 + h_t_1 * ( near_facade_temperature & … … 490 497 ! 491 498 !-- Calculation of the air temperature of the RC-node 499 500 492 501 theta_air = ( h_t_is * theta_s + h_v * near_facade_temperature + phi_ia + phi_hc_nd_dummy ) / & 493 502 ( h_t_is + h_v ) !< [degree_C] Eq. (C.11) 503 494 504 495 505 END SUBROUTINE im_calc_temperatures … … 925 935 ALLOCATE( buildings(nb)%l_v(1:buildings(nb)%num_facades_per_building_v_l) ) 926 936 ALLOCATE( buildings(nb)%m_v(1:buildings(nb)%num_facades_per_building_v_l) ) 937 938 ALLOCATE( buildings(nb)%theta_m_t_prev_h(1:buildings(nb)%num_facades_per_building_h_l) ) 939 ALLOCATE( buildings(nb)%theta_m_t_prev_v(1:buildings(nb)%num_facades_per_building_v_l) ) 927 940 ENDIF 928 941 … … 1125 1138 ENDDO 1126 1139 ! 1127 !-- Initial room temperature [K]1128 !-- (after first loop, use theta_m_t as theta_m_t_prev)1129 theta_m_t_prev = initial_indoor_temperature1130 !1131 1140 !-- Initialize indoor temperature. Actually only for output at initial state. 1132 1141 DO nb = 1, num_build 1133 IF ( buildings(nb)%on_pe ) buildings(nb)%t_in(:) = initial_indoor_temperature 1142 IF ( buildings(nb)%on_pe ) THEN 1143 buildings(nb)%t_in(:) = initial_indoor_temperature 1144 1145 ! 1146 !-- (after first loop, use theta_m_t as theta_m_t_prev) 1147 buildings(nb)%theta_m_t_prev_h(:) = initial_indoor_temperature 1148 buildings(nb)%theta_m_t_prev_v(:) = initial_indoor_temperature 1149 1150 ENDIF 1134 1151 ENDDO 1135 1152 … … 1337 1354 1338 1355 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1339 near_facade_temperature, phi_hc_nd )1356 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) 1340 1357 ! 1341 1358 !-- If air temperature between border temperatures of heating and cooling, assign output … … 1366 1383 1367 1384 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1368 near_facade_temperature, phi_hc_nd )1385 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) 1369 1386 theta_air_10 = theta_air !< temperature with 10 W/m2 of heating 1370 1387 phi_hc_nd_un = phi_hc_nd_10 * (theta_air_set - theta_air_0) & … … 1395 1412 !-- Calculate the temperature with phi_hc_nd_ac (new) 1396 1413 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1397 near_facade_temperature, phi_hc_nd )1414 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) 1398 1415 theta_air_ac = theta_air 1399 1416 ENDIF 1400 1417 ! 1401 1418 !-- Update theta_m_t_prev 1402 theta_m_t_prev = theta_m_t 1419 buildings(nb)%theta_m_t_prev_h(fa) = theta_m_t 1420 1403 1421 1404 1422 q_vent = h_v * ( theta_air - near_facade_temperature ) … … 1408 1426 !-- Will be used for thermal comfort calculations. 1409 1427 theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s !< [degree_C] operative Temperature Eq. (C.12) 1428 1410 1429 ! surf_usm_h(l)%t_indoor(m) = theta_op !< not integrated now 1411 1430 ! … … 1440 1459 ) / facade_element_area !< [W/m2] , observe the directional 1441 1460 !< convention in PALM! 1442 surf_usm_h(l)%waste_heat(m) = q_waste_heat1461 surf_usm_h(l)%waste_heat(m) = 0.0_wp !q_waste_heat 1443 1462 ENDDO !< Horizontal surfaces loop 1444 1463 ! … … 1524 1543 k = surf_usm_v(l)%k(m) 1525 1544 near_facade_temperature = surf_usm_v(l)%pt_10cm(m) 1526 indoor_wall_window_temperature = &1527 surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%val(nzt_wall,m) &1545 indoor_wall_window_temperature = & 1546 surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%val(nzt_wall,m) & 1528 1547 + surf_usm_v(l)%frac(m,ind_wat_win) * t_window_v(l)%val(nzt_wall,m) 1548 1529 1549 ! 1530 1550 !-- Solar thermal gains. If net_sw_in larger than sun-protection … … 1563 1583 phi_hc_nd = 0.0_wp 1564 1584 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1565 near_facade_temperature, phi_hc_nd )1585 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) 1566 1586 ! 1567 1587 !-- If air temperature between border temperatures of heating and cooling, assign output … … 1592 1612 1593 1613 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1594 near_facade_temperature, phi_hc_nd )1614 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) 1595 1615 1596 1616 theta_air_10 = theta_air !< Note the temperature with 10 W/m2 of heating … … 1623 1643 !-- Calculate the temperature with phi_hc_nd_ac (new) 1624 1644 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1625 near_facade_temperature, phi_hc_nd )1645 near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) 1626 1646 theta_air_ac = theta_air 1627 1647 ENDIF 1628 1648 ! 1629 1649 !-- Update theta_m_t_prev 1630 theta_m_t_prev = theta_m_t 1650 buildings(nb)%theta_m_t_prev_v(fa) = theta_m_t 1651 1631 1652 1632 1653 q_vent = h_v * ( theta_air - near_facade_temperature ) … … 1635 1656 !-- Will be used for thermal comfort calculations. 1636 1657 theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s 1658 1637 1659 ! surf_usm_v(l)%t_indoor(m) = theta_op !< not integrated yet 1638 1660 ! … … 1665 1687 ) / facade_element_area !< [W/m2] , observe the directional convention in 1666 1688 !< PALM! 1667 surf_usm_v(l)%waste_heat(m) = q_waste_heat1689 surf_usm_v(l)%waste_heat(m) = 0.0_wp !q_waste_heat 1668 1690 ENDDO !< Vertical surfaces loop 1669 1691 ENDIF !< buildings(nb)%on_pe
Note: See TracChangeset
for help on using the changeset viewer.