def calc_chp_process_energy(self, mfg_hw):

        chp_energy = End_use_eff.end_use_efficiency(mfg_hw).chp_eu

        chp_eff = End_use_eff.end_use_efficiency(mfg_hw).chp_efficiency

        chp_cty_list, cty_list_st, cty_list_gas, cty_list_both, cty_dict_st, cty_dict_gas, chp_st_dict, chp_gas_dict = End_use_eff.end_use_efficiency.chp_pm_frac(
        )

        #counties with only steam turbine chp
        chp_energy.loc[
            chp_energy['COUNTY_FIPS'].isin(cty_list_st['FIPS County']),
            'proc_MMBtu'] = chp_energy['hw_MMBtu'] * chp_eff[
                'Boiler/Steam Turbine']

        #counties with only gas turbine chp
        chp_energy.loc[
            chp_energy['COUNTY_FIPS'].isin(cty_list_gas['FIPS County']),
            'proc_MMBtu'] = chp_energy['hw_MMBtu'] * chp_eff['Gas Turbine']

        #counties with both
        chp_energy.loc[chp_energy['COUNTY_FIPS'].isin(cty_list_both['FIPS County']),
                    'proc_MMBtu'] = chp_energy.apply(lambda x: x['hw_MMBtu']*(
                    cty_dict_st.get(x['COUNTY_FIPS'],0)*chp_eff['Boiler/Steam Turbine'] + \
                    cty_dict_gas.get(x['COUNTY_FIPS'],0)*chp_eff['Gas Turbine']), axis=1)

        #counties with chp not mapped, so use naics subsector
        chp_energy.loc[~chp_energy['COUNTY_FIPS'].isin(chp_cty_list),'proc_MMBtu'] = chp_energy.apply(
            lambda x: x['hw_MMBtu']*(
            chp_st_dict[x['naics_sub']]*chp_eff['Boiler/Steam Turbine'] + \
            chp_gas_dict[x['naics_sub']]*chp_eff['Gas Turbine']), axis=1)

        return chp_energy
    def calc_boiler_process_energy(self, mfg_hw):

        boiler_energy = End_use_eff.end_use_efficiency(mfg_hw).boiler_eu
        boiler_eff = End_use_eff.end_use_efficiency(mfg_hw).boiler_efficiency

        boiler_energy.loc[:, 'proc_MMBtu'] = boiler_energy.apply(
            lambda x: boiler_eff[x['MECS_FT']] * x['hw_MMBtu'], axis=1)

        return boiler_energy
예제 #3
0
    def calc_ph_energy(self):

        ph_energy = End_use_eff.end_use_efficiency(self.mfg_energy).ph_eu
        ph_eff = End_use_eff.end_use_efficiency(self.mfg_energy).ph_efficiency

        #filter based on process temp < temp limit for PTC
        ph_energy.loc[ph_energy['Temp_C'] <= self.ptc_upper_temp,
                      'proc_MMBtu'] = ph_energy['MMBtu'] * ph_eff

        return ph_energy
예제 #4
0
    def calc_ph_energy(self):

        ph_energy = End_use_eff.end_use_efficiency(self.mfg_energy).ph_eu
        ph_eff = End_use_eff.end_use_efficiency(self.mfg_energy).ph_efficiency

        #calculating proc energy based on avg PH efficiency and fraction of heating in each industry
        # that can be replaced by resistance heating
        ph_energy.loc[:, 'res_MMBtu'] = ph_energy.apply(
            lambda x: x['MMBtu'] * self.ph_frac.get(x['naics'], 0), axis=1)

        ph_energy.loc[:, 'proc_MMBtu'] = ph_energy.apply(
            lambda x: x['res_MMBtu'] * ph_eff, axis=1)

        return ph_energy
예제 #5
0
    def calc_boiler_energy(self):

        boiler_energy = End_use_eff.end_use_efficiency(
            self.mfg_energy).boiler_eu
        boiler_eff = End_use_eff.end_use_efficiency(
            self.mfg_energy).boiler_efficiency

        #calculating proc energy based on boiler (fuel type) efficiency and inventory limit of boiler capacity

        boiler_energy.loc[:, 'res_MMBtu'] = boiler_energy.apply(
            lambda x: x['MMBtu'] * self.bchp_frac.get(x['naics'], 0), axis=1)

        boiler_energy.loc[:, 'proc_MMBtu'] = boiler_energy.apply(
            lambda x: boiler_eff[x['MECS_FT']] * x['res_MMBtu'], axis=1)

        return boiler_energy
예제 #6
0
    def calc_boiler_energy(self, csp_type):

        if (csp_type == 'PTC'):
            mfg_energy_df = self.mfg_energy.loc[
                self.mfg_energy['Temp_C'] <= self.ptc_upper_temp].copy()
        elif (csp_type == 'LF'):
            mfg_energy_df = self.mfg_energy.loc[
                self.mfg_energy['Temp_C'] <= self.LF_upper_temp].copy()

        boiler_energy = End_use_eff.end_use_efficiency(mfg_energy_df).boiler_eu
        boiler_eff = End_use_eff.end_use_efficiency(
            mfg_energy_df).boiler_efficiency

        #calculating proc energy based on boiler (fuel type) efficiency and inventory limit of boiler capacity
        boiler_energy.loc[:, 'proc_MMBtu'] = boiler_energy.apply(
            lambda x: boiler_eff[x['MECS_FT']] * x['MMBtu'], axis=1)

        return boiler_energy
예제 #7
0
    def calc_chp_energy(self, csp_type):

        if (csp_type == 'PTC'):
            mfg_energy_df = self.mfg_energy.loc[
                self.mfg_energy['Temp_C'] <= self.ptc_upper_temp].copy()
        elif (csp_type == 'LF'):
            mfg_energy_df = self.mfg_energy.loc[
                self.mfg_energy['Temp_C'] <= self.LF_upper_temp].copy()

        chp_energy = End_use_eff.end_use_efficiency(mfg_energy_df).chp_eu

        chp_eff = End_use_eff.end_use_efficiency(mfg_energy_df).chp_efficiency

        chp_cty_list, cty_list_st, cty_list_gas, cty_list_both, cty_dict_st, cty_dict_gas, chp_st_dict, chp_gas_dict = End_use_eff.end_use_efficiency.chp_pm_frac(
        )

        #counties with only steam turbine chp
        chp_energy.loc[
            chp_energy['COUNTY_FIPS'].isin(cty_list_st['FIPS County']),
            'proc_MMBtu'] = chp_energy['MMBtu'] * chp_eff[
                'Boiler/Steam Turbine']

        #counties with only gas turbine chp
        chp_energy.loc[
            chp_energy['COUNTY_FIPS'].isin(cty_list_gas['FIPS County']),
            'proc_MMBtu'] = chp_energy['MMBtu'] * chp_eff['Gas Turbine']

        #counties with both
        chp_energy.loc[chp_energy['COUNTY_FIPS'].isin(cty_list_both['FIPS County']),
                    'proc_MMBtu'] = chp_energy.apply(lambda x: x['MMBtu']*(
                    cty_dict_st.get(x['COUNTY_FIPS'],0)*chp_eff['Boiler/Steam Turbine'] + \
                    cty_dict_gas.get(x['COUNTY_FIPS'],0)*chp_eff['Gas Turbine']), axis=1)

        #counties with chp not mapped, so use naics subsector
        chp_energy.loc[~chp_energy['COUNTY_FIPS'].isin(chp_cty_list),'proc_MMBtu'] = chp_energy.apply(
            lambda x: x['MMBtu']*(
            chp_st_dict.get(x['naics_sub'],0)*chp_eff['Boiler/Steam Turbine'] + \
            chp_gas_dict.get(x['naics_sub'],0)*chp_eff['Gas Turbine']), axis=1)

        return chp_energy