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

Fix typo in HydrogenMinimumProduction #746

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Include comprehensive list of all settings flags (that are currently in GenX) in the docs (#721)
- Allow `load_vre_stor_variability!` to load only wind or solar resources as
part of the VRE_STOR module (#728)
- Fix typo in HydrogenMinimumProduction setting key (#746)

### Added
- Add objective scaler for addressing problem ill-conditioning (#667)
Expand Down
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.0-dev.17"
version = "0.4.0-dev.18"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/User_Guide/model_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following tables summarize the model settings parameters and their default/p
|MaxCapReq | Maximum system-wide technology capacity limit constraints.|
|| 1 = if one or more maximum technology capacity constraints are specified|
|| 0 = otherwise|
|HydrogenMimimumProduction | Hydrogen production requirements from electrolyzers.|
|HydrogenMinimumProduction | Hydrogen production requirements from electrolyzers.|
|1 = Constraint is active.|
||0 = Constraint is not active.|

Expand Down
2 changes: 1 addition & 1 deletion docs/src/User_Guide/model_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ This policy is applied when if `CapacityReserveMargin > 0` in the settings file.
|Resource| Resource name corresponding to a resource in one of the resource data files described above.|
|Derating\_Factor\_*| Fraction of the resource capacity eligible for contributing to the capacity reserve margin constraint (e.g. derate factor).|

This policy is applied when if `HydrogenMimimumProduction = 1` in the settings file. \* corresponds to the ith row of the file `Hydrogen_demand.csv`.
This policy is applied when if `HydrogenMinimumProduction = 1` in the settings file. \* corresponds to the ith row of the file `Hydrogen_demand.csv`.

##### Table 16: Hydrogen demand policy parameters in Resource\_hydrogen\_demand.csv
---
Expand Down
2 changes: 1 addition & 1 deletion example_systems/2_three_zones_w_electrolyzer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ julia> cd("example_systems/2_three_zones_w_electrolyzer/")
$ cd example_systems/2_three_zones_w_electrolyzer/
```

Next, ensure that your settings in `settings/GenX_settings.yml` are correct. The default settings use the solver `HiGHS`, time domain reduced input data (`TimeDomainReduction: 1`), regional requirements for hydrogen production (`HydrogenMimimumProduction: 1`), and minimum capacity requirement policy (`MinCapReq: 1`) as specified in the `policies/Minimum_capacity_requirement.csv` file. Other optional policies include a capacity reserve margin, an energy share requirement (such as renewable portfolio standard (RPS) or clean electricity standard (CES) policies), a CO2 emissions cap, and a maximum capacity requirement policy (see the documentation for more details).
Next, ensure that your settings in `settings/GenX_settings.yml` are correct. The default settings use the solver `HiGHS`, time domain reduced input data (`TimeDomainReduction: 1`), regional requirements for hydrogen production (`HydrogenMinimumProduction: 1`), and minimum capacity requirement policy (`MinCapReq: 1`) as specified in the `policies/Minimum_capacity_requirement.csv` file. Other optional policies include a capacity reserve margin, an energy share requirement (such as renewable portfolio standard (RPS) or clean electricity standard (CES) policies), a CO2 emissions cap, and a maximum capacity requirement policy (see the documentation for more details).

Once the settings are confirmed, run the model with the `Run.jl` script in the example directory:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ HydrogenHourlyMatching: 1 # Hydrogen electrolyzer hourly supply matching require
ParameterScale: 1 # Turn on parameter scaling wherein demand, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
TimeDomainReduction: 1 # Time domain reduce (i.e. cluster) inputs based on Demand_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
HydrogenMimimumProduction: 1 # Hydrogen production requirement; 0 = not active; 1 = active, meet regional level H2 production requirements
HydrogenMinimumProduction: 1 # Hydrogen production requirement; 0 = not active; 1 = active, meet regional level H2 production requirements
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ julia> cd("example_systems/8_three_zones_w_colocated_VRE_storage_electrolyzers/"
$ cd example_systems/8_three_zones_w_colocated_VRE_storage_electrolyzers/
```

Next, ensure that your settings in `settings/genx_settings.yml` are correct. The linear clustering unit commitment method (settings["UCommit"] = 2) is used. The default settings use the solver `HiGHS`, time domain reduced input data (`TimeDomainReduction: 0`), regional requirements for hydrogen production (`HydrogenMimimumProduction: 1`), minimum and maximum capacity requirement policies (`MinCapReq: 1`, `MaxCapReq: 1`), a capacity reserve margin, an energy share requirement (such as renewable portfolio standard (RPS) or clean electricity standard (CES) policies), and a CO2 emissions cap (see the documentation for more details). Each policy is specified in the corresponding file inside the `policies` folder. A mass-based carbon cap of 50 gCO<sub>2</sub> per kWh is specified in the `policies/CO2_cap.csv` input file.
Next, ensure that your settings in `settings/genx_settings.yml` are correct. The linear clustering unit commitment method (settings["UCommit"] = 2) is used. The default settings use the solver `HiGHS`, time domain reduced input data (`TimeDomainReduction: 0`), regional requirements for hydrogen production (`HydrogenMinimumProduction: 1`), minimum and maximum capacity requirement policies (`MinCapReq: 1`, `MaxCapReq: 1`), a capacity reserve margin, an energy share requirement (such as renewable portfolio standard (RPS) or clean electricity standard (CES) policies), and a CO2 emissions cap (see the documentation for more details). Each policy is specified in the corresponding file inside the `policies` folder. A mass-based carbon cap of 50 gCO<sub>2</sub> per kWh is specified in the `policies/CO2_cap.csv` input file.

Once the settings are confirmed, run the model with the `Run.jl` script in the example directory:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ HydrogenHourlyMatching: 0 # Hydrogen electrolyzer hourly supply matching require
ParameterScale: 0 # Turn on parameter scaling wherein demand, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
TimeDomainReduction: 0 # Time domain reduce (i.e. cluster) inputs based on Demand_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
HydrogenMimimumProduction: 1 # Hydrogen production requirement; 0 = not active; 1 = active, meet regional level H2 production requirements
HydrogenMinimumProduction: 1 # Hydrogen production requirement; 0 = not active; 1 = active, meet regional level H2 production requirements
2 changes: 1 addition & 1 deletion src/configure_settings/configure_settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function default_settings()
"MultiStage" => 0,
"MethodofMorris" => 0,
"IncludeLossesInESR" => 0,
"HydrogenMimimumProduction" => 0,
"HydrogenMinimumProduction" => 0,
"EnableJuMPStringNames" => false,
"HydrogenHourlyMatching" => 0,
"DC_OPF" => 0,
Expand Down
2 changes: 1 addition & 1 deletion src/load_inputs/load_energy_share_requirement.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc raw"""
load_energy_share_requirement!(setup::Dict, path::AbstractString, inputs::Dict)

Read input parameters related to mimimum energy share requirement constraints
Read input parameters related to minimum energy share requirement constraints
(e.g. renewable portfolio standard or clean electricity standard policies)
"""
function load_energy_share_requirement!(setup::Dict, path::AbstractString, inputs::Dict)
Expand Down
2 changes: 1 addition & 1 deletion src/load_inputs/load_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function load_inputs(setup::Dict, path::AbstractString)
end

# Read in hydrogen damand data
if setup["HydrogenMimimumProduction"] == 1
if setup["HydrogenMinimumProduction"] == 1
load_hydrogen_demand!(setup, policies_path, inputs)
end

Expand Down
2 changes: 1 addition & 1 deletion src/load_inputs/load_minimum_capacity_requirement.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc raw"""
load_minimum_capacity_requirement!(path::AbstractString, inputs::Dict, setup::Dict)

Read input parameters related to mimimum capacity requirement constraints (e.g. technology specific deployment mandates)
Read input parameters related to minimum capacity requirement constraints (e.g. technology specific deployment mandates)
"""
function load_minimum_capacity_requirement!(path::AbstractString, inputs::Dict, setup::Dict)
filename = "Minimum_capacity_requirement.csv"
Expand Down
2 changes: 1 addition & 1 deletion src/load_inputs/load_resources_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function _get_policyfile_info()
min_cap = (filenames = min_cap_filenames, setup_param = "MinCapReq"),
max_cap = (filenames = max_cap_filenames, setup_param = "MaxCapReq"),
h2_demand = (
filenames = h2_demand_filenames, setup_param = "HydrogenMimimumProduction"))
filenames = h2_demand_filenames, setup_param = "HydrogenMinimumProduction"))
return policyfile_info
end

Expand Down
4 changes: 2 additions & 2 deletions src/model/generate_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function generate_model(setup::Dict, inputs::Dict, OPTIMIZER::MOI.OptimizerWithA
create_empty_expression!(EP, :eMaxCapRes, inputs["NumberOfMaxCapReqs"])
end

if setup["HydrogenMimimumProduction"] > 0
if setup["HydrogenMinimumProduction"] > 0
create_empty_expression!(EP, :eH2DemandRes, inputs["NumberOfH2DemandReqs"])
end

Expand Down Expand Up @@ -229,7 +229,7 @@ function generate_model(setup::Dict, inputs::Dict, OPTIMIZER::MOI.OptimizerWithA
end

# Hydrogen demand limits
if setup["HydrogenMimimumProduction"] > 0
if setup["HydrogenMinimumProduction"] > 0
hydrogen_demand!(EP, inputs, setup)
end

Expand Down
2 changes: 1 addition & 1 deletion src/model/resources/hydrogen/electrolyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function electrolyzer!(EP::Model, inputs::Dict, setup::Dict)
for t in 1:T)
end)

if setup["HydrogenMimimumProduction"] == 1
if setup["HydrogenMinimumProduction"] == 1
@expression(EP, eH2ProductionRes[h2demand = 1:inputs["NumberOfH2DemandReqs"]],
sum(EP[:eH2Production][y]
for y in ids_with_policy(gen, h2_demand, tag = h2demand)))
Expand Down
2 changes: 1 addition & 1 deletion src/write_outputs/write_charge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function write_charge(path::AbstractString, inputs::Dict, setup::Dict, EP::Model
if !isempty(FLEX)
charge[FLEX, :] = value.(EP[:vCHARGE_FLEX][FLEX, :]) * scale_factor
end
if (setup["HydrogenMimimumProduction"] > 0) & (!isempty(ELECTROLYZER))
if (setup["HydrogenMinimumProduction"] > 0) & (!isempty(ELECTROLYZER))
charge[ELECTROLYZER, :] = value.(EP[:vUSE][ELECTROLYZER, :]) * scale_factor
end
if !isempty(VS_STOR)
Expand Down
2 changes: 1 addition & 1 deletion src/write_outputs/write_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function write_outputs(EP::Model, path::AbstractString, setup::Dict, inputs::Dic
println(elapsed_time_max_cap_req)
end

if setup["HydrogenMimimumProduction"] == 1 && has_duals(EP)
if setup["HydrogenMinimumProduction"] == 1 && has_duals(EP)
if output_settings_d["WriteHydrogenPrices"]
elapsed_time_hydrogen_prices = @elapsed write_hydrogen_prices(path,
inputs,
Expand Down
2 changes: 1 addition & 1 deletion test/test_electrolyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ genx_setup = Dict("Trans_Loss_Segments" => 1,
"StorageLosses" => 1,
"HydrogenHourlyMatching" => 1,
"ParameterScale" => 1,
"HydrogenMimimumProduction" => 1
"HydrogenMinimumProduction" => 1
)

# Run the case and get the objective value and tolerance
Expand Down
Loading