-
Notifications
You must be signed in to change notification settings - Fork 122
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
Maintenance constraints (and for thermal generators) #556
Conversation
No effects on CapResMargin re: COMMIT status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. A couple of comments and requests:
- Please add documentation to the docs for the new inputs and also the added functionality.
- Do the maintenance constraints make sense when TDR is used?
- Confirming that all the units make sense when unit commitment is not integer?
- How does this play with operating reserves? In the current formulation, can a plant provide operating reserves when it is on maintenance?
src/model/resources/maintenance.jl
Outdated
@constraint(EP, [t in T], vMDOWN[t] == sum(vMSHUT[controlling_hours(t)])) | ||
|
||
# Plant frequire maintenance every (certain number of) year(s) | ||
@constraint(EP, sum(vMSHUT[t]*weights[t] for t in maintenance_begin_hours) >= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this work when you are only modeling one year?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe it's pointless to have weights
here.
In general
- maintenance only works when you are modeling one year
- if a plant requires maintenance every N years then 1/N of the plants require maintenance.
src/model/resources/maintenance.jl
Outdated
const MAINTENANCESHUTVARS = "MaintenanceShutVariables" | ||
const HASMAINT = "has_maiNTENANCE" | ||
|
||
function get_maintenance(df::DataFrame)::Vector{Int} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide more documentation for these functions.
No, and the code will throw an
Yes, that should be fine. We interface with vCOMMIT (which is always measured in 'number of plants') and eTotalCap (which is always measured in 'power' (i.e. MW)). It's only vCAP which is sometimes one and sometimes the other.
Operating reserves require Still need to do docs. Might to a separate User docs and Developer docs. |
Requesting a second review. Possible todos: [ ] Mathematical formulation (is there any interest for this?) Any suggestions for variable names in Please read over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor documentation suggestions otherwise looks good.
@@ -388,6 +389,11 @@ This file contains cost and performance parameters for various generators and ot | |||
|PWFU\_Fuel\_Usage\_Zero\_Load\_MMBTU\_per\_h|The fuel usage (MMBTU/h) for the first PWFU segemnt (y-intercept) at zero load.| | |||
|PWFU\_Heat\_Rate\_MMBTU\_per\_MWh\_*i| The slope of fuel usage function of the segment i.| | |||
|PWFU\_Load\_Point\_MW\_*i| The end of segment i (MW).| | |||
|**Maintenance data**| | |||
|MAINT|[0,1], toggles scheduled maintenance formulation.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggests saying "constraints" instead of "formulation"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to only call it "constraints" because it includes new variables as well.
docs/src/data_documentation.md
Outdated
|MAINT|[0,1], toggles scheduled maintenance formulation.| | ||
|Maintenance\_Duration| Duration of the maintenance period, in number of timesteps. Only used if `MAINT=1`.| | ||
|Maintenance\_Frequency\_Years| (Inverse) frequency of scheduled maintenance, in years. Only used if `MAINT=1`.| | ||
|Maintenance\_Begin\_Cadence| Cadence of timesteps in which scheduled maintenance can begin. Only used if `MAINT=1`.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me what this means. Suggest adding more explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you explain it below but would suggest having just a bit more explanation here so it can stand on its own.
docs/src/maintenance.md
Outdated
- More than a single maintenance period per year (i.e. every three months) is not possible in the current formulation. | ||
- Only full-year cases can be run; there must be only one "representative period". | ||
It would not make sense to model a *month*-long maintenance period when the year is modeled as a series of representative *weeks*, for example. | ||
- Multi-stage has not yet been tested (but please let us know what happens if you test it!). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is appropriate for documentation. Maybe we should ask someone to test this, at least just a quick sanity check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it and it seemed to work.
docs/src/maintenance.md
Outdated
- Multi-stage has not yet been tested (but please let us know what happens if you test it!). | ||
|
||
### Interaction with integer unit commitment | ||
If integer unit commitment is on (`UCommit=1`), this module may not produce sensible results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this paragraph could be worded more clearly. I understand what you're saying after reading it a few times but it's not super clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and for including all the comments. Looks great to me.
Maintenance_Frequency_Years to Maintenance_Cycle_Length_Years Frequencies have units of inverse-time. This is quantity with units of time. I have corrected the name.
Add an optional formulation for scheduled maintenance. Plants with this formulation active (so far, limited to thermal-commit plants, THERM=1) need to undergo a certain number of contiguous hours of maintenance every y >= 1 years. During this time they produce no power. This may be particularly useful in modeling fission plants, which need roughly 4 weeks of maintenance every 18 or 24 months. (Here, 18 would need to be rounded up to 24, as only maintenance cycles which are an integer number of years work with this formulation.)
Add an optional formulation for scheduled maintenance. Plants with this formulation active (so far, limited to thermal-commit plants, THERM=1) need to undergo a certain number of contiguous hours of maintenance every y >= 1 years. During this time they produce no power. This may be particularly useful in modeling fission plants, which need roughly 4 weeks of maintenance every 18 or 24 months. (Here, 18 would need to be rounded up to 24, as only maintenance cycles which are an integer number of years work with this formulation.)
This adds the ability to have maintenance constraints for arbitrary generators that have
I've implemented this in a very general way:
The maintenance variables are given custom names per-resource (with an optional suffix). This potentially allows for more than one component of a complex resource to have maintenance, on different schedules.
So far I've "implemented" maintenance variables for THERM generators only.
I plan to apply these to fusion core
This adds 4 optional columns to Generators_data.csv:
MAINT
,Maintenance_Duration
,Maintenance_Frequency_Years
andMaintenance_Begin_Cadence
.The first is either 0/1. The others are not read for a given resource unless it has MAINT=1.
The
MAINT
column as a whole is optional.This outputs a new file called
maint_down.csv
. This tracks the number of plants (in units of Cap_Size) which are under maintenance in each timestep.I have yet to write documentation for this module.
I'd appreciate any critiques on code style, inconsistent or annoying variable names, etc.
This should be applied before the general Fusion/Thermal+Storage module Thermal+storage (fusion, maintenance) #546 , which will be edited accordingly.