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 38 commits into
base: solvent-storage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
73ab92d
Merge pull request #776 from GenXProject/docs/update_readme
lbonaldo Sep 23, 2024
65e25d7
Add new charging capacity constraint to VRE_STOR (#770)
qluo0320github Nov 18, 2024
6fabc96
Additional constraints to prevent violation of state of charge limits…
federicoparolin Nov 18, 2024
7147493
Fix getproperty for `Vector{Resources}` to align with updated array i…
lbonaldo Nov 18, 2024
f1bbba4
Fix description of TDR setting parameters in Tutorial 1 (#793)
lbonaldo Nov 19, 2024
5b0c5ff
Remove unused `CapRes_*` columns from `Network.csv` (784)
lbonaldo Nov 26, 2024
d201184
Fix writing cost for zones with no resources (#796)
lbonaldo Dec 3, 2024
4eb44e8
Fix demand_data path in tutorial 8 (#794)
lbonaldo Dec 3, 2024
165836d
Add `add_similar_to_expression!` for arrays of `Number`s (#798)
lbonaldo Dec 4, 2024
faaf58a
Update README.md and doc with development lead from Binghamton Univ (…
sambuddhac Dec 4, 2024
012a28d
Fix typos in documentation (#768)
sambuddhac Dec 4, 2024
cccab41
Settings flag for new LDS constraints (#801)
lbonaldo Dec 23, 2024
74650dd
Add instructions for skipping precompilation
lbonaldo Dec 23, 2024
e008d1f
Add GH action to automatically update version number
lbonaldo Nov 7, 2024
c2ff871
Update GH workflows
lbonaldo Nov 7, 2024
5e3d0be
Add `eTotalCMaxCapSlack` to `cUnmetPolicyPenalty` in `write_costs.jl`…
lbonaldo Jan 6, 2025
9f82165
Prep for v0.4.2
lbonaldo Dec 23, 2024
0efaff1
Merge pull request #805 from GenXProject/release/0.4.2
lbonaldo Jan 6, 2025
26d82e8
Merge pull request #808 from GenXProject/release/0.4.2
lbonaldo Jan 6, 2025
e0e3dca
Fix path to MGA reference in documentation (#813)
lbonaldo Jan 17, 2025
4daa001
Update `write_rsv.jl` with corrected filenames for RSV (#814)
sambuddhac Jan 23, 2025
a91b0a2
Fix #818
cfe316 Jan 28, 2025
c7915fe
Merge pull request #819 from cfe316/fix_818
lbonaldo Jan 28, 2025
a2f1fe1
Update thermal.jl with links to fuels page for Piecewise linear cost …
sambuddhac Jan 30, 2025
8603aa5
Update docs for fuel.jl (#821)
sambuddhac Jan 30, 2025
62827b3
docs: add documentation for `cap_size` in `model_input.md`
lbonaldo Jan 30, 2025
c19ff01
docs: small fixes to `model_input.md`
lbonaldo Jan 30, 2025
8e5af17
Prep for v0.4.3
lbonaldo Jan 30, 2025
dcf3df0
Merge pull request #822 from GenXProject/release/0.4.3
lbonaldo Jan 30, 2025
2ddad6c
Merge pull request #823 from GenXProject/release/0.4.3
lbonaldo Jan 30, 2025
4c653ed
Clean up storage model syntax, logic (#817)
cfe316 Feb 1, 2025
db1c84e
Fix path manipulation bug #827
cfe316 Feb 4, 2025
d47311f
Add Windows OS to GitHub Actions test matrix
lbonaldo Feb 5, 2025
1cbee53
Prep for v0.4.4
lbonaldo Feb 5, 2025
f92629b
Merge branch 'develop' into fix-827
cfe316 Feb 5, 2025
24021b6
Merge pull request #829 from cfe316/fix-827
lbonaldo Feb 5, 2025
f72c588
Add Allam Cycle module with Liquid Oxygen Storage (#772)
qluo0320github Feb 9, 2025
0070cea
Fix linking of pages of storage and crm in docs (#831)
lbonaldo Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .github/workflows/PR_checks.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Changelog Enforcer
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces update of changelog file on every pull request
Changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip-Changelog, skip changelog'
token: ${{ secrets.GITHUB_TOKEN }}
missingUpdateErrorMessage: >
No update to CHANGELOG.md found! Please add an entry describing
your change and include the pull request tag. Note that we use
the keepachangelog format (https://keepachangelog.com). If your
change doesn’t require a changelog entry, please add the
'Skip-Changelog' or 'skip changelog' label to the pull request.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ jobs:
fail-fast: false
matrix:
version:
- "1.6" # LTS (64-bit Linux)
- "1.7"
- "1.8"
- "1.6"
- "1.9"
- '1' # latest stable Julia release (Linux)
- "1.10" # LTS
- '1' # latest stable
os:
- ubuntu-latest
arch:
- x64
include:
- version: '1'
os: windows-latest
arch: x64

steps:
- uses: actions/checkout@v4
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/dev_version_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Dev Version Check and Update

on:
pull_request_review:
types: [submitted]

jobs:
check-version:
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'develop'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Set up Julia
uses: julia-actions/setup-julia@latest
with:
version: '1.x'

- uses: julia-actions/cache@v2

- name: Configure Git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"

- name: Check and Update Version
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
# Get PR base branch and export it
export BASE_BRANCH=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER" | \
jq -r .base.ref)

julia -e '

# Get base branch directly from environment variable
base_branch = ENV["BASE_BRANCH"]

# First ensure we have the base branch
run(`git fetch origin $(base_branch)`)

function parse_version(version_str)
# Extract M.m.p and optional dev number
base_pattern = r"^(\d+\.\d+\.\d+)(?:-dev\.(\d+))?$"
m = match(base_pattern, version_str)
if isnothing(m)
error("Invalid version format: $version_str")
end

version = m.captures[1]
dev_num = isnothing(m.captures[2]) ? nothing : parse(Int, m.captures[2])
return (version, dev_num)
end

function should_update_version(base_ver_str, current_ver_str)
base_ver, base_dev = parse_version(base_ver_str)
current_ver, current_dev = parse_version(current_ver_str)

# If versions differ, no update needed
if base_ver != current_ver
return false
end

# If base has dev number, we should increment from the base dev number
if !isnothing(base_dev)
return true
end

# If base has no dev number and current has none, add dev.1
if isnothing(base_dev) && isnothing(current_dev)
return true
end

return false
end

function get_new_version(base_ver_str, current_ver_str)
base_ver, base_dev = parse_version(base_ver_str)
current_ver, current_dev = parse_version(current_ver_str)

# If base has a dev number, increment from that
if !isnothing(base_dev)
return "$(base_ver)-dev.$(base_dev + 1)"
end

# If no dev numbers exist, start with dev.1
return "$(current_ver)-dev.1"
end

function check_and_update_version()
# Get the base branch version
base_content = read(pipeline(`git show origin/$(base_branch):Project.toml`), String)
# Get current branch version
current_content = read(joinpath(pwd(), "Project.toml"), String)

# Extract versions using regex
version_pattern = r"version = \"(.*?)\""
base_version = match(version_pattern, base_content).captures[1]
current_version = match(version_pattern, current_content).captures[1]

println("Base version: $base_version")
println("Current version: $current_version")

if should_update_version(base_version, current_version)
println("Version needs updating")

new_version = get_new_version(base_version, current_version)

# Update the file
new_content = replace(current_content,
"version = \"$current_version\"" =>
"version = \"$new_version\"")

write(joinpath(pwd(), "Project.toml"), new_content)

# Commit and push the change
run(`git add $(joinpath(pwd(), "Project.toml"))`)
run(`git commit -m "Bump version to $new_version"`)
run(`git push`)

println("Version updated to $new_version")
else
println("Version already updated")
end
end

check_and_update_version()'
14 changes: 0 additions & 14 deletions .github/workflows/format_suggestions.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
strategy:
matrix:
branch: ["main", "develop"]
version: ["1.8", "1.9", '1']
version: ["1.9", "1.10", '1']
include:
- version: '1'
os: windows-latest
arch: x64
runs-on: ubuntu-latest

steps:
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added
- New resource type: Allam Cycle with Oxygen Storage (#772).

## [0.4.4] - 2025-02-04

### Added
- Add Windows OS to GitHub Actions test matrix.

### Fixed
- Fix path manipulation crash on Windows with TDR & reconstruction (#827).

## [0.4.3] - 2025-01-29

### Changed
- Changed the output filename for RSV from `reg_dn.csv` to `reserves.csv` (#814).
- Created link in the thermal doc page to fuels page for piecewise linear cost curve documentation (#820).
- Doc rendering fix in fuel.jl (#821).

### Fixed
- Fixed capacity reserve margin formulation for asymmetric storage
when OperationalReserves is on. (#818)

## [0.4.2] - 2024-12-23

### Added
- Fusion plant optional features for thermal plants (#743).
- Support for reusing the same Gurobi environment for multiple solves when
number of concurrent Gurobi uses is limited (#783).
- Additional long-duration storage constraints to bound state of charge in
non-representative periods (#781).
- New version of `add_similar_to_expression!` to support arrays of `Number`s. (#798)
- New settings flag `LDSAdditionalConstraints` to provide flexibility in
activating new long-duration storage constraints (#781). Can be set in the GenX
settings file (PR #801).

### Changed
- The `charge.csv` and `storage.csv` files now include only resources with
charge and storage variables (#760 and #763).
- Deduplicated docs on optimized scheduled maintenance for thermal resources (#745).
- Removed the `CapRes_*` columns from `Network.csv` since they were not being used (#784).

### Fixed
- Add constraint to ensure that electricity charged from the grid cannot exceed
the charging capacity of the storage component in VRE_STOR (#770).
- Update `getproperty` function for vectors of resources to ensure compatibility
with Julia v1.11 (#785).
- Fixed cost calculation in `write_costs.jl` when no resources are present in
a zone. (#796)
- Added `eTotalCMaxCapSlack` to calculation of `cUnmetPolicyPenalty` in
`write_costs.jl` (#806).

## [0.4.1] - 2024-08-20

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ authors:
given-names: "Qingyu"
orcid: "https://orcid.org/0000-0003-2692-5135"
title: "GenX"
version: 0.4.1
version: 0.4.4
doi: 10.5281/zenodo.10846070
date-released: 2024-04-26
date-released: 2025-02-04
url: "https://github.com/GenXProject/GenX.jl"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GenX"
uuid = "5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac"
authors = ["Bonaldo, Luca", "Chakrabarti, Sambuddha", "Cheng, Fangwei", "Ding, Yifu", "Jenkins, Jesse D.", "Luo, Qian", "Macdonald, Ruaridh", "Mallapragada, Dharik", "Manocha, Aneesha", "Mantegna, Gabe ", "Morris, Jack", "Patankar, Neha", "Pecci, Filippo", "Schwartz, Aaron", "Schwartz, Jacob", "Schivley, Greg", "Sepulveda, Nestor", "Xu, Qingyu", "Zhou, Justin"]
version = "0.4.1-dev.9"
version = "0.4.4-dev.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ that incorporates several state-of-the-art practices in electricity system plann
The model was [originally developed](https://energy.mit.edu/publication/enhanced-decision-support-changing-electricity-landscape/) by
[Jesse D. Jenkins](https://mae.princeton.edu/people/faculty/jenkins) and
[Nestor A. Sepulveda](https://energy.mit.edu/profile/nestor-sepulveda/) at the Massachusetts Institute of Technology and is now jointly maintained by
[a team of contributors](https://github.com/GenXProject/GenX#genx-team) at the Princeton University ZERO Lab (led by Jenkins), MIT (led by [Ruaridh MacDonald](https://energy.mit.edu/profile/ruaridh-macdonald/)), and NYU (led by [Dharik Mallapragada](https://engineering.nyu.edu/faculty/dharik-mallapragada)).
[a team of contributors](https://github.com/GenXProject/GenX#genx-team) at the Princeton University ZERO Lab (led by Jenkins), MIT (led by [Ruaridh MacDonald](https://energy.mit.edu/profile/ruaridh-macdonald/)), NYU (led by [Dharik Mallapragada](https://engineering.nyu.edu/faculty/dharik-mallapragada)), and Binghamton University (led by [Neha Patankar](https://www.binghamton.edu/ssie/people/profile.html?id=npatankar)).

GenX is a constrained linear or mixed integer linear optimization model that determines the portfolio of electricity generation,
storage, transmission, and demand-side resource investments and operational decisions to meet electricity demand in one or more future planning years at lowest cost,
Expand All @@ -40,7 +40,7 @@ The 'main' branch is the current master branch of GenX. The various subdirectori

## Requirements

GenX (v0.4.1) runs on Julia v1.6 through v1.9, with a minimum version of the package JuMP v1.1.1. Julia v1.10 is also supported. However, we recently noticed a decline in performance with Julia v1.10, which is currently under investigation. Therefore, **we recommend using Julia v1.9**, particularly for very large cases.
GenX (v0.4.4) runs on Julia v1.6 through v1.9, with a minimum version of the package JuMP v1.1.1. Julia v1.10 and v1.11 are also supported. However, we recently noticed a decline in performance with Julia v1.10, which is currently under investigation. Therefore, **we recommend using Julia v1.9**, particularly for very large cases.
We recommend the users to either stick to a particular version of Julia to run GenX. If however, the users decide to switch between versions, it's very important to delete the old `Manifest.toml` file and do a fresh build of GenX when switching between Julia versions.

There is also an older version of GenX, which is also currently maintained and runs on Julia 1.3.x and 1.4.x series.
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pages = OrderedDict(
"Scheduled maintenance for Thermal Commit" => "Model_Reference/Resources/maintenance.md",
"Fusion" => "Model_Reference/Resources/fusion.md"
],
"Allam Cycle" => "Model_Reference/Resources/allam_cycle.md",
"Hydrogen Electrolyzers" => "Model_Reference/Resources/electrolyzers.md",
"Resource types" => "Model_Reference/Resources/resource.md"
],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/Model_Concept_Overview/model_notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $\mathcal{W} \subseteq \mathcal{G}$ | where $\mathcal{W}$ set of hydroelectric g
|$r^{ac,cha}_{y,z,t} \in \mathbb{R}_+$ | Upward spinning reserves contribution \[MW\] for the storage AC charge component from technology $y$ in zone $z$ at time $t$ - only applicable for co-located VRE and storage resources with a storage AC charge component, $y \in \mathcal{VS}^{sym,ac} \cup y \in \mathcal{VS}^{asym,ac,cha}$ |
|$\alpha^{Contingency,Aux}_{y,z} \in \{0,1\}$ | Binary variable that is set to be 1 if the total installed capacity $\Delta^{\text{total}}_{y,z} > 0$ for any generator $y \in \mathcal{UC}$ and zone $z$, and can be 0 otherwise |
|$\Phi_{l,t} \in \mathbb{R}_+$ | Power flow in line $l$ at time step $t$ \[MWh\]|
|$\theta_{z,t} \in \mathbb{R}$ | Volta phase angle in zone $z$ at time step $t$ \[radian\]|
|$\theta_{z,t} \in \mathbb{R}$ | Voltage phase angle in zone $z$ at time step $t$ \[radian\]|
|$\nu_{y,z,t}$ | Commitment state of the generation cluster $y$ in zone $z$ at time $t$|
|$\chi_{y,z,t}$ | Number of startup decisions, of the generation cluster $y$ in zone $z$ at time $t$|
|$\zeta_{y,z,t}$ | Number of shutdown decisions, of the generation cluster $y$ in zone $z$ at time $t$|
Expand Down
5 changes: 5 additions & 0 deletions docs/src/Model_Reference/Resources/allam_cycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Allam Cycle
```@autodocs
Modules = [GenX]
Pages = ["allamcycle_commit.jl", "allamcycle_no_commit.jl", "allamcyclelox.jl"]
```
6 changes: 6 additions & 0 deletions docs/src/Model_Reference/write_outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,9 @@ GenX.write_angles
```@docs
GenX.write_settings_file
```

## Write Allam Cycle LOX
```@docs
GenX.write_allam_capacity
GenX.write_allam_output
```
2 changes: 1 addition & 1 deletion docs/src/Tutorials/Tutorial_1_configuring_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GenX is easy to customize to fit a variety of problems. In this tutorial, we sho
There are 21 settings available to edit in GenX, found in the file `genx_settings.yml`. These settings are described at the [Model settings parameters
](@ref) page of the documentation. The file is located in the `settings` folder in the working directory. To change the location of the file, edit the `settings_path` variable in `Run.jl` within your directory.

Most settings are set as either 0 or 1, which correspond to whether or not to include a specific feature. For example, to use `TimeDomainReduction`, you would set its parameter to 0 within `genx_settings.yml`. If you would like to run GenX without it, you would set its parameter to 1.
Most settings are set as either 0 or 1, which correspond to whether or not to include a specific feature. For example, to use `TimeDomainReduction`, you would set its parameter to 1 within `genx_settings.yml`. If you would like to run GenX without it, you would set its parameter to 0.

Other settings, such as `CO2Cap`, have more options corresponding to integers, while some settings such as `ModelingtoGenerateAlternativeSlack` take a numerical input directly (in this case, the slack value). Two settings, `Solver` and `TimeDomainReductionFolder` take in text as input. To learn more about different solvers, read [here](https://github.com/GenXProject/GenX.jl/blob/main/docs/src/User_Guide/solver_configuration.md). For `TimeDomainReductionFolder`, specify the name of the directory you wish to see the results in. For a more comprehensive description of the input options, see the documentation linked above.

Expand Down
Loading
Loading