Renewables

This module has the functions used to compute available generation for wind and solar generators and potential energy for hydro generators.

Impacts of climate change on wind and solar generators was not simulated in this application. Wind and solar available generation is imported from NREL databases ([15][3]). Impacts of climate change on hydro generators was simulated only for existing generators, since we assumed that there would be no new hydro generators built in the southeast U.S.

Wind and Solar

wrapperwind(list_args)

wrapper function to read and process wind data in parallel

Parameters

list_args – a list with arguments for function getWindSiteCfs_2

Returns

list with: - 1d list with hourly CFs for wind site - 1d list with subhourly CFs for wind site - string with siteId - segment/block that this site is allocated - original capacity of site in Wind data base (MW) - capacity of site used for fleet computation (MW)

wrappersolar(site)

wrapper function to read and process solar data in parallel

Parameters

site – a list with arguments for function getSolarSiteCfs_2

Returns

list with: - 1d list with hourly CFs for wind site - 1d list with subhourly CFs for wind site - string with site file name - segment/block that this site is allocated - original capacity of site in solar data base (MW) - capacity of site used for fleet computation (MW)

getRenewableCFData(currZone, genparam, sizeSegment=1000, fleetCap=70, capacInCurrFleet=0, type='wind', existing=False, subHour=False)

Compile wind/solar potential data

This is the main function to compile wind/solar potential generation data for both existing and new solar/wind generators. It reads data from the databases and prepares a dataframe with hourly generation potential

Parameters
  • currZone – (string) name of ipm zone being simulated

  • genparam – object of type Generalparameters

  • sizeSegment – (int) size of segment (in MW)

  • fleetCap – (float) capacity in MW of each site

  • capacInCurrFleet – (float) existing total installed capacity in MW of wind or solar

  • type – (string) ‘wind’ or ‘solar’

  • existing – (boolean) If True process data for existing power plants. If False process data for new candidate plants

Returns

two data frame with hourly data and subhourly data

getPlantInfoInZone(metadata, cfCol, capacCol, siteNumberOrFileCol, fipsToZones, fipsToPolys, currZone, return_df=False)

Get all meta data of renewable sites in current zone

Match by zone

Parameters
  • metadata – 2-d list with metadata of solar or wind sites

  • cfCol – (int) index of column with CF data

  • capacCol – (int) index of column with capacity data (in MW)

  • siteNumberOrFileCol – (int) index of column with site ID

  • fipsToZones – (dict) dictionary mapping FIPS to zones

  • fipsToPolys – (dict) dictionary mapping FIPS to poly shapes

  • currZone – (string) ipm zone

  • return_df – if True return data frame as output with columns cfs, capacs, sitenumbers. If False returns tuple with three 1-d lists cfs, capacs, sitenumbers.

Returns

a data frame with three columns or a tuple with 3 lists: - CFs - capacs - sites IDs

getWindSiteCfs_2(windDir, siteId, siteCapac, desiredTz, windGenDataYr, subHour=False, listout=True)

Read wind data for a single site

optimized version of function getWindSiteCfs using pandas (75% faster)

Parameters
  • windDir – dir w/ wind data

  • siteId – site ID to get gen data for

  • siteCapac – wind site capac

  • desiredTz – desired timezone

  • windGenDataYr – year for wind gen data

  • subHour – if True reads sub hourly data

Returns

2 2d lists, both have first row = datetime. 1 2d list = hourly CFs, 2nd 2d list = subhourly CFs. Also row labels

getSolarSiteCfs_2(solarDir, siteFilename, datasetSiteCapac, siteTz, desiredTz, subHour=False, listout=True)

Read solar data for a single site

Optimized version of getSolarSiteCfs. This function uses Pandas in order to get more efficient processing

Parameters
  • solarDir

  • siteFilename

  • datasetSiteCapac

  • siteTz

  • desiredTz

  • listout – True if final result should be converted to list (same format as original function)

  • subHour – True if subhourly values should be returned

Returns

convert_pandas_to_list(df, header=None)

converts a pandas data frame to a list

To maintain compatibility with older functions, uses same dimension convention as the previous version. It does not follow the ordinary dimension convention of pd.tolist(). Each column in the data frame is a list (pd.tolist() transforms each row to a list).

Parameters
  • df – data frame

  • header – list of strings with header. If None, no header is added

trimNewRECFsToCEHours(zonalNewWindCFs, zonalNewSolarCFs, hoursForCE)

Trim hours of new renewable CFs to hours of CE simulation

Parameters
  • zonalNewWindCFs – hourly CFs for new wind & solar builds (1d lists)

  • zonalNewSolarCFs – hourly CFs for new wind & solar builds (1d lists)

  • hoursForCE – hours included in CE (1d list, 1-8760 basis)

Returns

zonal hourly CFs for new wind and solar builds only for CE hours as dict of zone: [CFs (1-8760 basis, 1d list)]

Hydro

getHydroEPotential(fleet, demandZonal, repAndSpeHoursDict, currYear, genparam, curtailparam)

Computes maximum hydro potential for each hydro generator

This function computes the maximum hydro potential for each hydro generator using PNNL data. Hydro potential is indexed by hydro unit and time block (special hours, summer, winter, …). This max hydro potential will be used as upper bound in hourly hydro generation by the GAMS model. Scales potential

July 2018: Currently we have only one hydro potential value per season. The objective is to decompose monthly potential to daily potential

Parameters
  • fleet – gen fleet

  • demandZonal – zonal demand (dict)

  • repAndSpeHoursDict – rep hrs per season or special block (dict of block:rep hrs, where seasons are labeled by name and special hours are ‘special’)

  • currYear – current year

  • genparam – object of class Generalparameters

  • curtailparam – object of class Curtailmentparameters

Returns

nested dict of {gcm:{season:{genSymbol:generation potential}}}

importHydroPotentialGen(currYear, genparam, gcm, format='new')

Returns hydro potential gen for current year in 2d list w/ col 1 = plant IDs

Read file with monthly hydro potential created by PNNL

Parameters
  • currYear – (integer)

  • genparam – object of class Generalparameters

  • gcm – (string) name of gcm model

  • format – (string) ‘new’ refers to the new hydro potential file format from october 2018

Returns

2d list w/ col 1 = plant IDs

getMonthsOfRepHrs(repHrs)

Function determines which months representative hours fall in, and outputs those months in a 1d list

Parameters

repHrs – 1d list of hours in a given season

Returns

1d list of months

getMonthlyDemand(demandZonal, months)

Computes total accumulated demand (in MWh) in given months

Parameters
  • demandZonal – 1d list of hourly demand

  • months – 1d list of months

Returns

dict of zone:total demand in those months

getRepHrsDemand(demandZonal, repHrs)

Computes total accumulated demand (in MWh) in given subset of representative hours

Parameters
  • demandZonal – 1d list of demand zonal (dict of zone:hourly demand),

  • repHrs – 1d list of rep hrs per season

Returns

dict of zone:total demand in those rep hrs

sumDemandInHours(demand, hours)

Get total demand in subset of hours

Parameters
  • demand – 1d list of demand (0-8759 idx)

  • hours – 1d list of hours (1-8760 idx).

Returns

sum of demand in those hours

getMonthsPotential(oris, hydroPotentials, months)

Gets total hydropower generation potential for month(s).

Parameters
  • oris – ORIS ID

  • hydroPotentials – hydro potential generation (2d list) for curr year

  • months – months of interest

Returns

total potential generation for month(s)

assignPotentialsToMissingUnits(unitsNoData, fleet, seasonDict, repHrs)

For ORIS units not in PNNL data, assign them potential for season based on average potential as CF of rest of fleet for that season. Modifies seasonDict to include other units

Parameters
  • unitsNoData – gen symbols (oris+unit ID) for units w/out data, ,

  • fleet – 2d list with gen fleet

  • seasonDict – dict of season:genSymbol:potential

  • repHrs – 1d list of rep hrs per season

getFleetAverageCF(genSymbols, capacs, seasonDict, repHrs)

Gets average fleet CF for rep hours in given season.

Parameters
  • genSymbols – 1d list of all hydro gen symbols

  • capacs – 1d list of all hydro capac,

  • seasonDict – dict of season:gensymbol:potential,

  • repHrs – rep hours (1d list)

Returns

average fleet CF in season

getListOfDaysInMonth(m)

Gets list with days of the year in given month m

Parameters

m – month (1-12 basis)

Returns

list of days of the year in given month (0-364 basis)

getDailyHydroPotentialsUC(fleetUC, hydroData, daysUC, ucYear)

Compiles dict with daily hydro potentials

Compiles dict with daily hydro potentials for individual hydro gens for UC run from list with monthly potentials

Parameters
  • fleetUC – 2d list with complete generator fleet

  • hydroData – 2d list with monthly hydro potentials for simulation year

  • daysUC – list with days of the year (1-365) that UC simulation will be performed

Returns

dict with {genID: hydro energy MWh}

compute_max_daily_hydro(fleet, currYear, genparam, gcm)

Converts monthly hydro capacity for each plant to daily hydro capacity

This conversion follows a simple linear rule with simulated water releases simulated by PNNL.

\[P^{MAX}_{day} = P_{month}^{PNNL}\frac{r_{day}^{PNNL}}{\sum_{day \in month} r_{day}^{PNNL}}\]
Parameters
  • fleet – (2d list) gen fleet

  • currYear – (int) current year

  • dataRoot – (string) folder with input data

Returns

dictionary with daily hydro capacity {gensymbol: 1d list of daily capacities}

importHydroDailyReleases(currYear, dataRoot, gcm)

Returns hydro daily releases for current year

Read file with daily hydro releases created by PNNL (Assumes format is the same as the monthly file)

Parameters
  • currYear – (integer) current year

  • dataRoot – (string) path to folder with input data

  • gcm – (string) name of climate model instance (GCM_RCP)

Returns

getReleasesForUnit(oris, daily_releases)

Gets total hydropower generation potential for month(s).

Parameters
  • oris – ORIS ID

  • daily_releases – hydro daily releases (2d list) for curr year

Returns

1d list with daily release for hydro unit in curr year (index of first year is 0)