Reorganize emissions info #121 - #136
Conversation
| results.append(df) | ||
|
|
||
| total_emissions_kg = sum(r[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum() for r in results) | ||
| total_emissions_kg = df[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum() |
There was a problem hiding this comment.
unrelated but i changed this because it was doing a cumulative sum of all emissions scenarios which didn't seem helpful to me. now it outputs the total emissions for each scenario - still summed up for all equipment scenarios, but better for a high level check i suppose
|
@urwahah Thanks for putting in all this work. One thing I wanted to flag before this gets built on: the nested loop means site_energy.pkl grows from N_equipment × 8760 rows to N_equipment × N_emissions × 8760. So with 3 equipment × 3 emission scenarios that's already 9× more data and 9× more simulation runs, right? And it would be more with additional scenarios. So please remind me: What was the reason we need the emissions data in the loop? Since sizing in the current code is driven purely by peak thermal loads (e.g. df["hhw_W"].max()), is the plan for fuel switching to affect sizing at all, or will it be a purely operational decision (i.e. which fuel to use at each hour)? If it's the latter, the fuel-switching logic could potentially stay in site_to_source() and avoid the data explosion entirely. We could just add some extra input columns (e.g. "potential gas" and "potential electric" per hour). Equipment simulation stays at N_equipment runs. I might not be thinking this through properly here, so feel to explain again. Maybe even if we need the loop, there's an alternative way to reduce the "data explosion". |
|
the nested loop is definitely the issue with this change. i like the idea that we could avoid the extra runs by passing new 'potential' gas and electricity input columns to however, thinking ahead to load shifting, this will come up again if we want to include AWHP sizing strategies that are dependent on peak day emissions. we should discuss |
Fuel switching (and maybe load shifting later on) requires the grid emissions data to be available for loads to site energy calculations. This is a fairly significant revision to the architecture of
energy.pyso it would be better to review and implement this before I start changing the calculations :-)To summarize the changes:
Currently:
run_loads_to_sitecallsloads_to_site_energy, which iterates through the equipment scenarios, and saves the site energy results as a temporary filerun_site_to_sourcepasses those results tosite_to_source, which iterates through the emissions scenarios for final source emissionsProposed:
run_loads_to_sitecallsloads_to_site_energya.
loads_to_site_energycallsgrid_emissions, which iterates through the emissions scenarios to return a dataframe containing grid emissions datab.
loads_to_site_energyiterates over both emissions and equipment scenarios (nested) to calculate site energyrun_site_to_sourcepasses the site energy results file (same as before) tosite_to_source, which iterates through the emissions scenarios for final source emissions