Skip to content

Conversation

softwareengineerprogrammer
Copy link
Owner

@softwareengineerprogrammer softwareengineerprogrammer commented Mar 4, 2025

Fix issue with revenue profile electricity annual revenue being erroneously replaced with total revenue (NREL#342)

Demonstration of fix for Fervo_Project_Cape-3:

image

Comment on lines +2807 to +2819
self.TotalRevenue.value = self.ElecRevenue.value.copy()
#self.TotalCummRevenue.value = self.ElecCummRevenue.value
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER]:
self.HeatRevenue.value, self.HeatCummRevenue.value = CalculateRevenue(
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
model.surfaceplant.HeatkWhProduced.value, self.HeatPrice.value)
self.TotalRevenue.value = self.HeatRevenue.value
self.TotalRevenue.value = self.HeatRevenue.value.copy()
#self.TotalCummRevenue.value = self.HeatCummRevenue.value
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value in [PlantType.ABSORPTION_CHILLER]:
self.CoolingRevenue.value, self.CoolingCummRevenue.value = CalculateRevenue(
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
model.surfaceplant.cooling_kWh_Produced.value, self.CoolingPrice.value)
self.TotalRevenue.value = self.CoolingRevenue.value
self.TotalRevenue.value = self.CoolingRevenue.value.copy()
Copy link
Owner Author

Choose a reason for hiding this comment

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

Adding .copy() here prevents subsequent changes to self.TotalRevenue from affecting self.{Elec|Heat|Cooling}Revenue because self.TotalRevenue is now a copy of the values instead of a reference to the same object.

Comment on lines +177 to +178
1 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 -28.12 -28.12
2 15.00 2.70 2.70 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 0.76 1.94 -26.18
Copy link
Owner Author

Choose a reason for hiding this comment

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

Example file diffs should only change electricity annual revenue column, which I manually verified in full for Fervo Cape Station 3 example and sanity-eyeball-checked for other results.

@softwareengineerprogrammer softwareengineerprogrammer merged commit d3920bc into ccus-profile-fix Mar 5, 2025
36 checks passed
@softwareengineerprogrammer softwareengineerprogrammer deleted the electricity-revenue-profile-revenue-fix branch May 1, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant