Skip to content

Conversation

@qluo0320github
Copy link
Collaborator

@qluo0320github qluo0320github commented Sep 19, 2024

Description

This module adds a new resource "Allam Cycle with Oxygen Storage" to GenX.
An allam cycle includes three components: sCO2 turbine, air separation unit, and liquid O2 storage. Each of them is subject to its own investment decisions and operational constraints.

What type of PR is this? (check all applicable)

  • Feature

Related Tickets & Documents

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and .md files under /docs/src have been updated if necessary.
  • The latest changes on the target branch have been incorporated, so that any conflicts are taken care of before merging. This can be accomplished either by merging in the target branch (e.g. 'git merge develop') or by rebasing on top of the target branch (e.g. 'git rebase develop'). Please do not hesitate to reach out to the GenX development team if you need help with this.
  • Code has been tested to ensure all functionality works as intended.
  • CHANGELOG.md has been updated (if this is a 'notable' change).
  • I consent to the release of this PR's code under the GNU General Public license.

How this can be tested

Using the new example case "three_zone_w_allam_cycle_lox"

Post-approval checklist for GenX core developers

After the PR is approved

  • Check that the latest changes on the target branch are incorporated, either via merge or rebase
  • Remember to squash and merge if incorporating into develop

Comment on lines 76 to 95
if setup["ParameterScale"] ==1
dfCapAllam.StartCap_sCO2turbine_MW_gross = dfCapAllam.StartCap_sCO2turbine_MW_gross* ModelScalingFactor
dfCapAllam.RetCap_sCO2turbine_MW_gross = dfCapAllam.RetCap_sCO2turbine_MW_gross * ModelScalingFactor
dfCapAllam.NewCap_sCO2turbine_MW_gross = dfCapAllam.NewCap_sCO2turbine_MW_gross * ModelScalingFactor
dfCapAllam.EndCap_sCO2turbine_MW_gross = dfCapAllam.EndCap_sCO2turbine_MW_gross * ModelScalingFactor

dfCapAllam.StartCap_ASU_MW_gross = dfCapAllam.StartCap_ASU_MW_gross* ModelScalingFactor
dfCapAllam.RetCap_ASU_MW_gross = dfCapAllam.RetCap_ASU_MW_gross * ModelScalingFactor
dfCapAllam.NewCap_ASU_MW_gross = dfCapAllam.NewCap_ASU_MW_gross * ModelScalingFactor
dfCapAllam.EndCap_ASU_MW_gross = dfCapAllam.EndCap_ASU_MW_gross * ModelScalingFactor

dfCapAllam.StartCap_LOX_t = dfCapAllam.StartCap_LOX_t * ModelScalingFactor
dfCapAllam.RetCap_LOX_t = dfCapAllam.RetCap_LOX_t * ModelScalingFactor
dfCapAllam.NewCap_LOX_t = dfCapAllam.NewCap_LOX_t * ModelScalingFactor
dfCapAllam.EndCap_LOX_t = dfCapAllam.EndCap_LOX_t * ModelScalingFactor
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using the scale_columns! function like you did in scale_allamcycle_data!.

Comment on lines 20 to 22
capAllam_sco2turbine = zeros(size(inputs["RESOURCE_NAMES"]))
capAllam_asu = zeros(size(inputs["RESOURCE_NAMES"]))
capAllam_lox = zeros(size(inputs["RESOURCE_NAMES"]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using G = inputs["G"] and then zeros(G) instead of size(inputs["RESOURCE_NAMES"]).

Comment on lines 131 to 139
[inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_sco2turbine_gross_power_mw";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_sco2turbine_commit";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_asu_gross_power_mw";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_asu_commit";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_net_power_output_mw";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_storage_lox_t";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_lox_in_t";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_lox_out_t";
inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] .*"_gox_t"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider assigning a variable name like allam_resources = inputs["RESOURCE_NAMES"][ALLAM_CYCLE_LOX] for brevity.

Comment on lines 142 to 140
@constraints(EP, begin
# cUpTimeInterior: Constraint looks back over last n hours, where n = allam_dict[y, "up_time"][i])
[t in setdiff(INTERIOR_SUBPERIODS,Up_Time_HOURS)], vCOMMIT_Allam[y,i,t] >= sum(vSTART_Allam[y,i,e] for e=(t-allam_dict[y, "up_time"][i]):t)

# cUpTimeWrap: If n is greater than the number of subperiods left in the period, constraint wraps around to first hour of time series
# cUpTimeWrap constraint equivalant to: sum(vSTART_Allam[y,e] for e=(t-((t%hours_per_subperiod)-1):t))+sum(vSTART_Allam[y,e] for e=(hours_per_subperiod_max-(allam_dict[y, "up_time"][i])-(t%hours_per_subperiod))):hours_per_subperiod_max)
[t in Up_Time_HOURS], vCOMMIT_Allam[y,i,t] >= sum(vSTART_Allam[y,i,e] for e=(t-((t%hours_per_subperiod)-1):t))+sum(vSTART_Allam[y,i,e] for e=((t+hours_per_subperiod-(t%hours_per_subperiod))-(allam_dict[y, "up_time"][i]-(t%hours_per_subperiod))):(t+hours_per_subperiod-(t%hours_per_subperiod)))

# cUpTimeStart:
# NOTE: Expression t+hours_per_subperiod-(t%hours_per_subperiod) is equivalant to "hours_per_subperiod_max"
[t in START_SUBPERIODS], vCOMMIT_Allam[y,i,t] >= vSTART_Allam[y,i,t]+sum(vSTART_Allam[y,i,e] for e=((t+hours_per_subperiod-1)-(allam_dict[y, "up_time"][i]-1)):(t+hours_per_subperiod-1))
end)

## down time
Down_Time = Int(floor(allam_dict[y, "down_time"][i]))
Down_Time_HOURS = [] # Set of hours in the summation term of the maximum down time constraint for the first subperiod of each representative period
for s in START_SUBPERIODS
Down_Time_HOURS = union(Down_Time_HOURS, (s+1):(s+Down_Time-1))
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here and elsewhere, consider using hoursbefore and hoursafter in order to simplify formulation of the constraints. It should be possible to write a single constraint over [t in 1:T].

Comment on lines 23 to 24
START_SUBPERIODS = inputs["START_SUBPERIODS"] #start
INTERIOR_SUBPERIODS = inputs["INTERIOR_SUBPERIODS"] #interiors
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two lines are not used in this function.

@lbonaldo lbonaldo added the enhancement New feature or request label Dec 3, 2024
@lbonaldo lbonaldo added this to the v0.4.3 milestone Dec 4, 2024
@lbonaldo lbonaldo force-pushed the allamcycle branch 4 times, most recently from 345eb8a to 27bed48 Compare January 24, 2025 23:08
Copy link
Collaborator

@lbonaldo lbonaldo left a comment

Choose a reason for hiding this comment

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

Thanks, @qluo0320github, for adding this new module and the documentation!

@lbonaldo lbonaldo merged commit f72c588 into develop Feb 9, 2025
@lbonaldo lbonaldo deleted the allamcycle branch February 9, 2025 22:14
sambuddhac pushed a commit to sambuddhac/GenX.jl that referenced this pull request Mar 5, 2025
* Add Allam Cycle with Liquid Oxygen Storage
* Add duration constraints on LOX of allam cycle
* Add policy-related constraints to allam cycle; add UC
* Add doc for Allam Cycle inputs
* Add test for Allam Cycle module

---------
Co-authored-by: Fangwei Cheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants