Exemple #1
0
def calc_m_ve_required(bpr, tsd, region):
    """
    Calculate required outdoor air ventilation rate according to occupancy

    Author: Legacy
    Date: old

    :param tsd: Timestep data
    :type tsd: Dict[str, numpy.ndarray]
    :return: updates tsd
    """

    m_ve_required_people = (tsd['ve'] / 3.6) * physics.calc_rho_air(
        tsd['T_ext'][:]) * 0.001  # kg/s

    if region in {'SG'}:
        # 0.6 l/s/m2 minimum ventilation rate according to Singapore standard SS 553
        # [https://escholarship.org/content/qt7k1796zv/qt7k1796zv.pdf]
        m_ve_required_min = 0.6 * bpr.rc_model['Af'] * physics.calc_rho_air(
            tsd['T_ext'][:]) * 0.001  # kg/s
        m_ve_required = [
            req_min if 0.0 < req_peop < req_min else req_peop for req_min,
            req_peop in zip(m_ve_required_min, m_ve_required_people)
        ]
        m_ve_required = np.asarray(m_ve_required)  # convert list to array

    else:
        m_ve_required = m_ve_required_people

    tsd['m_ve_required'] = m_ve_required

    return
def calc_Eauxf_ve(tsd):
    """
    calculation of auxiliary electricity consumption of mechanical ventilation and AC fans
    
    :param tsd: Time series data of building
    :type tsd: dict
    :return: electrical energy for fans of mechanical ventilation in [Wh/h]
    :rtype: float
    """

    # TODO: DOCUMENTATION
    # FIXME: Why only energy demand for AC? Also other mechanical ventilation should have auxiliary energy demand
    # FIXME: What are the units

    # m_ve_mech is

    fan_power = P_FAN  # specific fan consumption in W/m3/h, see globalvar.py

    # mechanical ventilation system air flow [m3/s] = outdoor air + recirculation air
    q_ve_mech = tsd['m_ve_mech']/physics.calc_rho_air(tsd['theta_ve_mech']) \
        + tsd['m_ve_rec']/physics.calc_rho_air(tsd['T_int'])

    Eve_aux = fan_power * q_ve_mech * 3600

    tsd['Eaux_ve'] = np.nan_to_num(Eve_aux)

    return tsd
def calc_qm_lea(p_zone_ref, temp_zone, temp_ext, u_wind_site,
                dict_props_nat_vent):
    """
    Calculation of leakage infiltration and exfiltration air mass flow as a function of zone indoor reference pressure

    Parameters
    ----------
    p_zone_ref : zone reference pressure (Pa)
    temp_zone : air temperature in ventilation zone (°C)
    temp_ext : exterior air temperature (°C)
    u_wind_site : wind velocity (m/s)
    dict_props_nat_vent : dictionary containing natural ventilation properties of zone

    Returns
    -------
    qm_lea_in : air mass flow rate into zone through leakages (kg/h)
    qm_lea_out : air mass flow rate out of zone through leakages (kg/h)
    """

    # get default leakage paths from locals
    coeff_lea_path = dict_props_nat_vent['coeff_lea_path']
    height_lea_path = dict_props_nat_vent['height_lea_path']

    # lookup wind pressure coefficients for leakage paths from locals
    coeff_wind_pressure_path = dict_props_nat_vent[
        'coeff_wind_pressure_path_lea']

    # calculation of pressure difference at leakage path
    delta_p_path = calc_delta_p_path(p_zone_ref, height_lea_path, temp_zone,
                                     coeff_wind_pressure_path, u_wind_site,
                                     temp_ext)

    # calculation of leakage air volume flow at path
    qv_lea_path = calc_qv_lea_path(coeff_lea_path, delta_p_path)

    # Eq. (65) in [1], infiltration is sum of air flows greater zero
    qv_lea_in = qv_lea_path[np.where(qv_lea_path > 0)].sum()

    # Eq. (66) in [1], exfiltration is sum of air flows smaller zero
    qv_lea_out = qv_lea_path[np.where(qv_lea_path < 0)].sum()

    # conversion to air mass flows according to 6.4.3.8 in [1]
    # Eq. (67) in [1]
    qm_lea_in = qv_lea_in * calc_rho_air(temp_ext)
    # Eq. (68) in [1]
    qm_lea_out = qv_lea_out * calc_rho_air(temp_zone)

    # print (qm_lea_in, qm_lea_out)

    return qm_lea_in, qm_lea_out
def calc_qm_vent(p_zone_ref, temp_zone, temp_ext, u_wind_site,
                 dict_props_nat_vent):
    """
    Calculation of air flows through ventilation openings in the facade

    Parameters
    ----------
    p_zone_ref : zone reference pressure (Pa)
    temp_zone : zone air temperature (°C)
    temp_ext : exterior air temperature (°C)
    u_wind_site : wind velocity (m/s)
    dict_props_nat_vent : dictionary containing natural ventilation properties of zone

    Returns
    -------
    qm_vent_in : air mass flow rate into zone through ventilation openings (kg/h)
    qm_vent_out : air mass flow rate out of zone through ventilation openings (kg/h)
    """

    # get properties from locals()
    coeff_vent_path = dict_props_nat_vent['coeff_vent_path']
    height_vent_path = dict_props_nat_vent['height_vent_path']
    coeff_wind_pressure_path = dict_props_nat_vent[
        'coeff_wind_pressure_path_vent']

    # calculation of pressure difference at leakage path
    delta_p_path = calc_delta_p_path(p_zone_ref, height_vent_path, temp_zone,
                                     coeff_wind_pressure_path, u_wind_site,
                                     temp_ext)

    # calculation of leakage air volume flow at path
    qv_vent_path = calc_qv_vent_path(coeff_vent_path, delta_p_path)

    # Eq. (62) in [1], air flow entering through ventilation openings is sum of air flows greater zero
    qv_vent_in = qv_vent_path[np.where(qv_vent_path > 0)].sum()

    # Eq. (63) in [1], air flow entering through ventilation openings is sum of air flows smaller zero
    qv_vent_out = qv_vent_path[np.where(qv_vent_path < 0)].sum()

    # conversion to air mass flows according to 6.4.3.8 in [1]
    # Eq. (67) in [1]
    qm_vent_in = qv_vent_in * calc_rho_air(temp_ext)
    # Eq. (68) in [1]
    qm_vent_out = qv_vent_out * calc_rho_air(temp_zone)

    # print (qm_lea_in, qm_lea_out)

    return qm_vent_in, qm_vent_out
Exemple #5
0
def calc_m_ve_leakage_simple(bpr, tsd):
    """
    Calculates mass flow rate of leakage at time step t according to ventilation control options and
     building systems properties

    Estimation of infiltration air volume flow rate according to Eq. (3) in DIN 1946-6

    Author: Gabriel Happle
    Date: 01/2017

    :param bpr: Building properties row object
    :type bpr: cea.demand.thermal_loads.BuildingPropertiesRow
    :param tsd: Timestep data
    :type tsd: Dict[str, numpy.ndarray]
    :return: updates tsd
    """

    # 'flat rate' infiltration considered for all buildings

    # get properties
    n50 = bpr.architecture.n50
    area_f = bpr.rc_model['Af']

    # estimation of infiltration air volume flow rate according to Eq. (3) in DIN 1946-6
    n_inf = 0.5 * n50 * (DELTA_P_DIM / 50)**(
        2 / 3)  # [air changes per hour] m3/h.m2
    infiltration = H_F * area_f * n_inf * 0.000277778  # m3/s

    tsd['m_ve_inf'] = infiltration * physics.calc_rho_air(
        tsd['T_ext'][:])  # (kg/s)

    return
def calc_m_ve_leakage_simple(bpr, tsd, gv):
    """
    Calculates mass flow rate of leakage at time step t according to ventilation control options and
     building systems properties

    Estimation of infiltration air volume flow rate according to Eq. (3) in DIN 1946-6

    Author: Gabriel Happle
    Date: 01/2017

    :param bpr: Building properties row object
    :param tsd: Time series data dict
    :param gv: globalvars
    :return: updates tsd
    """

    # 'flat rate' infiltration considered for all buildings

    # get properties
    n50 = bpr.architecture.n50
    area_f = bpr.rc_model['Af']

    # estimation of infiltration air volume flow rate according to Eq. (3) in DIN 1946-6
    n_inf = 0.5 * n50 * (gv.delta_p_dim/50) ** (2/3)  # [air changes per hour] m3/h.m2
    infiltration = gv.hf * area_f * n_inf * 0.000277778  # m3/s

    tsd['m_ve_inf'] = infiltration * physics.calc_rho_air(tsd['T_ext'][:])  # (kg/s)

    return
def calc_qm_lea(p_zone_ref, temp_zone, temp_ext, u_wind_site, dict_props_nat_vent):
    """
    Calculation of leakage infiltration and exfiltration air mass flow as a function of zone indoor reference pressure

    Parameters
    ----------
    p_zone_ref : zone reference pressure (Pa)
    temp_zone : air temperature in ventilation zone (°C)
    temp_ext : exterior air temperature (°C)
    u_wind_site : wind velocity (m/s)
    dict_props_nat_vent : dictionary containing natural ventilation properties of zone

    Returns
    -------
    qm_lea_in : air mass flow rate into zone through leakages (kg/h)
    qm_lea_out : air mass flow rate out of zone through leakages (kg/h)
    """

    # get default leakage paths from locals
    coeff_lea_path = dict_props_nat_vent['coeff_lea_path']
    height_lea_path = dict_props_nat_vent['height_lea_path']

    # lookup wind pressure coefficients for leakage paths from locals
    coeff_wind_pressure_path = dict_props_nat_vent['coeff_wind_pressure_path_lea']

    # calculation of pressure difference at leakage path
    delta_p_path = calc_delta_p_path(p_zone_ref, height_lea_path, temp_zone, coeff_wind_pressure_path, u_wind_site,
                                     temp_ext)

    # calculation of leakage air volume flow at path
    qv_lea_path = calc_qv_lea_path(coeff_lea_path, delta_p_path)

    # Eq. (65) in [1], infiltration is sum of air flows greater zero
    qv_lea_in = qv_lea_path[np.where(qv_lea_path > 0)].sum()

    # Eq. (66) in [1], exfiltration is sum of air flows smaller zero
    qv_lea_out = qv_lea_path[np.where(qv_lea_path < 0)].sum()

    # conversion to air mass flows according to 6.4.3.8 in [1]
    # Eq. (67) in [1]
    qm_lea_in = qv_lea_in * calc_rho_air(temp_ext)
    # Eq. (68) in [1]
    qm_lea_out = qv_lea_out * calc_rho_air(temp_zone)

    # print (qm_lea_in, qm_lea_out)

    return qm_lea_in, qm_lea_out
def calc_qm_vent(p_zone_ref, temp_zone, temp_ext, u_wind_site, dict_props_nat_vent):
    """
    Calculation of air flows through ventilation openings in the facade

    Parameters
    ----------
    p_zone_ref : zone reference pressure (Pa)
    temp_zone : zone air temperature (°C)
    temp_ext : exterior air temperature (°C)
    u_wind_site : wind velocity (m/s)
    dict_props_nat_vent : dictionary containing natural ventilation properties of zone

    Returns
    -------
    qm_vent_in : air mass flow rate into zone through ventilation openings (kg/h)
    qm_vent_out : air mass flow rate out of zone through ventilation openings (kg/h)
    """

    # get properties from locals()
    coeff_vent_path = dict_props_nat_vent['coeff_vent_path']
    height_vent_path = dict_props_nat_vent['height_vent_path']
    coeff_wind_pressure_path = dict_props_nat_vent['coeff_wind_pressure_path_vent']

    # calculation of pressure difference at leakage path
    delta_p_path = calc_delta_p_path(p_zone_ref, height_vent_path, temp_zone, coeff_wind_pressure_path, u_wind_site,
                                     temp_ext)

    # calculation of leakage air volume flow at path
    qv_vent_path = calc_qv_vent_path(coeff_vent_path, delta_p_path)

    # Eq. (62) in [1], air flow entering through ventilation openings is sum of air flows greater zero
    qv_vent_in = qv_vent_path[np.where(qv_vent_path > 0)].sum()

    # Eq. (63) in [1], air flow entering through ventilation openings is sum of air flows smaller zero
    qv_vent_out = qv_vent_path[np.where(qv_vent_path < 0)].sum()

    # conversion to air mass flows according to 6.4.3.8 in [1]
    # Eq. (67) in [1]
    qm_vent_in = qv_vent_in * calc_rho_air(temp_ext)
    # Eq. (68) in [1]
    qm_vent_out = qv_vent_out * calc_rho_air(temp_zone)

    # print (qm_lea_in, qm_lea_out)

    return qm_vent_in, qm_vent_out
Exemple #9
0
def calc_m_ve_required(bpr, tsd):
    """
    Calculate required outdoor air ventilation rate according to occupancy

    Author: Legacy
    Date: old

    :param tsd: Timestep data
    :type tsd: Dict[str, numpy.ndarray]
    :return: updates tsd
    """

    m_ve_required_people = (tsd['ve']/3.6) * physics.calc_rho_air(tsd['T_ext'][:]) * 0.001  # kg/s

    if control_heating_cooling_systems.has_3for2_cooling_system(bpr) \
            or control_heating_cooling_systems.has_central_ac_cooling_system(bpr):
        # 0.6 l/s/m2 minimum ventilation rate according to Singapore standard SS 553
        # air conditioning systems supply the higher rate between minimum flow per area and required ventilation for
        #  people during occupied hours. The minimum flow rate ensures dilution of pollutants inside the building
        # This applies to buildings with air-conditioning systems for cooling
        # [https://escholarship.org/content/qt7k1796zv/qt7k1796zv.pdf]
        m_ve_required_min = constants.MIN_VENTILATION_RATE * bpr.rc_model['Af'] * physics.calc_rho_air(tsd['T_ext'][:]) * 0.001  # kg/s
        # we want this not to affect the air flows during the heating season
        m_ve_required = []
        for t in range(0, HOURS_IN_YEAR):
            if 0.0 < m_ve_required_people[t] < m_ve_required_min[t] and \
                control_heating_cooling_systems.is_cooling_season(t, bpr):
                m_ve_required.append(m_ve_required_min[t])
            else:
                m_ve_required.append(m_ve_required_people[t])

        #m_ve_required = [req_min if 0.0 < req_peop < req_min else req_peop for req_min, req_peop in zip(m_ve_required_min, m_ve_required_people)]
        m_ve_required = np.asarray(m_ve_required) # convert list to array

    else:
        m_ve_required = m_ve_required_people

    tsd['m_ve_required'] = m_ve_required

    return
Exemple #10
0
def calc_m_ve_required(tsd):
    """
    Calculate required outdoor air ventilation rate according to occupancy

    Author: Legacy
    Date: old

    :param tsd: Timestep data
    :type tsd: Dict[str, numpy.ndarray]
    :return: updates tsd
    """
    rho_kgm3 = physics.calc_rho_air(tsd['T_ext'][:])
    tsd['m_ve_required'] = np.array(tsd['ve_lps']) * rho_kgm3 * 0.001  # kg/s

    return
def calc_m_ve_required(bpr, tsd):
    """
    Calculate required outdoor air ventilation rate according to occupancy

    Author: Legacy
    Date: old

    :param bpr: Building properties row object
    :param tsd: Time series data dict
    :return: updates tsd
    """

    tsd['m_ve_required'] = (tsd['ve']/3.6) * physics.calc_rho_air(tsd['T_ext'][:]) * 0.001  # kg/s

    return
def calc_qm_arg(factor_cros, temp_ext, dict_windows_building, u_wind_10, temp_zone, r_window_arg):
    """
    Calculation of cross ventilated and non-cross ventilated window ventilation according to procedure in 6.4.3.5.4
    in [1]

    :param factor_cros : cross ventilation factor [0,1]
    :param temp_ext : exterior temperature (°C)
    :param dict_windows_building : dictionary containing information of all windows in building
    :param u_wind_10 : wind velocity (m/s)
    :param temp_zone : zone temperature (°C)
    :param r_window_arg : fraction of window opening (-)

    :returns: window ventilation air mass flows in (kg/h)
    """

    # initialize result
    q_v_arg_in = 0
    q_v_arg_out = 0
    qm_arg_in = qm_arg_out = 0  # this is the output for buildings without windows

    # if building has windows
    if dict_windows_building:

        # constants from Table 12 in [1]
        # TODO import from global variables
        rho_air_ref = 1.23  # (kg/m3)
        coeff_turb = 0.01  # (m/s)
        coeff_wind = 0.001  # (1/(m/s))
        coeff_stack = 0.0035  # ((m/s)/(mK))

        # default values from annex B in [1]
        coeff_d_window = 0.67  # (-), B.1.2.1 in [1]
        delta_c_p = 0.75  # (-), option 2 in B.1.3.4 in [1]

        # get necessary inputs
        rho_air_ext = calc_rho_air(temp_ext)
        rho_air_zone = calc_rho_air(temp_zone)
        area_window_tot = calc_area_window_tot(dict_windows_building, r_window_arg)
        h_window_stack = calc_effective_stack_height(dict_windows_building)
        # print(h_window_stack, area_window_tot)

        # volume flow rates of non-cross ventilated zone according to 6.4.3.5.4.2 in [1]
        if factor_cros == 0:

            # Eq. (47) in [1]
            # FIXME: this equation was modified from the version in the standard (possibly wrong in preliminary version)
            # TODO: check final edition of standard as soon as possible
            q_v_arg_in = 3600 * rho_air_ref / rho_air_ext * area_window_tot / 2 * (
                coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(
                    temp_zone - temp_ext))  # ** 0.5
            # Eq. (48) in [1]
            q_v_arg_out = -3600 * rho_air_ref / rho_air_zone * area_window_tot / 2 * (
                coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(
                    temp_zone - temp_ext))  # ** 0.5

            # print(coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(temp_zone - temp_ext))

        elif factor_cros == 1:

            # get window area of cross-ventilation
            area_window_cros = calc_area_window_cros(dict_windows_building, r_window_arg)
            # print(area_window_cros)

            # Eq. (49) in [1]
            q_v_arg_in = 3600 * rho_air_ref / rho_air_ext * ((
                                                                 coeff_d_window * area_window_cros * u_wind_10 * delta_c_p ** 0.5) ** 2 + (
                                                                 area_window_tot / 2 * (
                                                                     coeff_stack * h_window_stack * abs(
                                                                         temp_zone - temp_ext))) ** 2) ** 0.5

            # Eq. (50) in [1]
            # TODO this formula was changed from the standard to use the air density in the zone
            # TODO adjusted from the standard to have consistent units
            # TODO check final edition of standard as soon as possible
            q_v_arg_out = -3600 * rho_air_ref / rho_air_zone * ((
                                                                    coeff_d_window * area_window_cros * u_wind_10 * delta_c_p ** 0.5) ** 2 + (
                                                                    area_window_tot / 2 * (
                                                                        coeff_stack * h_window_stack * abs(
                                                                            temp_zone - temp_ext))) ** 2) ** 0.5

        # conversion to air mass flows according to 6.4.3.8 in [1]
        # Eq. (67) in [1]
        qm_arg_in = q_v_arg_in * calc_rho_air(temp_ext)
        # Eq. (68) in [1]
        qm_arg_out = q_v_arg_out * calc_rho_air(temp_zone)

    return qm_arg_in, qm_arg_out
def calc_qm_arg(factor_cros, temp_ext, dict_windows_building, u_wind_10, temp_zone, r_window_arg):
    """
    Calculation of cross ventilated and non-cross ventilated window ventilation according to procedure in 6.4.3.5.4
    in [1]

    Parameters
    ----------
    factor_cros : cross ventilation factor [0,1]
    temp_ext : exterior temperature (°C)
    dict_windows_building : dictionary containing information of all windows in building
    u_wind_10 : wind velocity (m/s)
    temp_zone : zone temperature (°C)
    r_window_arg : fraction of window opening (-)

    Returns
    -------
    window ventilation air mass flows in (kg/h)
    """

    # initialize result
    q_v_arg_in = 0
    q_v_arg_out = 0
    qm_arg_in = qm_arg_out = 0  # this is the output for buildings without windows

    # if building has windows
    if dict_windows_building:

        # constants from Table 12 in [1]
        # TODO import from global variables
        rho_air_ref = 1.23  # (kg/m3)
        coeff_turb = 0.01  # (m/s)
        coeff_wind = 0.001  # (1/(m/s))
        coeff_stack = 0.0035  # ((m/s)/(mK))

        # default values from annex B in [1]
        coeff_d_window = 0.67  # (-), B.1.2.1 in [1]
        delta_c_p = 0.75  # (-), option 2 in B.1.3.4 in [1]

        # get necessary inputs
        rho_air_ext = calc_rho_air(temp_ext)
        rho_air_zone = calc_rho_air(temp_zone)
        area_window_tot = calc_area_window_tot(dict_windows_building, r_window_arg)
        h_window_stack = calc_effective_stack_height(dict_windows_building)
        # print(h_window_stack, area_window_tot)

        # volume flow rates of non-cross ventilated zone according to 6.4.3.5.4.2 in [1]
        if factor_cros == 0:

            # Eq. (47) in [1]
            # FIXME: this equation was modified from the version in the standard (possibly wrong in preliminary version)
            # TODO: check final edition of standard as soon as possible
            q_v_arg_in = 3600 * rho_air_ref / rho_air_ext * area_window_tot / 2 * (
                coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(
                    temp_zone - temp_ext))  # ** 0.5
            # Eq. (48) in [1]
            q_v_arg_out = -3600 * rho_air_ref / rho_air_zone * area_window_tot / 2 * (
                coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(
                    temp_zone - temp_ext))  # ** 0.5

            # print(coeff_turb + coeff_wind * u_wind_10 ** 2 + coeff_stack * h_window_stack * abs(temp_zone - temp_ext))

        elif factor_cros == 1:

            # get window area of cross-ventilation
            area_window_cros = calc_area_window_cros(dict_windows_building, r_window_arg)
            # print(area_window_cros)

            # Eq. (49) in [1]
            q_v_arg_in = 3600 * rho_air_ref / rho_air_ext * ((
                                                                 coeff_d_window * area_window_cros * u_wind_10 * delta_c_p ** 0.5) ** 2 + (
                                                                 area_window_tot / 2 * (
                                                                     coeff_stack * h_window_stack * abs(
                                                                         temp_zone - temp_ext))) ** 2) ** 0.5

            # Eq. (50) in [1]
            # TODO this formula was changed from the standard to use the air density in the zone
            # TODO adjusted from the standard to have consistent units
            # TODO check final edition of standard as soon as possible
            q_v_arg_out = -3600 * rho_air_ref / rho_air_zone * ((
                                                                    coeff_d_window * area_window_cros * u_wind_10 * delta_c_p ** 0.5) ** 2 + (
                                                                    area_window_tot / 2 * (
                                                                        coeff_stack * h_window_stack * abs(
                                                                            temp_zone - temp_ext))) ** 2) ** 0.5

        # conversion to air mass flows according to 6.4.3.8 in [1]
        # Eq. (67) in [1]
        qm_arg_in = q_v_arg_in * calc_rho_air(temp_ext)
        # Eq. (68) in [1]
        qm_arg_out = q_v_arg_out * calc_rho_air(temp_zone)

    return qm_arg_in, qm_arg_out