示例#1
0
    def cost_breakdown(self):
        """Calculate costs breakdown for the solar power plant"""
        eng_t = self.mat.abscissa('E_elec', valuesOnly=True)  # Time [s]
        eng_v = self.mat.data('E_elec')  # Cumulative electricity generated [J]
        disc_v = self.mat.data('r_disc')  # Discount rate [-]
        life_v = self.mat.data('t_life')  # Plant lifetime [year]

        C_field_v = self.mat.data('C_field')  # Solar field capital cost [$]
        C_tower_v = self.mat.data('C_tower')  # Tower capital cost [$]
        C_receiver_v = self.mat.data('C_receiver')  # Receiver capital cost [$]
        C_storage_v = self.mat.data(
            'C_storage')  # Storage tanks capital cost [$]
        C_block_v = self.mat.data('C_block')  # Power block capital cost [$]
        C_bop_v = self.mat.data('C_bop')  # Balance of plant cost [$]
        C_land_v = self.mat.data('C_land')  # Land cos [$]

        C_cap_v = self.mat.data('C_cap')  # Capital costs [$]

        om_y_v = self.mat.data('C_year')  # Fixed O&M costs per year [$/year]
        om_p_v = self.mat.data(
            'C_prod')  # Variable O&M costs per production per year [$/J/year]

        dur = eng_t[-1] - eng_t[0]  # Time duration [s]
        epy = fin.energy_per_year(dur,
                                  eng_v[-1])  # Energy expected in a year [J]

        C_cap = C_cap_v[0] * 1e-3  # Total capital investment (TCI) [k$]
        C_cap_ann = fin.annualised_capital_cost(C_cap, disc_v[0], int(
            life_v[0]))  # Annualised TCI [k$/year]
        C_year = (om_y_v[0] +
                  om_p_v[0] * epy) * 1e-3  # Total operational costs [k$/year]

        C_cap_bd_n = [
            'Solar field', 'Tower', 'Receiver', 'Storage', 'PB', 'BOP', 'Land'
        ]  # Capital cost components name
        C_cap_bd_u = 'k$'  # Capital cost components unit
        C_cap_bd_v = [
            C_field_v[0] * 1e-3, C_tower_v[0] * 1e-3, C_receiver_v[0] * 1e-3,
            C_storage_v[0] * 1e-3, C_block_v[0] * 1e-3, C_bop_v[0] * 1e-3,
            C_land_v[0] * 1e-3
        ]  # Capital cost breakdown [k$]

        C_op_bd_n = ['Fixed O&M',
                     'variable O&M']  # Operational cost components name
        C_op_bd_u = 'k$/year'  # Operational cost components unit
        C_op_bd_v = [om_y_v[0] * 1e-3, om_p_v[0] * epy * 1e-3
                     ]  # Operational cost breakdown [k$/year]

        C_ann_bd_n = ['Total capital investment',
                      'Operational']  # Annualised cost breakdown names
        C_ann_bd_u = 'k$/year'  # Annualised cost breakdown unit
        C_ann_bd_v = [C_cap_ann, C_year]  # Annualised cost breakdown [k$/year]

        return C_cap_bd_n, C_cap_bd_u, C_cap_bd_v, C_op_bd_n, C_op_bd_u, C_op_bd_v, C_ann_bd_n, C_ann_bd_u, C_ann_bd_v
示例#2
0
    def calc_perf(self):
        """Calculate plant performance.

		Some of the metrics will be returned as none if simulation runtime is
		not a multiple of a year.
		"""
        eng_t = self.mat.abscissa('E_elec', valuesOnly=True)
        eng_v = self.mat.data('E_elec')  # cumulative electricity generated
        cap_v = self.mat.data('C_cap')  # capital costs
        om_y_v = self.mat.data('C_year')  # O&M costs per year
        om_p_v = self.mat.data('C_prod')  # O&M costs per production per year
        disc_v = self.mat.data('r_disc')  # discount factor
        life_v = self.mat.data('t_life')  # plant lifetime
        cons_v = self.mat.data('t_cons')  # construction time
        name_v = self.mat.data('P_name')  # generator nameplate
        rev_v = self.mat.data('R_spot')  # cumulative revenue

        dur = eng_t[-1] - eng_t[0]
        years = dur / 31536000
        # Only provide certain metrics if runtime is a multiple of a year
        close_to_year = years > 0.5 and abs(years - round(years)) <= 0.01

        epy = fin.energy_per_year(dur, eng_v[-1])  # energy expected in a year
        srev = rev_v[-1]  # spot market revenue
        lcoe = None  # levelised cost of electricity
        capf = None  # capacity factor
        if close_to_year:
            lcoe = fin.lcoe(cap_v[0], om_y_v[0] + om_p_v[0] * epy, disc_v[0],
                            int(life_v[0]), int(cons_v[0]), epy)
            capf = fin.capacity_factor(name_v[0], epy)

        # Convert to useful units
        epy = epy / (1e6 * 3600)  # convert from J/year to MWh/year
        if close_to_year:
            lcoe = lcoe * 1e6 * 3600  # convert from $/J to $/MWh
            capf = 100 * capf

        return [
            epy,
            lcoe,
            capf,
            srev,
        ]
示例#3
0
	def calc_perf(self):
		"""Calculate the solar power plant performance.
		Some of the metrics will be returned as none if simulation runtime is
		not a multiple of a year.
		"""
		var_names = self.get_names()
		assert('E_elec' in var_names), "For a levelised cost of electricity calculation, It is expected to see E_elec variable in the results file!"

		eng_t = self.mat.abscissa('E_elec', valuesOnly=True) # Time [s]
		eng_v = self.mat.data('E_elec') # Cumulative electricity generated [J]
		cap_v = self.mat.data('C_cap') # Capital costs [$]
		om_y_v = self.mat.data('C_year') # O&M costs per year [$/year]
		om_p_v = self.mat.data('C_prod') # O&M costs per production per year [$/J/year]
		disc_v = self.mat.data('r_disc') # Discount rate [-]
		life_v = self.mat.data('t_life') # Plant lifetime [year]
		cons_v = self.mat.data('t_cons') # Construction time [year]
		name_v = self.mat.data('P_name') # Generator nameplate [W]
		rev_v = self.mat.data('R_spot') # Cumulative revenue [$]

		dur = eng_t[-1] - eng_t[0] # Time duration [s]
		years = dur/31536000 # number of years of simulation [year]
		# Only provide certain metrics if runtime is a multiple of a year
		close_to_year = years > 0.5 and abs(years - round(years)) <= 0.01

		epy = fin.energy_per_year(dur, eng_v[-1]) # Energy expected in a year [J]
		srev = rev_v[-1] # spot market revenue [$]
		lcoe = None # Levelised cost of electricity
		capf = None # Capacity factor
		if close_to_year: 
			lcoe = fin.lcoe_r(cap_v[0], om_y_v[0] + om_p_v[0]*epy, disc_v[0],
					int(life_v[0]), int(cons_v[0]), epy)
			capf = fin.capacity_factor(name_v[0], epy)

		# Convert to useful units
		epy = epy/(1e6*3600) # Convert from J/year to MWh/year
		if close_to_year: 
			lcoe = lcoe*1e6*3600 # Convert from $/J to $/MWh
			capf = 100*capf

		return [epy, lcoe, capf, srev,]
示例#4
0
    def calc_perf(self):
        """Calculate plant performance.

		Some of the metrics will be returned as none if simulation runtime is
		not a multiple of a year.
		"""
        eng_t = self.mat.abscissa("E_elec", valuesOnly=True)
        eng_v = self.mat.data("E_elec")  # cumulative electricity generated
        cap_v = self.mat.data("C_cap")  # capital costs
        om_y_v = self.mat.data("C_year")  # O&M costs per year
        om_p_v = self.mat.data("C_prod")  # O&M costs per production per year
        disc_v = self.mat.data("r_disc")  # discount factor
        life_v = self.mat.data("t_life")  # plant lifetime
        cons_v = self.mat.data("t_cons")  # construction time
        name_v = self.mat.data("P_name")  # generator nameplate
        rev_v = self.mat.data("R_spot")  # cumulative revenue

        dur = eng_t[-1] - eng_t[0]
        years = dur / 31536000
        # Only provide certain metrics if runtime is a multiple of a year
        close_to_year = years > 0.5 and abs(years - round(years)) <= 0.01

        epy = fin.energy_per_year(dur, eng_v[-1])  # energy expected in a year
        srev = rev_v[-1]  # spot market revenue
        lcoe = None  # levelised cost of electricity
        capf = None  # capacity factor
        if close_to_year:
            lcoe = fin.lcoe(cap_v[0], om_y_v[0] + om_p_v[0] * epy, disc_v[0], int(life_v[0]), int(cons_v[0]), epy)
            capf = fin.capacity_factor(name_v[0], epy)

            # Convert to useful units
        epy = epy / (1e6 * 3600)  # convert from J/year to MWh/year
        if close_to_year:
            lcoe = lcoe * 1e6 * 3600  # convert from $/J to $/MWh
            capf = 100 * capf

        return [epy, lcoe, capf, srev]
示例#5
0
    def calc_perf(self, peaker=False):
        """Calculate the solar power plant performance.
		Some of the metrics will be returned as none if simulation runtime is
		not a multiple of a year.

		peaker: bool, True: to calculate performance of a peaker plant
		"""
        var_names = self.get_names()
        assert (
            'E_elec' in var_names
        ), "For a levelised cost of electricity calculation, It is expected to see E_elec variable in the results file!"

        eng_t = self.mat.abscissa('E_elec', valuesOnly=True)  # Time [s]
        eng_v = self.mat.data('E_elec')  # Cumulative electricity generated [J]
        cap_v = self.mat.data('C_cap')  # Capital costs [$]
        om_y_v = self.mat.data('C_year')  # O&M costs per year [$/year]
        om_p_v = self.mat.data(
            'C_prod')  # O&M costs per production per year [$/J/year]
        disc_v = self.mat.data('r_disc')  # Discount rate [-]
        life_v = self.mat.data('t_life')  # Plant lifetime [year]
        cons_v = self.mat.data('t_cons')  # Construction time [year]
        name_v = self.mat.data('P_name')  # Generator nameplate [W]
        rev_v = self.mat.data('R_spot')  # Cumulative revenue [$]

        dur = eng_t[-1] - eng_t[0]  # Time duration [s]
        years = dur / 31536000  # number of years of simulation [year]
        # Only provide certain metrics if runtime is a multiple of a year
        close_to_year = years > 0.5 and abs(years - round(years)) <= 0.01

        epy = fin.energy_per_year(dur,
                                  eng_v[-1])  # Energy expected in a year [J]
        srev = rev_v[-1]  # spot market revenue [$]
        lcoe = None  # Levelised cost of electricity
        capf = None  # Capacity factor
        if close_to_year:
            if peaker:
                tod_v = self.mat.data('TOD_W')
                tod_factor = tod_v[-1] / eng_v[-1]
                lcoe = fin.lcoe_p(cap_v[0],
                                  om_y_v[0] + om_p_v[0] * epy, disc_v[0],
                                  int(life_v[0]), int(cons_v[0]), epy,
                                  tod_factor)
                capf = fin.capacity_factor(name_v[0], tod_v[-1])

            else:
                lcoe = fin.lcoe_r(cap_v[0],
                                  om_y_v[0] + om_p_v[0] * epy, disc_v[0],
                                  int(life_v[0]), int(cons_v[0]), epy)
                capf = fin.capacity_factor(name_v[0], epy)

        # Convert to useful units
        epy = epy / (1e6 * 3600)  # Convert from J/year to MWh/year
        if close_to_year:
            lcoe = lcoe * 1e6 * 3600  # Convert from $/J to $/MWh
            capf = 100 * capf
        '''
		#dump param
		SM = self.mat.data('SM')[0]
		H_tower = self.mat.data("H_tower")[0]
		t_storage = self.mat.data("t_storage")[0]
		fb = self.mat.data("fb")[0]
		R1 = self.mat.data("R1")[0]
		
		if peaker:
			fn = "/home/philgun/Documents/PhD/report/dispatch-optimisation-report/new-run-for-epri/withglpk/result.csv"
			import os
			if not os.path.exists(fn):
				f = open(fn,'w')
				f.write("SM,H_tower,t_storage,fb,R1,lcoe_peaker,capf_peaker,t_bar,TOD_W\n")
				f.close()
				
			f = open(fn,"a")
			f.write("%s,%s,%s,%s,%s,%s,%s,%s,%s\n"%(SM,H_tower,t_storage,fb,R1,lcoe,capf,tod_factor,tod_v[-1]))
			f.close()
		'''
        return [
            epy,
            lcoe,
            capf,
            srev,
        ]