diff --git a/docs/src/User_Guide/model_configuration.md b/docs/src/User_Guide/model_configuration.md index 3dd0f5d882..a6f7ba3b51 100644 --- a/docs/src/User_Guide/model_configuration.md +++ b/docs/src/User_Guide/model_configuration.md @@ -34,12 +34,6 @@ The following tables summarize the model settings parameters and their default/p |LDSAdditionalConstraints | Flag to activate additional constraints for long duration storage resources to prevent violation of SoC limits in non-representative periods.| ||1 = activate additional constraints.| ||0 = do not activate additional constraints.| -|HourlyMatching| Constraint to match generation from clean sources with hourly consumption.| -||1 = Constraint is active.| -||0 = Constraint is not active.| -|HydrogenHourlyMatching | Flag to allow hydrogen production to contribute to the hourly clean supply matching constraint.| -||1 = Hydrogen production contributes to the hourly clean supply matching constraint.| -||0 = Hydrogen production does not contribute to the hourly clean supply matching constraint.| ## 2. Solution strategy @@ -87,6 +81,9 @@ The following tables summarize the model settings parameters and their default/p |HydrogenMinimumProduction | Hydrogen production requirements from electrolyzers.| |1 = Constraint is active.| ||0 = Constraint is not active.| +|HourlyMatchingRequirement| Constraint to match generation from clean sources with hourly consumption.| +||1 = Constraint is active.| +||0 = Constraint is not active.| ## 4. Network related diff --git a/src/model/resources/flexible_ccs/allamcyclelox.jl b/src/model/resources/flexible_ccs/allamcyclelox.jl index 49f8efb6fb..9ecb01f98f 100644 --- a/src/model/resources/flexible_ccs/allamcyclelox.jl +++ b/src/model/resources/flexible_ccs/allamcyclelox.jl @@ -279,11 +279,10 @@ function allamcyclelox!(EP::Model, inputs::Dict, setup::Dict) end # Hourly matching constraints - if setup["HourlyMatching"] == 1 - QUALIFIED_SUPPLY = inputs["QUALIFIED_SUPPLY"] # Resources that are qualified to contribute to hourly matching constraint - @expression(EP, eHMAllam[t = 1:T, z = 1:Z], - -sum(EP[:vCHARGE_ALLAM][y,t] - for y in intersect(resources_in_zone_by_rid(gen,z), QUALIFIED_SUPPLY, ALLAM_CYCLE_LOX))) + if setup["HourlyMatchingRequirement"] == 1 + @expression(EP, eHMAllam[t = 1:T, HM = 1:inputs["nHM"]], + -sum(hm(gen[y], tag = HM) * vCHARGE_ALLAM[y,t] + for y in intersect(ids_with_policy(gen, hm, tag = HM), ALLAM_CYCLE_LOX))) add_similar_to_expression!(EP[:eHM], eHMAllam) end end \ No newline at end of file