Example #1
0
def calc_Cinv_VCC(Q_nom_W, locator, technology_type):
    """
    Annualized investment costs for the vapor compressor chiller

    :type Q_nom_W : float
    :param Q_nom_W: Nominal cooling demand in [W]

    :returns InvCa: annualized chiller investment cost in CHF/a
    :rtype InvCa: float

    """
    Capex_a_VCC_USD = 0
    Opex_fixed_VCC_USD = 0
    Capex_VCC_USD = 0

    if Q_nom_W > 0:
        VCC_cost_data = pd.read_excel(locator.get_database_conversion_systems(), sheet_name="Chiller")
        VCC_cost_data = VCC_cost_data[VCC_cost_data['code'] == technology_type]
        max_chiller_size = max(VCC_cost_data['cap_max'].values)
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if Q_nom_W < VCC_cost_data.iloc[0]['cap_min']:
            Q_nom_W = VCC_cost_data.iloc[0]['cap_min']
        if Q_nom_W <= max_chiller_size:
            VCC_cost_data = VCC_cost_data[(VCC_cost_data['cap_min'] <= Q_nom_W) & (VCC_cost_data['cap_max'] >= Q_nom_W)]
            Inv_a = VCC_cost_data.iloc[0]['a']
            Inv_b = VCC_cost_data.iloc[0]['b']
            Inv_c = VCC_cost_data.iloc[0]['c']
            Inv_d = VCC_cost_data.iloc[0]['d']
            Inv_e = VCC_cost_data.iloc[0]['e']
            Inv_IR = VCC_cost_data.iloc[0]['IR_%']
            Inv_LT = VCC_cost_data.iloc[0]['LT_yr']
            Inv_OM = VCC_cost_data.iloc[0]['O&M_%'] / 100
            InvC = Inv_a + Inv_b * (Q_nom_W) ** Inv_c + (Inv_d + Inv_e * Q_nom_W) * log(Q_nom_W)
            Capex_a_VCC_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_fixed_VCC_USD = InvC * Inv_OM
            Capex_VCC_USD = InvC
        else:  # more than one unit of ACH are activated
            number_of_chillers = int(ceil(Q_nom_W / max_chiller_size))
            Q_nom_each_chiller = Q_nom_W / number_of_chillers
            for i in range(number_of_chillers):
                VCC_cost_data = VCC_cost_data[
                    (VCC_cost_data['cap_min'] <= Q_nom_each_chiller) & (VCC_cost_data['cap_max'] >= Q_nom_each_chiller)]
                Inv_a = VCC_cost_data.iloc[0]['a']
                Inv_b = VCC_cost_data.iloc[0]['b']
                Inv_c = VCC_cost_data.iloc[0]['c']
                Inv_d = VCC_cost_data.iloc[0]['d']
                Inv_e = VCC_cost_data.iloc[0]['e']
                Inv_IR = VCC_cost_data.iloc[0]['IR_%']
                Inv_LT = VCC_cost_data.iloc[0]['LT_yr']
                Inv_OM = VCC_cost_data.iloc[0]['O&M_%'] / 100
                InvC = Inv_a + Inv_b * (Q_nom_each_chiller) ** Inv_c + (Inv_d + Inv_e * Q_nom_each_chiller) * log(
                    Q_nom_each_chiller)
                Capex_a1 = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
                Capex_a_VCC_USD = Capex_a_VCC_USD + Capex_a1
                Opex_fixed_VCC_USD = Opex_fixed_VCC_USD + InvC * Inv_OM
                Capex_VCC_USD = Capex_VCC_USD + InvC

    return Capex_a_VCC_USD, Opex_fixed_VCC_USD, Capex_VCC_USD
Example #2
0
def calc_Cinv_GHP(GHP_Size_W, GHP_cost_data, BH_cost_data):
    """
    Calculates the annualized investment costs for the geothermal heat pump

    :type GHP_Size_W : float
    :param GHP_Size_W: Design electrical size of the heat pump in [Wel]

    InvCa : float
        annualized investment costs in EUROS/a
    """
    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if GHP_Size_W < GHP_cost_data['cap_min'][0]:
        GHP_Size_W = GHP_cost_data['cap_min'][0]
    GHP_cost_data = GHP_cost_data[(GHP_cost_data['cap_min'] <= GHP_Size_W)
                                  & (GHP_cost_data['cap_max'] > GHP_Size_W)]

    Inv_a = GHP_cost_data.iloc[0]['a']
    Inv_b = GHP_cost_data.iloc[0]['b']
    Inv_c = GHP_cost_data.iloc[0]['c']
    Inv_d = GHP_cost_data.iloc[0]['d']
    Inv_e = GHP_cost_data.iloc[0]['e']
    Inv_IR = GHP_cost_data.iloc[0]['IR_%']
    Inv_LT = GHP_cost_data.iloc[0]['LT_yr']
    Inv_OM = GHP_cost_data.iloc[0]['O&M_%'] / 100

    InvC_GHP = Inv_a + Inv_b * (GHP_Size_W)**Inv_c + (
        Inv_d + Inv_e * GHP_Size_W) * log(GHP_Size_W)

    Capex_a_GHP_USD = calc_capex_annualized(InvC_GHP, Inv_IR, Inv_LT)
    Opex_fixed_GHP_USD = InvC_GHP * Inv_OM

    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if GHP_Size_W < BH_cost_data['cap_min'][0]:
        GHP_Size_W = BH_cost_data['cap_min'][0]
    BH_cost_data = BH_cost_data[(BH_cost_data['cap_min'] <= GHP_Size_W)
                                & (BH_cost_data['cap_max'] > GHP_Size_W)]

    Inv_a = BH_cost_data.iloc[0]['a']
    Inv_b = BH_cost_data.iloc[0]['b']
    Inv_c = BH_cost_data.iloc[0]['c']
    Inv_d = BH_cost_data.iloc[0]['d']
    Inv_e = BH_cost_data.iloc[0]['e']
    Inv_IR = BH_cost_data.iloc[0]['IR_%']
    Inv_LT = BH_cost_data.iloc[0]['LT_yr']
    Inv_OM = BH_cost_data.iloc[0]['O&M_%'] / 100

    InvC_BH = Inv_a + Inv_b * (GHP_Size_W)**Inv_c + (
        Inv_d + Inv_e * GHP_Size_W) * log(GHP_Size_W)

    Capex_a_BH_USD = calc_capex_annualized(InvC_BH, Inv_IR, Inv_LT)
    Opex_fixed_BH_USD = InvC_BH * Inv_OM

    Capex_a_GHP_total_USD = Capex_a_BH_USD + Capex_a_GHP_USD
    Opex_fixed_GHP_total_USD = Opex_fixed_BH_USD + Opex_fixed_GHP_USD
    Capex_GHP_total_USD = InvC_BH + InvC_GHP

    return Capex_a_GHP_total_USD, Opex_fixed_GHP_total_USD, Capex_GHP_total_USD
Example #3
0
def calc_Cinv_PVT(PVT_peak_W, locator, technology=0):
    """
    P_peak in kW
    result in CHF
    technology = 0 represents the first technology when there are multiple technologies.
    FIXME: handle multiple technologies when cost calculations are done
    """
    if PVT_peak_W > 0.0:
        PVT_cost_data = pd.read_excel(locator.get_database_conversion_systems(), sheet_name="PV")
        technology_code = list(set(PVT_cost_data['code']))
        PVT_cost_data = PVT_cost_data[PVT_cost_data['code'] == technology_code[technology]]
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if PVT_peak_W < PVT_cost_data['cap_min'].values[0]:
            PVT_peak_W = PVT_cost_data['cap_min'].values[0]
        PVT_cost_data = PVT_cost_data[
            (PVT_cost_data['cap_min'] <= PVT_peak_W) & (PVT_cost_data['cap_max'] > PVT_peak_W)]
        Inv_a = PVT_cost_data.iloc[0]['a']
        Inv_b = PVT_cost_data.iloc[0]['b']
        Inv_c = PVT_cost_data.iloc[0]['c']
        Inv_d = PVT_cost_data.iloc[0]['d']
        Inv_e = PVT_cost_data.iloc[0]['e']
        Inv_IR = PVT_cost_data.iloc[0]['IR_%']
        Inv_LT = PVT_cost_data.iloc[0]['LT_yr']
        Inv_OM = PVT_cost_data.iloc[0]['O&M_%'] / 100

        InvC = Inv_a + Inv_b * (PVT_peak_W) ** Inv_c + (Inv_d + Inv_e * PVT_peak_W) * log(PVT_peak_W)

        Capex_a = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
        Opex_fixed = InvC * Inv_OM
        Capex = InvC
    else:
        Capex_a = Opex_fixed = Capex = 0.0

    return Capex_a, Opex_fixed, Capex
def calc_Cinv_FC(P_design_W, FC_cost_data):
    """
    Calculates the investment cost of a Fuel Cell in CHF
    http://hexis.com/sites/default/files/media/publikationen/140623_hexis_galileo_ibb_profitpaket.pdf?utm_source=HEXIS+Mitarbeitende&utm_campaign=06d2c528a5-1_Newsletter_2014_Mitarbeitende_DE&utm_medium=email&utm_term=0_e97bc1703e-06d2c528a5-
    :type P_design_W : float
    :param P_design_W: Design thermal Load of Fuel Cell [W_th]
    :rtype InvCa: float
    :returns InvCa: annualized investment costs in CHF
    """
    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if P_design_W < FC_cost_data['cap_min'][0]:
        P_design_W = FC_cost_data['cap_min'][0]
    FC_cost_data = FC_cost_data[(FC_cost_data['cap_min'] <= P_design_W)
                                & (FC_cost_data['cap_max'] > P_design_W)]

    Inv_a = FC_cost_data.iloc[0]['a']
    Inv_b = FC_cost_data.iloc[0]['b']
    Inv_c = FC_cost_data.iloc[0]['c']
    Inv_d = FC_cost_data.iloc[0]['d']
    Inv_e = FC_cost_data.iloc[0]['e']
    Inv_IR = FC_cost_data.iloc[0]['IR_%']
    Inv_LT = FC_cost_data.iloc[0]['LT_yr']
    Inv_OM = FC_cost_data.iloc[0]['O&M_%'] / 100

    InvC = Inv_a + Inv_b * (P_design_W)**Inv_c + (
        Inv_d + Inv_e * P_design_W) * log(P_design_W)

    Capex_a_FC_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
    Opex_fixed_FC_USD = InvC * Inv_OM
    Capex_FC_USD = InvC

    return Capex_a_FC_USD, Opex_fixed_FC_USD, Capex_FC_USD
Example #5
0
def calc_Capex_a_network_pipes(network_info):
    ''' Calculates network piping costs'''
    if network_info.network_type == 'DH':
        InvC = network_info.network_features.pipesCosts_DHN_USD
    else:
        InvC = network_info.network_features.pipesCosts_DCN_USD
    # Assume lifetime of 25 years and 5 % IR
    Inv_IR = 5
    Inv_LT = 25  #TODO: find reference
    Capex_a_netw = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
    return Capex_a_netw
def calc_Cinv_HEX(Q_design_W, locator, config, technology_type):
    """
    Calculates the cost of a heat exchanger (based on A+W cost of oil boilers) [CHF / a]

    :type Q_design_W : float
    :param Q_design_W: Design Load of Boiler

    :rtype InvC_return : float
    :returns InvC_return: total investment Cost in [CHF]

    :rtype InvCa : float
    :returns InvCa: annualized investment costs in [CHF/a]

    """
    if Q_design_W > 0:
        HEX_cost_data = pd.read_excel(
            locator.get_database_conversion_systems(), sheet_name="HEX")
        HEX_cost_data = HEX_cost_data[HEX_cost_data['code'] == technology_type]
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if Q_design_W < HEX_cost_data.iloc[0]['cap_min']:
            Q_design_W = HEX_cost_data.iloc[0]['cap_min']
        HEX_cost_data = HEX_cost_data[(HEX_cost_data['cap_min'] <= Q_design_W)
                                      &
                                      (HEX_cost_data['cap_max'] > Q_design_W)]

        Inv_a = HEX_cost_data.iloc[0]['a']
        Inv_b = HEX_cost_data.iloc[0]['b']
        Inv_c = HEX_cost_data.iloc[0]['c']
        Inv_d = HEX_cost_data.iloc[0]['d']
        Inv_e = HEX_cost_data.iloc[0]['e']
        Inv_IR = HEX_cost_data.iloc[0]['IR_%']
        Inv_LT = HEX_cost_data.iloc[0]['LT_yr']
        Inv_OM = HEX_cost_data.iloc[0]['O&M_%'] / 100

        InvC = Inv_a + Inv_b * (Q_design_W)**Inv_c + (
            Inv_d + Inv_e * Q_design_W) * log(Q_design_W)

        Capex_a_HEX_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
        Opex_fixed_HEX_USD = InvC * Inv_OM
        Capex_HEX_USD = InvC

    else:
        Capex_a_HEX_USD = 0.0
        Opex_fixed_HEX_USD = 0.0
        Capex_HEX_USD = 0.0

    return Capex_a_HEX_USD, Opex_fixed_HEX_USD, Capex_HEX_USD
Example #7
0
def calc_Cinv_furnace(Q_design_W, locator, technology_type):
    """
    Calculates the annualized investment cost of a Furnace
    based on Bioenergy 2020 (AFO) and POLYCITY Ostfildern 

    :type Q_design_W : float
    :param Q_design_W: Design Load of Boiler
        
    :type Q_annual_W : float
    :param Q_annual_W: annual thermal Power output [Wh]

    :rtype InvC_return : float
    :returns InvC_return: total investment Cost for building the plant
    
    :rtype InvCa : float
    :returns InvCa: annualized investment costs in [CHF] including O&M
        
    """
    furnace_cost_data = pd.read_excel(
        locator.get_database_conversion_systems(), sheet_name="Furnace")
    furnace_cost_data = furnace_cost_data[furnace_cost_data['code'] ==
                                          technology_type]
    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if Q_design_W < furnace_cost_data.iloc[0]['cap_min']:
        Q_design_W = furnace_cost_data.iloc[0]['cap_min']
    furnace_cost_data = furnace_cost_data[
        (furnace_cost_data['cap_min'] <= Q_design_W)
        & (furnace_cost_data['cap_max'] > Q_design_W)]

    Inv_a = furnace_cost_data.iloc[0]['a']
    Inv_b = furnace_cost_data.iloc[0]['b']
    Inv_c = furnace_cost_data.iloc[0]['c']
    Inv_d = furnace_cost_data.iloc[0]['d']
    Inv_e = furnace_cost_data.iloc[0]['e']
    Inv_IR = furnace_cost_data.iloc[0]['IR_%']
    Inv_LT = furnace_cost_data.iloc[0]['LT_yr']
    Inv_OM = furnace_cost_data.iloc[0]['O&M_%'] / 100

    InvC = Inv_a + Inv_b * (Q_design_W)**Inv_c + (
        Inv_d + Inv_e * Q_design_W) * log(Q_design_W)

    Capex_a_furnace_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
    Opex_fixed_furnace_USD = InvC * Inv_OM
    Capex_furnace_USD = InvC

    return Capex_a_furnace_USD, Opex_fixed_furnace_USD, Capex_furnace_USD
Example #8
0
def calc_Cinv_storage(V_tank_m3, locator, config, technology_type):
    """
    calculate the annualized investment cost of a thermal storage tank

    :param V_tank_m3: storage tank volume
    :type V_tank_m3: float

    :returns InvCa:

    """
    if V_tank_m3 > 0:
        storage_cost_data = pd.read_excel(
            locator.get_database_conversion_systems(), sheet_name="TES")
        storage_cost_data = storage_cost_data[storage_cost_data['code'] ==
                                              technology_type]

        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if V_tank_m3 < storage_cost_data.iloc[0]['cap_min']:
            V_tank_m3 = storage_cost_data[0]['cap_min']

        storage_cost_data = storage_cost_data[
            (storage_cost_data['cap_min'] <= V_tank_m3)
            & (storage_cost_data['cap_max'] > V_tank_m3)]

        Inv_a = storage_cost_data.iloc[0]['a']
        Inv_b = storage_cost_data.iloc[0]['b']
        Inv_c = storage_cost_data.iloc[0]['c']
        Inv_d = storage_cost_data.iloc[0]['d']
        Inv_e = storage_cost_data.iloc[0]['e']
        Inv_IR = storage_cost_data.iloc[0]['IR_%']
        Inv_LT = storage_cost_data.iloc[0]['LT_yr']
        Inv_OM = storage_cost_data.iloc[0]['O&M_%'] / 100

        Capex_total_USD = Inv_a + Inv_b * (V_tank_m3)**Inv_c + (
            Inv_d + Inv_e * V_tank_m3) * log(V_tank_m3)
        Capex_a_storage_USD = calc_capex_annualized(Capex_total_USD, Inv_IR,
                                                    Inv_LT)
        Opex_fixed_storage_USD = Capex_total_USD * Inv_OM
    else:
        Capex_a_storage_USD = 0.0
        Opex_fixed_storage_USD = 0.0
        Capex_total_USD = 0.0

    return Capex_a_storage_USD, Opex_fixed_storage_USD, Capex_total_USD
def calc_Cinv_CCGT(CC_size_W, CCGT_cost_data):
    """
    Annualized investment costs for the Combined cycle
    :type CC_size_W : float
    :param CC_size_W: Electrical size of the CC
    :rtype InvCa : float
    :returns InvCa: annualized investment costs in CHF
    ..[C. Weber, 2008] C.Weber, Multi-objective design and optimization of district energy systems including
    polygeneration energy conversion technologies., PhD Thesis, EPFL
    """

    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if CC_size_W < CCGT_cost_data['cap_min'][0]:
        CC_size_W = CCGT_cost_data['cap_min'][0]
    CCGT_cost_data = CCGT_cost_data[(CCGT_cost_data['cap_min'] <= CC_size_W)
                                    & (CCGT_cost_data['cap_max'] > CC_size_W)]

    #costs of connection
    connection_costs = ngas.calc_Cinv_gas(CC_size_W)

    Inv_a = CCGT_cost_data.iloc[0]['a']
    Inv_b = CCGT_cost_data.iloc[0]['b']
    Inv_c = CCGT_cost_data.iloc[0]['c']
    Inv_d = CCGT_cost_data.iloc[0]['d']
    Inv_e = CCGT_cost_data.iloc[0]['e']
    Inv_IR = CCGT_cost_data.iloc[0]['IR_%']
    Inv_LT = CCGT_cost_data.iloc[0]['LT_yr']
    Inv_OM = CCGT_cost_data.iloc[0]['O&M_%'] / 100

    InvC = Inv_a + Inv_b * (CC_size_W)**Inv_c + (
        Inv_d + Inv_e * CC_size_W) * log(CC_size_W)

    Capex_a_CCGT_USD = calc_capex_annualized((InvC + connection_costs), Inv_IR,
                                             Inv_LT)
    Opex_fixed_CCGT_USD = InvC * Inv_OM
    Capex_CCGT_USD = InvC

    return Capex_a_CCGT_USD, Opex_fixed_CCGT_USD, Capex_CCGT_USD
Example #10
0
def calc_Cinv_pv(total_module_area_m2, locator, technology=0):
    """
    To calculate capital cost of PV modules, assuming 20 year system lifetime.
    :param P_peak: installed capacity of PV module [kW]
    :return InvCa: capital cost of the installed PV module [CHF/Y]
    """
    PV_cost_data = pd.read_excel(locator.get_database_conversion_systems(),
                                 sheet_name="PV")
    technology_code = list(set(PV_cost_data['code']))
    PV_cost_data = PV_cost_data[PV_cost_data['code'] ==
                                technology_code[technology]]
    nominal_efficiency = PV_cost_data[
        PV_cost_data['code'] == technology_code[technology]]['PV_n'].max()
    P_nominal_W = total_module_area_m2 * (constants.STC_RADIATION_Wperm2 *
                                          nominal_efficiency)
    # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
    # capacity for the corresponding technology from the database
    if P_nominal_W < PV_cost_data['cap_min'][0]:
        P_nominal_W = PV_cost_data['cap_min'][0]
    PV_cost_data = PV_cost_data[(PV_cost_data['cap_min'] <= P_nominal_W)
                                & (PV_cost_data['cap_max'] > P_nominal_W)]
    Inv_a = PV_cost_data.iloc[0]['a']
    Inv_b = PV_cost_data.iloc[0]['b']
    Inv_c = PV_cost_data.iloc[0]['c']
    Inv_d = PV_cost_data.iloc[0]['d']
    Inv_e = PV_cost_data.iloc[0]['e']
    Inv_IR = PV_cost_data.iloc[0]['IR_%']
    Inv_LT = PV_cost_data.iloc[0]['LT_yr']
    Inv_OM = PV_cost_data.iloc[0]['O&M_%'] / 100

    InvC = Inv_a + Inv_b * (P_nominal_W)**Inv_c + (
        Inv_d + Inv_e * P_nominal_W) * log(P_nominal_W)

    Capex_a_PV_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
    Opex_fixed_PV_USD = InvC * Inv_OM
    Capex_PV_USD = InvC

    return Capex_a_PV_USD, Opex_fixed_PV_USD, Capex_PV_USD, P_nominal_W
def calc_Cinv_DX(Q_design_W):
    """
    Assume the same cost as gas boilers.
    :type Q_design_W : float
    :param Q_design_W: Design Load of Boiler in [W]
    :rtype InvCa : float
    :returns InvCa: Annualized investment costs in CHF/a including Maintenance Cost
    """
    Capex_a_DX_USD = 0
    Opex_fixed_DX_USD = 0
    Capex_DX_USD = 0

    if Q_design_W > 0:
        InvC = Q_design_W * PRICE_DX_PER_W
        Inv_IR = 5
        Inv_LT = 25
        Inv_OM = 5 / 100

        Capex_a_DX_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
        Opex_fixed_DX_USD = InvC * Inv_OM
        Capex_DX_USD = InvC

    return Capex_a_DX_USD, Opex_fixed_DX_USD, Capex_DX_USD
def calc_Cinv_ACH(Q_nom_W, Absorption_chiller_cost_data, ACH_type):
    """
    Annualized investment costs for the vapor compressor chiller
    :type Q_nom_W : float
    :param Q_nom_W: peak cooling demand in [W]
    :returns InvCa: annualized chiller investment cost in CHF/a
    :rtype InvCa: float
    """
    Capex_a_ACH_USD = 0
    Opex_fixed_ACH_USD = 0
    Capex_ACH_USD = 0
    if Q_nom_W > 0:
        Absorption_chiller_cost_data = Absorption_chiller_cost_data[Absorption_chiller_cost_data['type'] == ACH_type]
        max_chiller_size = max(Absorption_chiller_cost_data['cap_max'].values)

        Q_nom_W = Absorption_chiller_cost_data['cap_min'].values.min() if Q_nom_W < Absorption_chiller_cost_data[
            'cap_min'].values.min() else Q_nom_W  # minimum technology size


        if Q_nom_W <= max_chiller_size:

            Absorption_chiller_cost_data = Absorption_chiller_cost_data[
                (Absorption_chiller_cost_data['cap_min'] <= Q_nom_W) & (
                        Absorption_chiller_cost_data[
                            'cap_max'] > Q_nom_W)]  # keep properties of the associated capacity
            Inv_a = Absorption_chiller_cost_data.iloc[0]['a']
            Inv_b = Absorption_chiller_cost_data.iloc[0]['b']
            Inv_c = Absorption_chiller_cost_data.iloc[0]['c']
            Inv_d = Absorption_chiller_cost_data.iloc[0]['d']
            Inv_e = Absorption_chiller_cost_data.iloc[0]['e']
            Inv_IR = Absorption_chiller_cost_data.iloc[0]['IR_%']
            Inv_LT = Absorption_chiller_cost_data.iloc[0]['LT_yr']
            Inv_OM = Absorption_chiller_cost_data.iloc[0]['O&M_%'] / 100

            InvC = Inv_a + Inv_b * (Q_nom_W) ** Inv_c + (Inv_d + Inv_e * Q_nom_W) * log(Q_nom_W)
            Capex_a_ACH_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_fixed_ACH_USD = InvC * Inv_OM
            Capex_ACH_USD = InvC
        else:
            number_of_chillers = int(ceil(Q_nom_W / max_chiller_size))
            Q_nom_each_chiller = Q_nom_W / number_of_chillers
            for i in range(number_of_chillers):
                Absorption_chiller_cost_data = Absorption_chiller_cost_data[
                    (Absorption_chiller_cost_data['cap_min'] <= Q_nom_each_chiller) & (
                            Absorption_chiller_cost_data[
                                'cap_max'] > Q_nom_each_chiller)]  # keep properties of the associated capacity
                Inv_a = Absorption_chiller_cost_data.iloc[0]['a']
                Inv_b = Absorption_chiller_cost_data.iloc[0]['b']
                Inv_c = Absorption_chiller_cost_data.iloc[0]['c']
                Inv_d = Absorption_chiller_cost_data.iloc[0]['d']
                Inv_e = Absorption_chiller_cost_data.iloc[0]['e']
                Inv_IR = Absorption_chiller_cost_data.iloc[0]['IR_%']
                Inv_LT = Absorption_chiller_cost_data.iloc[0]['LT_yr']
                Inv_OM = Absorption_chiller_cost_data.iloc[0]['O&M_%'] / 100

                InvC = Inv_a + Inv_b * (Q_nom_each_chiller) ** Inv_c + (Inv_d + Inv_e * Q_nom_each_chiller) * log(Q_nom_each_chiller)
                Capex_a1 = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
                Capex_a_ACH_USD = Capex_a_ACH_USD + Capex_a1
                Opex_fixed_ACH_USD = Opex_fixed_ACH_USD + InvC * Inv_OM
                Capex_ACH_USD = Capex_ACH_USD + InvC

    return Capex_a_ACH_USD, Opex_fixed_ACH_USD, Capex_ACH_USD
Example #13
0
def calc_Cinv_boiler(Q_design_W, technology_type, boiler_cost_data):
    """
    Calculates the annual cost of a boiler (based on A+W cost of oil boilers) [CHF / a]
    and Faz. 2012 data

    :type Q_design_W : float
    :param Q_design_W: Design Load of Boiler in [W]

    :rtype InvCa : float
    :returns InvCa: Annualized investment costs in CHF/a including Maintenance Cost
    """
    Capex_a_Boiler_USD = 0.0
    Opex_a_fix_Boiler_USD = 0.0
    Capex_Boiler_USD = 0.0

    if Q_design_W > 0.0:
        boiler_cost_data = boiler_cost_data[boiler_cost_data['code'] == technology_type]
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if Q_design_W < boiler_cost_data.iloc[0]['cap_min']:
            Q_design_W = boiler_cost_data.iloc[0]['cap_min']
        max_boiler_size = boiler_cost_data.iloc[0]['cap_max']

        if Q_design_W <= max_boiler_size:

            boiler_cost_data = boiler_cost_data[
                (boiler_cost_data['cap_min'] <= Q_design_W) & (boiler_cost_data['cap_max'] > Q_design_W)]

            Inv_a = boiler_cost_data.iloc[0]['a']
            Inv_b = boiler_cost_data.iloc[0]['b']
            Inv_c = boiler_cost_data.iloc[0]['c']
            Inv_d = boiler_cost_data.iloc[0]['d']
            Inv_e = boiler_cost_data.iloc[0]['e']
            Inv_IR = boiler_cost_data.iloc[0]['IR_%']
            Inv_LT = boiler_cost_data.iloc[0]['LT_yr']
            Inv_OM = boiler_cost_data.iloc[0]['O&M_%'] / 100.0

            InvC = Inv_a + Inv_b * (Q_design_W) ** Inv_c + (Inv_d + Inv_e * Q_design_W) * log(Q_design_W)

            Capex_a_Boiler_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_a_fix_Boiler_USD = InvC * Inv_OM
            Capex_Boiler_USD = InvC

        else:
            number_of_boilers = int(ceil(Q_design_W / max_boiler_size))
            Q_nom_W = Q_design_W / number_of_boilers

            boiler_cost_data = boiler_cost_data[
                (boiler_cost_data['cap_min'] <= Q_nom_W) & (boiler_cost_data['cap_max'] > Q_nom_W)]

            Inv_a = boiler_cost_data.iloc[0]['a']
            Inv_b = boiler_cost_data.iloc[0]['b']
            Inv_c = boiler_cost_data.iloc[0]['c']
            Inv_d = boiler_cost_data.iloc[0]['d']
            Inv_e = boiler_cost_data.iloc[0]['e']
            Inv_IR = boiler_cost_data.iloc[0]['IR_%']
            Inv_LT = boiler_cost_data.iloc[0]['LT_yr']
            Inv_OM = boiler_cost_data.iloc[0]['O&M_%'] / 100.0

            InvC = (Inv_a + Inv_b * (Q_nom_W) ** Inv_c + (Inv_d + Inv_e * Q_nom_W) * log(Q_nom_W)) * number_of_boilers

            Capex_a_Boiler_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_a_fix_Boiler_USD = InvC * Inv_OM
            Capex_Boiler_USD = InvC

    return Capex_a_Boiler_USD, Opex_a_fix_Boiler_USD, Capex_Boiler_USD
def calc_Cinv_HEX_hisaka(network_info):
    """
    Calculates costs of all substation heat exchangers in a network.
    Used in thermal_network_optimization.
    """
    ## read in cost values from database
    HEX_prices = pd.read_excel(
        network_info.locator.get_database_conversion_systems(),
        sheet_name="HEX",
        index_col=0)
    a = HEX_prices['a']['District substation heat exchanger']
    b = HEX_prices['b']['District substation heat exchanger']
    c = HEX_prices['c']['District substation heat exchanger']
    d = HEX_prices['d']['District substation heat exchanger']
    e = HEX_prices['e']['District substation heat exchanger']
    Inv_IR = HEX_prices['IR_%']['District substation heat exchanger']
    Inv_LT = HEX_prices['LT_yr']['District substation heat exchanger']
    Inv_OM = HEX_prices['O&M_%']['District substation heat exchanger'] / 100

    ## list node id of all substations
    # read in nodes list
    all_nodes = pd.read_csv(
        network_info.locator.get_thermal_network_node_types_csv_file(
            network_info.network_type, network_info.network_name))
    Capex_a = 0.0
    Opex_a_fixed = 0.0

    substation_node_id_list = []
    # add buildings to node id list
    for building in network_info.building_names:
        # check if building is connected to network
        if building not in network_info.building_names[
                network_info.disconnected_buildings_index]:
            # add HEX cost
            node_id = int(np.where(all_nodes['Building'] == building)[0])
            substation_node_id_list.append(all_nodes['Name'][node_id])
    # add plants to node id list
    plant_id_list = np.where(all_nodes['Type'] == 'Plant')[0]
    # find plant nodes
    for plant_id in plant_id_list:
        substation_node_id_list.append('NODE' + str(plant_id))

    ## calculate costs of hex at substations
    for node_id in substation_node_id_list:
        # read in node mass flows
        node_flows = pd.read_csv(
            network_info.locator.get_nominal_node_mass_flow_csv_file(
                network_info.network_type, network_info.network_name))
        # find design condition node mcp
        node_flow = max(node_flows[node_id])
        if node_flow > 0:
            # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
            # capacity for the corresponding technology from the database # TODO: add minimum capacity to cost function

            # Split into several HEXs if flows are too high
            if node_flow <= MAX_NODE_FLOW:
                mcp_sub = node_flow * HEAT_CAPACITY_OF_WATER_JPERKGK
                Capex_substation_hex = a + b * mcp_sub**c + d * np.log(
                    mcp_sub) + e * mcp_sub * np.log(mcp_sub)
            else:
                # we need to split into several HEXs
                Capex_substation_hex = 0
                number_of_HEXs = int(ceil(node_flow / MAX_NODE_FLOW))
                nodeflow_nom = node_flow / number_of_HEXs
                mcp_sub = nodeflow_nom * HEAT_CAPACITY_OF_WATER_JPERKGK
                for i in range(number_of_HEXs):

                    Capex_substation_hex = Capex_substation_hex + (
                        a + b * mcp_sub**c + d * np.log(mcp_sub) +
                        e * mcp_sub * np.log(mcp_sub))

            Capex_a_substation_hex = calc_capex_annualized(
                Capex_substation_hex, Inv_IR, Inv_LT)
            Opex_fixed_substation_hex = Capex_substation_hex * Inv_OM

            # aggregate all substation costs in a network
            Capex_a = Capex_a + Capex_a_substation_hex
            Opex_a_fixed = Opex_a_fixed + Opex_fixed_substation_hex

    return Capex_a, Opex_a_fixed
def calc_Cinv_pump(pump_peak_W, locator, technology_type):
    """
    Calculates the cost of a pumping device.
    if the nominal load (electric) > 375kW, a new pump is installed
    if the nominal load (electric) < 500W, a pump with Pel_design = 500W is assumed
    Investement costs are calculated upon the life time of a GHP (20y) and a GHP- related interest rate of 6%
    :type deltaP : float
    :param deltaP: nominal pressure drop that has to be overcome with the pump
    :type mdot_kgpers : float
    :param mdot_kgpers: nominal mass flow
    :type eta_pumping : float
    :param pump efficiency: (set 0.8 as standard value, eta = E_pumping / E_elec)
    :rtype InvC_return : float
    :returns InvC_return: total investment Cost in CHF
    :rtype InvCa : float
    :returns InvCa: annualized investment costs in CHF/year
    """

    Pump_max_kW = 375.0
    Pump_min_kW = 0.5
    nPumps = int(np.ceil(pump_peak_W / 1000.0 / Pump_max_kW))
    # if the nominal load (electric) > 375kW, a new pump is installed
    Pump_Array_W = np.zeros((nPumps))
    Pump_Remain_W = pump_peak_W

    Capex_a_pump_USD = 0.0
    Opex_fixed_pump_USD = 0.0
    Capex_pump_USD = 0.0

    for pump_i in range(nPumps):
        # calculate pump nominal capacity
        Pump_Array_W[pump_i] = min(Pump_Remain_W, Pump_max_kW * 1000)
        if Pump_Array_W[pump_i] < Pump_min_kW * 1000:
            Pump_Array_W[pump_i] = Pump_min_kW * 1000
        Pump_Remain_W -= Pump_Array_W[pump_i]

        PUMP_COST_DATA = pd.read_excel(locator.get_database_conversion_systems(), sheet_name="Pump")
        pump_cost_data = PUMP_COST_DATA[PUMP_COST_DATA['code'] == technology_type]
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if Pump_Array_W[pump_i] < pump_cost_data.iloc[0]['cap_min']:
            Pump_Array_W[pump_i] = pump_cost_data.iloc[0]['cap_min']
        pump_cost_data = pump_cost_data[
            (pump_cost_data['cap_min'] <= Pump_Array_W[pump_i]) & (pump_cost_data['cap_max'] > Pump_Array_W[pump_i])]

        Inv_a = pump_cost_data.iloc[0]['a']
        Inv_b = pump_cost_data.iloc[0]['b']
        Inv_c = pump_cost_data.iloc[0]['c']
        Inv_d = pump_cost_data.iloc[0]['d']
        Inv_e = pump_cost_data.iloc[0]['e']
        Inv_IR = pump_cost_data.iloc[0]['IR_%']
        Inv_LT = pump_cost_data.iloc[0]['LT_yr']
        Inv_OM = pump_cost_data.iloc[0]['O&M_%'] / 100

        InvC = Inv_a + Inv_b * (Pump_Array_W[pump_i]) ** Inv_c + (Inv_d + Inv_e * Pump_Array_W[pump_i]) * log(
            Pump_Array_W[pump_i])

        Capex_a_pump_USD += calc_capex_annualized(InvC, Inv_IR, Inv_LT)
        Opex_fixed_pump_USD += InvC * Inv_OM
        Capex_pump_USD += InvC

    return Capex_a_pump_USD, Opex_fixed_pump_USD, Capex_pump_USD
def calc_Cinv_CT(Q_nom_CT_W, locator, technology_type):
    """
    Annualized investment costs for the Combined cycle

    :type Q_nom_CT_W : float
    :param Q_nom_CT_W: Nominal size of the cooling tower in [W]

    :rtype InvCa : float
    :returns InvCa: annualized investment costs in Dollars
    """
    Capex_a_CT_USD = 0.0
    Opex_fixed_CT_USD = 0.0
    Capex_CT_USD = 0.0

    if Q_nom_CT_W > 0:
        CT_cost_data = pd.read_excel(locator.get_database_conversion_systems(),
                                     sheet_name="CT")
        CT_cost_data = CT_cost_data[CT_cost_data['code'] == technology_type]
        max_chiller_size = max(CT_cost_data['cap_max'].values)

        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if Q_nom_CT_W < CT_cost_data.iloc[0]['cap_min']:
            Q_nom_CT_W = CT_cost_data.iloc[0]['cap_min']
        if Q_nom_CT_W <= max_chiller_size:
            CT_cost_data = CT_cost_data[(CT_cost_data['cap_min'] <= Q_nom_CT_W)
                                        &
                                        (CT_cost_data['cap_max'] > Q_nom_CT_W)]

            Inv_a = CT_cost_data.iloc[0]['a']
            Inv_b = CT_cost_data.iloc[0]['b']
            Inv_c = CT_cost_data.iloc[0]['c']
            Inv_d = CT_cost_data.iloc[0]['d']
            Inv_e = CT_cost_data.iloc[0]['e']
            Inv_IR = CT_cost_data.iloc[0]['IR_%']
            Inv_LT = CT_cost_data.iloc[0]['LT_yr']
            Inv_OM = CT_cost_data.iloc[0]['O&M_%'] / 100

            InvC = Inv_a + Inv_b * (Q_nom_CT_W)**Inv_c + (
                Inv_d + Inv_e * Q_nom_CT_W) * log(Q_nom_CT_W)

            Capex_a_CT_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_fixed_CT_USD = InvC * Inv_OM
            Capex_CT_USD = InvC

        else:
            number_of_chillers = int(ceil(Q_nom_CT_W / max_chiller_size))
            Q_nom_each_CT = Q_nom_CT_W / number_of_chillers

            for i in range(number_of_chillers):
                CT_cost_data = CT_cost_data[
                    (CT_cost_data['cap_min'] <= Q_nom_each_CT)
                    & (CT_cost_data['cap_max'] > Q_nom_each_CT)]
                Inv_a = CT_cost_data.iloc[0]['a']
                Inv_b = CT_cost_data.iloc[0]['b']
                Inv_c = CT_cost_data.iloc[0]['c']
                Inv_d = CT_cost_data.iloc[0]['d']
                Inv_e = CT_cost_data.iloc[0]['e']
                Inv_IR = CT_cost_data.iloc[0]['IR_%']
                Inv_LT = CT_cost_data.iloc[0]['LT_yr']
                Inv_OM = CT_cost_data.iloc[0]['O&M_%'] / 100
                InvC = Inv_a + Inv_b * (Q_nom_each_CT)**Inv_c + (
                    Inv_d + Inv_e * Q_nom_each_CT) * log(Q_nom_each_CT)
                Capex_a1 = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
                Capex_a_CT_USD = Capex_a_CT_USD + Capex_a1
                Opex_fixed_CT_USD = Opex_fixed_CT_USD + InvC * Inv_OM
                Capex_CT_USD = Capex_CT_USD + InvC

    return Capex_a_CT_USD, Opex_fixed_CT_USD, Capex_CT_USD
def calc_Cinv_HP(HP_Size, locator, technology_type):
    """
    Calculates the annualized investment costs for a water to water heat pump.

    :type HP_Size : float
    :param HP_Size: Design thermal size of the heat pump in [W]

    :rtype InvCa : float
    :returns InvCa: annualized investment costs in [CHF/a]

    ..[C. Weber, 2008] C.Weber, Multi-objective design and optimization of district energy systems including
    polygeneration energy conversion technologies., PhD Thesis, EPFL
    """
    Capex_a_HP_USD = 0.0
    Opex_fixed_HP_USD = 0.0
    Capex_HP_USD = 0.0

    if HP_Size > 0.0:
        HP_cost_data = pd.read_excel(locator.get_database_conversion_systems(), sheet_name="HP")
        HP_cost_data = HP_cost_data[HP_cost_data['code'] == technology_type]
        # if the Q_design is below the lowest capacity available for the technology, then it is replaced by the least
        # capacity for the corresponding technology from the database
        if HP_Size < HP_cost_data.iloc[0]['cap_min']:
            HP_Size = HP_cost_data.iloc[0]['cap_min']

        max_HP_size = max(HP_cost_data['cap_max'].values)

        if HP_Size <= max_HP_size:

            HP_cost_data = HP_cost_data[
                (HP_cost_data['cap_min'] <= HP_Size) & (HP_cost_data['cap_max'] > HP_Size)]

            Inv_a = HP_cost_data.iloc[0]['a']
            Inv_b = HP_cost_data.iloc[0]['b']
            Inv_c = HP_cost_data.iloc[0]['c']
            Inv_d = HP_cost_data.iloc[0]['d']
            Inv_e = HP_cost_data.iloc[0]['e']
            Inv_IR = HP_cost_data.iloc[0]['IR_%']
            Inv_LT = HP_cost_data.iloc[0]['LT_yr']
            Inv_OM = HP_cost_data.iloc[0]['O&M_%'] / 100

            InvC = Inv_a + Inv_b * (HP_Size) ** Inv_c + (Inv_d + Inv_e * HP_Size) * log(HP_Size)

            Capex_a_HP_USD = calc_capex_annualized(InvC, Inv_IR, Inv_LT)
            Opex_fixed_HP_USD = InvC * Inv_OM
            Capex_HP_USD = InvC

        else:
            number_of_chillers = int(ceil(HP_Size / max_HP_size))
            Q_nom_each_chiller = HP_Size / number_of_chillers
            HP_cost_data = HP_cost_data[
                (HP_cost_data['cap_min'] <= Q_nom_each_chiller) & (HP_cost_data['cap_max'] > Q_nom_each_chiller)]

            for i in range(number_of_chillers):

                Inv_a = HP_cost_data.iloc[0]['a']
                Inv_b = HP_cost_data.iloc[0]['b']
                Inv_c = HP_cost_data.iloc[0]['c']
                Inv_d = HP_cost_data.iloc[0]['d']
                Inv_e = HP_cost_data.iloc[0]['e']
                Inv_IR = HP_cost_data.iloc[0]['IR_%']
                Inv_LT = HP_cost_data.iloc[0]['LT_yr']
                Inv_OM = HP_cost_data.iloc[0]['O&M_%'] / 100

                InvC = Inv_a + Inv_b * (Q_nom_each_chiller) ** Inv_c + (Inv_d + Inv_e * Q_nom_each_chiller) * log(Q_nom_each_chiller)

                Capex_a_HP_USD += calc_capex_annualized(InvC, Inv_IR, Inv_LT)
                Opex_fixed_HP_USD += InvC * Inv_OM
                Capex_HP_USD += InvC
    else:
        Capex_a_HP_USD = Opex_fixed_HP_USD = Capex_HP_USD = 0.0

    return Capex_a_HP_USD, Opex_fixed_HP_USD, Capex_HP_USD
def calculate_contributions(df, year_to_calculate):
    """
    Calculate the embodied energy/emissions for each building based on their construction year, and the area and
    renovation year of each building component.

    :param archetype: String that defines whether the 'EMBODIED_ENERGY' or 'EMBODIED_EMISSIONS' are being calculated.
    :type archetype: str
    :param df: DataFrame with joined data of all categories for each building, that is: occupancy, age, geometry,
        architecture, building component area, construction category and renovation category for each building component
    :type df: DataFrame
    :param locator: an InputLocator instance set to the scenario to work on
    :type locator: InputLocator
    :param year_to_calculate: year in which the calculation is done; since the embodied energy and emissions are
        calculated over 60 years, if the year of calculation is more than 60 years after construction, the results
        will be 0
    :type year_to_calculate: int
    :param total_column: label for the column with the total results (e.g., 'GEN_GJ')
    :type total_column: str
    :param specific_column: label for the column with the results per square meter (e.g., 'GEN_MJm2')
    :type specific_column: str

    :return result: DataFrame with the calculation results (i.e., the total and specific embodied energy or emisisons
        for each building)
    :rtype result: DataFrame
    """

    # calculate the embodied energy/emissions due to construction
    total_column = 'saver'
    ## calculate how many years before the calculation year the building was built in
    df['delta_year'] = year_to_calculate - df['YEAR']

    ## if it was built more than X years before, the embodied energy/emissions have been "paid off" and are set to 0
    df['confirm'] = df.apply(
        lambda x: calc_if_existing(x['delta_year'], SERVICE_LIFE_OF_BUILDINGS),
        axis=1)
    ## if it was built less than X years before, the contribution from each building component is calculated
    df[total_column] = (
        (df['capex_WALL'] *
         (df['area_walls_ext_ag'] + df['area_walls_ext_bg']) +
         df['capex_WIN'] * df['windows_ag'] +
         df['capex_FLOOR'] * df['floor_area_ag'] + df['capex_CONS'] *
         (df['floor_area_bg'] + df['floor_area_ag']) + df['capex_LEAK'] *
         (df['area_walls_ext_ag'] + df['area_walls_ext_bg']) +
         df['capex_hvacCS'] * df['floor_area_ag'] + df['capex_hvacHS'] *
         df['floor_area_ag'] + df['capex_hvacVENT'] * df['floor_area_ag'] +
         df['capex_BASE'] * df['floor_area_bg'] + df['capex_PART'] *
         (df['floor_area_ag'] + df['floor_area_bg']) *
         CONVERSION_AREA_TO_FLOOR_AREA_RATIO + df['capex_ROOF'] *
         df['footprint']) / SERVICE_LIFE_OF_TECHNICAL_SYSTEMS) * df['confirm']

    # df[total_column] += (((df['floor_area_ag'] + df['floor_area_bg']) * EMISSIONS_EMBODIED_TECHNICAL_SYSTEMS) / SERVICE_LIFE_OF_TECHNICAL_SYSTEMS) * df['confirm']

    # the total cost intensity
    df['capex_total_cost_m2'] = df[total_column] / df['GFA_m2']

    # the total and specific embodied energy/emissions are returned
    # result = df[['Name', 'GHG_sys_embodied_tonCO2', 'GHG_sys_embodied_kgCO2m2', 'GFA_m2']]

    df['capex_building_systems'] = df[total_column]
    df['opex_building_systems'] = df['capex_building_systems'] * (.05)
    df['capex_ann_building_systems'] = df.apply(
        lambda x: calc_capex_annualized(x['capex_building_systems'], 5, 30),
        axis=1)
    df['opex_ann_building_systems'] = df.apply(
        lambda x: calc_opex_annualized(x['opex_building_systems'], 5, 30),
        axis=1)
    df['TAC_building_systems'] = df['capex_ann_building_systems'] + df[
        'opex_ann_building_systems']

    return df