Skip to content

Residual electricity mix#18

Merged
frankhanna94 merged 18 commits intodevelopmentfrom
rem
Dec 29, 2025
Merged

Residual electricity mix#18
frankhanna94 merged 18 commits intodevelopmentfrom
rem

Conversation

@dt-woods
Copy link

This pull request is to incorporate residual mix processes and product systems into the ElectricityLCI (NETL-RIC#276) using methods described in Davis et al. (2025).1 The proposed change adds five new configurable parameters:

Name Type Description
add_residual_mix bool Whether to include residual electricity mix processes in JSON-LD.
output_residual_mix bool Whether to save the residual mix data as CSV in output folder.
add_rem_product_systems bool Whether to create "at user; residual consumption mix" product systems.
rem_weight_method str The state-to-balancing authority weighting method (e.g., by facility 'count').
neg_rem_method str The method to deal with negative renewable electricity generation (e.g., if REC sales in a BA are greater than renewable electricity generation); choose either to 'zero' excess or 'keep' excess and attempt to subtract if vague fuel categories (e.g., MIXED or OTHER) exist.

and six new global parameters introduced to globals.py:

Name Type Description
GREEN_E list Green or renewable energy categories for residual mixes.
OVERFLOW_E list Non-green fuels that can lend overflow electricity for res. mixes.
REM_WEIGHT_METHODS list State-level REC sales to Balancing authority weighting methods.
NEG_REM_METHODS list Accounting methods for negative renewable generation for REM.
NREL_REC_YEAR int See https://www.nrel.gov/analysis/renewable-power for pub years.
NREL_REC_URL str NREL voluntary renewable power procurement data sheet URL.

See __doc__ string in new residual_grid_mix.py module for explanation of the residual grid mix method. Only one weighting method is employed (i.e., the facility 'county' method). The add_residual_mixes method is added to the run_post_processes method in __init__.py, which only triggers new residual process creation if configured within the YAML. Residual processes take advantage of the existing _process method in olca_jsonld_write.py and are assigned UUIDs based on the new process name (see _make_residual_process_name). Two additional helper functions (i.e., _make_rem_gen_process and _make_rem_con_process) support the creation of "Electricity; at grid; residual generation mix", "Electricity; at grid; residual consumption mix", and "Electricity; at user; consumption mix" processes for each region.

If the user selects "add_rem_product_system" in the YAML, the "at user; residual consumption mix" processes are converted to product systems using the default providers.

If the user selects, "output_residual_mix", a CSV file is located in the electricitylci/output data store to show the original fuel-based generation (in MWh) and ratio along with the new non-REC generation and ratio.

This method was successfully tested on "ELCI_2023" configuration, producing residual processes and product systems on macOS 14 using Python 3.12 and developer version of fedelemflowlist (from KeyLogicLCA's forked repository), esupy (0.4.2), and StEWI (1.2.0).

Footnotes

  1. Tyler W. Davis, Matthew Jamieson, Becca Rosen, Joseph Chou, elci_to_rem, 1/21/2025, https://edx.netl.doe.gov/dataset/elci_to_rem, DOI: 10.18141/2503966.

New global parameters for NREL REC URL, GREEN energy and OVERFLOW energy fuel categories.\nNew utility functions to find the header row based on keyword search in an Excel workbook, get Balancing authority map (dict version of read ba codes), map a data frame BA names to codes, and to download NREL REC voluntary renewable sales workbook. Updated writing to CSV in outputs directory with new option to compress to zip.\nNew module for residual grid mix calculation (dataframe creation only).
New global parameters for tracking REM configuration settings; only updated YAML files for 2022-2024; should also update 2016 through 2021
The main effort here is the helper, _make_rem_mix_process, which is based on residual_grid_mix module in olca-tools repo. Notable updates to _process helper and its dependencies to make this work with pre-formatted dictionaries and ISO time stamps.
new subroutine for making residual consumption mix processes. The logic is to create all consumption mix processes, mapping the original process UUIDs to new residual UUIDs, then loop over exchanges to update default providers of all residual consumption processes. Development testing ran successfully; need to test new standalone methods. Consider putting default provider updating into its own helper function.
see SANDBOX for example test, which uses a previously run ELCI_2023 JSON-LD to test.
output residual mix parameter handles the CSV creation of BA-level residual mixes and saves to outputs folder. add_rem_product_systems parameter triggers the creation of Electricity; at user; residual consumption mix processes to become product systems (in addition to the non-residual mix processes).
@dt-woods dt-woods added the enhancement New feature or request label Dec 23, 2025
Copy link

@frankhanna94 frankhanna94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a minor change in model_config.py for error handling if 'output_residual_mix' = True but 'add_residual_mix' = False

@frankhanna94 frankhanna94 merged commit 143b0db into development Dec 29, 2025
@frankhanna94 frankhanna94 deleted the rem branch January 8, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants