Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydro_res.jl treats Eff_Down inconsistently. #483

Open
AshwinSandeep1 opened this issue Jun 17, 2023 · 3 comments
Open

hydro_res.jl treats Eff_Down inconsistently. #483

AshwinSandeep1 opened this issue Jun 17, 2023 · 3 comments
Milestone

Comments

@AshwinSandeep1
Copy link

I think RHS should be multiplied by Eff_Down

@cfe316
Copy link
Collaborator

cfe316 commented Jun 17, 2023

Hi Ashwin,

Thank you for your careful reading of the code! It would be great if you could explain why Eff_Down is needed here. It would also be very helpful to provide a 'minimal working example' or even an example time series that shows why this is needed or gives an example of erroneous output without this. As a general principal it's also helpful to quote the surrounding code, so that readers can get some context. You can use Github Markdown to insert code blocks.

	### Constraints commmon to all reservoir hydro (y in set HYDRO_RES) ###
	@constraints(EP, begin
	### NOTE: time coupling constraints in this block do not apply to first hour in each sample period;
		# Energy stored in reservoir at end of each other hour is equal to energy at end of prior hour less generation and spill and + inflows in the current hour
		# The ["pP_Max"][y,t] term here refers to inflows as a fraction of peak discharge power capacity.
		# DEV NOTE: Last inputs["pP_Max"][y,t] term above is inflows; currently part of capacity factors inputs in Generators_variability.csv but should be moved to its own Hydro_inflows.csv input in future.

		# Constraints for reservoir hydro
		cHydroReservoir[y in HYDRO_RES, t in 1:T], EP[:vS_HYDRO][y,t] == (EP[:vS_HYDRO][y, hoursbefore(p,t,1)]
				- (1/dfGen[y,:Eff_Down]*EP[:vP][y,t]) - vSPILL[y,t] + inputs["pP_Max"][y,t]*EP[:eTotalCap][y])

		# Maximum ramp up and down
        cRampUp[y in HYDRO_RES, t in 1:T], EP[:vP][y,t] + regulation_term[y,t] + reserves_term[y,t] - EP[:vP][y, hoursbefore(p,t,1)] <= dfGen[y,:Ramp_Up_Percentage]*EP[:eTotalCap][y]
        cRampDown[y in HYDRO_RES, t in 1:T], EP[:vP][y, hoursbefore(p,t,1)] - EP[:vP][y,t] - regulation_term[y,t] + reserves_term[y, hoursbefore(p,t,1)] <= dfGen[y,:Ramp_Dn_Percentage]*EP[:eTotalCap][y]
		# Minimum streamflow running requirements (power generation and spills must be >= min value) in all hours
		cHydroMinFlow[y in HYDRO_RES, t in 1:T], EP[:vP][y,t] + EP[:vSPILL][y,t] >= dfGen[y,:Min_Power]*EP[:eTotalCap][y]
		# DEV NOTE: When creating new hydro inputs, should rename Min_Power with Min_flow or similar for clarity since this includes spilled water as well

		# Maximum discharging rate must be less than power rating OR available stored energy at start of hour, whichever is less
		# DEV NOTE: We do not currently account for hydro power plant outages - leave it for later to figure out if we should.
		# DEV NOTE (CONTD): If we defin pPMax as hourly availability of the plant and define inflows as a separate parameter, then notation will be consistent with its use for other resources
		cHydroMaxPower[y in HYDRO_RES, t in 1:T], EP[:vP][y,t] <= EP[:eTotalCap][y]
		cHydroMaxOutflow[y in HYDRO_RES, t in 1:T], EP[:vP][y,t] <= EP[:vS_HYDRO][y, hoursbefore(p,t,1)]
	end)

I think you have a point regarding the need for Eff_Down here in the cHydroMaxOutflow constraint for consistency with the cHydroReservoir constraint. Should it also be in cHydroMinFlow for consistency?

@AshwinSandeep1
Copy link
Author

Hi Jacob

Thank you for your response.

  1. Adding Eff_Down to cHydroMaxOutFlow makes it consistent with cHydroReservoir as you suggested. It also makes it consistent with the analogous constraint defined for storage technologies (Line 93 in storage_all.jl).
  2. Eff_Down is not needed for cHydroMinFlow since (as the way I understand it), efficiencies need to be included only when referencing energies to convert the actual energy produced by the resource to the energy received by the grid.

@cfe316 cfe316 added this to the v0.4 milestone Dec 11, 2023
@cfe316
Copy link
Collaborator

cfe316 commented Dec 11, 2023

Ok. These values vP, vS_HYDRO, and vSPILL need to be made consistent.

@cfe316 cfe316 changed the title hydro_res.jl (Line 132) hydro_res.jl treats Eff_Down inconsistently. Dec 11, 2023
@lbonaldo lbonaldo modified the milestones: v0.4, v0.4.2 Aug 20, 2024
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

No branches or pull requests

3 participants