Dynamic fuel switching #121 - #154
Conversation
t-kramer
left a comment
There was a problem hiding this comment.
Hi @urwahah, great work as always.
I added some minor comments/questions that should be pretty easy handle. Let me know if you have questions. When these are resolved, I'll go ahead with the merge and handle the merge conflicts.
| emissions_intensity_NG = gas_emissions_rate / merged[Col.BOILER_EFF.value] | ||
| NG_mode = ( | ||
| merged[Col.FUEL_SWITCHING.value].to_numpy() # only evaluate if fuel switching is true | ||
| & ( |
There was a problem hiding this comment.
For this block, I guess AWHP_COP_H can be 0 for hours when AWHP isn't operating? That would produce inf and inf > emissions_intensity_NG is True. Wouldn't that incorrectly trigger NG mode even when the AWHP wasn't running? Please double check, I don't know if I am right on this one. You could use AWHP_HHW_W > 0 is a condition.
There was a problem hiding this comment.
AWHP_COP is never 0, _capacity_constraints overrides the capacity to 0 for OATs outside the operating constraints, which prevents it from operating - but the COP is just interpolated once (_per_unit_heating_cop) and returns the min/max value when OAT is outside the curve. also even if COP were 0 and returned an infinite value, we would want the boiler to operate to serve the loads
| results.append(final_df) | ||
|
|
||
| total_emissions_kg = sum(r[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum() for r in results) | ||
| total_emissions_kg = final_df[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum() |
There was a problem hiding this comment.
Can you double-check that the change you made in this line is correct? I just want to make sure we don't sum up total_emissions_kg across all scenarios.
There was a problem hiding this comment.
yep - that's what it was doing before - final_df is the results from the scenario currently being processed, and is appended to results iteratively. this will still print total emissions across all equipment scenarios, but i don't think it's needed to print those separately for a quick check
| else 0 | ||
| ) | ||
| logger.debug(f"Phase 3 complete: Boiler covers {boiler_coverage:.1f}% of heating load") | ||
| df[Col.HHW_REM_W.value] -= boiler_served_W |
There was a problem hiding this comment.
This and previous version are mathematically equivalent only if the boiler always serves exactly the remaining load, which should be true, right? Can you check?
There was a problem hiding this comment.
yes, have spot checked some results and they are equivalent. the reason to change this is that my understanding is there should never be a scenario in which we reach this stage and the boiler doesn't serve exactly all the remaining HHW load. there is a logger warning in case both gas and electric resistance operate (line 904) - but that warning doesn't really do anything until we make this change because currently the remaining load is manually set to 0 before that phase.
For #121:
loads_to_sitedataframe:site_to_sourcesite_to_sourceHere is a link to the change request to update docs for this.
A few minor changes unrelated to the fuel switching: