Esempio n. 1
0
def calc_cooling_coil(Qcsf, Qcsf_0, Ta_sup_cs, Ta_re_cs, Tcs_sup_0, Tcs_re_0, ma_sup_cs, ma_sup_0, Ta_sup_0, Ta_re_0,Cpa):
    '''
    this function calculates the state of the heat exchanger at the substation of every customer with cooling needs

    :param Q: cooling laad
    :param thi: in temperature of primary side
    :param tho: out temperature of primary side
    :param tci: in temperature of secondary side
    :param ch: capacity mass flow rate primary side
    :param ch_0: nominal capacity mass flow rate primary side
    :param Qnom: nominal cooling load
    :param thi_0: nominal in temperature of primary side
    :param tci_0: nominal in temperature of secondary side
    :param tho_0: nominal out temperature of primary side
    :param gv: path to global variables class

    :return:
        - tco = out temperature of secondary side (district cooling network)
        - cc = capacity mass flow rate secondary side
        - Area_HEX_cooling = are of heat excahnger.

    '''
    Q = abs(Qcsf)
    Qnom = abs(Qcsf_0)
    thi = Ta_re_cs + 273
    tho =  Ta_sup_cs + 273
    tci = Tcs_sup_0 + 273
    ch = ma_sup_cs * Cpa # WperC
    ch_0 = ma_sup_0 * Cpa # WperC
    thi_0 = Ta_re_0
    tho_0 = Ta_sup_0
    tci_0 = Tcs_sup_0 + 273
    tco_0 = Tcs_re_0 + 273

    if Q > 0 and ma_sup_cs > 0:
        U_COOL = 450.0  # W/m2K for air cooled heat exchanger
        # nominal conditions network side
        # cc_0 = Qnom / (tci_0 - tco_0)
        # # cc_0 = ch_0 * (thi_0 - tho_0) / ((thi_0 - tci_0) * 0.5)
        # # tco_0 = Qnom / cc_0 + tci_0
        dTm_0 = substation.calc_dTm_HEX(thi_0, tho_0, tci_0, tco_0, 'cool')
        # Area heat exchange and UA_heating
        Area_HEX_cooling, UA_cooling = substation.calc_area_HEX(Qnom, dTm_0, U_COOL)
        tco, cc = np.vectorize(substation.calc_HEX_cooling)(Q, UA_cooling, thi, tho, tci, ch)
    else:
        tco = np.nan
        tci = np.nan
        cc = 0.0

    return np.float(tci-273), np.float(tco), np.float(cc) #temperature return, capacitymassflowrate, area heat exchange
Esempio n. 2
0
def calc_heating_coil(Qhsf, Qhsf_0, Ta_sup_hs, Ta_re_hs, Ths_sup_0, Ths_re_0,
                      ma_sup_hs, ma_sup_0, Ta_sup_0, Ta_re_0):
    '''
    this function calculates the state of the heat exchanger at the substation of every customer with heating needs in
    an analogous way to the cooling coil calculation

    :param Q: cooling load
    :param thi: in temperature of primary side
    :param tho: out temperature of primary side
    :param tci: in temperature of secondary side
    :param ch: capacity mass flow rate primary side
    :param ch_0: nominal capacity mass flow rate primary side
    :param Qnom: nominal cooling load
    :param thi_0: nominal in temperature of primary side
    :param tci_0: nominal in temperature of secondary side
    :param tho_0: nominal out temperature of primary side

    :return:
        - tci = inlet temperature of secondary side (district heating network)
        - tco = out temperature of secondary side (district heating network)
        - cc = capacity mass flow rate secondary side
    '''

    Q = abs(Qhsf)
    Qnom = abs(Qhsf_0)
    tci = Ta_re_hs + 273
    tco = Ta_sup_hs + 273
    thi = Ths_sup_0 + 273
    tci_0 = Ta_re_0
    tco_0 = Ta_sup_0
    thi_0 = Ths_sup_0 + 273
    tho_0 = Ths_re_0 + 273
    cc = ma_sup_hs * C_A  # WperC

    if Q > 0 and ma_sup_hs > 0:
        U_HEAT = 450.0  # W/m2K for air-based heat exchanger
        # nominal conditions network side
        dTm_0 = substation.calc_dTm_HEX(thi_0, tho_0, tci_0, tco_0)
        # Area heat exchange and UA_heating
        Area_HEX_heating, UA_heating = substation.calc_area_HEX(
            Qnom, dTm_0, U_HEAT)
        tho, ch = np.vectorize(substation.calc_HEX_heating)(Q, UA_heating, thi,
                                                            tco, tci, cc)

    else:
        thi = np.nan
        tho = np.nan
        ch = 0.0

    return np.float(thi - 273), np.float(tho), np.float(ch)