Changeset 4730


Ignore:
Timestamp:
Oct 7, 2020 10:48:51 AM (4 years ago)
Author:
suehring
Message:

Indoor model: bugfix - avoid divisions by zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/indoor_model_mod.f90

    r4709 r4730  
    2020! Current revisions:
    2121! -----------------
    22 ! 
    23 ! 
     22!
     23!
    2424! Former revisions:
    2525! -----------------
    2626! $Id$
     27! Bugfix - avoid divisions by zero
     28!
     29! 4709 2020-09-28 19:20:00Z maronga
    2730! Bugfix: avoid division by zero in case of zero window fraction (now also for vertical walls).
    2831! Reactivated waste heat.
     
    14081411                                             near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) )
    14091412                theta_air_10 = theta_air                                                !< temperature with 10 W/m2 of heating
    1410                 phi_hc_nd_un = phi_hc_nd_10 * (theta_air_set - theta_air_0)                        &
    1411                                             / (theta_air_10  - theta_air_0)             !< Eq. (C.13)
     1413!
     1414!--             Avoid division by zero at first timestep where the denominator can become zero.
     1415                IF ( ABS( theta_air_10  - theta_air_0 ) < 1E-10_wp )  THEN
     1416                   phi_hc_nd_un = phi_hc_nd_10
     1417                ELSE
     1418                   phi_hc_nd_un = phi_hc_nd_10 * ( theta_air_set - theta_air_0 )                   &
     1419                                               / ( theta_air_10  - theta_air_0 )             !< Eq. (C.13)
     1420                ENDIF
    14121421!
    14131422!--             Step 3: with temperature ratio to determine the heating or cooling capacity.
     
    16481657
    16491658                theta_air_10 = theta_air !< Note the temperature with 10 W/m2 of heating
    1650 
    1651                 phi_hc_nd_un = phi_hc_nd_10 * ( theta_air_set - theta_air_0 )                      &
    1652                                             / ( theta_air_10  - theta_air_0 )            !< Eq. (C.13)
     1659!
     1660!--             Avoid division by zero at first timestep where the denominator can become zero.
     1661                IF ( ABS( theta_air_10  - theta_air_0 ) < 1E-10_wp )  THEN
     1662                   phi_hc_nd_un = phi_hc_nd_10
     1663                ELSE
     1664                   phi_hc_nd_un = phi_hc_nd_10 * ( theta_air_set - theta_air_0 )                   &
     1665                                               / ( theta_air_10  - theta_air_0 )             !< Eq. (C.13)
     1666                ENDIF
    16531667!
    16541668!--             Step 3: with temperature ratio to determine the heating or cooling capacity
Note: See TracChangeset for help on using the changeset viewer.