Skip to content

Commit

Permalink
Merge pull request #6 from IdahoLabResearch/HP_dev_1.2
Browse files Browse the repository at this point in the history
Update hydropower_potential.py to fix an error in revenue calculation
  • Loading branch information
jgallegocalderon authored Jul 3, 2024
2 parents 25849ae + 7b53ef5 commit b1ad693
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions HydroGenerate/hydropower_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,21 +397,20 @@ def revenue_calculation(self, hp_params):

mean_power = np.mean(hp_params.power) # mean of the power provided for a time series of flow

if hp_params.n_operation_days is None:
hp_params.n_operation_days = 365

if hp_params.capacity_factor:
annual_energy = hp_params.capacity_factor * mean_power * 365 # annual energy generated, killowatt day
hp_params.n_operation_days = hp_params.capacity_factor * 365 # update

elif hp_params.n_operation_days:
else:
if hp_params.n_operation_days > 365:
raise ValueError('The number of days in a year a plant operates cannot exceed 365')

annual_energy = hp_params.n_operation_days * mean_power / 365 # annual energy generatedkillowatt day
annual_energy = hp_params.n_operation_days * mean_power # annual energy generatedkillowatt day
hp_params.capacity_factor = hp_params.n_operation_days * 100/ 365 # update

else:
raise ValueError('The number of days a plant operates, or the capacity factor, are needed' \
' to compute annual energy generated and revenue')

if hp_params.electricity_sell_price is None:
hp_params.electricity_sell_price = 0.01110 # average retail U.S. electricity price in 2021. https://www.eia.gov/electricity/state/

Expand Down

0 comments on commit b1ad693

Please sign in to comment.