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

Add new resource type: CCS with solvent storage #795

Open
wants to merge 17 commits into
base: solvent-storage
Choose a base branch
from

Conversation

qluo0320github
Copy link
Collaborator

@qluo0320github qluo0320github commented Nov 22, 2024

Description

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

  • Feature
  • Bug Fix
  • Documentation Update
  • Code Refactor
  • Performance Improvements

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

An example case "11_three_zones_CCS_solvent_storage" is used in test.

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

end
if !isempty(DC_DISCHARGE)


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

(value.(EP[:vP_AC_DISCHARGE][AC_DISCHARGE,:]).data * inputs["omega"])
end
end


[JuliaFormatter] reported by reviewdog 🐶

MIN_CAP_GEN_SOLAR = ids_with_policy(gen_VRE_STOR, min_cap_solar, tag = mincap)


[JuliaFormatter] reported by reviewdog 🐶

MIN_CAP_GEN_ASYM_DC_DIS = intersect(inputs["VS_ASYM_DC_DISCHARGE"], HAS_MIN_CAP_STOR)
MIN_CAP_GEN_ASYM_AC_DIS = intersect(inputs["VS_ASYM_AC_DISCHARGE"], HAS_MIN_CAP_STOR)


[JuliaFormatter] reported by reviewdog 🐶

etainverter.(gen[MIN_CAP_GEN_SOLAR]) *
(dual.(EP[:cZoneMinCapReq][mincap])))


[JuliaFormatter] reported by reviewdog 🐶

dfRegSubRevenue.SubsidyRevenue[MIN_CAP_GEN_WIND] .+= ((value.(EP[:eTotalCap_WIND][MIN_CAP_GEN_WIND]).data) *


[JuliaFormatter] reported by reviewdog 🐶

dfRegSubRevenue.SubsidyRevenue[MIN_CAP_GEN_ASYM_DC_DIS] .+= ((value.(EP[:eTotalCapDischarge_DC][MIN_CAP_GEN_ASYM_DC_DIS].data) .*
etainverter.(gen[MIN_CAP_GEN_ASYM_DC_DIS])) *
(dual.(EP[:cZoneMinCapReq][mincap])))


[JuliaFormatter] reported by reviewdog 🐶

dfRegSubRevenue.SubsidyRevenue[MIN_CAP_GEN_ASYM_AC_DIS] .+= ((value.(EP[:eTotalCapDischarge_AC][MIN_CAP_GEN_ASYM_AC_DIS]).data) *
(dual.(EP[:cZoneMinCapReq][mincap])))


[JuliaFormatter] reported by reviewdog 🐶

dfRegSubRevenue.SubsidyRevenue[MIN_CAP_GEN_SYM_DC] .+= ((value.(EP[:eTotalCap_STOR][MIN_CAP_GEN_SYM_DC]).data .*
power_to_energy_dc.(gen[MIN_CAP_GEN_SYM_DC]) .*
etainverter.(gen[MIN_CAP_GEN_SYM_DC])) *


[JuliaFormatter] reported by reviewdog 🐶

dfRegSubRevenue.SubsidyRevenue[MIN_CAP_GEN_SYM_AC] .+= ((value.(EP[:eTotalCap_STOR][MIN_CAP_GEN_SYM_AC]).data .*
power_to_energy_ac.(gen[MIN_CAP_GEN_SYM_AC])) *

@@ -71,6 +108,12 @@ function hydro_inter_period_linkage!(EP::Model, inputs::Dict)
# Build up inventory can be positive or negative
@variable(EP, vdSOC_HYDRO[y in STOR_HYDRO_LONG_DURATION, w = 1:REP_PERIOD])

# Maximum positive storage inventory change within subperiod
@variable(EP, vdSOC_maxPos_HYDRO[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD] >= 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@variable(EP, vdSOC_maxPos_HYDRO[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD] >= 0)
@variable(EP, vdSOC_maxPos_HYDRO[y in STOR_HYDRO_LONG_DURATION, w = 1:REP_PERIOD]>=0)

Comment on lines 114 to 115
# Maximum negative storage inventory change within subperiod
@variable(EP, vdSOC_maxNeg_HYDRO[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD] <= 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# Maximum negative storage inventory change within subperiod
@variable(EP, vdSOC_maxNeg_HYDRO[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD] <= 0)
# Maximum negative storage inventory change within subperiod
@variable(EP, vdSOC_maxNeg_HYDRO[y in STOR_HYDRO_LONG_DURATION, w = 1:REP_PERIOD]<=0)

@@ -111,4 +154,27 @@
r in REP_PERIODS_INDEX],
vSOC_HYDROw[y,r]==EP[:vS_HYDRO][y, hours_per_subperiod * dfPeriodMap[r, :Rep_Period_Index]] -
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
vSOC_HYDROw[y,r]==EP[:vS_HYDRO][y, hours_per_subperiod * dfPeriodMap[r, :Rep_Period_Index]] -
vSOC_HYDROw[y,
r]==EP[:vS_HYDRO][y, hours_per_subperiod * dfPeriodMap[r, :Rep_Period_Index]] -

Comment on lines 159 to 160
@constraint(EP, cMaxSoCVarPos_H[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD, t=2:hours_per_subperiod],
vdSOC_maxPos_HYDRO[y,w] >= EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+t] - EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+1])
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@constraint(EP, cMaxSoCVarPos_H[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD, t=2:hours_per_subperiod],
vdSOC_maxPos_HYDRO[y,w] >= EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+t] - EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+1])
@constraint(EP,
cMaxSoCVarPos_H[
y in STOR_HYDRO_LONG_DURATION, w = 1:REP_PERIOD, t = 2:hours_per_subperiod],
vdSOC_maxPos_HYDRO[y,
w]>=EP[:vS_HYDRO][y, hours_per_subperiod * (w - 1) + t] -
EP[:vS_HYDRO][y, hours_per_subperiod * (w - 1) + 1])

Comment on lines 163 to 164
@constraint(EP, cMaxSoCVarNeg_H[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD, t=2:hours_per_subperiod],
vdSOC_maxNeg_HYDRO[y,w] <= EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+t] - EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+1])
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@constraint(EP, cMaxSoCVarNeg_H[y in STOR_HYDRO_LONG_DURATION, w=1:REP_PERIOD, t=2:hours_per_subperiod],
vdSOC_maxNeg_HYDRO[y,w] <= EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+t] - EP[:vS_HYDRO][y,hours_per_subperiod*(w-1)+1])
@constraint(EP,
cMaxSoCVarNeg_H[
y in STOR_HYDRO_LONG_DURATION, w = 1:REP_PERIOD, t = 2:hours_per_subperiod],
vdSOC_maxNeg_HYDRO[y,
w]<=EP[:vS_HYDRO][y, hours_per_subperiod * (w - 1) + t] -
EP[:vS_HYDRO][y, hours_per_subperiod * (w - 1) + 1])


for t_int in t_interior
t = hours_per_subperiod * (w - 1) + t_int
SOC_t[stor_hydro_long_duration, t_r + t_int - 1] = SOC_t[stor_hydro_long_duration, t_r + t_int - 2] .- 1 ./ efficiency_down.(gen[stor_long_duration]) .* v_P[stor_hydro_long_duration, t] .- v_spill[stor_hydro_long_duration, t] .+ pP_max[stor_hydro_long_duration, t] .* e_total_cap[stor_hydro_long_duration]
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
SOC_t[stor_hydro_long_duration, t_r + t_int - 1] = SOC_t[stor_hydro_long_duration, t_r + t_int - 2] .- 1 ./ efficiency_down.(gen[stor_long_duration]) .* v_P[stor_hydro_long_duration, t] .- v_spill[stor_hydro_long_duration, t] .+ pP_max[stor_hydro_long_duration, t] .* e_total_cap[stor_hydro_long_duration]
SOC_t[stor_hydro_long_duration, t_r + t_int - 1] = SOC_t[
stor_hydro_long_duration, t_r + t_int - 2] .-
1 ./
efficiency_down.(gen[stor_long_duration]) .*
v_P[
stor_hydro_long_duration, t] .- v_spill[
stor_hydro_long_duration, t] .+
pP_max[
stor_hydro_long_duration, t] .* e_total_cap[stor_hydro_long_duration]

Comment on lines +82 to +84
rename!(df_SOC_t,auxNew_Names)
CSV.write(joinpath(path, "StorageEvol.csv"), dftranspose(df_SOC_t, false), writeheader=false)

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
rename!(df_SOC_t,auxNew_Names)
CSV.write(joinpath(path, "StorageEvol.csv"), dftranspose(df_SOC_t, false), writeheader=false)
rename!(df_SOC_t, auxNew_Names)
CSV.write(joinpath(path, "StorageEvol.csv"),
dftranspose(df_SOC_t, false), writeheader = false)

Comment on lines +30 to +31
inputs["pP_Max_Solar"][SOLAR, :] .-
value.(EP[:vP_SOLAR][SOLAR, :]).data) .*
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
inputs["pP_Max_Solar"][SOLAR, :] .-
value.(EP[:vP_SOLAR][SOLAR, :]).data) .*
inputs["pP_Max_Solar"][SOLAR, :] .-
value.(EP[:vP_SOLAR][SOLAR, :]).data) .*

dfNetRevenue.Var_OM_cost_out[WIND] += var_om_cost_per_mwh_wind.(gen_VRE_STOR[(gen_VRE_STOR.wind .!= 0)]) .*
(value.(EP[:vP_WIND][WIND, :]).data *
inputs["omega"])
dfVreStor[1:VRE_STOR_LENGTH, :EndCapWind]
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
dfVreStor[1:VRE_STOR_LENGTH, :EndCapWind]
(value.(EP[:vP_SOLAR][SOLAR, :]).data .*


dfNetRevenue.Var_OM_cost_out[WIND] += var_om_cost_per_mwh_wind.(gen[WIND]) .*
(value.(EP[:vP_WIND][WIND, :]).data *
inputs["omega"])
end
if !isempty(DC)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if !isempty(DC)
dfVreStor[
1:VRE_STOR_LENGTH, :EndCapWind]

@lbonaldo lbonaldo added the enhancement New feature or request label Dec 3, 2024
@lbonaldo lbonaldo modified the milestones: v0.4, v0.4.3 Dec 4, 2024
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.

4 participants