Beispiel #1
0
def calc_cool_loads_3for2(bpr, t, tsd):
    """
    Calculation procedure for cooling system loads of AHU, ARU and SCU subsystems of 3for2 system

    Gabriel Happle, Feb. 2018

    :param bpr: building properties row object
    :param t: time step / hour of year [0..8760]
    :param tsd:  time series data dict
    :return: dict of rc_model_temperatures
    """

    # get values from tsd
    m_ve_mech = tsd['m_ve_mech'][t]
    t_ve_mech_after_hex = tsd['theta_ve_mech'][t]
    x_ve_mech = tsd['x_ve_mech'][t]
    t_int_prev = tsd['T_int'][t - 1]
    x_int_prev = tsd['x_int'][t - 1]

    # ***
    # RC MODEL
    # ***
    # calculate rc model demand
    qc_sen_rc_demand, rc_model_temperatures = calc_rc_cooling_demand(bpr=bpr,
                                                                     tsd=tsd,
                                                                     t=t)

    # ***
    # AHU
    # ***
    # calculate ahu loads
    ahu_loads = airconditioning_model.central_air_handling_unit_cooling(
        m_ve_mech, t_ve_mech_after_hex, x_ve_mech, bpr)
    qc_sen_ahu = ahu_loads['qc_sen_ahu']
    qc_lat_ahu = ahu_loads['qc_lat_ahu']
    tsd['x_ve_mech'][t] = ahu_loads['x_sup_c_ahu']
    # ***
    # ARU
    # ***
    # calculate recirculation unit dehumidification demand
    tsd['T_int'][t] = rc_model_temperatures[
        'T_int']  # dehumidification load needs zone temperature
    # NOTE: here we might make some error, as we calculate the moisture set point for the
    # uncorrected zone air temperature (i.e. no over cooling)
    g_dhu_demand_aru = latent_loads.calc_dehumidification_moisture_load(
        bpr, tsd, t)
    # no sensible demand that controls the ARU
    qc_sen_demand_aru = 0.0
    # calculate ARU system loads with T and x control activated
    aru_system_loads = airconditioning_model.local_air_recirculation_unit_cooling(
        qc_sen_demand_aru,
        g_dhu_demand_aru,
        t_int_prev,
        x_int_prev,
        bpr,
        t_control=False,
        x_control=True)
    g_dhu_aru = aru_system_loads['g_dhu_aru']
    qc_lat_aru = aru_system_loads['qc_lat_aru']
    qc_sen_aru = aru_system_loads['qc_sen_aru']
    # ***
    # SCU
    # ***
    # calculate remaining sensible cooling demand to be met by radiative cooling
    qc_sen_demand_scu = np.min(
        [0.0, qc_sen_rc_demand - qc_sen_ahu - qc_sen_aru])
    # demand is load
    qc_sen_scu = qc_sen_demand_scu
    # ***
    # ADJUST RC MODEL TEMPERATURE
    # ***
    # TODO: check, if it is smaller something went wrong in the calculation
    qc_sen_total = qc_sen_ahu + qc_sen_aru + qc_sen_scu
    # update rc model temperatures
    rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_cooling(
        qc_sen_total, bpr, tsd, t)
    # ***
    # ZONE MOISTURE
    # ***
    # action on moisture
    tsd['g_hu_ld'][t] = 0.0  # no humidification
    tsd['g_dhu_ld'][t] = g_dhu_aru
    latent_loads.calc_moisture_content_in_zone_local(bpr, tsd, t)
    # ***
    # emission losses
    # ***
    # emission losses on total sensible load
    # TODO: check

    # write to tsd
    tsd['Qcs_sen_rc'][t] = qc_sen_rc_demand
    tsd['Qcs_sen_ahu'][t] = qc_sen_ahu
    tsd['Qcs_sen_aru'][t] = qc_sen_aru
    tsd['Qcs_sen_scu'][t] = qc_sen_scu
    tsd['Qcs_lat_ahu'][t] = qc_lat_ahu
    tsd['Qcs_lat_aru'][t] = qc_lat_aru
    rc_temperatures_to_tsd(rc_model_temperatures, tsd, t)
    tsd['Qcs_sen_sys'][
        t] = qc_sen_ahu + qc_sen_aru + qc_sen_scu  # sum system loads
    tsd['Qcs_lat_sys'][t] = qc_lat_ahu + qc_lat_aru

    # air flow
    tsd['m_ve_rec'][t] = aru_system_loads['ma_sup_cs_aru']

    # mass flows to tsd
    tsd['ma_sup_cs_ahu'][t] = ahu_loads['ma_sup_cs_ahu']
    tsd['ta_sup_cs_ahu'][t] = ahu_loads['ta_sup_cs_ahu']
    tsd['ta_re_cs_ahu'][t] = ahu_loads['ta_re_cs_ahu']
    tsd['ma_sup_cs_aru'][t] = aru_system_loads['ma_sup_cs_aru']
    tsd['ta_sup_cs_aru'][t] = aru_system_loads['ta_sup_cs_aru']
    tsd['ta_re_cs_aru'][t] = aru_system_loads['ta_re_cs_aru']

    q_em_ls_cooling = space_emission_systems.calc_q_em_ls_cooling(bpr, tsd, t)
    tsd['Qcs_em_ls'][t] = q_em_ls_cooling

    # system status
    tsd['sys_status_ahu'][t] = 'On'
    tsd['sys_status_aru'][t] = 'On:R'
    tsd['sys_status_sen'][t] = 'On'

    # the return is only for the input into the detailed thermal reverse calculations for the dashboard graphs
    return rc_model_temperatures
Beispiel #2
0
def calc_rc_cooling_demand(bpr, tsd, t):
    """
       Crank-Nicholson Procedure to calculate heating / cooling demand of buildings
       following the procedure in 2.3.2 in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011
       / Korrigenda C2 zum Mekblatt SIA 2044:2011

       Special procedures for updating ventilation air AC-heated and AC-cooled buildings

       Author: Gabriel Happle
       Date: 01/2017

       :param bpr: building properties row object
       :param tsd: time series data dict
       :param t: time step / hour of year [0..8760]
       :return: phi_c_act, rc_model_temperatures
       """

    # following the procedure in 2.3.2 in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011
    #  / Korrigenda C2 zum Mekblatt SIA 2044:2011

    # ++++++++++++++++
    # CASE 2 - COOLING
    # ++++++++++++++++
    # case for cooling
    # tsd['system_status'][t] = 'Radiative cooling'

    # STEP 1
    # ******
    # calculate temperatures with 0 heating power
    rc_model_temperatures_0 = rc_model_SIA.calc_rc_model_temperatures_no_heating_cooling(
        bpr, tsd, t)

    t_int_0 = rc_model_temperatures_0['T_int']

    # CHECK FOR DEMAND
    if not rc_model_SIA.has_sensible_cooling_demand(t_int_0, tsd, t):

        # return zero demand
        rc_model_temperatures = rc_model_temperatures_0
        phi_c_act = 0.0

    elif rc_model_SIA.has_sensible_cooling_demand(t_int_0, tsd, t):
        # continue

        # STEP 2
        # ******
        # calculate temperatures with 10 W/m2 cooling power
        phi_hc_10 = 10.0 * bpr.rc_model['Af']
        rc_model_temperatures_10 = rc_model_SIA.calc_rc_model_temperatures_cooling(
            phi_hc_10, bpr, tsd, t)

        t_int_10 = rc_model_temperatures_10['T_int']

        t_int_set = tsd['ta_cs_set'][t]

        # interpolate heating power
        # (64) in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011 / Korrigenda C2 zum Mekblatt SIA 2044:2011
        phi_hc_ul = phi_hc_10 * (t_int_set - t_int_0) / (t_int_10 - t_int_0)

        # STEP 3
        # ******
        # check if available power is sufficient
        phi_c_max = -bpr.hvac['Qcsmax_Wm2'] * bpr.rc_model['Af']

        if 0.0 > phi_hc_ul >= phi_c_max:
            # case heating with phi_hc_ul
            # calculate temperatures with this power
            phi_c_act = phi_hc_ul

        elif 0.0 > phi_hc_ul < phi_c_max:
            # case heating with max power available
            # calculate temperatures with this power
            phi_c_act = phi_c_max

        else:
            raise Exception("Unexpected status in 'calc_rc_cooling_demand'")

        # STEP 4
        # ******
        rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_cooling(
            phi_c_act, bpr, tsd, t)

    else:
        raise Exception("Unexpected status in 'calc_rc_cooling_demand'")

    return phi_c_act, rc_model_temperatures
Beispiel #3
0
def calc_rc_model_demand_heating_cooling(bpr, tsd, t, gv):
    """
    Crank-Nicholson Procedure to calculate heating / cooling demand of buildings
    following the procedure in 2.3.2 in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011 / Korrigenda C2 zum Mekblatt SIA 2044:2011

    Special procedures for updating ventilation air AC-heated and AC-cooled buildings

    Author: Gabriel Happle
    Date: 01/2017

    :param bpr: building properties row object
    :param tsd: time series data dict
    :param t: time step / hour of year [0..8760]
    :param gv: globalvars
    :return: updates values in tsd
    """

    # following the procedure in 2.3.2 in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011
    #  / Korrigenda C2 zum Mekblatt SIA 2044:2011

    # ++++++++++++++++++++++++++++++
    # CASE 0 - NO HEATING OR COOLING
    # ++++++++++++++++++++++++++++++
    if not control_heating_cooling_systems.is_active_heating_system(bpr, tsd, t) \
            and not control_heating_cooling_systems.is_active_cooling_system(bpr, tsd, t):

        # STEP 1
        # ******
        # calculate temperatures
        rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_no_heating_cooling(
            bpr, tsd, t)

        # write to tsd
        tsd['theta_a'][t] = rc_model_temperatures['theta_a']
        tsd['theta_m'][t] = rc_model_temperatures['theta_m']
        tsd['theta_c'][t] = rc_model_temperatures['theta_c']
        tsd['theta_o'][t] = rc_model_temperatures['theta_o']
        update_tsd_no_cooling(tsd, t)
        update_tsd_no_heating(tsd, t)
        tsd['system_status'][t] = 'systems off'

    # ++++++++++++++++
    # CASE 1 - HEATING
    # ++++++++++++++++
    elif control_heating_cooling_systems.is_active_heating_system(bpr, tsd, t):
        # case for heating
        tsd['system_status'][t] = 'Radiative heating'

        # STEP 1
        # ******
        # calculate temperatures with 0 heating power
        rc_model_temperatures_0 = rc_model_SIA.calc_rc_model_temperatures_no_heating_cooling(
            bpr, tsd, t)

        theta_a_0 = rc_model_temperatures_0['theta_a']

        # STEP 2
        # ******
        # calculate temperatures with 10 W/m2 heating power
        phi_hc_10 = 10 * bpr.rc_model['Af']
        rc_model_temperatures_10 = rc_model_SIA.calc_rc_model_temperatures_heating(
            phi_hc_10, bpr, tsd, t)

        theta_a_10 = rc_model_temperatures_10['theta_a']

        theta_a_set = tsd['ta_hs_set'][t]

        # interpolate heating power
        # (64) in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011 / Korrigenda C2 zum Mekblatt SIA 2044:2011
        phi_hc_ul = phi_hc_10 * (theta_a_set - theta_a_0) / (theta_a_10 -
                                                             theta_a_0)

        # STEP 3
        # ******
        # check if available power is sufficient
        phi_h_max = bpr.hvac['Qhsmax_Wm2'] * bpr.rc_model['Af']

        if 0 < phi_hc_ul <= phi_h_max:
            # case heating with phi_hc_ul
            # calculate temperatures with this power
            phi_h_act = phi_hc_ul

        elif 0 < phi_hc_ul > phi_h_max:
            # case heating with max power available
            # calculate temperatures with this power
            phi_h_act = phi_h_max

        else:
            raise

        # STEP 4
        # ******
        rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_heating(
            phi_h_act, bpr, tsd, t)
        # write necessary parameters for AC calculation to tsd
        tsd['theta_a'][t] = rc_model_temperatures['theta_a']
        tsd['theta_m'][t] = rc_model_temperatures['theta_m']
        tsd['theta_c'][t] = rc_model_temperatures['theta_c']
        tsd['theta_o'][t] = rc_model_temperatures['theta_o']
        tsd['Qhs_sen'][t] = phi_h_act
        tsd['Qhs_sen_sys'][t] = phi_h_act
        tsd['Qhs_lat_sys'][t] = 0
        tsd['Ehs_lat_aux'][t] = 0
        tsd['ma_sup_hs'][t] = 0
        tsd['Ta_sup_hs'][t] = 0
        tsd['Ta_re_hs'][t] = 0
        tsd['m_ve_recirculation'][t] = 0

        # STEP 5 - latent and sensible heat demand of AC systems
        # ******
        if control_heating_cooling_systems.heating_system_is_ac(bpr):
            air_con_model_loads_flows_temperatures = airconditioning_model.calc_hvac_heating(
                tsd, t, gv)

            tsd['system_status'][t] = 'AC heating'

            # update temperatures for over heating case
            if air_con_model_loads_flows_temperatures[
                    'q_hs_sen_hvac'] > phi_h_act:
                phi_h_act_over_heating = air_con_model_loads_flows_temperatures[
                    'q_hs_sen_hvac']
                rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_heating(
                    phi_h_act_over_heating, bpr, tsd, t)

                # update temperatures
                tsd['theta_a'][t] = rc_model_temperatures['theta_a']
                tsd['theta_m'][t] = rc_model_temperatures['theta_m']
                tsd['theta_c'][t] = rc_model_temperatures['theta_c']
                tsd['theta_o'][t] = rc_model_temperatures['theta_o']
                tsd['system_status'][t] = 'AC over heating'

            # update AC energy demand
            tsd['Qhs_sen_sys'][t] = air_con_model_loads_flows_temperatures[
                'q_hs_sen_hvac']
            tsd['Qhs_lat_sys'][t] = air_con_model_loads_flows_temperatures[
                'q_hs_lat_hvac']
            tsd['ma_sup_hs'][t] = air_con_model_loads_flows_temperatures[
                'ma_sup_hs']
            tsd['Ta_sup_hs'][t] = air_con_model_loads_flows_temperatures[
                'ta_sup_hs']
            tsd['Ta_re_hs'][t] = air_con_model_loads_flows_temperatures[
                'ta_re_hs']
            tsd['Ehs_lat_aux'][t] = air_con_model_loads_flows_temperatures[
                'e_hs_lat_aux']
            tsd['m_ve_recirculation'][
                t] = air_con_model_loads_flows_temperatures[
                    'm_ve_hvac_recirculation']

        # STEP 6 - emission system losses
        # ******
        q_em_ls_heating = space_emission_systems.calc_q_em_ls_heating(
            bpr, tsd, t)

        # set temperatures to tsd for heating
        tsd['theta_a'][t] = rc_model_temperatures['theta_a']
        tsd['theta_m'][t] = rc_model_temperatures['theta_m']
        tsd['theta_c'][t] = rc_model_temperatures['theta_c']
        tsd['theta_o'][t] = rc_model_temperatures['theta_o']
        tsd['Qhs_lat_sys'][t] = 0
        tsd['Qhs_em_ls'][t] = q_em_ls_heating
        tsd['Qhs_sen'][t] = phi_h_act
        tsd['Qhsf'][t] = 0
        tsd['Qhsf_lat'][t] = 0
        update_tsd_no_cooling(tsd, t)

    # ++++++++++++++++
    # CASE 2 - COOLING
    # ++++++++++++++++
    elif control_heating_cooling_systems.is_active_cooling_system(bpr, tsd, t):

        # case for cooling
        tsd['system_status'][t] = 'Radiative cooling'

        # STEP 1
        # ******
        # calculate temperatures with 0 heating power
        rc_model_temperatures_0 = rc_model_SIA.calc_rc_model_temperatures_no_heating_cooling(
            bpr, tsd, t)

        theta_a_0 = rc_model_temperatures_0['theta_a']

        # STEP 2
        # ******
        # calculate temperatures with 10 W/m2 cooling power
        phi_hc_10 = 10 * bpr.rc_model['Af']
        rc_model_temperatures_10 = rc_model_SIA.calc_rc_model_temperatures_cooling(
            phi_hc_10, bpr, tsd, t)

        theta_a_10 = rc_model_temperatures_10['theta_a']

        theta_a_set = tsd['ta_cs_set'][t]

        # interpolate heating power
        # (64) in SIA 2044 / Korrigenda C1 zum Merkblatt SIA 2044:2011 / Korrigenda C2 zum Mekblatt SIA 2044:2011
        phi_hc_ul = phi_hc_10 * (theta_a_set - theta_a_0) / (theta_a_10 -
                                                             theta_a_0)

        # STEP 3
        # ******
        # check if available power is sufficient
        phi_c_max = -bpr.hvac['Qcsmax_Wm2'] * bpr.rc_model['Af']

        if 0 > phi_hc_ul >= phi_c_max:
            # case heating with phi_hc_ul
            # calculate temperatures with this power
            phi_c_act = phi_hc_ul

        elif 0 > phi_hc_ul < phi_c_max:
            # case heating with max power available
            # calculate temperatures with this power
            phi_c_act = phi_c_max

        else:
            raise

        # STEP 4
        # ******
        rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_cooling(
            phi_c_act, bpr, tsd, t)

        # write necessary parameters for AC calculation to tsd
        tsd['theta_a'][t] = rc_model_temperatures['theta_a']
        tsd['theta_m'][t] = rc_model_temperatures['theta_m']
        tsd['theta_c'][t] = rc_model_temperatures['theta_c']
        tsd['theta_o'][t] = rc_model_temperatures['theta_o']
        tsd['Qcs_sen'][t] = phi_c_act
        tsd['Qcs_sen_sys'][t] = phi_c_act
        tsd['Qcs_lat_sys'][t] = 0
        tsd['ma_sup_cs'][t] = 0
        tsd['m_ve_recirculation'][t] = 0

        # STEP 5 - latent and sensible heat demand of AC systems
        # ******
        if control_heating_cooling_systems.cooling_system_is_ac(bpr):

            tsd['system_status'][t] = 'AC cooling'

            air_con_model_loads_flows_temperatures = airconditioning_model.calc_hvac_cooling(
                tsd, t, gv)

            # update temperatures for over cooling case
            if air_con_model_loads_flows_temperatures[
                    'q_cs_sen_hvac'] < phi_c_act:

                phi_c_act_over_cooling = air_con_model_loads_flows_temperatures[
                    'q_cs_sen_hvac']
                rc_model_temperatures = rc_model_SIA.calc_rc_model_temperatures_cooling(
                    phi_c_act_over_cooling, bpr, tsd, t)
                # update temperatures
                tsd['theta_a'][t] = rc_model_temperatures['theta_a']
                tsd['theta_m'][t] = rc_model_temperatures['theta_m']
                tsd['theta_c'][t] = rc_model_temperatures['theta_c']
                tsd['theta_o'][t] = rc_model_temperatures['theta_o']
                tsd['system_status'][t] = 'AC over cooling'

            # update AC energy demand

            tsd['Qcs_sen_sys'][t] = air_con_model_loads_flows_temperatures[
                'q_cs_sen_hvac']
            tsd['Qcs_lat_sys'][t] = air_con_model_loads_flows_temperatures[
                'q_cs_lat_hvac']
            tsd['ma_sup_cs'][t] = air_con_model_loads_flows_temperatures[
                'ma_sup_cs']
            tsd['Ta_sup_cs'][t] = air_con_model_loads_flows_temperatures[
                'ta_sup_cs']
            tsd['Ta_re_cs'][t] = air_con_model_loads_flows_temperatures[
                'ta_re_cs']
            tsd['m_ve_recirculation'][
                t] = air_con_model_loads_flows_temperatures[
                    'm_ve_hvac_recirculation']

        # STEP 6 - emission system losses
        # ******
        q_em_ls_cooling = space_emission_systems.calc_q_em_ls_cooling(
            bpr, tsd, t)

        # set temperatures to tsd for heating
        tsd['theta_a'][t] = rc_model_temperatures['theta_a']
        tsd['theta_m'][t] = rc_model_temperatures['theta_m']
        tsd['theta_c'][t] = rc_model_temperatures['theta_c']
        tsd['theta_o'][t] = rc_model_temperatures['theta_o']
        tsd['Qcs'][t] = 0
        tsd['Qcs_em_ls'][t] = q_em_ls_cooling
        tsd['Qcsf'][t] = 0
        tsd['Qcsf_lat'][t] = 0
        update_tsd_no_heating(tsd, t)

    return