From d540d9ec126c2dd4678307739df4ec6c719cd7f0 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 11 Jul 2024 13:08:05 -0600 Subject: [PATCH 01/69] add fields --- src/models/generated/DemandRequirement.jl | 68 ++++++-- src/models/generated/StorageTechnology.jl | 180 ++++++++++++++++++-- src/models/generated/SupplyTechnology.jl | 68 ++++++-- src/models/generated/TransportTechnology.jl | 76 +++++++-- src/models/generated/includes.jl | 62 ++++++- 5 files changed, 396 insertions(+), 58 deletions(-) diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index b83b7f3..e658cd6 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -6,33 +6,47 @@ This file is auto-generated. Do not edit. """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - load_growth::Float64 + available::Bool name::String + value_lost_load::Float64 + cost_of_curtailment::Float64 + load_growth::Float64 power_systems_type::String internal::InfrastructureSystemsInternal ext::Dict region::String - available::Bool + load_fraction::Float64 peak_load::Float64 + max_curtailment::Float64 end # Arguments -- `load_growth::Float64`: (default: `1.0`) Annual load growth (%) +- `available::Bool`: (default: `true`) identifies whether the technology is available - `name::String`: The technology name +- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy ($/MWh) +- `cost_of_curtailment::Float64`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load +- `load_growth::Float64`: (default: `0.0`) Annual load growth (%) - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `region::String`: Corresponding region for peak demand -- `available::Bool`: (default: `true`) identifies whether the technology is available +- `load_fraction::Float64`: (default: `1.0`) Demand representedt as a fraction of peak load - `peak_load::Float64`: (default: `100.0`) Demand value (MW) for single timepoint (for now) +- `max_curtailment::Float64`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - "Annual load growth (%)" - load_growth::Float64 + "identifies whether the technology is available" + available::Bool "The technology name" name::String + "Value of lost load/non-served energy ($/MWh)" + value_lost_load::Float64 + "Cost of non-served energy, fraction of value of lost load" + cost_of_curtailment::Float64 + "Annual load growth (%)" + load_growth::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" @@ -41,21 +55,29 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology ext::Dict "Corresponding region for peak demand" region::String - "identifies whether the technology is available" - available::Bool + "Demand representedt as a fraction of peak load" + load_fraction::Float64 "Demand value (MW) for single timepoint (for now)" peak_load::Float64 + "Maximum percentage of demand that can be curtailed in an investment period" + max_curtailment::Float64 end -function DemandRequirement{T}(; load_growth=1.0, name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), region, available=true, peak_load=100.0, ) where T <: PSY.StaticInjection - DemandRequirement{T}(load_growth, name, power_systems_type, internal, ext, region, available, peak_load, ) +function DemandRequirement{T}(; available=true, name, value_lost_load=0.0, cost_of_curtailment=0.0, load_growth=0.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), region, load_fraction=1.0, peak_load=100.0, max_curtailment=0.0, ) where T <: PSY.StaticInjection + DemandRequirement{T}(available, name, value_lost_load, cost_of_curtailment, load_growth, power_systems_type, internal, ext, region, load_fraction, peak_load, max_curtailment, ) end -"""Get [`DemandRequirement`](@ref) `load_growth`.""" -get_load_growth(value::DemandRequirement) = value.load_growth +"""Get [`DemandRequirement`](@ref) `available`.""" +get_available(value::DemandRequirement) = value.available """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name +"""Get [`DemandRequirement`](@ref) `value_lost_load`.""" +get_value_lost_load(value::DemandRequirement) = value.value_lost_load +"""Get [`DemandRequirement`](@ref) `cost_of_curtailment`.""" +get_cost_of_curtailment(value::DemandRequirement) = value.cost_of_curtailment +"""Get [`DemandRequirement`](@ref) `load_growth`.""" +get_load_growth(value::DemandRequirement) = value.load_growth """Get [`DemandRequirement`](@ref) `power_systems_type`.""" get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" @@ -64,15 +86,23 @@ get_internal(value::DemandRequirement) = value.internal get_ext(value::DemandRequirement) = value.ext """Get [`DemandRequirement`](@ref) `region`.""" get_region(value::DemandRequirement) = value.region -"""Get [`DemandRequirement`](@ref) `available`.""" -get_available(value::DemandRequirement) = value.available +"""Get [`DemandRequirement`](@ref) `load_fraction`.""" +get_load_fraction(value::DemandRequirement) = value.load_fraction """Get [`DemandRequirement`](@ref) `peak_load`.""" get_peak_load(value::DemandRequirement) = value.peak_load +"""Get [`DemandRequirement`](@ref) `max_curtailment`.""" +get_max_curtailment(value::DemandRequirement) = value.max_curtailment -"""Set [`DemandRequirement`](@ref) `load_growth`.""" -set_load_growth!(value::DemandRequirement, val) = value.load_growth = val +"""Set [`DemandRequirement`](@ref) `available`.""" +set_available!(value::DemandRequirement, val) = value.available = val """Set [`DemandRequirement`](@ref) `name`.""" set_name!(value::DemandRequirement, val) = value.name = val +"""Set [`DemandRequirement`](@ref) `value_lost_load`.""" +set_value_lost_load!(value::DemandRequirement, val) = value.value_lost_load = val +"""Set [`DemandRequirement`](@ref) `cost_of_curtailment`.""" +set_cost_of_curtailment!(value::DemandRequirement, val) = value.cost_of_curtailment = val +"""Set [`DemandRequirement`](@ref) `load_growth`.""" +set_load_growth!(value::DemandRequirement, val) = value.load_growth = val """Set [`DemandRequirement`](@ref) `power_systems_type`.""" set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" @@ -81,7 +111,9 @@ set_internal!(value::DemandRequirement, val) = value.internal = val set_ext!(value::DemandRequirement, val) = value.ext = val """Set [`DemandRequirement`](@ref) `region`.""" set_region!(value::DemandRequirement, val) = value.region = val -"""Set [`DemandRequirement`](@ref) `available`.""" -set_available!(value::DemandRequirement, val) = value.available = val +"""Set [`DemandRequirement`](@ref) `load_fraction`.""" +set_load_fraction!(value::DemandRequirement, val) = value.load_fraction = val """Set [`DemandRequirement`](@ref) `peak_load`.""" set_peak_load!(value::DemandRequirement, val) = value.peak_load = val +"""Set [`DemandRequirement`](@ref) `max_curtailment`.""" +set_max_curtailment!(value::DemandRequirement, val) = value.max_curtailment = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 3cb6bd8..c52cd3e 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -6,74 +6,218 @@ This file is auto-generated. Do not edit. """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology + base_power::Float64 + capital_cost_energy::PSY.ValueCurve + initial_capacity_power::Float64 + prime_mover_type::PrimeMovers + capital_cost_power::PSY.ValueCurve + gen_ID::String + available::Bool name::String storage_tech::StorageTech + minimum_required_capacity_power::Float64 + minimum_duration::Float64 power_systems_type::String - prime_mover_type::PrimeMovers internal::InfrastructureSystemsInternal ext::Dict - available::Bool + balancing_topology::String + region::String + maximum_capacity::Float64 + maximum_duration::Float64 + initial_capacity_energy::Float64 + operations_cost_power::PSY.ValueCurve + maximum_capacity_energy::Float64 + operations_cost_energy::PSY.ValueCurve + minimum_required_capacity_energy::Float64 + variable_cost_power::PSY.ValueCurve + variable_cost_energy::PSY.ValueCurve end # Arguments +- `base_power::Float64`: Base power +- `capital_cost_energy::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology +- `initial_capacity_power::Float64`: Pre-existing power capacity for a technology (MW) +- `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator +- `capital_cost_power::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `gen_ID::String`: ID for individual generator +- `available::Bool`: identifies whether the technology is available - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type +- `minimum_required_capacity_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology +- `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling -- `prime_mover_type::PrimeMovers`: Prime mover for storage - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `available::Bool`: identifies whether the technology is available +- `balancing_topology::String`: Set of balancing nodes +- `region::String`: (default: `1.0`) Region/zone technology operates in +- `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed power capacity for a storage technology +- `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) +- `operations_cost_power::PSY.ValueCurve`: Fixed O&M costs for a technology +- `maximum_capacity_energy::Float64`: (default: `Inf`) Maximum allowable installed energy capacity for a storage technology +- `operations_cost_energy::PSY.ValueCurve`: Fixed O&M costs for energy capacity of storage technology +- `minimum_required_capacity_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology +- `variable_cost_power::PSY.ValueCurve`: Variable O&M costs for a technology +- `variable_cost_energy::PSY.ValueCurve`: Variable O&M costs for energy capacity of storage technology """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology + "Base power" + base_power::Float64 + "Capital costs for energy capacity of storage technology" + capital_cost_energy::PSY.ValueCurve + "Pre-existing power capacity for a technology (MW)" + initial_capacity_power::Float64 + "Prime mover for generator" + prime_mover_type::PrimeMovers + "Capital costs for investing in a technology." + capital_cost_power::PSY.ValueCurve + "ID for individual generator" + gen_ID::String + "identifies whether the technology is available" + available::Bool "The technology name" name::String "Storage Technology Type" storage_tech::StorageTech + "Minimum required power capacity for a storage technology" + minimum_required_capacity_power::Float64 + "Minimum required durection for a storage technology" + minimum_duration::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String - "Prime mover for storage" - prime_mover_type::PrimeMovers "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "identifies whether the technology is available" - available::Bool + "Set of balancing nodes" + balancing_topology::String + "Region/zone technology operates in" + region::String + "Maximum allowable installed power capacity for a storage technology" + maximum_capacity::Float64 + "Maximum allowable durection for a storage technology" + maximum_duration::Float64 + "Pre-existing energy capacity for a technology (MWh)" + initial_capacity_energy::Float64 + "Fixed O&M costs for a technology" + operations_cost_power::PSY.ValueCurve + "Maximum allowable installed energy capacity for a storage technology" + maximum_capacity_energy::Float64 + "Fixed O&M costs for energy capacity of storage technology" + operations_cost_energy::PSY.ValueCurve + "Minimum required energy capacity for a storage technology" + minimum_required_capacity_energy::Float64 + "Variable O&M costs for a technology" + variable_cost_power::PSY.ValueCurve + "Variable O&M costs for energy capacity of storage technology" + variable_cost_energy::PSY.ValueCurve end -function StorageTechnology{T}(; name, storage_tech, power_systems_type, prime_mover_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.Storage - StorageTechnology{T}(name, storage_tech, power_systems_type, prime_mover_type, internal, ext, available, ) +function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_power=0.0, gen_ID, available, name, storage_tech, minimum_required_capacity_power=0.0, minimum_duration=0.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, variable_cost_power, variable_cost_energy, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_power, gen_ID, available, name, storage_tech, minimum_required_capacity_power, minimum_duration, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, variable_cost_power, variable_cost_energy, ) end +"""Get [`StorageTechnology`](@ref) `base_power`.""" +get_base_power(value::StorageTechnology) = value.base_power +"""Get [`StorageTechnology`](@ref) `capital_cost_energy`.""" +get_capital_cost_energy(value::StorageTechnology) = value.capital_cost_energy +"""Get [`StorageTechnology`](@ref) `initial_capacity_power`.""" +get_initial_capacity_power(value::StorageTechnology) = value.initial_capacity_power +"""Get [`StorageTechnology`](@ref) `prime_mover_type`.""" +get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type +"""Get [`StorageTechnology`](@ref) `capital_cost_power`.""" +get_capital_cost_power(value::StorageTechnology) = value.capital_cost_power +"""Get [`StorageTechnology`](@ref) `gen_ID`.""" +get_gen_ID(value::StorageTechnology) = value.gen_ID +"""Get [`StorageTechnology`](@ref) `available`.""" +get_available(value::StorageTechnology) = value.available """Get [`StorageTechnology`](@ref) `name`.""" get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech +"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" +get_minimum_required_capacity_power(value::StorageTechnology) = value.minimum_required_capacity_power +"""Get [`StorageTechnology`](@ref) `minimum_duration`.""" +get_minimum_duration(value::StorageTechnology) = value.minimum_duration """Get [`StorageTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::StorageTechnology) = value.power_systems_type -"""Get [`StorageTechnology`](@ref) `prime_mover_type`.""" -get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type """Get [`StorageTechnology`](@ref) `internal`.""" get_internal(value::StorageTechnology) = value.internal """Get [`StorageTechnology`](@ref) `ext`.""" get_ext(value::StorageTechnology) = value.ext -"""Get [`StorageTechnology`](@ref) `available`.""" -get_available(value::StorageTechnology) = value.available +"""Get [`StorageTechnology`](@ref) `balancing_topology`.""" +get_balancing_topology(value::StorageTechnology) = value.balancing_topology +"""Get [`StorageTechnology`](@ref) `region`.""" +get_region(value::StorageTechnology) = value.region +"""Get [`StorageTechnology`](@ref) `maximum_capacity`.""" +get_maximum_capacity(value::StorageTechnology) = value.maximum_capacity +"""Get [`StorageTechnology`](@ref) `maximum_duration`.""" +get_maximum_duration(value::StorageTechnology) = value.maximum_duration +"""Get [`StorageTechnology`](@ref) `initial_capacity_energy`.""" +get_initial_capacity_energy(value::StorageTechnology) = value.initial_capacity_energy +"""Get [`StorageTechnology`](@ref) `operations_cost_power`.""" +get_operations_cost_power(value::StorageTechnology) = value.operations_cost_power +"""Get [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" +get_maximum_capacity_energy(value::StorageTechnology) = value.maximum_capacity_energy +"""Get [`StorageTechnology`](@ref) `operations_cost_energy`.""" +get_operations_cost_energy(value::StorageTechnology) = value.operations_cost_energy +"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" +get_minimum_required_capacity_energy(value::StorageTechnology) = value.minimum_required_capacity_energy +"""Get [`StorageTechnology`](@ref) `variable_cost_power`.""" +get_variable_cost_power(value::StorageTechnology) = value.variable_cost_power +"""Get [`StorageTechnology`](@ref) `variable_cost_energy`.""" +get_variable_cost_energy(value::StorageTechnology) = value.variable_cost_energy +"""Set [`StorageTechnology`](@ref) `base_power`.""" +set_base_power!(value::StorageTechnology, val) = value.base_power = val +"""Set [`StorageTechnology`](@ref) `capital_cost_energy`.""" +set_capital_cost_energy!(value::StorageTechnology, val) = value.capital_cost_energy = val +"""Set [`StorageTechnology`](@ref) `initial_capacity_power`.""" +set_initial_capacity_power!(value::StorageTechnology, val) = value.initial_capacity_power = val +"""Set [`StorageTechnology`](@ref) `prime_mover_type`.""" +set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val +"""Set [`StorageTechnology`](@ref) `capital_cost_power`.""" +set_capital_cost_power!(value::StorageTechnology, val) = value.capital_cost_power = val +"""Set [`StorageTechnology`](@ref) `gen_ID`.""" +set_gen_ID!(value::StorageTechnology, val) = value.gen_ID = val +"""Set [`StorageTechnology`](@ref) `available`.""" +set_available!(value::StorageTechnology, val) = value.available = val """Set [`StorageTechnology`](@ref) `name`.""" set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val +"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" +set_minimum_required_capacity_power!(value::StorageTechnology, val) = value.minimum_required_capacity_power = val +"""Set [`StorageTechnology`](@ref) `minimum_duration`.""" +set_minimum_duration!(value::StorageTechnology, val) = value.minimum_duration = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::StorageTechnology, val) = value.power_systems_type = val -"""Set [`StorageTechnology`](@ref) `prime_mover_type`.""" -set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val """Set [`StorageTechnology`](@ref) `internal`.""" set_internal!(value::StorageTechnology, val) = value.internal = val """Set [`StorageTechnology`](@ref) `ext`.""" set_ext!(value::StorageTechnology, val) = value.ext = val -"""Set [`StorageTechnology`](@ref) `available`.""" -set_available!(value::StorageTechnology, val) = value.available = val +"""Set [`StorageTechnology`](@ref) `balancing_topology`.""" +set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val +"""Set [`StorageTechnology`](@ref) `region`.""" +set_region!(value::StorageTechnology, val) = value.region = val +"""Set [`StorageTechnology`](@ref) `maximum_capacity`.""" +set_maximum_capacity!(value::StorageTechnology, val) = value.maximum_capacity = val +"""Set [`StorageTechnology`](@ref) `maximum_duration`.""" +set_maximum_duration!(value::StorageTechnology, val) = value.maximum_duration = val +"""Set [`StorageTechnology`](@ref) `initial_capacity_energy`.""" +set_initial_capacity_energy!(value::StorageTechnology, val) = value.initial_capacity_energy = val +"""Set [`StorageTechnology`](@ref) `operations_cost_power`.""" +set_operations_cost_power!(value::StorageTechnology, val) = value.operations_cost_power = val +"""Set [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" +set_maximum_capacity_energy!(value::StorageTechnology, val) = value.maximum_capacity_energy = val +"""Set [`StorageTechnology`](@ref) `operations_cost_energy`.""" +set_operations_cost_energy!(value::StorageTechnology, val) = value.operations_cost_energy = val +"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" +set_minimum_required_capacity_energy!(value::StorageTechnology, val) = value.minimum_required_capacity_energy = val +"""Set [`StorageTechnology`](@ref) `variable_cost_power`.""" +set_variable_cost_power!(value::StorageTechnology, val) = value.variable_cost_power = val +"""Set [`StorageTechnology`](@ref) `variable_cost_energy`.""" +set_variable_cost_energy!(value::StorageTechnology, val) = value.variable_cost_energy = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 7f591f3..0a73347 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -7,48 +7,62 @@ This file is auto-generated. Do not edit. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 + outage_factor::Float64 prime_mover_type::PrimeMovers capital_cost::PSY.ValueCurve minimum_required_capacity::Float64 gen_ID::String available::Bool name::String + variable_capacity_factor::Float64 + ramp_down::Float64 initial_capacity::Float64 fuel::ThermalFuels power_systems_type::String internal::InfrastructureSystemsInternal variable_cost::PSY.ValueCurve + heat_rate::Float64 + minimum_generation::Float64 ext::Dict balancing_topology::String + region::String operations_cost::PSY.ValueCurve maximum_capacity::Float64 - capacity_factor::Float64 + ramp_up::Float64 end # Arguments - `base_power::Float64`: Base power +- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `gen_ID::String`: ID for individual generator - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name +- `variable_capacity_factor::Float64`: (default: `1.0`) Fraction of renewable resource capacity availble +- `ramp_down::Float64`: (default: `1.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `initial_capacity::Float64`: Pre-existing capacity for a technology - `fuel::ThermalFuels`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `variable_cost::PSY.ValueCurve`: Variable O&M costs for a technology +- `heat_rate::Float64`: (default: `1.0`) Heat rate of generator, MMBTU/MWh +- `minimum_generation::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes +- `region::String`: (default: `1.0`) Region/zone technology operates in - `operations_cost::PSY.ValueCurve`: Fixed O&M costs for a technology - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology -- `capacity_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology +- `ramp_up::Float64`: (default: `1.0`) Maximum increase in output between operation periods. Fraction of total capacity """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Base power" base_power::Float64 + "Derating factor to account for planned or forced outages of a technology" + outage_factor::Float64 "Prime mover for generator" prime_mover_type::PrimeMovers "Capital costs for investing in a technology." @@ -61,6 +75,10 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology available::Bool "The technology name" name::String + "Fraction of renewable resource capacity availble" + variable_capacity_factor::Float64 + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_down::Float64 "Pre-existing capacity for a technology" initial_capacity::Float64 "Fuel type according to IEA" @@ -71,25 +89,33 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology internal::InfrastructureSystemsInternal "Variable O&M costs for a technology" variable_cost::PSY.ValueCurve + "Heat rate of generator, MMBTU/MWh" + heat_rate::Float64 + "Minimum generation as a fraction of total capacity" + minimum_generation::Float64 "Option for providing additional data" ext::Dict "Set of balancing nodes" balancing_topology::String + "Region/zone technology operates in" + region::String "Fixed O&M costs for a technology" operations_cost::PSY.ValueCurve "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 - "Derating factor to account for planned or forced outages of a technology" - capacity_factor::Float64 + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up::Float64 end -function SupplyTechnology{T}(; base_power, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, minimum_required_capacity=0.0, gen_ID, available, name, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, internal=InfrastructureSystemsInternal(), variable_cost, ext=Dict(), balancing_topology, operations_cost, maximum_capacity=Inf, capacity_factor=1.0, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, prime_mover_type, capital_cost, minimum_required_capacity, gen_ID, available, name, initial_capacity, fuel, power_systems_type, internal, variable_cost, ext, balancing_topology, operations_cost, maximum_capacity, capacity_factor, ) +function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, minimum_required_capacity=0.0, gen_ID, available, name, variable_capacity_factor=1.0, ramp_down=1.0, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, internal=InfrastructureSystemsInternal(), variable_cost, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, ramp_up=1.0, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, minimum_required_capacity, gen_ID, available, name, variable_capacity_factor, ramp_down, initial_capacity, fuel, power_systems_type, internal, variable_cost, heat_rate, minimum_generation, ext, balancing_topology, region, operations_cost, maximum_capacity, ramp_up, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" get_base_power(value::SupplyTechnology) = value.base_power +"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" +get_outage_factor(value::SupplyTechnology) = value.outage_factor """Get [`SupplyTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::SupplyTechnology) = value.prime_mover_type """Get [`SupplyTechnology`](@ref) `capital_cost`.""" @@ -102,6 +128,10 @@ get_gen_ID(value::SupplyTechnology) = value.gen_ID get_available(value::SupplyTechnology) = value.available """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name +"""Get [`SupplyTechnology`](@ref) `variable_capacity_factor`.""" +get_variable_capacity_factor(value::SupplyTechnology) = value.variable_capacity_factor +"""Get [`SupplyTechnology`](@ref) `ramp_down`.""" +get_ramp_down(value::SupplyTechnology) = value.ramp_down """Get [`SupplyTechnology`](@ref) `initial_capacity`.""" get_initial_capacity(value::SupplyTechnology) = value.initial_capacity """Get [`SupplyTechnology`](@ref) `fuel`.""" @@ -112,19 +142,27 @@ get_power_systems_type(value::SupplyTechnology) = value.power_systems_type get_internal(value::SupplyTechnology) = value.internal """Get [`SupplyTechnology`](@ref) `variable_cost`.""" get_variable_cost(value::SupplyTechnology) = value.variable_cost +"""Get [`SupplyTechnology`](@ref) `heat_rate`.""" +get_heat_rate(value::SupplyTechnology) = value.heat_rate +"""Get [`SupplyTechnology`](@ref) `minimum_generation`.""" +get_minimum_generation(value::SupplyTechnology) = value.minimum_generation """Get [`SupplyTechnology`](@ref) `ext`.""" get_ext(value::SupplyTechnology) = value.ext """Get [`SupplyTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::SupplyTechnology) = value.balancing_topology +"""Get [`SupplyTechnology`](@ref) `region`.""" +get_region(value::SupplyTechnology) = value.region """Get [`SupplyTechnology`](@ref) `operations_cost`.""" get_operations_cost(value::SupplyTechnology) = value.operations_cost """Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity -"""Get [`SupplyTechnology`](@ref) `capacity_factor`.""" -get_capacity_factor(value::SupplyTechnology) = value.capacity_factor +"""Get [`SupplyTechnology`](@ref) `ramp_up`.""" +get_ramp_up(value::SupplyTechnology) = value.ramp_up """Set [`SupplyTechnology`](@ref) `base_power`.""" set_base_power!(value::SupplyTechnology, val) = value.base_power = val +"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" +set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val """Set [`SupplyTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::SupplyTechnology, val) = value.prime_mover_type = val """Set [`SupplyTechnology`](@ref) `capital_cost`.""" @@ -137,6 +175,10 @@ set_gen_ID!(value::SupplyTechnology, val) = value.gen_ID = val set_available!(value::SupplyTechnology, val) = value.available = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val +"""Set [`SupplyTechnology`](@ref) `variable_capacity_factor`.""" +set_variable_capacity_factor!(value::SupplyTechnology, val) = value.variable_capacity_factor = val +"""Set [`SupplyTechnology`](@ref) `ramp_down`.""" +set_ramp_down!(value::SupplyTechnology, val) = value.ramp_down = val """Set [`SupplyTechnology`](@ref) `initial_capacity`.""" set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val """Set [`SupplyTechnology`](@ref) `fuel`.""" @@ -147,13 +189,19 @@ set_power_systems_type!(value::SupplyTechnology, val) = value.power_systems_type set_internal!(value::SupplyTechnology, val) = value.internal = val """Set [`SupplyTechnology`](@ref) `variable_cost`.""" set_variable_cost!(value::SupplyTechnology, val) = value.variable_cost = val +"""Set [`SupplyTechnology`](@ref) `heat_rate`.""" +set_heat_rate!(value::SupplyTechnology, val) = value.heat_rate = val +"""Set [`SupplyTechnology`](@ref) `minimum_generation`.""" +set_minimum_generation!(value::SupplyTechnology, val) = value.minimum_generation = val """Set [`SupplyTechnology`](@ref) `ext`.""" set_ext!(value::SupplyTechnology, val) = value.ext = val """Set [`SupplyTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val +"""Set [`SupplyTechnology`](@ref) `region`.""" +set_region!(value::SupplyTechnology, val) = value.region = val """Set [`SupplyTechnology`](@ref) `operations_cost`.""" set_operations_cost!(value::SupplyTechnology, val) = value.operations_cost = val """Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val -"""Set [`SupplyTechnology`](@ref) `capacity_factor`.""" -set_capacity_factor!(value::SupplyTechnology, val) = value.capacity_factor = val +"""Set [`SupplyTechnology`](@ref) `ramp_up`.""" +set_ramp_up!(value::SupplyTechnology, val) = value.ramp_up = val diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 99faafe..e129998 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -6,58 +6,114 @@ This file is auto-generated. Do not edit. """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology + start_region::String + available::Bool name::String + end_region::String power_systems_type::String internal::InfrastructureSystemsInternal ext::Dict - available::Bool + resistance::Float64 + voltage::Float64 + existing_flow_capacity::Float64 + maximum_new_capacity::Float64 + line_loss::Float64 end # Arguments +- `start_region::String`: Start region for transport technology +- `available::Bool`: identifies whether the technology is available - `name::String`: The technology name +- `end_region::String`: End region for transport technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `available::Bool`: identifies whether the technology is available +- `resistance::Float64`: Technology resistance in Ohms +- `voltage::Float64`: Technology resistance in Ohms +- `existing_flow_capacity::Float64`: Existing capacity of transport technology (MW) +- `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) +- `line_loss::Float64`: Transmission loss for each transport technology (%) """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology + "Start region for transport technology" + start_region::String + "identifies whether the technology is available" + available::Bool "The technology name" name::String + "End region for transport technology" + end_region::String "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "identifies whether the technology is available" - available::Bool + "Technology resistance in Ohms" + resistance::Float64 + "Technology resistance in Ohms" + voltage::Float64 + "Existing capacity of transport technology (MW)" + existing_flow_capacity::Float64 + "Maximum capacity that can be added to transmission line (MW)" + maximum_new_capacity::Float64 + "Transmission loss for each transport technology (%)" + line_loss::Float64 end -function TransportTechnology{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.Device - TransportTechnology{T}(name, power_systems_type, internal, ext, available, ) +function TransportTechnology{T}(; start_region, available, name, end_region, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), resistance, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, ) where T <: PSY.Device + TransportTechnology{T}(start_region, available, name, end_region, power_systems_type, internal, ext, resistance, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, ) end +"""Get [`TransportTechnology`](@ref) `start_region`.""" +get_start_region(value::TransportTechnology) = value.start_region +"""Get [`TransportTechnology`](@ref) `available`.""" +get_available(value::TransportTechnology) = value.available """Get [`TransportTechnology`](@ref) `name`.""" get_name(value::TransportTechnology) = value.name +"""Get [`TransportTechnology`](@ref) `end_region`.""" +get_end_region(value::TransportTechnology) = value.end_region """Get [`TransportTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::TransportTechnology) = value.power_systems_type """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal """Get [`TransportTechnology`](@ref) `ext`.""" get_ext(value::TransportTechnology) = value.ext -"""Get [`TransportTechnology`](@ref) `available`.""" -get_available(value::TransportTechnology) = value.available +"""Get [`TransportTechnology`](@ref) `resistance`.""" +get_resistance(value::TransportTechnology) = value.resistance +"""Get [`TransportTechnology`](@ref) `voltage`.""" +get_voltage(value::TransportTechnology) = value.voltage +"""Get [`TransportTechnology`](@ref) `existing_flow_capacity`.""" +get_existing_flow_capacity(value::TransportTechnology) = value.existing_flow_capacity +"""Get [`TransportTechnology`](@ref) `maximum_new_capacity`.""" +get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity +"""Get [`TransportTechnology`](@ref) `line_loss`.""" +get_line_loss(value::TransportTechnology) = value.line_loss +"""Set [`TransportTechnology`](@ref) `start_region`.""" +set_start_region!(value::TransportTechnology, val) = value.start_region = val +"""Set [`TransportTechnology`](@ref) `available`.""" +set_available!(value::TransportTechnology, val) = value.available = val """Set [`TransportTechnology`](@ref) `name`.""" set_name!(value::TransportTechnology, val) = value.name = val +"""Set [`TransportTechnology`](@ref) `end_region`.""" +set_end_region!(value::TransportTechnology, val) = value.end_region = val """Set [`TransportTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_type = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val """Set [`TransportTechnology`](@ref) `ext`.""" set_ext!(value::TransportTechnology, val) = value.ext = val -"""Set [`TransportTechnology`](@ref) `available`.""" -set_available!(value::TransportTechnology, val) = value.available = val +"""Set [`TransportTechnology`](@ref) `resistance`.""" +set_resistance!(value::TransportTechnology, val) = value.resistance = val +"""Set [`TransportTechnology`](@ref) `voltage`.""" +set_voltage!(value::TransportTechnology, val) = value.voltage = val +"""Set [`TransportTechnology`](@ref) `existing_flow_capacity`.""" +set_existing_flow_capacity!(value::TransportTechnology, val) = value.existing_flow_capacity = val +"""Set [`TransportTechnology`](@ref) `maximum_new_capacity`.""" +set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val +"""Set [`TransportTechnology`](@ref) `line_loss`.""" +set_line_loss!(value::TransportTechnology, val) = value.line_loss = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index db0be6f..f266799 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -7,40 +7,98 @@ include("DemandSideTechnology.jl") export get_available export get_balancing_topology export get_base_power -export get_capacity_factor export get_capital_cost +export get_capital_cost_energy +export get_capital_cost_power +export get_cost_of_curtailment +export get_end_region +export get_existing_flow_capacity export get_ext export get_fuel export get_gen_ID +export get_heat_rate export get_initial_capacity +export get_initial_capacity_energy +export get_initial_capacity_power +export get_line_loss +export get_load_fraction export get_load_growth +export get_max_curtailment export get_maximum_capacity +export get_maximum_capacity_energy +export get_maximum_duration +export get_maximum_new_capacity +export get_minimum_duration +export get_minimum_generation export get_minimum_required_capacity +export get_minimum_required_capacity_energy +export get_minimum_required_capacity_power export get_name export get_operations_cost +export get_operations_cost_energy +export get_operations_cost_power +export get_outage_factor export get_peak_load export get_power_systems_type export get_prime_mover_type +export get_ramp_down +export get_ramp_up export get_region +export get_resistance +export get_start_region export get_storage_tech +export get_value_lost_load +export get_variable_capacity_factor export get_variable_cost +export get_variable_cost_energy +export get_variable_cost_power +export get_voltage export set_available! export set_balancing_topology! export set_base_power! -export set_capacity_factor! export set_capital_cost! +export set_capital_cost_energy! +export set_capital_cost_power! +export set_cost_of_curtailment! +export set_end_region! +export set_existing_flow_capacity! export set_ext! export set_fuel! export set_gen_ID! +export set_heat_rate! export set_initial_capacity! +export set_initial_capacity_energy! +export set_initial_capacity_power! +export set_line_loss! +export set_load_fraction! export set_load_growth! +export set_max_curtailment! export set_maximum_capacity! +export set_maximum_capacity_energy! +export set_maximum_duration! +export set_maximum_new_capacity! +export set_minimum_duration! +export set_minimum_generation! export set_minimum_required_capacity! +export set_minimum_required_capacity_energy! +export set_minimum_required_capacity_power! export set_name! export set_operations_cost! +export set_operations_cost_energy! +export set_operations_cost_power! +export set_outage_factor! export set_peak_load! export set_power_systems_type! export set_prime_mover_type! +export set_ramp_down! +export set_ramp_up! export set_region! +export set_resistance! +export set_start_region! export set_storage_tech! +export set_value_lost_load! +export set_variable_capacity_factor! export set_variable_cost! +export set_variable_cost_energy! +export set_variable_cost_power! +export set_voltage! From 55522e964cfa3993e1f1b17e93ac925f2e2b3314 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 16 Jul 2024 13:10:00 -0600 Subject: [PATCH 02/69] add electrolyzer and flexible demand structs --- src/PowerSystemsInvestmentsPortfolios.jl | 2 + src/models/generated/DemandRequirement.jl | 100 +++++++--------- src/models/generated/Electrolyzers.jl | 111 ++++++++++++++++++ .../generated/FlexibleDemandTechnology.jl | 95 +++++++++++++++ src/models/generated/StorageTechnology.jl | 56 +++++---- src/models/generated/SupplyTechnology.jl | 70 ++++++----- src/models/generated/includes.jl | 48 +++++--- 7 files changed, 359 insertions(+), 123 deletions(-) create mode 100644 src/models/generated/Electrolyzers.jl create mode 100644 src/models/generated/FlexibleDemandTechnology.jl diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index c96e1ba..5812416 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -33,6 +33,8 @@ export TransportTechnology export StorageTechnology export DemandRequirement export DemandsideTechnology +export FlexibleDemandTechnology +export Electrolyzers export add_technology! export add_technologies! diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index e658cd6..5b48adf 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -6,114 +6,98 @@ This file is auto-generated. Do not edit. """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - available::Bool name::String - value_lost_load::Float64 - cost_of_curtailment::Float64 - load_growth::Float64 power_systems_type::String internal::InfrastructureSystemsInternal + demand_mw_z::Float64 + value_lost_load::Float64 + max_curtailment::Float64 ext::Dict + cost_of_curtailment::Float64 region::String - load_fraction::Float64 - peak_load::Float64 - max_curtailment::Float64 + available::Bool end # Arguments -- `available::Bool`: (default: `true`) identifies whether the technology is available - `name::String`: The technology name -- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy ($/MWh) -- `cost_of_curtailment::Float64`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load -- `load_growth::Float64`: (default: `0.0`) Annual load growth (%) - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW +- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy ($/MWh) +- `max_curtailment::Float64`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `cost_of_curtailment::Float64`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load - `region::String`: Corresponding region for peak demand -- `load_fraction::Float64`: (default: `1.0`) Demand representedt as a fraction of peak load -- `peak_load::Float64`: (default: `100.0`) Demand value (MW) for single timepoint (for now) -- `max_curtailment::Float64`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period +- `available::Bool`: (default: `true`) identifies whether the technology is available """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - "identifies whether the technology is available" - available::Bool "The technology name" name::String - "Value of lost load/non-served energy ($/MWh)" - value_lost_load::Float64 - "Cost of non-served energy, fraction of value of lost load" - cost_of_curtailment::Float64 - "Annual load growth (%)" - load_growth::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal + "Demand profile in MW" + demand_mw_z::Float64 + "Value of lost load/non-served energy ($/MWh)" + value_lost_load::Float64 + "Maximum percentage of demand that can be curtailed in an investment period" + max_curtailment::Float64 "Option for providing additional data" ext::Dict + "Cost of non-served energy, fraction of value of lost load" + cost_of_curtailment::Float64 "Corresponding region for peak demand" region::String - "Demand representedt as a fraction of peak load" - load_fraction::Float64 - "Demand value (MW) for single timepoint (for now)" - peak_load::Float64 - "Maximum percentage of demand that can be curtailed in an investment period" - max_curtailment::Float64 + "identifies whether the technology is available" + available::Bool end -function DemandRequirement{T}(; available=true, name, value_lost_load=0.0, cost_of_curtailment=0.0, load_growth=0.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), region, load_fraction=1.0, peak_load=100.0, max_curtailment=0.0, ) where T <: PSY.StaticInjection - DemandRequirement{T}(available, name, value_lost_load, cost_of_curtailment, load_growth, power_systems_type, internal, ext, region, load_fraction, peak_load, max_curtailment, ) +function DemandRequirement{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, value_lost_load=0.0, max_curtailment=0.0, ext=Dict(), cost_of_curtailment=0.0, region, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, power_systems_type, internal, demand_mw_z, value_lost_load, max_curtailment, ext, cost_of_curtailment, region, available, ) end -"""Get [`DemandRequirement`](@ref) `available`.""" -get_available(value::DemandRequirement) = value.available """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name -"""Get [`DemandRequirement`](@ref) `value_lost_load`.""" -get_value_lost_load(value::DemandRequirement) = value.value_lost_load -"""Get [`DemandRequirement`](@ref) `cost_of_curtailment`.""" -get_cost_of_curtailment(value::DemandRequirement) = value.cost_of_curtailment -"""Get [`DemandRequirement`](@ref) `load_growth`.""" -get_load_growth(value::DemandRequirement) = value.load_growth """Get [`DemandRequirement`](@ref) `power_systems_type`.""" get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal +"""Get [`DemandRequirement`](@ref) `demand_mw_z`.""" +get_demand_mw_z(value::DemandRequirement) = value.demand_mw_z +"""Get [`DemandRequirement`](@ref) `value_lost_load`.""" +get_value_lost_load(value::DemandRequirement) = value.value_lost_load +"""Get [`DemandRequirement`](@ref) `max_curtailment`.""" +get_max_curtailment(value::DemandRequirement) = value.max_curtailment """Get [`DemandRequirement`](@ref) `ext`.""" get_ext(value::DemandRequirement) = value.ext +"""Get [`DemandRequirement`](@ref) `cost_of_curtailment`.""" +get_cost_of_curtailment(value::DemandRequirement) = value.cost_of_curtailment """Get [`DemandRequirement`](@ref) `region`.""" get_region(value::DemandRequirement) = value.region -"""Get [`DemandRequirement`](@ref) `load_fraction`.""" -get_load_fraction(value::DemandRequirement) = value.load_fraction -"""Get [`DemandRequirement`](@ref) `peak_load`.""" -get_peak_load(value::DemandRequirement) = value.peak_load -"""Get [`DemandRequirement`](@ref) `max_curtailment`.""" -get_max_curtailment(value::DemandRequirement) = value.max_curtailment +"""Get [`DemandRequirement`](@ref) `available`.""" +get_available(value::DemandRequirement) = value.available -"""Set [`DemandRequirement`](@ref) `available`.""" -set_available!(value::DemandRequirement, val) = value.available = val """Set [`DemandRequirement`](@ref) `name`.""" set_name!(value::DemandRequirement, val) = value.name = val -"""Set [`DemandRequirement`](@ref) `value_lost_load`.""" -set_value_lost_load!(value::DemandRequirement, val) = value.value_lost_load = val -"""Set [`DemandRequirement`](@ref) `cost_of_curtailment`.""" -set_cost_of_curtailment!(value::DemandRequirement, val) = value.cost_of_curtailment = val -"""Set [`DemandRequirement`](@ref) `load_growth`.""" -set_load_growth!(value::DemandRequirement, val) = value.load_growth = val """Set [`DemandRequirement`](@ref) `power_systems_type`.""" set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val +"""Set [`DemandRequirement`](@ref) `demand_mw_z`.""" +set_demand_mw_z!(value::DemandRequirement, val) = value.demand_mw_z = val +"""Set [`DemandRequirement`](@ref) `value_lost_load`.""" +set_value_lost_load!(value::DemandRequirement, val) = value.value_lost_load = val +"""Set [`DemandRequirement`](@ref) `max_curtailment`.""" +set_max_curtailment!(value::DemandRequirement, val) = value.max_curtailment = val """Set [`DemandRequirement`](@ref) `ext`.""" set_ext!(value::DemandRequirement, val) = value.ext = val +"""Set [`DemandRequirement`](@ref) `cost_of_curtailment`.""" +set_cost_of_curtailment!(value::DemandRequirement, val) = value.cost_of_curtailment = val """Set [`DemandRequirement`](@ref) `region`.""" set_region!(value::DemandRequirement, val) = value.region = val -"""Set [`DemandRequirement`](@ref) `load_fraction`.""" -set_load_fraction!(value::DemandRequirement, val) = value.load_fraction = val -"""Set [`DemandRequirement`](@ref) `peak_load`.""" -set_peak_load!(value::DemandRequirement, val) = value.peak_load = val -"""Set [`DemandRequirement`](@ref) `max_curtailment`.""" -set_max_curtailment!(value::DemandRequirement, val) = value.max_curtailment = val +"""Set [`DemandRequirement`](@ref) `available`.""" +set_available!(value::DemandRequirement, val) = value.available = val diff --git a/src/models/generated/Electrolyzers.jl b/src/models/generated/Electrolyzers.jl new file mode 100644 index 0000000..32bb403 --- /dev/null +++ b/src/models/generated/Electrolyzers.jl @@ -0,0 +1,111 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology + available::Bool + name::String + ramp_down::Float64 + hydrogen_mwh_per_tonne::PSY.ValueCurve + power_systems_type::String + internal::InfrastructureSystemsInternal + hydrogen_price_per_tonne::Float64 + ext::Dict + electrolyzer_min_kt::Float64 + min_power::Float64 + ramp_up::Float64 + end + + + +# Arguments +- `available::Bool`: identifies whether the technology is available +- `name::String`: The technology name +- `ramp_down::Float64`: Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. +- `hydrogen_mwh_per_tonne::PSY.ValueCurve`: Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t) +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `hydrogen_price_per_tonne::Float64`: Price (or value) of hydrogen per metric tonne (/t) +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `electrolyzer_min_kt::Float64`: Minimum annual quantity of hydrogen that must be produced by electrolyzer in kilotonnes (kt) +- `min_power::Float64`: The minimum generation level for a unit as a fraction of total capacity. +- `ramp_up::Float64`: Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. +""" +mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology + "identifies whether the technology is available" + available::Bool + "The technology name" + name::String + "Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." + ramp_down::Float64 + "Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t)" + hydrogen_mwh_per_tonne::PSY.ValueCurve + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "Internal field" + internal::InfrastructureSystemsInternal + "Price (or value) of hydrogen per metric tonne (/t)" + hydrogen_price_per_tonne::Float64 + "Option for providing additional data" + ext::Dict + "Minimum annual quantity of hydrogen that must be produced by electrolyzer in kilotonnes (kt)" + electrolyzer_min_kt::Float64 + "The minimum generation level for a unit as a fraction of total capacity." + min_power::Float64 + "Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." + ramp_up::Float64 +end + + +function Electrolyzers{T}(; available, name, ramp_down, hydrogen_mwh_per_tonne, power_systems_type, internal=InfrastructureSystemsInternal(), hydrogen_price_per_tonne, ext=Dict(), electrolyzer_min_kt, min_power, ramp_up, ) where T <: PSY.StaticInjection + Electrolyzers{T}(available, name, ramp_down, hydrogen_mwh_per_tonne, power_systems_type, internal, hydrogen_price_per_tonne, ext, electrolyzer_min_kt, min_power, ramp_up, ) +end + +"""Get [`Electrolyzers`](@ref) `available`.""" +get_available(value::Electrolyzers) = value.available +"""Get [`Electrolyzers`](@ref) `name`.""" +get_name(value::Electrolyzers) = value.name +"""Get [`Electrolyzers`](@ref) `ramp_down`.""" +get_ramp_down(value::Electrolyzers) = value.ramp_down +"""Get [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" +get_hydrogen_mwh_per_tonne(value::Electrolyzers) = value.hydrogen_mwh_per_tonne +"""Get [`Electrolyzers`](@ref) `power_systems_type`.""" +get_power_systems_type(value::Electrolyzers) = value.power_systems_type +"""Get [`Electrolyzers`](@ref) `internal`.""" +get_internal(value::Electrolyzers) = value.internal +"""Get [`Electrolyzers`](@ref) `hydrogen_price_per_tonne`.""" +get_hydrogen_price_per_tonne(value::Electrolyzers) = value.hydrogen_price_per_tonne +"""Get [`Electrolyzers`](@ref) `ext`.""" +get_ext(value::Electrolyzers) = value.ext +"""Get [`Electrolyzers`](@ref) `electrolyzer_min_kt`.""" +get_electrolyzer_min_kt(value::Electrolyzers) = value.electrolyzer_min_kt +"""Get [`Electrolyzers`](@ref) `min_power`.""" +get_min_power(value::Electrolyzers) = value.min_power +"""Get [`Electrolyzers`](@ref) `ramp_up`.""" +get_ramp_up(value::Electrolyzers) = value.ramp_up + +"""Set [`Electrolyzers`](@ref) `available`.""" +set_available!(value::Electrolyzers, val) = value.available = val +"""Set [`Electrolyzers`](@ref) `name`.""" +set_name!(value::Electrolyzers, val) = value.name = val +"""Set [`Electrolyzers`](@ref) `ramp_down`.""" +set_ramp_down!(value::Electrolyzers, val) = value.ramp_down = val +"""Set [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" +set_hydrogen_mwh_per_tonne!(value::Electrolyzers, val) = value.hydrogen_mwh_per_tonne = val +"""Set [`Electrolyzers`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::Electrolyzers, val) = value.power_systems_type = val +"""Set [`Electrolyzers`](@ref) `internal`.""" +set_internal!(value::Electrolyzers, val) = value.internal = val +"""Set [`Electrolyzers`](@ref) `hydrogen_price_per_tonne`.""" +set_hydrogen_price_per_tonne!(value::Electrolyzers, val) = value.hydrogen_price_per_tonne = val +"""Set [`Electrolyzers`](@ref) `ext`.""" +set_ext!(value::Electrolyzers, val) = value.ext = val +"""Set [`Electrolyzers`](@ref) `electrolyzer_min_kt`.""" +set_electrolyzer_min_kt!(value::Electrolyzers, val) = value.electrolyzer_min_kt = val +"""Set [`Electrolyzers`](@ref) `min_power`.""" +set_min_power!(value::Electrolyzers, val) = value.min_power = val +"""Set [`Electrolyzers`](@ref) `ramp_up`.""" +set_ramp_up!(value::Electrolyzers, val) = value.ramp_up = val diff --git a/src/models/generated/FlexibleDemandTechnology.jl b/src/models/generated/FlexibleDemandTechnology.jl new file mode 100644 index 0000000..7fd5e9a --- /dev/null +++ b/src/models/generated/FlexibleDemandTechnology.jl @@ -0,0 +1,95 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct FlexibleDemandTechnology{T <: PSY.StaticInjection} <: Technology + max_demand_delay::Float64 + name::String + power_systems_type::String + var_cost_per_mwh::PSY.ValueCurve + internal::InfrastructureSystemsInternal + ext::Dict + max_demand_advance::Float64 + demand_energy_efficiency::Float64 + available::Bool + end + + + +# Arguments +- `max_demand_delay::Float64`: Maximum number of hours that demand can be deferred or delayed (hours). +- `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `var_cost_per_mwh::PSY.ValueCurve`: Variable operations and maintenance costs associated with flexible demand deferral +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `max_demand_advance::Float64`: Maximum number of hours that demand can be scheduled in advance of the original schedule (hours). +- `demand_energy_efficiency::Float64`: Energy efficiency associated with time shifting demand. Represents energy losses due to time shifting +- `available::Bool`: identifies whether the technology is available +""" +mutable struct FlexibleDemandTechnology{T <: PSY.StaticInjection} <: Technology + "Maximum number of hours that demand can be deferred or delayed (hours)." + max_demand_delay::Float64 + "The technology name" + name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "Variable operations and maintenance costs associated with flexible demand deferral" + var_cost_per_mwh::PSY.ValueCurve + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Maximum number of hours that demand can be scheduled in advance of the original schedule (hours)." + max_demand_advance::Float64 + "Energy efficiency associated with time shifting demand. Represents energy losses due to time shifting" + demand_energy_efficiency::Float64 + "identifies whether the technology is available" + available::Bool +end + + +function FlexibleDemandTechnology{T}(; max_demand_delay, name, power_systems_type, var_cost_per_mwh, internal=InfrastructureSystemsInternal(), ext=Dict(), max_demand_advance, demand_energy_efficiency, available, ) where T <: PSY.StaticInjection + FlexibleDemandTechnology{T}(max_demand_delay, name, power_systems_type, var_cost_per_mwh, internal, ext, max_demand_advance, demand_energy_efficiency, available, ) +end + +"""Get [`FlexibleDemandTechnology`](@ref) `max_demand_delay`.""" +get_max_demand_delay(value::FlexibleDemandTechnology) = value.max_demand_delay +"""Get [`FlexibleDemandTechnology`](@ref) `name`.""" +get_name(value::FlexibleDemandTechnology) = value.name +"""Get [`FlexibleDemandTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::FlexibleDemandTechnology) = value.power_systems_type +"""Get [`FlexibleDemandTechnology`](@ref) `var_cost_per_mwh`.""" +get_var_cost_per_mwh(value::FlexibleDemandTechnology) = value.var_cost_per_mwh +"""Get [`FlexibleDemandTechnology`](@ref) `internal`.""" +get_internal(value::FlexibleDemandTechnology) = value.internal +"""Get [`FlexibleDemandTechnology`](@ref) `ext`.""" +get_ext(value::FlexibleDemandTechnology) = value.ext +"""Get [`FlexibleDemandTechnology`](@ref) `max_demand_advance`.""" +get_max_demand_advance(value::FlexibleDemandTechnology) = value.max_demand_advance +"""Get [`FlexibleDemandTechnology`](@ref) `demand_energy_efficiency`.""" +get_demand_energy_efficiency(value::FlexibleDemandTechnology) = value.demand_energy_efficiency +"""Get [`FlexibleDemandTechnology`](@ref) `available`.""" +get_available(value::FlexibleDemandTechnology) = value.available + +"""Set [`FlexibleDemandTechnology`](@ref) `max_demand_delay`.""" +set_max_demand_delay!(value::FlexibleDemandTechnology, val) = value.max_demand_delay = val +"""Set [`FlexibleDemandTechnology`](@ref) `name`.""" +set_name!(value::FlexibleDemandTechnology, val) = value.name = val +"""Set [`FlexibleDemandTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::FlexibleDemandTechnology, val) = value.power_systems_type = val +"""Set [`FlexibleDemandTechnology`](@ref) `var_cost_per_mwh`.""" +set_var_cost_per_mwh!(value::FlexibleDemandTechnology, val) = value.var_cost_per_mwh = val +"""Set [`FlexibleDemandTechnology`](@ref) `internal`.""" +set_internal!(value::FlexibleDemandTechnology, val) = value.internal = val +"""Set [`FlexibleDemandTechnology`](@ref) `ext`.""" +set_ext!(value::FlexibleDemandTechnology, val) = value.ext = val +"""Set [`FlexibleDemandTechnology`](@ref) `max_demand_advance`.""" +set_max_demand_advance!(value::FlexibleDemandTechnology, val) = value.max_demand_advance = val +"""Set [`FlexibleDemandTechnology`](@ref) `demand_energy_efficiency`.""" +set_demand_energy_efficiency!(value::FlexibleDemandTechnology, val) = value.demand_energy_efficiency = val +"""Set [`FlexibleDemandTechnology`](@ref) `available`.""" +set_available!(value::FlexibleDemandTechnology, val) = value.available = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index c52cd3e..435b48b 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -15,8 +15,11 @@ This file is auto-generated. Do not edit. available::Bool name::String storage_tech::StorageTech + efficiency_down::Float64 + self_discharge::Float64 minimum_required_capacity_power::Float64 minimum_duration::Float64 + efficiency_up::Float64 power_systems_type::String internal::InfrastructureSystemsInternal ext::Dict @@ -25,12 +28,10 @@ This file is auto-generated. Do not edit. maximum_capacity::Float64 maximum_duration::Float64 initial_capacity_energy::Float64 - operations_cost_power::PSY.ValueCurve + operations_cost_power::PSY.OperationalCost maximum_capacity_energy::Float64 - operations_cost_energy::PSY.ValueCurve + operations_cost_energy::PSY.OperationalCost minimum_required_capacity_energy::Float64 - variable_cost_power::PSY.ValueCurve - variable_cost_energy::PSY.ValueCurve end @@ -45,8 +46,11 @@ This file is auto-generated. Do not edit. - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type +- `efficiency_down::Float64`: (default: `1.0`) Efficiency of discharging storage +- `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage - `minimum_required_capacity_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology - `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `efficiency_up::Float64`: (default: `1.0`) Efficiency of charging storage - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -55,12 +59,10 @@ This file is auto-generated. Do not edit. - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed power capacity for a storage technology - `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology - `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) -- `operations_cost_power::PSY.ValueCurve`: Fixed O&M costs for a technology +- `operations_cost_power::PSY.OperationalCost`: Fixed O&M costs for a technology - `maximum_capacity_energy::Float64`: (default: `Inf`) Maximum allowable installed energy capacity for a storage technology -- `operations_cost_energy::PSY.ValueCurve`: Fixed O&M costs for energy capacity of storage technology +- `operations_cost_energy::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology - `minimum_required_capacity_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology -- `variable_cost_power::PSY.ValueCurve`: Variable O&M costs for a technology -- `variable_cost_energy::PSY.ValueCurve`: Variable O&M costs for energy capacity of storage technology """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology "Base power" @@ -81,10 +83,16 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology name::String "Storage Technology Type" storage_tech::StorageTech + "Efficiency of discharging storage" + efficiency_down::Float64 + "Efficiency of discharging storage" + self_discharge::Float64 "Minimum required power capacity for a storage technology" minimum_required_capacity_power::Float64 "Minimum required durection for a storage technology" minimum_duration::Float64 + "Efficiency of charging storage" + efficiency_up::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" @@ -102,22 +110,18 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology "Pre-existing energy capacity for a technology (MWh)" initial_capacity_energy::Float64 "Fixed O&M costs for a technology" - operations_cost_power::PSY.ValueCurve + operations_cost_power::PSY.OperationalCost "Maximum allowable installed energy capacity for a storage technology" maximum_capacity_energy::Float64 "Fixed O&M costs for energy capacity of storage technology" - operations_cost_energy::PSY.ValueCurve + operations_cost_energy::PSY.OperationalCost "Minimum required energy capacity for a storage technology" minimum_required_capacity_energy::Float64 - "Variable O&M costs for a technology" - variable_cost_power::PSY.ValueCurve - "Variable O&M costs for energy capacity of storage technology" - variable_cost_energy::PSY.ValueCurve end -function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_power=0.0, gen_ID, available, name, storage_tech, minimum_required_capacity_power=0.0, minimum_duration=0.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, variable_cost_power, variable_cost_energy, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_power, gen_ID, available, name, storage_tech, minimum_required_capacity_power, minimum_duration, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, variable_cost_power, variable_cost_energy, ) +function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_power=0.0, gen_ID, available, name, storage_tech, efficiency_down=1.0, self_discharge=1.0, minimum_required_capacity_power=0.0, minimum_duration=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_power, gen_ID, available, name, storage_tech, efficiency_down, self_discharge, minimum_required_capacity_power, minimum_duration, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" @@ -138,10 +142,16 @@ get_available(value::StorageTechnology) = value.available get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech +"""Get [`StorageTechnology`](@ref) `efficiency_down`.""" +get_efficiency_down(value::StorageTechnology) = value.efficiency_down +"""Get [`StorageTechnology`](@ref) `self_discharge`.""" +get_self_discharge(value::StorageTechnology) = value.self_discharge """Get [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" get_minimum_required_capacity_power(value::StorageTechnology) = value.minimum_required_capacity_power """Get [`StorageTechnology`](@ref) `minimum_duration`.""" get_minimum_duration(value::StorageTechnology) = value.minimum_duration +"""Get [`StorageTechnology`](@ref) `efficiency_up`.""" +get_efficiency_up(value::StorageTechnology) = value.efficiency_up """Get [`StorageTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::StorageTechnology) = value.power_systems_type """Get [`StorageTechnology`](@ref) `internal`.""" @@ -166,10 +176,6 @@ get_maximum_capacity_energy(value::StorageTechnology) = value.maximum_capacity_e get_operations_cost_energy(value::StorageTechnology) = value.operations_cost_energy """Get [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" get_minimum_required_capacity_energy(value::StorageTechnology) = value.minimum_required_capacity_energy -"""Get [`StorageTechnology`](@ref) `variable_cost_power`.""" -get_variable_cost_power(value::StorageTechnology) = value.variable_cost_power -"""Get [`StorageTechnology`](@ref) `variable_cost_energy`.""" -get_variable_cost_energy(value::StorageTechnology) = value.variable_cost_energy """Set [`StorageTechnology`](@ref) `base_power`.""" set_base_power!(value::StorageTechnology, val) = value.base_power = val @@ -189,10 +195,16 @@ set_available!(value::StorageTechnology, val) = value.available = val set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val +"""Set [`StorageTechnology`](@ref) `efficiency_down`.""" +set_efficiency_down!(value::StorageTechnology, val) = value.efficiency_down = val +"""Set [`StorageTechnology`](@ref) `self_discharge`.""" +set_self_discharge!(value::StorageTechnology, val) = value.self_discharge = val """Set [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" set_minimum_required_capacity_power!(value::StorageTechnology, val) = value.minimum_required_capacity_power = val """Set [`StorageTechnology`](@ref) `minimum_duration`.""" set_minimum_duration!(value::StorageTechnology, val) = value.minimum_duration = val +"""Set [`StorageTechnology`](@ref) `efficiency_up`.""" +set_efficiency_up!(value::StorageTechnology, val) = value.efficiency_up = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::StorageTechnology, val) = value.power_systems_type = val """Set [`StorageTechnology`](@ref) `internal`.""" @@ -217,7 +229,3 @@ set_maximum_capacity_energy!(value::StorageTechnology, val) = value.maximum_capa set_operations_cost_energy!(value::StorageTechnology, val) = value.operations_cost_energy = val """Set [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" set_minimum_required_capacity_energy!(value::StorageTechnology, val) = value.minimum_required_capacity_energy = val -"""Set [`StorageTechnology`](@ref) `variable_cost_power`.""" -set_variable_cost_power!(value::StorageTechnology, val) = value.variable_cost_power = val -"""Set [`StorageTechnology`](@ref) `variable_cost_energy`.""" -set_variable_cost_energy!(value::StorageTechnology, val) = value.variable_cost_energy = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 0a73347..c217647 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -10,23 +10,25 @@ This file is auto-generated. Do not edit. outage_factor::Float64 prime_mover_type::PrimeMovers capital_cost::PSY.ValueCurve + cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} minimum_required_capacity::Float64 + cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} gen_ID::String + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} available::Bool name::String - variable_capacity_factor::Float64 ramp_down::Float64 initial_capacity::Float64 - fuel::ThermalFuels + fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} power_systems_type::String + cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} internal::InfrastructureSystemsInternal - variable_cost::PSY.ValueCurve - heat_rate::Float64 + heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} minimum_generation::Float64 ext::Dict balancing_topology::String region::String - operations_cost::PSY.ValueCurve + operations_cost::PSY.OperationalCost maximum_capacity::Float64 ramp_up::Float64 end @@ -38,23 +40,25 @@ This file is auto-generated. Do not edit. - `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during normal generation process for multi-fuel generator - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology +- `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during start-up process for multi-fuel generator - `gen_ID::String`: ID for individual generator +- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during start-up process for multi-fuel generator - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name -- `variable_capacity_factor::Float64`: (default: `1.0`) Fraction of renewable resource capacity availble - `ramp_down::Float64`: (default: `1.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `initial_capacity::Float64`: Pre-existing capacity for a technology -- `fuel::ThermalFuels`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA +- `fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during normal generation process for multi-fuel generator - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `variable_cost::PSY.ValueCurve`: Variable O&M costs for a technology -- `heat_rate::Float64`: (default: `1.0`) Heat rate of generator, MMBTU/MWh +- `heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `1.0`) Heat rate of generator, MMBTU/MWh - `minimum_generation::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes - `region::String`: (default: `1.0`) Region/zone technology operates in -- `operations_cost::PSY.ValueCurve`: Fixed O&M costs for a technology +- `operations_cost::PSY.OperationalCost`: Fixed O&M costs for a technology - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology - `ramp_up::Float64`: (default: `1.0`) Maximum increase in output between operation periods. Fraction of total capacity """ @@ -67,30 +71,34 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology prime_mover_type::PrimeMovers "Capital costs for investing in a technology." capital_cost::PSY.ValueCurve + "Minimum blending level of each fuel during normal generation process for multi-fuel generator" + cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Minimum required capacity for a technology" minimum_required_capacity::Float64 + "Maximum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} "ID for individual generator" gen_ID::String + "Minimum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} "identifies whether the technology is available" available::Bool "The technology name" name::String - "Fraction of renewable resource capacity availble" - variable_capacity_factor::Float64 "Maximum decrease in output between operation periods. Fraction of total capacity" ramp_down::Float64 "Pre-existing capacity for a technology" initial_capacity::Float64 "Fuel type according to IEA" - fuel::ThermalFuels + fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String + "Maximum blending level of each fuel during normal generation process for multi-fuel generator" + cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} "Internal field" internal::InfrastructureSystemsInternal - "Variable O&M costs for a technology" - variable_cost::PSY.ValueCurve "Heat rate of generator, MMBTU/MWh" - heat_rate::Float64 + heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} "Minimum generation as a fraction of total capacity" minimum_generation::Float64 "Option for providing additional data" @@ -100,7 +108,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Region/zone technology operates in" region::String "Fixed O&M costs for a technology" - operations_cost::PSY.ValueCurve + operations_cost::PSY.OperationalCost "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 "Maximum increase in output between operation periods. Fraction of total capacity" @@ -108,8 +116,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, minimum_required_capacity=0.0, gen_ID, available, name, variable_capacity_factor=1.0, ramp_down=1.0, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, internal=InfrastructureSystemsInternal(), variable_cost, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, ramp_up=1.0, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, minimum_required_capacity, gen_ID, available, name, variable_capacity_factor, ramp_down, initial_capacity, fuel, power_systems_type, internal, variable_cost, heat_rate, minimum_generation, ext, balancing_topology, region, operations_cost, maximum_capacity, ramp_up, ) +function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down=1.0, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max, internal=InfrastructureSystemsInternal(), heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, ramp_up=1.0, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, initial_capacity, fuel, power_systems_type, cofire_level_max, internal, heat_rate, minimum_generation, ext, balancing_topology, region, operations_cost, maximum_capacity, ramp_up, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -120,16 +128,20 @@ get_outage_factor(value::SupplyTechnology) = value.outage_factor get_prime_mover_type(value::SupplyTechnology) = value.prime_mover_type """Get [`SupplyTechnology`](@ref) `capital_cost`.""" get_capital_cost(value::SupplyTechnology) = value.capital_cost +"""Get [`SupplyTechnology`](@ref) `cofire_level_min`.""" +get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min """Get [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_capacity +"""Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" +get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max """Get [`SupplyTechnology`](@ref) `gen_ID`.""" get_gen_ID(value::SupplyTechnology) = value.gen_ID +"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" +get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min """Get [`SupplyTechnology`](@ref) `available`.""" get_available(value::SupplyTechnology) = value.available """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name -"""Get [`SupplyTechnology`](@ref) `variable_capacity_factor`.""" -get_variable_capacity_factor(value::SupplyTechnology) = value.variable_capacity_factor """Get [`SupplyTechnology`](@ref) `ramp_down`.""" get_ramp_down(value::SupplyTechnology) = value.ramp_down """Get [`SupplyTechnology`](@ref) `initial_capacity`.""" @@ -138,10 +150,10 @@ get_initial_capacity(value::SupplyTechnology) = value.initial_capacity get_fuel(value::SupplyTechnology) = value.fuel """Get [`SupplyTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::SupplyTechnology) = value.power_systems_type +"""Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" +get_cofire_level_max(value::SupplyTechnology) = value.cofire_level_max """Get [`SupplyTechnology`](@ref) `internal`.""" get_internal(value::SupplyTechnology) = value.internal -"""Get [`SupplyTechnology`](@ref) `variable_cost`.""" -get_variable_cost(value::SupplyTechnology) = value.variable_cost """Get [`SupplyTechnology`](@ref) `heat_rate`.""" get_heat_rate(value::SupplyTechnology) = value.heat_rate """Get [`SupplyTechnology`](@ref) `minimum_generation`.""" @@ -167,16 +179,20 @@ set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val set_prime_mover_type!(value::SupplyTechnology, val) = value.prime_mover_type = val """Set [`SupplyTechnology`](@ref) `capital_cost`.""" set_capital_cost!(value::SupplyTechnology, val) = value.capital_cost = val +"""Set [`SupplyTechnology`](@ref) `cofire_level_min`.""" +set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val """Set [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_required_capacity = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" +set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val """Set [`SupplyTechnology`](@ref) `gen_ID`.""" set_gen_ID!(value::SupplyTechnology, val) = value.gen_ID = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" +set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val """Set [`SupplyTechnology`](@ref) `available`.""" set_available!(value::SupplyTechnology, val) = value.available = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val -"""Set [`SupplyTechnology`](@ref) `variable_capacity_factor`.""" -set_variable_capacity_factor!(value::SupplyTechnology, val) = value.variable_capacity_factor = val """Set [`SupplyTechnology`](@ref) `ramp_down`.""" set_ramp_down!(value::SupplyTechnology, val) = value.ramp_down = val """Set [`SupplyTechnology`](@ref) `initial_capacity`.""" @@ -185,10 +201,10 @@ set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = v set_fuel!(value::SupplyTechnology, val) = value.fuel = val """Set [`SupplyTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::SupplyTechnology, val) = value.power_systems_type = val +"""Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" +set_cofire_level_max!(value::SupplyTechnology, val) = value.cofire_level_max = val """Set [`SupplyTechnology`](@ref) `internal`.""" set_internal!(value::SupplyTechnology, val) = value.internal = val -"""Set [`SupplyTechnology`](@ref) `variable_cost`.""" -set_variable_cost!(value::SupplyTechnology, val) = value.variable_cost = val """Set [`SupplyTechnology`](@ref) `heat_rate`.""" set_heat_rate!(value::SupplyTechnology, val) = value.heat_rate = val """Set [`SupplyTechnology`](@ref) `minimum_generation`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index f266799..8795a33 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,7 +1,9 @@ +include("Electrolyzers.jl") include("TransportTechnology.jl") include("SupplyTechnology.jl") include("DemandRequirement.jl") include("StorageTechnology.jl") +include("FlexibleDemandTechnology.jl") include("DemandSideTechnology.jl") export get_available @@ -10,24 +12,36 @@ export get_base_power export get_capital_cost export get_capital_cost_energy export get_capital_cost_power +export get_cofire_level_max +export get_cofire_level_min +export get_cofire_start_max +export get_cofire_start_min export get_cost_of_curtailment +export get_demand_energy_efficiency +export get_demand_mw_z +export get_efficiency_down +export get_efficiency_up +export get_electrolyzer_min_kt export get_end_region export get_existing_flow_capacity export get_ext export get_fuel export get_gen_ID export get_heat_rate +export get_hydrogen_mwh_per_tonne +export get_hydrogen_price_per_tonne export get_initial_capacity export get_initial_capacity_energy export get_initial_capacity_power export get_line_loss -export get_load_fraction -export get_load_growth export get_max_curtailment +export get_max_demand_advance +export get_max_demand_delay export get_maximum_capacity export get_maximum_capacity_energy export get_maximum_duration export get_maximum_new_capacity +export get_min_power export get_minimum_duration export get_minimum_generation export get_minimum_required_capacity @@ -38,20 +52,17 @@ export get_operations_cost export get_operations_cost_energy export get_operations_cost_power export get_outage_factor -export get_peak_load export get_power_systems_type export get_prime_mover_type export get_ramp_down export get_ramp_up export get_region export get_resistance +export get_self_discharge export get_start_region export get_storage_tech export get_value_lost_load -export get_variable_capacity_factor -export get_variable_cost -export get_variable_cost_energy -export get_variable_cost_power +export get_var_cost_per_mwh export get_voltage export set_available! export set_balancing_topology! @@ -59,24 +70,36 @@ export set_base_power! export set_capital_cost! export set_capital_cost_energy! export set_capital_cost_power! +export set_cofire_level_max! +export set_cofire_level_min! +export set_cofire_start_max! +export set_cofire_start_min! export set_cost_of_curtailment! +export set_demand_energy_efficiency! +export set_demand_mw_z! +export set_efficiency_down! +export set_efficiency_up! +export set_electrolyzer_min_kt! export set_end_region! export set_existing_flow_capacity! export set_ext! export set_fuel! export set_gen_ID! export set_heat_rate! +export set_hydrogen_mwh_per_tonne! +export set_hydrogen_price_per_tonne! export set_initial_capacity! export set_initial_capacity_energy! export set_initial_capacity_power! export set_line_loss! -export set_load_fraction! -export set_load_growth! export set_max_curtailment! +export set_max_demand_advance! +export set_max_demand_delay! export set_maximum_capacity! export set_maximum_capacity_energy! export set_maximum_duration! export set_maximum_new_capacity! +export set_min_power! export set_minimum_duration! export set_minimum_generation! export set_minimum_required_capacity! @@ -87,18 +110,15 @@ export set_operations_cost! export set_operations_cost_energy! export set_operations_cost_power! export set_outage_factor! -export set_peak_load! export set_power_systems_type! export set_prime_mover_type! export set_ramp_down! export set_ramp_up! export set_region! export set_resistance! +export set_self_discharge! export set_start_region! export set_storage_tech! export set_value_lost_load! -export set_variable_capacity_factor! -export set_variable_cost! -export set_variable_cost_energy! -export set_variable_cost_power! +export set_var_cost_per_mwh! export set_voltage! From 95b3522043883069a06a3681cecf5a5de0bdcc56 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 22 Jul 2024 10:50:55 -0600 Subject: [PATCH 03/69] typo --- src/models/generated/DemandRequirement.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index 5b48adf..146852c 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -25,7 +25,7 @@ This file is auto-generated. Do not edit. - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW -- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy ($/MWh) +- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy (USD/MWh) - `max_curtailment::Float64`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `cost_of_curtailment::Float64`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load @@ -41,7 +41,7 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology internal::InfrastructureSystemsInternal "Demand profile in MW" demand_mw_z::Float64 - "Value of lost load/non-served energy ($/MWh)" + "Value of lost load/non-served energy (USD/MWh)" value_lost_load::Float64 "Maximum percentage of demand that can be curtailed in an investment period" max_curtailment::Float64 From f13d3fcee97b810a036e0998ba5aa62609147ee9 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 23 Jul 2024 09:51:49 -0600 Subject: [PATCH 04/69] update IS dependency --- src/PowerSystemsInvestmentsPortfolios.jl | 1 + src/models/technologies.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 5812416..9189301 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -11,6 +11,7 @@ import InfrastructureSystems: get_time_series_array, get_time_series_timestamps, get_time_series_values, + supports_time_series, InfrastructureSystemsInternal, CompressionSettings, CompressionTypes, diff --git a/src/models/technologies.jl b/src/models/technologies.jl index bfe3eb6..d6c73e1 100644 --- a/src/models/technologies.jl +++ b/src/models/technologies.jl @@ -20,4 +20,4 @@ get_ext(val::Technology) = get_ext(get_internal(val)) get_time_series_container(val::Technology) = val.time_series_container get_supplemental_attributes_container(val::Technology) = val.supplemental_attributes_container -IS.supports_time_series(::Technology) = true +supports_time_series(::Technology) = true From add5332d7b29312187a7eff72d1715e455dfc447 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 23 Jul 2024 13:44:36 -0600 Subject: [PATCH 05/69] add colocated resources, retireable and retofittable techs --- .../CoLocatedSupplyStorageTechnology.jl | 335 ++++++++++++++++++ src/models/generated/RetireableTechnology.jl | 56 +++ src/models/generated/RetrofitTechnology.jl | 74 ++++ src/models/generated/StorageTechnology.jl | 100 ++++-- src/models/generated/SupplyTechnology.jl | 100 ++++-- src/models/generated/TransportTechnology.jl | 56 ++- src/models/generated/includes.jl | 83 +++++ 7 files changed, 736 insertions(+), 68 deletions(-) create mode 100644 src/models/generated/CoLocatedSupplyStorageTechnology.jl create mode 100644 src/models/generated/RetireableTechnology.jl create mode 100644 src/models/generated/RetrofitTechnology.jl diff --git a/src/models/generated/CoLocatedSupplyStorageTechnology.jl b/src/models/generated/CoLocatedSupplyStorageTechnology.jl new file mode 100644 index 0000000..10220a0 --- /dev/null +++ b/src/models/generated/CoLocatedSupplyStorageTechnology.jl @@ -0,0 +1,335 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct CoLocatedSupplyStorageTechnology{T <: PSY.Generator} <: Technology + base_power::Float64 + capital_cost_energy::PSY.ValueCurve + initial_capacity_power::Float64 + prime_mover_type::PrimeMovers + capital_cost_gen::PSY.ValueCurve + efficiency_up_dc::Float64 + capital_cost_inv::PSY.ValueCurve + capital_cost_power::PSY.ValueCurve + maximum_capacity_power::Float64 + operations_cost_inv::PSY.OperationalCost + efficiency_up_ac::Float64 + efficiency_down_dc::Float64 + gen_ID::String + available::Bool + name::String + storage_tech::StorageTech + minimum_required_capacity_gen::Float64 + self_discharge::Float64 + initial_gen_capacity::Float64 + minimum_inverter_capacity::Float64 + minimum_required_capacity_power::Float64 + operations_cost_gen::PSY.OperationalCost + minimum_duration::Float64 + inverter_ratio::Float64 + power_systems_type::String + internal::InfrastructureSystemsInternal + ext::Dict + balancing_topology::String + initial_capacity_inverter::Float64 + region::String + maximum_inverter_capacity::Float64 + maximum_duration::Float64 + initial_capacity_energy::Float64 + operations_cost_power::PSY.OperationalCost + maximum_capacity_energy::Float64 + operations_cost_energy::PSY.OperationalCost + minimum_required_capacity_energy::Float64 + maximum_gen_capacity::Float64 + efficiency_down_ac::Float64 + end + + + +# Arguments +- `base_power::Float64`: Base power +- `capital_cost_energy::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology +- `initial_capacity_power::Float64`: Pre-existing power capacity for a technology (MW) +- `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator +- `capital_cost_gen::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `efficiency_up_dc::Float64`: (default: `1.0`) Efficiency of charging storage +- `capital_cost_inv::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology +- `capital_cost_power::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `maximum_capacity_power::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology +- `operations_cost_inv::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology +- `efficiency_up_ac::Float64`: (default: `1.0`) Efficiency of charging storage +- `efficiency_down_dc::Float64`: (default: `1.0`) Efficiency of discharging storage +- `gen_ID::String`: ID for individual generator +- `available::Bool`: identifies whether the technology is available +- `name::String`: The technology name +- `storage_tech::StorageTech`: Storage Technology Type +- `minimum_required_capacity_gen::Float64`: (default: `-1`) Minimum required capacity for a technology +- `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage +- `initial_gen_capacity::Float64`: Pre-existing capacity for a technology +- `minimum_inverter_capacity::Float64`: (default: `-1`) Minimum allowable installed capacity for a technology +- `minimum_required_capacity_power::Float64`: (default: `-1`) Minimum required power capacity for a storage technology +- `operations_cost_gen::PSY.OperationalCost`: Fixed O&M costs for a technology +- `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `inverter_ratio::Float64`: (default: `-1.0`) Ratio of generation capacity to grid connection capacity built +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `balancing_topology::String`: Set of balancing nodes +- `initial_capacity_inverter::Float64`: The existing capacity of co-located VRE-STOR resource's inverter in MW (AC) +- `region::String`: (default: `1.0`) Region/zone technology operates in +- `maximum_inverter_capacity::Float64`: (default: `-1`) Maximum allowable installed capacity for a technology +- `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) +- `operations_cost_power::PSY.OperationalCost`: Fixed O&M costs for a technology +- `maximum_capacity_energy::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology +- `operations_cost_energy::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology +- `minimum_required_capacity_energy::Float64`: (default: `-1`) Minimum required energy capacity for a storage technology +- `maximum_gen_capacity::Float64`: (default: `-1`) Maximum allowable installed capacity for a technology +- `efficiency_down_ac::Float64`: (default: `1.0`) Efficiency of discharging storage +""" +mutable struct CoLocatedSupplyStorageTechnology{T <: PSY.Generator} <: Technology + "Base power" + base_power::Float64 + "Capital costs for energy capacity of storage technology" + capital_cost_energy::PSY.ValueCurve + "Pre-existing power capacity for a technology (MW)" + initial_capacity_power::Float64 + "Prime mover for generator" + prime_mover_type::PrimeMovers + "Capital costs for investing in a technology." + capital_cost_gen::PSY.ValueCurve + "Efficiency of charging storage" + efficiency_up_dc::Float64 + "Capital costs for energy capacity of storage technology" + capital_cost_inv::PSY.ValueCurve + "Capital costs for investing in a technology." + capital_cost_power::PSY.ValueCurve + "Maximum allowable installed power capacity for a storage technology" + maximum_capacity_power::Float64 + "Fixed O&M costs for energy capacity of storage technology" + operations_cost_inv::PSY.OperationalCost + "Efficiency of charging storage" + efficiency_up_ac::Float64 + "Efficiency of discharging storage" + efficiency_down_dc::Float64 + "ID for individual generator" + gen_ID::String + "identifies whether the technology is available" + available::Bool + "The technology name" + name::String + "Storage Technology Type" + storage_tech::StorageTech + "Minimum required capacity for a technology" + minimum_required_capacity_gen::Float64 + "Efficiency of discharging storage" + self_discharge::Float64 + "Pre-existing capacity for a technology" + initial_gen_capacity::Float64 + "Minimum allowable installed capacity for a technology" + minimum_inverter_capacity::Float64 + "Minimum required power capacity for a storage technology" + minimum_required_capacity_power::Float64 + "Fixed O&M costs for a technology" + operations_cost_gen::PSY.OperationalCost + "Minimum required durection for a storage technology" + minimum_duration::Float64 + "Ratio of generation capacity to grid connection capacity built" + inverter_ratio::Float64 + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Set of balancing nodes" + balancing_topology::String + "The existing capacity of co-located VRE-STOR resource's inverter in MW (AC)" + initial_capacity_inverter::Float64 + "Region/zone technology operates in" + region::String + "Maximum allowable installed capacity for a technology" + maximum_inverter_capacity::Float64 + "Maximum allowable durection for a storage technology" + maximum_duration::Float64 + "Pre-existing energy capacity for a technology (MWh)" + initial_capacity_energy::Float64 + "Fixed O&M costs for a technology" + operations_cost_power::PSY.OperationalCost + "Maximum allowable installed energy capacity for a storage technology" + maximum_capacity_energy::Float64 + "Fixed O&M costs for energy capacity of storage technology" + operations_cost_energy::PSY.OperationalCost + "Minimum required energy capacity for a storage technology" + minimum_required_capacity_energy::Float64 + "Maximum allowable installed capacity for a technology" + maximum_gen_capacity::Float64 + "Efficiency of discharging storage" + efficiency_down_ac::Float64 +end + + +function CoLocatedSupplyStorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_gen=0.0, efficiency_up_dc=1.0, capital_cost_inv=0.0, capital_cost_power=0.0, maximum_capacity_power=-1, operations_cost_inv, efficiency_up_ac=1.0, efficiency_down_dc=1.0, gen_ID, available, name, storage_tech, minimum_required_capacity_gen=-1, self_discharge=1.0, initial_gen_capacity, minimum_inverter_capacity=-1, minimum_required_capacity_power=-1, operations_cost_gen, minimum_duration=0.0, inverter_ratio=-1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, initial_capacity_inverter, region=1.0, maximum_inverter_capacity=-1, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=-1, operations_cost_energy, minimum_required_capacity_energy=-1, maximum_gen_capacity=-1, efficiency_down_ac=1.0, ) where T <: PSY.Generator + CoLocatedSupplyStorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_gen, efficiency_up_dc, capital_cost_inv, capital_cost_power, maximum_capacity_power, operations_cost_inv, efficiency_up_ac, efficiency_down_dc, gen_ID, available, name, storage_tech, minimum_required_capacity_gen, self_discharge, initial_gen_capacity, minimum_inverter_capacity, minimum_required_capacity_power, operations_cost_gen, minimum_duration, inverter_ratio, power_systems_type, internal, ext, balancing_topology, initial_capacity_inverter, region, maximum_inverter_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, maximum_gen_capacity, efficiency_down_ac, ) +end + +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `base_power`.""" +get_base_power(value::CoLocatedSupplyStorageTechnology) = value.base_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_energy`.""" +get_capital_cost_energy(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_energy +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_power`.""" +get_initial_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `prime_mover_type`.""" +get_prime_mover_type(value::CoLocatedSupplyStorageTechnology) = value.prime_mover_type +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_gen`.""" +get_capital_cost_gen(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_gen +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_dc`.""" +get_efficiency_up_dc(value::CoLocatedSupplyStorageTechnology) = value.efficiency_up_dc +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_inv`.""" +get_capital_cost_inv(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_inv +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_power`.""" +get_capital_cost_power(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_power`.""" +get_maximum_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.maximum_capacity_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_inv`.""" +get_operations_cost_inv(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_inv +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_ac`.""" +get_efficiency_up_ac(value::CoLocatedSupplyStorageTechnology) = value.efficiency_up_ac +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_dc`.""" +get_efficiency_down_dc(value::CoLocatedSupplyStorageTechnology) = value.efficiency_down_dc +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `gen_ID`.""" +get_gen_ID(value::CoLocatedSupplyStorageTechnology) = value.gen_ID +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `available`.""" +get_available(value::CoLocatedSupplyStorageTechnology) = value.available +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `name`.""" +get_name(value::CoLocatedSupplyStorageTechnology) = value.name +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `storage_tech`.""" +get_storage_tech(value::CoLocatedSupplyStorageTechnology) = value.storage_tech +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_gen`.""" +get_minimum_required_capacity_gen(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_gen +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `self_discharge`.""" +get_self_discharge(value::CoLocatedSupplyStorageTechnology) = value.self_discharge +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_gen_capacity`.""" +get_initial_gen_capacity(value::CoLocatedSupplyStorageTechnology) = value.initial_gen_capacity +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_inverter_capacity`.""" +get_minimum_inverter_capacity(value::CoLocatedSupplyStorageTechnology) = value.minimum_inverter_capacity +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_power`.""" +get_minimum_required_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_gen`.""" +get_operations_cost_gen(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_gen +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_duration`.""" +get_minimum_duration(value::CoLocatedSupplyStorageTechnology) = value.minimum_duration +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `inverter_ratio`.""" +get_inverter_ratio(value::CoLocatedSupplyStorageTechnology) = value.inverter_ratio +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::CoLocatedSupplyStorageTechnology) = value.power_systems_type +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `internal`.""" +get_internal(value::CoLocatedSupplyStorageTechnology) = value.internal +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `ext`.""" +get_ext(value::CoLocatedSupplyStorageTechnology) = value.ext +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `balancing_topology`.""" +get_balancing_topology(value::CoLocatedSupplyStorageTechnology) = value.balancing_topology +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_inverter`.""" +get_initial_capacity_inverter(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_inverter +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `region`.""" +get_region(value::CoLocatedSupplyStorageTechnology) = value.region +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_inverter_capacity`.""" +get_maximum_inverter_capacity(value::CoLocatedSupplyStorageTechnology) = value.maximum_inverter_capacity +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_duration`.""" +get_maximum_duration(value::CoLocatedSupplyStorageTechnology) = value.maximum_duration +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_energy`.""" +get_initial_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_energy +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_power`.""" +get_operations_cost_power(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_power +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_energy`.""" +get_maximum_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.maximum_capacity_energy +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_energy`.""" +get_operations_cost_energy(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_energy +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_energy`.""" +get_minimum_required_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_energy +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_gen_capacity`.""" +get_maximum_gen_capacity(value::CoLocatedSupplyStorageTechnology) = value.maximum_gen_capacity +"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_ac`.""" +get_efficiency_down_ac(value::CoLocatedSupplyStorageTechnology) = value.efficiency_down_ac + +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `base_power`.""" +set_base_power!(value::CoLocatedSupplyStorageTechnology, val) = value.base_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_energy`.""" +set_capital_cost_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_energy = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_power`.""" +set_initial_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `prime_mover_type`.""" +set_prime_mover_type!(value::CoLocatedSupplyStorageTechnology, val) = value.prime_mover_type = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_gen`.""" +set_capital_cost_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_gen = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_dc`.""" +set_efficiency_up_dc!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_up_dc = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_inv`.""" +set_capital_cost_inv!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_inv = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_power`.""" +set_capital_cost_power!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_power`.""" +set_maximum_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_capacity_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_inv`.""" +set_operations_cost_inv!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_inv = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_ac`.""" +set_efficiency_up_ac!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_up_ac = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_dc`.""" +set_efficiency_down_dc!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_down_dc = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `gen_ID`.""" +set_gen_ID!(value::CoLocatedSupplyStorageTechnology, val) = value.gen_ID = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `available`.""" +set_available!(value::CoLocatedSupplyStorageTechnology, val) = value.available = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `name`.""" +set_name!(value::CoLocatedSupplyStorageTechnology, val) = value.name = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `storage_tech`.""" +set_storage_tech!(value::CoLocatedSupplyStorageTechnology, val) = value.storage_tech = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_gen`.""" +set_minimum_required_capacity_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_gen = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `self_discharge`.""" +set_self_discharge!(value::CoLocatedSupplyStorageTechnology, val) = value.self_discharge = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_gen_capacity`.""" +set_initial_gen_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_gen_capacity = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_inverter_capacity`.""" +set_minimum_inverter_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_inverter_capacity = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_power`.""" +set_minimum_required_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_gen`.""" +set_operations_cost_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_gen = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_duration`.""" +set_minimum_duration!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_duration = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `inverter_ratio`.""" +set_inverter_ratio!(value::CoLocatedSupplyStorageTechnology, val) = value.inverter_ratio = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::CoLocatedSupplyStorageTechnology, val) = value.power_systems_type = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `internal`.""" +set_internal!(value::CoLocatedSupplyStorageTechnology, val) = value.internal = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `ext`.""" +set_ext!(value::CoLocatedSupplyStorageTechnology, val) = value.ext = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `balancing_topology`.""" +set_balancing_topology!(value::CoLocatedSupplyStorageTechnology, val) = value.balancing_topology = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_inverter`.""" +set_initial_capacity_inverter!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_inverter = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `region`.""" +set_region!(value::CoLocatedSupplyStorageTechnology, val) = value.region = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_inverter_capacity`.""" +set_maximum_inverter_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_inverter_capacity = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_duration`.""" +set_maximum_duration!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_duration = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_energy`.""" +set_initial_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_energy = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_power`.""" +set_operations_cost_power!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_power = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_energy`.""" +set_maximum_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_capacity_energy = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_energy`.""" +set_operations_cost_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_energy = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_energy`.""" +set_minimum_required_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_energy = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_gen_capacity`.""" +set_maximum_gen_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_gen_capacity = val +"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_ac`.""" +set_efficiency_down_ac!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_down_ac = val diff --git a/src/models/generated/RetireableTechnology.jl b/src/models/generated/RetireableTechnology.jl new file mode 100644 index 0000000..398491b --- /dev/null +++ b/src/models/generated/RetireableTechnology.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology + can_retire::Dict{PrimeMovers,Dict{String, Int64}} + internal::InfrastructureSystemsInternal + ext::Dict + end + + + +# Arguments +- `can_retire::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology + "Dictionary of PrimeMovers in each region that can retire" + can_retire::Dict{PrimeMovers,Dict{String, Int64}} + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict +end + + +function RetireableTechnology{T}(; can_retire=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator + RetireableTechnology{T}(can_retire, internal, ext, ) +end + +# Constructor for demo purposes; non-functional. +function RetireableTechnology{T}(::Nothing) where T <: PSY.Generator + RetireableTechnology{T}(; + can_retire=Dict(), + internal=Dict(), + ext=Dict(), + ) +end + +"""Get [`RetireableTechnology`](@ref) `can_retire`.""" +get_can_retire(value::RetireableTechnology) = value.can_retire +"""Get [`RetireableTechnology`](@ref) `internal`.""" +get_internal(value::RetireableTechnology) = value.internal +"""Get [`RetireableTechnology`](@ref) `ext`.""" +get_ext(value::RetireableTechnology) = value.ext + +"""Set [`RetireableTechnology`](@ref) `can_retire`.""" +set_can_retire!(value::RetireableTechnology, val) = value.can_retire = val +"""Set [`RetireableTechnology`](@ref) `internal`.""" +set_internal!(value::RetireableTechnology, val) = value.internal = val +"""Set [`RetireableTechnology`](@ref) `ext`.""" +set_ext!(value::RetireableTechnology, val) = value.ext = val diff --git a/src/models/generated/RetrofitTechnology.jl b/src/models/generated/RetrofitTechnology.jl new file mode 100644 index 0000000..1afb463 --- /dev/null +++ b/src/models/generated/RetrofitTechnology.jl @@ -0,0 +1,74 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology + retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} + retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} + internal::InfrastructureSystemsInternal + ext::Dict + can_retrofit::Dict{PrimeMovers,Dict{String, Int64}} + end + + + +# Arguments +- `retrofit_id::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone. +- `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `can_retrofit::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire +""" +mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology + "Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone." + retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} + "Dictionary of Efficiency of the retrofit technology." + retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Dictionary of PrimeMovers in each region that can retire" + can_retrofit::Dict{PrimeMovers,Dict{String, Int64}} +end + + +function RetrofitTechnology{T}(; retrofit_id=Dict(), retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator + RetrofitTechnology{T}(retrofit_id, retrofit_efficiency, internal, ext, can_retrofit, ) +end + +# Constructor for demo purposes; non-functional. +function RetrofitTechnology{T}(::Nothing) where T <: PSY.Generator + RetrofitTechnology{T}(; + retrofit_id=Dict(), + retrofit_efficiency=Dict(), + internal=Dict(), + ext=Dict(), + can_retrofit=Dict(), + ) +end + +"""Get [`RetrofitTechnology`](@ref) `retrofit_id`.""" +get_retrofit_id(value::RetrofitTechnology) = value.retrofit_id +"""Get [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" +get_retrofit_efficiency(value::RetrofitTechnology) = value.retrofit_efficiency +"""Get [`RetrofitTechnology`](@ref) `internal`.""" +get_internal(value::RetrofitTechnology) = value.internal +"""Get [`RetrofitTechnology`](@ref) `ext`.""" +get_ext(value::RetrofitTechnology) = value.ext +"""Get [`RetrofitTechnology`](@ref) `can_retrofit`.""" +get_can_retrofit(value::RetrofitTechnology) = value.can_retrofit + +"""Set [`RetrofitTechnology`](@ref) `retrofit_id`.""" +set_retrofit_id!(value::RetrofitTechnology, val) = value.retrofit_id = val +"""Set [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" +set_retrofit_efficiency!(value::RetrofitTechnology, val) = value.retrofit_efficiency = val +"""Set [`RetrofitTechnology`](@ref) `internal`.""" +set_internal!(value::RetrofitTechnology, val) = value.internal = val +"""Set [`RetrofitTechnology`](@ref) `ext`.""" +set_ext!(value::RetrofitTechnology, val) = value.ext = val +"""Set [`RetrofitTechnology`](@ref) `can_retrofit`.""" +set_can_retrofit!(value::RetrofitTechnology, val) = value.can_retrofit = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 435b48b..9b31d4f 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -8,17 +8,18 @@ This file is auto-generated. Do not edit. mutable struct StorageTechnology{T <: PSY.Storage} <: Technology base_power::Float64 capital_cost_energy::PSY.ValueCurve - initial_capacity_power::Float64 prime_mover_type::PrimeMovers - capital_cost_power::PSY.ValueCurve + rsv_cost::Float64 gen_ID::String + minimum_required_capacity_charge::Float64 available::Bool name::String storage_tech::StorageTech + operations_cost_charge::PSY.OperationalCost efficiency_down::Float64 self_discharge::Float64 - minimum_required_capacity_power::Float64 minimum_duration::Float64 + rsv_max::Float64 efficiency_up::Float64 power_systems_type::String internal::InfrastructureSystemsInternal @@ -28,10 +29,13 @@ This file is auto-generated. Do not edit. maximum_capacity::Float64 maximum_duration::Float64 initial_capacity_energy::Float64 - operations_cost_power::PSY.OperationalCost maximum_capacity_energy::Float64 operations_cost_energy::PSY.OperationalCost minimum_required_capacity_energy::Float64 + reg_cost::Float64 + reg_max::Float64 + capital_cost_charge::PSY.ValueCurve + initial_capacity_charge::Float64 end @@ -39,17 +43,18 @@ This file is auto-generated. Do not edit. # Arguments - `base_power::Float64`: Base power - `capital_cost_energy::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology -- `initial_capacity_power::Float64`: Pre-existing power capacity for a technology (MW) - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `capital_cost_power::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `gen_ID::String`: ID for individual generator +- `minimum_required_capacity_charge::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type +- `operations_cost_charge::PSY.OperationalCost`: Fixed O&M costs for a technology - `efficiency_down::Float64`: (default: `1.0`) Efficiency of discharging storage - `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage -- `minimum_required_capacity_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology - `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `efficiency_up::Float64`: (default: `1.0`) Efficiency of charging storage - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field @@ -59,38 +64,43 @@ This file is auto-generated. Do not edit. - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed power capacity for a storage technology - `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology - `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) -- `operations_cost_power::PSY.OperationalCost`: Fixed O&M costs for a technology - `maximum_capacity_energy::Float64`: (default: `Inf`) Maximum allowable installed energy capacity for a storage technology - `operations_cost_energy::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology - `minimum_required_capacity_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology +- `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves +- `capital_cost_charge::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `initial_capacity_charge::Float64`: Pre-existing power capacity for a technology (MW) """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology "Base power" base_power::Float64 "Capital costs for energy capacity of storage technology" capital_cost_energy::PSY.ValueCurve - "Pre-existing power capacity for a technology (MW)" - initial_capacity_power::Float64 "Prime mover for generator" prime_mover_type::PrimeMovers - "Capital costs for investing in a technology." - capital_cost_power::PSY.ValueCurve + "Cost of providing upwards spinning or contingency reserves" + rsv_cost::Float64 "ID for individual generator" gen_ID::String + "Minimum required power capacity for a storage technology" + minimum_required_capacity_charge::Float64 "identifies whether the technology is available" available::Bool "The technology name" name::String "Storage Technology Type" storage_tech::StorageTech + "Fixed O&M costs for a technology" + operations_cost_charge::PSY.OperationalCost "Efficiency of discharging storage" efficiency_down::Float64 "Efficiency of discharging storage" self_discharge::Float64 - "Minimum required power capacity for a storage technology" - minimum_required_capacity_power::Float64 "Minimum required durection for a storage technology" minimum_duration::Float64 + "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." + rsv_max::Float64 "Efficiency of charging storage" efficiency_up::Float64 "maps to a valid PowerSystems.jl for PCM modeling" @@ -109,47 +119,55 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology maximum_duration::Float64 "Pre-existing energy capacity for a technology (MWh)" initial_capacity_energy::Float64 - "Fixed O&M costs for a technology" - operations_cost_power::PSY.OperationalCost "Maximum allowable installed energy capacity for a storage technology" maximum_capacity_energy::Float64 "Fixed O&M costs for energy capacity of storage technology" operations_cost_energy::PSY.OperationalCost "Minimum required energy capacity for a storage technology" minimum_required_capacity_energy::Float64 + "Cost of providing regulation reserves " + reg_cost::Float64 + "Fraction of nameplate capacity that can committed to provided regulation reserves" + reg_max::Float64 + "Capital costs for investing in a technology." + capital_cost_charge::PSY.ValueCurve + "Pre-existing power capacity for a technology (MW)" + initial_capacity_charge::Float64 end -function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_power=0.0, gen_ID, available, name, storage_tech, efficiency_down=1.0, self_discharge=1.0, minimum_required_capacity_power=0.0, minimum_duration=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_power, gen_ID, available, name, storage_tech, efficiency_down, self_discharge, minimum_required_capacity_power, minimum_duration, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, ) +function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, gen_ID, minimum_required_capacity_charge=0.0, available, name, storage_tech, operations_cost_charge, efficiency_down=1.0, self_discharge=1.0, minimum_duration=0.0, rsv_max=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, reg_cost=0.0, reg_max=0.0, capital_cost_charge=0.0, initial_capacity_charge, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, capital_cost_energy, prime_mover_type, rsv_cost, gen_ID, minimum_required_capacity_charge, available, name, storage_tech, operations_cost_charge, efficiency_down, self_discharge, minimum_duration, rsv_max, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, reg_cost, reg_max, capital_cost_charge, initial_capacity_charge, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" get_base_power(value::StorageTechnology) = value.base_power """Get [`StorageTechnology`](@ref) `capital_cost_energy`.""" get_capital_cost_energy(value::StorageTechnology) = value.capital_cost_energy -"""Get [`StorageTechnology`](@ref) `initial_capacity_power`.""" -get_initial_capacity_power(value::StorageTechnology) = value.initial_capacity_power """Get [`StorageTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type -"""Get [`StorageTechnology`](@ref) `capital_cost_power`.""" -get_capital_cost_power(value::StorageTechnology) = value.capital_cost_power +"""Get [`StorageTechnology`](@ref) `rsv_cost`.""" +get_rsv_cost(value::StorageTechnology) = value.rsv_cost """Get [`StorageTechnology`](@ref) `gen_ID`.""" get_gen_ID(value::StorageTechnology) = value.gen_ID +"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_charge`.""" +get_minimum_required_capacity_charge(value::StorageTechnology) = value.minimum_required_capacity_charge """Get [`StorageTechnology`](@ref) `available`.""" get_available(value::StorageTechnology) = value.available """Get [`StorageTechnology`](@ref) `name`.""" get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech +"""Get [`StorageTechnology`](@ref) `operations_cost_charge`.""" +get_operations_cost_charge(value::StorageTechnology) = value.operations_cost_charge """Get [`StorageTechnology`](@ref) `efficiency_down`.""" get_efficiency_down(value::StorageTechnology) = value.efficiency_down """Get [`StorageTechnology`](@ref) `self_discharge`.""" get_self_discharge(value::StorageTechnology) = value.self_discharge -"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" -get_minimum_required_capacity_power(value::StorageTechnology) = value.minimum_required_capacity_power """Get [`StorageTechnology`](@ref) `minimum_duration`.""" get_minimum_duration(value::StorageTechnology) = value.minimum_duration +"""Get [`StorageTechnology`](@ref) `rsv_max`.""" +get_rsv_max(value::StorageTechnology) = value.rsv_max """Get [`StorageTechnology`](@ref) `efficiency_up`.""" get_efficiency_up(value::StorageTechnology) = value.efficiency_up """Get [`StorageTechnology`](@ref) `power_systems_type`.""" @@ -168,41 +186,49 @@ get_maximum_capacity(value::StorageTechnology) = value.maximum_capacity get_maximum_duration(value::StorageTechnology) = value.maximum_duration """Get [`StorageTechnology`](@ref) `initial_capacity_energy`.""" get_initial_capacity_energy(value::StorageTechnology) = value.initial_capacity_energy -"""Get [`StorageTechnology`](@ref) `operations_cost_power`.""" -get_operations_cost_power(value::StorageTechnology) = value.operations_cost_power """Get [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" get_maximum_capacity_energy(value::StorageTechnology) = value.maximum_capacity_energy """Get [`StorageTechnology`](@ref) `operations_cost_energy`.""" get_operations_cost_energy(value::StorageTechnology) = value.operations_cost_energy """Get [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" get_minimum_required_capacity_energy(value::StorageTechnology) = value.minimum_required_capacity_energy +"""Get [`StorageTechnology`](@ref) `reg_cost`.""" +get_reg_cost(value::StorageTechnology) = value.reg_cost +"""Get [`StorageTechnology`](@ref) `reg_max`.""" +get_reg_max(value::StorageTechnology) = value.reg_max +"""Get [`StorageTechnology`](@ref) `capital_cost_charge`.""" +get_capital_cost_charge(value::StorageTechnology) = value.capital_cost_charge +"""Get [`StorageTechnology`](@ref) `initial_capacity_charge`.""" +get_initial_capacity_charge(value::StorageTechnology) = value.initial_capacity_charge """Set [`StorageTechnology`](@ref) `base_power`.""" set_base_power!(value::StorageTechnology, val) = value.base_power = val """Set [`StorageTechnology`](@ref) `capital_cost_energy`.""" set_capital_cost_energy!(value::StorageTechnology, val) = value.capital_cost_energy = val -"""Set [`StorageTechnology`](@ref) `initial_capacity_power`.""" -set_initial_capacity_power!(value::StorageTechnology, val) = value.initial_capacity_power = val """Set [`StorageTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val -"""Set [`StorageTechnology`](@ref) `capital_cost_power`.""" -set_capital_cost_power!(value::StorageTechnology, val) = value.capital_cost_power = val +"""Set [`StorageTechnology`](@ref) `rsv_cost`.""" +set_rsv_cost!(value::StorageTechnology, val) = value.rsv_cost = val """Set [`StorageTechnology`](@ref) `gen_ID`.""" set_gen_ID!(value::StorageTechnology, val) = value.gen_ID = val +"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_charge`.""" +set_minimum_required_capacity_charge!(value::StorageTechnology, val) = value.minimum_required_capacity_charge = val """Set [`StorageTechnology`](@ref) `available`.""" set_available!(value::StorageTechnology, val) = value.available = val """Set [`StorageTechnology`](@ref) `name`.""" set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val +"""Set [`StorageTechnology`](@ref) `operations_cost_charge`.""" +set_operations_cost_charge!(value::StorageTechnology, val) = value.operations_cost_charge = val """Set [`StorageTechnology`](@ref) `efficiency_down`.""" set_efficiency_down!(value::StorageTechnology, val) = value.efficiency_down = val """Set [`StorageTechnology`](@ref) `self_discharge`.""" set_self_discharge!(value::StorageTechnology, val) = value.self_discharge = val -"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_power`.""" -set_minimum_required_capacity_power!(value::StorageTechnology, val) = value.minimum_required_capacity_power = val """Set [`StorageTechnology`](@ref) `minimum_duration`.""" set_minimum_duration!(value::StorageTechnology, val) = value.minimum_duration = val +"""Set [`StorageTechnology`](@ref) `rsv_max`.""" +set_rsv_max!(value::StorageTechnology, val) = value.rsv_max = val """Set [`StorageTechnology`](@ref) `efficiency_up`.""" set_efficiency_up!(value::StorageTechnology, val) = value.efficiency_up = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" @@ -221,11 +247,17 @@ set_maximum_capacity!(value::StorageTechnology, val) = value.maximum_capacity = set_maximum_duration!(value::StorageTechnology, val) = value.maximum_duration = val """Set [`StorageTechnology`](@ref) `initial_capacity_energy`.""" set_initial_capacity_energy!(value::StorageTechnology, val) = value.initial_capacity_energy = val -"""Set [`StorageTechnology`](@ref) `operations_cost_power`.""" -set_operations_cost_power!(value::StorageTechnology, val) = value.operations_cost_power = val """Set [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" set_maximum_capacity_energy!(value::StorageTechnology, val) = value.maximum_capacity_energy = val """Set [`StorageTechnology`](@ref) `operations_cost_energy`.""" set_operations_cost_energy!(value::StorageTechnology, val) = value.operations_cost_energy = val """Set [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" set_minimum_required_capacity_energy!(value::StorageTechnology, val) = value.minimum_required_capacity_energy = val +"""Set [`StorageTechnology`](@ref) `reg_cost`.""" +set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val +"""Set [`StorageTechnology`](@ref) `reg_max`.""" +set_reg_max!(value::StorageTechnology, val) = value.reg_max = val +"""Set [`StorageTechnology`](@ref) `capital_cost_charge`.""" +set_capital_cost_charge!(value::StorageTechnology, val) = value.capital_cost_charge = val +"""Set [`StorageTechnology`](@ref) `initial_capacity_charge`.""" +set_initial_capacity_charge!(value::StorageTechnology, val) = value.initial_capacity_charge = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index c217647..f4e9872 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -18,19 +18,26 @@ This file is auto-generated. Do not edit. available::Bool name::String ramp_down::Float64 + down_time::Float64 initial_capacity::Float64 fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} - power_systems_type::String cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} - internal::InfrastructureSystemsInternal + start_fuel::Float64 heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} minimum_generation::Float64 ext::Dict balancing_topology::String + internal::InfrastructureSystemsInternal region::String operations_cost::PSY.OperationalCost maximum_capacity::Float64 + cluster::Int64 + maintenance_duration::Int64 + start_cost::Float64 + maintenance_cycle_length_years::Int64 + up_time::Float64 ramp_up::Float64 + maintenance_begin_cadence::Int64 end @@ -45,22 +52,29 @@ This file is auto-generated. Do not edit. - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during start-up process for multi-fuel generator - `gen_ID::String`: ID for individual generator - `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during start-up process for multi-fuel generator -- `available::Bool`: identifies whether the technology is available +- `available::Bool`: (default: `True`) identifies whether the technology is available - `name::String`: The technology name -- `ramp_down::Float64`: (default: `1.0`) Maximum decrease in output between operation periods. Fraction of total capacity +- `ramp_down::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity +- `down_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to remain in the shutdown state. - `initial_capacity::Float64`: Pre-existing capacity for a technology - `fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during normal generation process for multi-fuel generator -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `start_fuel::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) - `heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `1.0`) Heat rate of generator, MMBTU/MWh - `minimum_generation::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes -- `region::String`: (default: `1.0`) Region/zone technology operates in +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `region::String`: Region/zone technology operates in - `operations_cost::PSY.OperationalCost`: Fixed O&M costs for a technology - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology -- `ramp_up::Float64`: (default: `1.0`) Maximum increase in output between operation periods. Fraction of total capacity +- `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. +- `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. +- `start_cost::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). +- `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. +- `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. +- `ramp_up::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity +- `maintenance_begin_cadence::Int64`: (default: `1`) Cadence of timesteps in which scheduled maintenance can begin. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Base power" @@ -87,16 +101,16 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology name::String "Maximum decrease in output between operation periods. Fraction of total capacity" ramp_down::Float64 + "Minimum amount of time a resource has to remain in the shutdown state." + down_time::Float64 "Pre-existing capacity for a technology" initial_capacity::Float64 "Fuel type according to IEA" fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String "Maximum blending level of each fuel during normal generation process for multi-fuel generator" cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} - "Internal field" - internal::InfrastructureSystemsInternal + "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" + start_fuel::Float64 "Heat rate of generator, MMBTU/MWh" heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} "Minimum generation as a fraction of total capacity" @@ -105,19 +119,33 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology ext::Dict "Set of balancing nodes" balancing_topology::String + "Internal field" + internal::InfrastructureSystemsInternal "Region/zone technology operates in" region::String "Fixed O&M costs for a technology" operations_cost::PSY.OperationalCost "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 + "Number of the cluster when representing multiple clusters of a given technology in a given region." + cluster::Int64 + "Duration of the maintenance period, in number of timesteps." + maintenance_duration::Int64 + "Cost per MW of nameplate capacity to start a generator (/MW per start)." + start_cost::Float64 + "Length of scheduled maintenance cycle, in years." + maintenance_cycle_length_years::Int64 + "Minimum amount of time a resource has to stay in the committed state." + up_time::Float64 "Maximum increase in output between operation periods. Fraction of total capacity" ramp_up::Float64 + "Cadence of timesteps in which scheduled maintenance can begin." + maintenance_begin_cadence::Int64 end -function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down=1.0, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max, internal=InfrastructureSystemsInternal(), heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, ramp_up=1.0, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, initial_capacity, fuel, power_systems_type, cofire_level_max, internal, heat_rate, minimum_generation, ext, balancing_topology, region, operations_cost, maximum_capacity, ramp_up, ) +function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, cofire_start_max, gen_ID, cofire_start_min, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, fuel=ThermalFuels.OTHER, cofire_level_max, start_fuel=0.0, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, up_time, ramp_up, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -144,16 +172,16 @@ get_available(value::SupplyTechnology) = value.available get_name(value::SupplyTechnology) = value.name """Get [`SupplyTechnology`](@ref) `ramp_down`.""" get_ramp_down(value::SupplyTechnology) = value.ramp_down +"""Get [`SupplyTechnology`](@ref) `down_time`.""" +get_down_time(value::SupplyTechnology) = value.down_time """Get [`SupplyTechnology`](@ref) `initial_capacity`.""" get_initial_capacity(value::SupplyTechnology) = value.initial_capacity """Get [`SupplyTechnology`](@ref) `fuel`.""" get_fuel(value::SupplyTechnology) = value.fuel -"""Get [`SupplyTechnology`](@ref) `power_systems_type`.""" -get_power_systems_type(value::SupplyTechnology) = value.power_systems_type """Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" get_cofire_level_max(value::SupplyTechnology) = value.cofire_level_max -"""Get [`SupplyTechnology`](@ref) `internal`.""" -get_internal(value::SupplyTechnology) = value.internal +"""Get [`SupplyTechnology`](@ref) `start_fuel`.""" +get_start_fuel(value::SupplyTechnology) = value.start_fuel """Get [`SupplyTechnology`](@ref) `heat_rate`.""" get_heat_rate(value::SupplyTechnology) = value.heat_rate """Get [`SupplyTechnology`](@ref) `minimum_generation`.""" @@ -162,14 +190,28 @@ get_minimum_generation(value::SupplyTechnology) = value.minimum_generation get_ext(value::SupplyTechnology) = value.ext """Get [`SupplyTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::SupplyTechnology) = value.balancing_topology +"""Get [`SupplyTechnology`](@ref) `internal`.""" +get_internal(value::SupplyTechnology) = value.internal """Get [`SupplyTechnology`](@ref) `region`.""" get_region(value::SupplyTechnology) = value.region """Get [`SupplyTechnology`](@ref) `operations_cost`.""" get_operations_cost(value::SupplyTechnology) = value.operations_cost """Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity +"""Get [`SupplyTechnology`](@ref) `cluster`.""" +get_cluster(value::SupplyTechnology) = value.cluster +"""Get [`SupplyTechnology`](@ref) `maintenance_duration`.""" +get_maintenance_duration(value::SupplyTechnology) = value.maintenance_duration +"""Get [`SupplyTechnology`](@ref) `start_cost`.""" +get_start_cost(value::SupplyTechnology) = value.start_cost +"""Get [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" +get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years +"""Get [`SupplyTechnology`](@ref) `up_time`.""" +get_up_time(value::SupplyTechnology) = value.up_time """Get [`SupplyTechnology`](@ref) `ramp_up`.""" get_ramp_up(value::SupplyTechnology) = value.ramp_up +"""Get [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" +get_maintenance_begin_cadence(value::SupplyTechnology) = value.maintenance_begin_cadence """Set [`SupplyTechnology`](@ref) `base_power`.""" set_base_power!(value::SupplyTechnology, val) = value.base_power = val @@ -195,16 +237,16 @@ set_available!(value::SupplyTechnology, val) = value.available = val set_name!(value::SupplyTechnology, val) = value.name = val """Set [`SupplyTechnology`](@ref) `ramp_down`.""" set_ramp_down!(value::SupplyTechnology, val) = value.ramp_down = val +"""Set [`SupplyTechnology`](@ref) `down_time`.""" +set_down_time!(value::SupplyTechnology, val) = value.down_time = val """Set [`SupplyTechnology`](@ref) `initial_capacity`.""" set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val """Set [`SupplyTechnology`](@ref) `fuel`.""" set_fuel!(value::SupplyTechnology, val) = value.fuel = val -"""Set [`SupplyTechnology`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::SupplyTechnology, val) = value.power_systems_type = val """Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" set_cofire_level_max!(value::SupplyTechnology, val) = value.cofire_level_max = val -"""Set [`SupplyTechnology`](@ref) `internal`.""" -set_internal!(value::SupplyTechnology, val) = value.internal = val +"""Set [`SupplyTechnology`](@ref) `start_fuel`.""" +set_start_fuel!(value::SupplyTechnology, val) = value.start_fuel = val """Set [`SupplyTechnology`](@ref) `heat_rate`.""" set_heat_rate!(value::SupplyTechnology, val) = value.heat_rate = val """Set [`SupplyTechnology`](@ref) `minimum_generation`.""" @@ -213,11 +255,25 @@ set_minimum_generation!(value::SupplyTechnology, val) = value.minimum_generation set_ext!(value::SupplyTechnology, val) = value.ext = val """Set [`SupplyTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val +"""Set [`SupplyTechnology`](@ref) `internal`.""" +set_internal!(value::SupplyTechnology, val) = value.internal = val """Set [`SupplyTechnology`](@ref) `region`.""" set_region!(value::SupplyTechnology, val) = value.region = val """Set [`SupplyTechnology`](@ref) `operations_cost`.""" set_operations_cost!(value::SupplyTechnology, val) = value.operations_cost = val """Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val +"""Set [`SupplyTechnology`](@ref) `cluster`.""" +set_cluster!(value::SupplyTechnology, val) = value.cluster = val +"""Set [`SupplyTechnology`](@ref) `maintenance_duration`.""" +set_maintenance_duration!(value::SupplyTechnology, val) = value.maintenance_duration = val +"""Set [`SupplyTechnology`](@ref) `start_cost`.""" +set_start_cost!(value::SupplyTechnology, val) = value.start_cost = val +"""Set [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" +set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val +"""Set [`SupplyTechnology`](@ref) `up_time`.""" +set_up_time!(value::SupplyTechnology, val) = value.up_time = val """Set [`SupplyTechnology`](@ref) `ramp_up`.""" set_ramp_up!(value::SupplyTechnology, val) = value.ramp_up = val +"""Set [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" +set_maintenance_begin_cadence!(value::SupplyTechnology, val) = value.maintenance_begin_cadence = val diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index e129998..0d194fa 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -6,53 +6,67 @@ This file is auto-generated. Do not edit. """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology + capital_cost::PSY.ValueCurve start_region::String available::Bool - name::String + capital_recovery_factor::Int64 end_region::String power_systems_type::String internal::InfrastructureSystemsInternal + network_lines::Int64 ext::Dict resistance::Float64 + derate_cap_res::Float64 voltage::Float64 existing_flow_capacity::Float64 maximum_new_capacity::Float64 line_loss::Float64 + cap_res_excl::Int64 end # Arguments +- `capital_cost::PSY.ValueCurve`: Cost of adding new capacity to the inter-regional transmission line. - `start_region::String`: Start region for transport technology - `available::Bool`: identifies whether the technology is available -- `name::String`: The technology name +- `capital_recovery_factor::Int64`: (default: `0`) Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion. - `end_region::String`: End region for transport technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `network_lines::Int64`: Numerical Index - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `resistance::Float64`: Technology resistance in Ohms -- `voltage::Float64`: Technology resistance in Ohms +- `resistance::Float64`: (default: `0.0`) Technology resistance in Ohms +- `derate_cap_res::Float64`: (default: `0.0`) value represents the derating of the firm transmission capacity for the capacity reserve margin constraint. +- `voltage::Float64`: (default: `0.0`) Technology resistance in Ohms - `existing_flow_capacity::Float64`: Existing capacity of transport technology (MW) - `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) - `line_loss::Float64`: Transmission loss for each transport technology (%) +- `cap_res_excl::Int64`: (default: `0`) (-1,1,0) """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology + "Cost of adding new capacity to the inter-regional transmission line." + capital_cost::PSY.ValueCurve "Start region for transport technology" start_region::String "identifies whether the technology is available" available::Bool - "The technology name" - name::String + "Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion." + capital_recovery_factor::Int64 "End region for transport technology" end_region::String "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal + "Numerical Index" + network_lines::Int64 "Option for providing additional data" ext::Dict "Technology resistance in Ohms" resistance::Float64 + "value represents the derating of the firm transmission capacity for the capacity reserve margin constraint." + derate_cap_res::Float64 "Technology resistance in Ohms" voltage::Float64 "Existing capacity of transport technology (MW)" @@ -61,29 +75,37 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology maximum_new_capacity::Float64 "Transmission loss for each transport technology (%)" line_loss::Float64 + "(-1,1,0)" + cap_res_excl::Int64 end -function TransportTechnology{T}(; start_region, available, name, end_region, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), resistance, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, ) where T <: PSY.Device - TransportTechnology{T}(start_region, available, name, end_region, power_systems_type, internal, ext, resistance, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, ) +function TransportTechnology{T}(; capital_cost, start_region, available, capital_recovery_factor=0, end_region, power_systems_type, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, derate_cap_res=0.0, voltage=0.0, existing_flow_capacity, maximum_new_capacity, line_loss, cap_res_excl=0, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, capital_recovery_factor, end_region, power_systems_type, internal, network_lines, ext, resistance, derate_cap_res, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, cap_res_excl, ) end +"""Get [`TransportTechnology`](@ref) `capital_cost`.""" +get_capital_cost(value::TransportTechnology) = value.capital_cost """Get [`TransportTechnology`](@ref) `start_region`.""" get_start_region(value::TransportTechnology) = value.start_region """Get [`TransportTechnology`](@ref) `available`.""" get_available(value::TransportTechnology) = value.available -"""Get [`TransportTechnology`](@ref) `name`.""" -get_name(value::TransportTechnology) = value.name +"""Get [`TransportTechnology`](@ref) `capital_recovery_factor`.""" +get_capital_recovery_factor(value::TransportTechnology) = value.capital_recovery_factor """Get [`TransportTechnology`](@ref) `end_region`.""" get_end_region(value::TransportTechnology) = value.end_region """Get [`TransportTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::TransportTechnology) = value.power_systems_type """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal +"""Get [`TransportTechnology`](@ref) `network_lines`.""" +get_network_lines(value::TransportTechnology) = value.network_lines """Get [`TransportTechnology`](@ref) `ext`.""" get_ext(value::TransportTechnology) = value.ext """Get [`TransportTechnology`](@ref) `resistance`.""" get_resistance(value::TransportTechnology) = value.resistance +"""Get [`TransportTechnology`](@ref) `derate_cap_res`.""" +get_derate_cap_res(value::TransportTechnology) = value.derate_cap_res """Get [`TransportTechnology`](@ref) `voltage`.""" get_voltage(value::TransportTechnology) = value.voltage """Get [`TransportTechnology`](@ref) `existing_flow_capacity`.""" @@ -92,23 +114,31 @@ get_existing_flow_capacity(value::TransportTechnology) = value.existing_flow_cap get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity """Get [`TransportTechnology`](@ref) `line_loss`.""" get_line_loss(value::TransportTechnology) = value.line_loss +"""Get [`TransportTechnology`](@ref) `cap_res_excl`.""" +get_cap_res_excl(value::TransportTechnology) = value.cap_res_excl +"""Set [`TransportTechnology`](@ref) `capital_cost`.""" +set_capital_cost!(value::TransportTechnology, val) = value.capital_cost = val """Set [`TransportTechnology`](@ref) `start_region`.""" set_start_region!(value::TransportTechnology, val) = value.start_region = val """Set [`TransportTechnology`](@ref) `available`.""" set_available!(value::TransportTechnology, val) = value.available = val -"""Set [`TransportTechnology`](@ref) `name`.""" -set_name!(value::TransportTechnology, val) = value.name = val +"""Set [`TransportTechnology`](@ref) `capital_recovery_factor`.""" +set_capital_recovery_factor!(value::TransportTechnology, val) = value.capital_recovery_factor = val """Set [`TransportTechnology`](@ref) `end_region`.""" set_end_region!(value::TransportTechnology, val) = value.end_region = val """Set [`TransportTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_type = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val +"""Set [`TransportTechnology`](@ref) `network_lines`.""" +set_network_lines!(value::TransportTechnology, val) = value.network_lines = val """Set [`TransportTechnology`](@ref) `ext`.""" set_ext!(value::TransportTechnology, val) = value.ext = val """Set [`TransportTechnology`](@ref) `resistance`.""" set_resistance!(value::TransportTechnology, val) = value.resistance = val +"""Set [`TransportTechnology`](@ref) `derate_cap_res`.""" +set_derate_cap_res!(value::TransportTechnology, val) = value.derate_cap_res = val """Set [`TransportTechnology`](@ref) `voltage`.""" set_voltage!(value::TransportTechnology, val) = value.voltage = val """Set [`TransportTechnology`](@ref) `existing_flow_capacity`.""" @@ -117,3 +147,5 @@ set_existing_flow_capacity!(value::TransportTechnology, val) = value.existing_fl set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val """Set [`TransportTechnology`](@ref) `line_loss`.""" set_line_loss!(value::TransportTechnology, val) = value.line_loss = val +"""Set [`TransportTechnology`](@ref) `cap_res_excl`.""" +set_cap_res_excl!(value::TransportTechnology, val) = value.cap_res_excl = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 8795a33..0582f8f 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,17 +1,28 @@ include("Electrolyzers.jl") include("TransportTechnology.jl") include("SupplyTechnology.jl") +include("RetireableTechnology.jl") +include("CoLocatedSupplyStorageTechnology.jl") include("DemandRequirement.jl") include("StorageTechnology.jl") include("FlexibleDemandTechnology.jl") +include("RetrofitTechnology.jl") include("DemandSideTechnology.jl") export get_available export get_balancing_topology export get_base_power +export get_can_retire +export get_can_retrofit +export get_cap_res_excl export get_capital_cost +export get_capital_cost_charge export get_capital_cost_energy +export get_capital_cost_gen +export get_capital_cost_inv export get_capital_cost_power +export get_capital_recovery_factor +export get_cluster export get_cofire_level_max export get_cofire_level_min export get_cofire_start_max @@ -19,8 +30,14 @@ export get_cofire_start_min export get_cost_of_curtailment export get_demand_energy_efficiency export get_demand_mw_z +export get_derate_cap_res +export get_down_time export get_efficiency_down +export get_efficiency_down_ac +export get_efficiency_down_dc export get_efficiency_up +export get_efficiency_up_ac +export get_efficiency_up_dc export get_electrolyzer_min_kt export get_end_region export get_existing_flow_capacity @@ -31,45 +48,79 @@ export get_heat_rate export get_hydrogen_mwh_per_tonne export get_hydrogen_price_per_tonne export get_initial_capacity +export get_initial_capacity_charge export get_initial_capacity_energy +export get_initial_capacity_inverter export get_initial_capacity_power +export get_initial_gen_capacity +export get_inverter_ratio export get_line_loss +export get_maintenance_begin_cadence +export get_maintenance_cycle_length_years +export get_maintenance_duration export get_max_curtailment export get_max_demand_advance export get_max_demand_delay export get_maximum_capacity export get_maximum_capacity_energy +export get_maximum_capacity_power export get_maximum_duration +export get_maximum_gen_capacity +export get_maximum_inverter_capacity export get_maximum_new_capacity export get_min_power export get_minimum_duration export get_minimum_generation +export get_minimum_inverter_capacity export get_minimum_required_capacity +export get_minimum_required_capacity_charge export get_minimum_required_capacity_energy +export get_minimum_required_capacity_gen export get_minimum_required_capacity_power export get_name +export get_network_lines export get_operations_cost +export get_operations_cost_charge export get_operations_cost_energy +export get_operations_cost_gen +export get_operations_cost_inv export get_operations_cost_power export get_outage_factor export get_power_systems_type export get_prime_mover_type export get_ramp_down export get_ramp_up +export get_reg_cost +export get_reg_max export get_region export get_resistance +export get_retrofit_efficiency +export get_retrofit_id +export get_rsv_cost +export get_rsv_max export get_self_discharge +export get_start_cost +export get_start_fuel export get_start_region export get_storage_tech +export get_up_time export get_value_lost_load export get_var_cost_per_mwh export get_voltage export set_available! export set_balancing_topology! export set_base_power! +export set_can_retire! +export set_can_retrofit! +export set_cap_res_excl! export set_capital_cost! +export set_capital_cost_charge! export set_capital_cost_energy! +export set_capital_cost_gen! +export set_capital_cost_inv! export set_capital_cost_power! +export set_capital_recovery_factor! +export set_cluster! export set_cofire_level_max! export set_cofire_level_min! export set_cofire_start_max! @@ -77,8 +128,14 @@ export set_cofire_start_min! export set_cost_of_curtailment! export set_demand_energy_efficiency! export set_demand_mw_z! +export set_derate_cap_res! +export set_down_time! export set_efficiency_down! +export set_efficiency_down_ac! +export set_efficiency_down_dc! export set_efficiency_up! +export set_efficiency_up_ac! +export set_efficiency_up_dc! export set_electrolyzer_min_kt! export set_end_region! export set_existing_flow_capacity! @@ -89,36 +146,62 @@ export set_heat_rate! export set_hydrogen_mwh_per_tonne! export set_hydrogen_price_per_tonne! export set_initial_capacity! +export set_initial_capacity_charge! export set_initial_capacity_energy! +export set_initial_capacity_inverter! export set_initial_capacity_power! +export set_initial_gen_capacity! +export set_inverter_ratio! export set_line_loss! +export set_maintenance_begin_cadence! +export set_maintenance_cycle_length_years! +export set_maintenance_duration! export set_max_curtailment! export set_max_demand_advance! export set_max_demand_delay! export set_maximum_capacity! export set_maximum_capacity_energy! +export set_maximum_capacity_power! export set_maximum_duration! +export set_maximum_gen_capacity! +export set_maximum_inverter_capacity! export set_maximum_new_capacity! export set_min_power! export set_minimum_duration! export set_minimum_generation! +export set_minimum_inverter_capacity! export set_minimum_required_capacity! +export set_minimum_required_capacity_charge! export set_minimum_required_capacity_energy! +export set_minimum_required_capacity_gen! export set_minimum_required_capacity_power! export set_name! +export set_network_lines! export set_operations_cost! +export set_operations_cost_charge! export set_operations_cost_energy! +export set_operations_cost_gen! +export set_operations_cost_inv! export set_operations_cost_power! export set_outage_factor! export set_power_systems_type! export set_prime_mover_type! export set_ramp_down! export set_ramp_up! +export set_reg_cost! +export set_reg_max! export set_region! export set_resistance! +export set_retrofit_efficiency! +export set_retrofit_id! +export set_rsv_cost! +export set_rsv_max! export set_self_discharge! +export set_start_cost! +export set_start_fuel! export set_start_region! export set_storage_tech! +export set_up_time! export set_value_lost_load! export set_var_cost_per_mwh! export set_voltage! From cea12916c23e21e38bbb344a49e2da752bda3c40 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 23 Jul 2024 15:03:05 -0600 Subject: [PATCH 06/69] add reserves to SupplyTechnology --- src/models/generated/SupplyTechnology.jl | 36 ++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index f4e9872..0904f6b 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -12,6 +12,7 @@ This file is auto-generated. Do not edit. capital_cost::PSY.ValueCurve cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} minimum_required_capacity::Float64 + rsv_cost::Float64 cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} gen_ID::String cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} @@ -20,6 +21,7 @@ This file is auto-generated. Do not edit. ramp_down::Float64 down_time::Float64 initial_capacity::Float64 + rsv_max::Float64 fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} start_fuel::Float64 @@ -35,6 +37,8 @@ This file is auto-generated. Do not edit. maintenance_duration::Int64 start_cost::Float64 maintenance_cycle_length_years::Int64 + reg_cost::Float64 + reg_max::Float64 up_time::Float64 ramp_up::Float64 maintenance_begin_cadence::Int64 @@ -49,6 +53,7 @@ This file is auto-generated. Do not edit. - `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during normal generation process for multi-fuel generator - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology +- `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during start-up process for multi-fuel generator - `gen_ID::String`: ID for individual generator - `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during start-up process for multi-fuel generator @@ -57,6 +62,7 @@ This file is auto-generated. Do not edit. - `ramp_down::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `down_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to remain in the shutdown state. - `initial_capacity::Float64`: Pre-existing capacity for a technology +- `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during normal generation process for multi-fuel generator - `start_fuel::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) @@ -72,6 +78,8 @@ This file is auto-generated. Do not edit. - `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. - `start_cost::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). - `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. +- `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves - `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. - `ramp_up::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity - `maintenance_begin_cadence::Int64`: (default: `1`) Cadence of timesteps in which scheduled maintenance can begin. @@ -89,6 +97,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Minimum required capacity for a technology" minimum_required_capacity::Float64 + "Cost of providing upwards spinning or contingency reserves" + rsv_cost::Float64 "Maximum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} "ID for individual generator" @@ -105,6 +115,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology down_time::Float64 "Pre-existing capacity for a technology" initial_capacity::Float64 + "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." + rsv_max::Float64 "Fuel type according to IEA" fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} "Maximum blending level of each fuel during normal generation process for multi-fuel generator" @@ -135,6 +147,10 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology start_cost::Float64 "Length of scheduled maintenance cycle, in years." maintenance_cycle_length_years::Int64 + "Cost of providing regulation reserves " + reg_cost::Float64 + "Fraction of nameplate capacity that can committed to provided regulation reserves" + reg_max::Float64 "Minimum amount of time a resource has to stay in the committed state." up_time::Float64 "Maximum increase in output between operation periods. Fraction of total capacity" @@ -144,8 +160,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, cofire_start_max, gen_ID, cofire_start_min, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, fuel=ThermalFuels.OTHER, cofire_level_max, start_fuel=0.0, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, up_time, ramp_up, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, rsv_cost=0.0, cofire_start_max, gen_ID, cofire_start_min, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max, start_fuel=0.0, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, reg_cost=0.0, reg_max=0.0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, rsv_cost, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, rsv_max, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, reg_cost, reg_max, up_time, ramp_up, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -160,6 +176,8 @@ get_capital_cost(value::SupplyTechnology) = value.capital_cost get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min """Get [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_capacity +"""Get [`SupplyTechnology`](@ref) `rsv_cost`.""" +get_rsv_cost(value::SupplyTechnology) = value.rsv_cost """Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max """Get [`SupplyTechnology`](@ref) `gen_ID`.""" @@ -176,6 +194,8 @@ get_ramp_down(value::SupplyTechnology) = value.ramp_down get_down_time(value::SupplyTechnology) = value.down_time """Get [`SupplyTechnology`](@ref) `initial_capacity`.""" get_initial_capacity(value::SupplyTechnology) = value.initial_capacity +"""Get [`SupplyTechnology`](@ref) `rsv_max`.""" +get_rsv_max(value::SupplyTechnology) = value.rsv_max """Get [`SupplyTechnology`](@ref) `fuel`.""" get_fuel(value::SupplyTechnology) = value.fuel """Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" @@ -206,6 +226,10 @@ get_maintenance_duration(value::SupplyTechnology) = value.maintenance_duration get_start_cost(value::SupplyTechnology) = value.start_cost """Get [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years +"""Get [`SupplyTechnology`](@ref) `reg_cost`.""" +get_reg_cost(value::SupplyTechnology) = value.reg_cost +"""Get [`SupplyTechnology`](@ref) `reg_max`.""" +get_reg_max(value::SupplyTechnology) = value.reg_max """Get [`SupplyTechnology`](@ref) `up_time`.""" get_up_time(value::SupplyTechnology) = value.up_time """Get [`SupplyTechnology`](@ref) `ramp_up`.""" @@ -225,6 +249,8 @@ set_capital_cost!(value::SupplyTechnology, val) = value.capital_cost = val set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val """Set [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_required_capacity = val +"""Set [`SupplyTechnology`](@ref) `rsv_cost`.""" +set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val """Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val """Set [`SupplyTechnology`](@ref) `gen_ID`.""" @@ -241,6 +267,8 @@ set_ramp_down!(value::SupplyTechnology, val) = value.ramp_down = val set_down_time!(value::SupplyTechnology, val) = value.down_time = val """Set [`SupplyTechnology`](@ref) `initial_capacity`.""" set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val +"""Set [`SupplyTechnology`](@ref) `rsv_max`.""" +set_rsv_max!(value::SupplyTechnology, val) = value.rsv_max = val """Set [`SupplyTechnology`](@ref) `fuel`.""" set_fuel!(value::SupplyTechnology, val) = value.fuel = val """Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" @@ -271,6 +299,10 @@ set_maintenance_duration!(value::SupplyTechnology, val) = value.maintenance_dura set_start_cost!(value::SupplyTechnology, val) = value.start_cost = val """Set [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val +"""Set [`SupplyTechnology`](@ref) `reg_cost`.""" +set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val +"""Set [`SupplyTechnology`](@ref) `reg_max`.""" +set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val """Set [`SupplyTechnology`](@ref) `up_time`.""" set_up_time!(value::SupplyTechnology, val) = value.up_time = val """Set [`SupplyTechnology`](@ref) `ramp_up`.""" From b31e265960dccb7b0592f999d0a8737c7f577310 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 23 Jul 2024 15:46:29 -0600 Subject: [PATCH 07/69] fix SupplyTechnology --- src/models/generated/SupplyTechnology.jl | 26 ++++++++++++++++-------- src/models/generated/includes.jl | 2 ++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 0904f6b..d539471 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -25,7 +25,7 @@ This file is auto-generated. Do not edit. fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} start_fuel::Float64 - heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} minimum_generation::Float64 ext::Dict balancing_topology::String @@ -38,6 +38,7 @@ This file is auto-generated. Do not edit. start_cost::Float64 maintenance_cycle_length_years::Int64 reg_cost::Float64 + cap_size::Float64 reg_max::Float64 up_time::Float64 ramp_up::Float64 @@ -51,12 +52,12 @@ This file is auto-generated. Do not edit. - `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. -- `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during normal generation process for multi-fuel generator +- `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves -- `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during start-up process for multi-fuel generator +- `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator - `gen_ID::String`: ID for individual generator -- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: Minimum blending level of each fuel during start-up process for multi-fuel generator +- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator - `available::Bool`: (default: `True`) identifies whether the technology is available - `name::String`: The technology name - `ramp_down::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity @@ -64,9 +65,9 @@ This file is auto-generated. Do not edit. - `initial_capacity::Float64`: Pre-existing capacity for a technology - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA -- `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: Maximum blending level of each fuel during normal generation process for multi-fuel generator +- `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during normal generation process for multi-fuel generator - `start_fuel::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) -- `heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `1.0`) Heat rate of generator, MMBTU/MWh +- `heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh - `minimum_generation::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes @@ -79,6 +80,7 @@ This file is auto-generated. Do not edit. - `start_cost::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). - `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `cap_size::Float64`: (default: `1.0`) Cap_size - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves - `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. - `ramp_up::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity @@ -124,7 +126,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" start_fuel::Float64 "Heat rate of generator, MMBTU/MWh" - heat_rate::Union{PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} "Minimum generation as a fraction of total capacity" minimum_generation::Float64 "Option for providing additional data" @@ -149,6 +151,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology maintenance_cycle_length_years::Int64 "Cost of providing regulation reserves " reg_cost::Float64 + "Cap_size" + cap_size::Float64 "Fraction of nameplate capacity that can committed to provided regulation reserves" reg_max::Float64 "Minimum amount of time a resource has to stay in the committed state." @@ -160,8 +164,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min, minimum_required_capacity=0.0, rsv_cost=0.0, cofire_start_max, gen_ID, cofire_start_min, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max, start_fuel=0.0, heat_rate=1.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, reg_cost=0.0, reg_max=0.0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, rsv_cost, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, rsv_max, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, reg_cost, reg_max, up_time, ramp_up, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min=nothing, minimum_required_capacity=0.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, cofire_start_min=nothing, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, start_fuel=0.0, heat_rate=0.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, reg_cost=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, rsv_cost, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, rsv_max, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, reg_cost, cap_size, reg_max, up_time, ramp_up, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -228,6 +232,8 @@ get_start_cost(value::SupplyTechnology) = value.start_cost get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years """Get [`SupplyTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::SupplyTechnology) = value.reg_cost +"""Get [`SupplyTechnology`](@ref) `cap_size`.""" +get_cap_size(value::SupplyTechnology) = value.cap_size """Get [`SupplyTechnology`](@ref) `reg_max`.""" get_reg_max(value::SupplyTechnology) = value.reg_max """Get [`SupplyTechnology`](@ref) `up_time`.""" @@ -301,6 +307,8 @@ set_start_cost!(value::SupplyTechnology, val) = value.start_cost = val set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val """Set [`SupplyTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val +"""Set [`SupplyTechnology`](@ref) `cap_size`.""" +set_cap_size!(value::SupplyTechnology, val) = value.cap_size = val """Set [`SupplyTechnology`](@ref) `reg_max`.""" set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val """Set [`SupplyTechnology`](@ref) `up_time`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 0582f8f..ab637a4 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -15,6 +15,7 @@ export get_base_power export get_can_retire export get_can_retrofit export get_cap_res_excl +export get_cap_size export get_capital_cost export get_capital_cost_charge export get_capital_cost_energy @@ -113,6 +114,7 @@ export set_base_power! export set_can_retire! export set_can_retrofit! export set_cap_res_excl! +export set_cap_size! export set_capital_cost! export set_capital_cost_charge! export set_capital_cost_energy! From 7b7a692f052daac6cc178971aecf264d3ff60caf Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 24 Jul 2024 12:09:02 -0600 Subject: [PATCH 08/69] update storage structs --- src/models/generated/StorageTechnology.jl | 36 +++++++++++------------ src/models/generated/includes.jl | 2 -- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 9b31d4f..f9dba82 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -15,7 +15,6 @@ This file is auto-generated. Do not edit. available::Bool name::String storage_tech::StorageTech - operations_cost_charge::PSY.OperationalCost efficiency_down::Float64 self_discharge::Float64 minimum_duration::Float64 @@ -26,11 +25,12 @@ This file is auto-generated. Do not edit. ext::Dict balancing_topology::String region::String + operations_cost::PSY.OperationalCost maximum_capacity::Float64 maximum_duration::Float64 + cluster::Int64 initial_capacity_energy::Float64 maximum_capacity_energy::Float64 - operations_cost_energy::PSY.OperationalCost minimum_required_capacity_energy::Float64 reg_cost::Float64 reg_max::Float64 @@ -50,7 +50,6 @@ This file is auto-generated. Do not edit. - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type -- `operations_cost_charge::PSY.OperationalCost`: Fixed O&M costs for a technology - `efficiency_down::Float64`: (default: `1.0`) Efficiency of discharging storage - `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage - `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology @@ -61,11 +60,12 @@ This file is auto-generated. Do not edit. - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes - `region::String`: (default: `1.0`) Region/zone technology operates in +- `operations_cost::PSY.OperationalCost`: Fixed O&M costs for a technology - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed power capacity for a storage technology - `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `cluster::Int64`: (default: `0`) Cluster - `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) - `maximum_capacity_energy::Float64`: (default: `Inf`) Maximum allowable installed energy capacity for a storage technology -- `operations_cost_energy::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology - `minimum_required_capacity_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves @@ -91,8 +91,6 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology name::String "Storage Technology Type" storage_tech::StorageTech - "Fixed O&M costs for a technology" - operations_cost_charge::PSY.OperationalCost "Efficiency of discharging storage" efficiency_down::Float64 "Efficiency of discharging storage" @@ -113,16 +111,18 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology balancing_topology::String "Region/zone technology operates in" region::String + "Fixed O&M costs for a technology" + operations_cost::PSY.OperationalCost "Maximum allowable installed power capacity for a storage technology" maximum_capacity::Float64 "Maximum allowable durection for a storage technology" maximum_duration::Float64 + "Cluster" + cluster::Int64 "Pre-existing energy capacity for a technology (MWh)" initial_capacity_energy::Float64 "Maximum allowable installed energy capacity for a storage technology" maximum_capacity_energy::Float64 - "Fixed O&M costs for energy capacity of storage technology" - operations_cost_energy::PSY.OperationalCost "Minimum required energy capacity for a storage technology" minimum_required_capacity_energy::Float64 "Cost of providing regulation reserves " @@ -136,8 +136,8 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology end -function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, gen_ID, minimum_required_capacity_charge=0.0, available, name, storage_tech, operations_cost_charge, efficiency_down=1.0, self_discharge=1.0, minimum_duration=0.0, rsv_max=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, maximum_capacity=Inf, maximum_duration=1000.0, initial_capacity_energy, maximum_capacity_energy=Inf, operations_cost_energy, minimum_required_capacity_energy=0.0, reg_cost=0.0, reg_max=0.0, capital_cost_charge=0.0, initial_capacity_charge, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, capital_cost_energy, prime_mover_type, rsv_cost, gen_ID, minimum_required_capacity_charge, available, name, storage_tech, operations_cost_charge, efficiency_down, self_discharge, minimum_duration, rsv_max, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, maximum_capacity, maximum_duration, initial_capacity_energy, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, reg_cost, reg_max, capital_cost_charge, initial_capacity_charge, ) +function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, gen_ID, minimum_required_capacity_charge=0.0, available, name, storage_tech, efficiency_down=1.0, self_discharge=1.0, minimum_duration=0.0, rsv_max=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, maximum_duration=1000.0, cluster=0, initial_capacity_energy, maximum_capacity_energy=Inf, minimum_required_capacity_energy=0.0, reg_cost=0.0, reg_max=0.0, capital_cost_charge=0.0, initial_capacity_charge, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, capital_cost_energy, prime_mover_type, rsv_cost, gen_ID, minimum_required_capacity_charge, available, name, storage_tech, efficiency_down, self_discharge, minimum_duration, rsv_max, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, operations_cost, maximum_capacity, maximum_duration, cluster, initial_capacity_energy, maximum_capacity_energy, minimum_required_capacity_energy, reg_cost, reg_max, capital_cost_charge, initial_capacity_charge, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" @@ -158,8 +158,6 @@ get_available(value::StorageTechnology) = value.available get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech -"""Get [`StorageTechnology`](@ref) `operations_cost_charge`.""" -get_operations_cost_charge(value::StorageTechnology) = value.operations_cost_charge """Get [`StorageTechnology`](@ref) `efficiency_down`.""" get_efficiency_down(value::StorageTechnology) = value.efficiency_down """Get [`StorageTechnology`](@ref) `self_discharge`.""" @@ -180,16 +178,18 @@ get_ext(value::StorageTechnology) = value.ext get_balancing_topology(value::StorageTechnology) = value.balancing_topology """Get [`StorageTechnology`](@ref) `region`.""" get_region(value::StorageTechnology) = value.region +"""Get [`StorageTechnology`](@ref) `operations_cost`.""" +get_operations_cost(value::StorageTechnology) = value.operations_cost """Get [`StorageTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::StorageTechnology) = value.maximum_capacity """Get [`StorageTechnology`](@ref) `maximum_duration`.""" get_maximum_duration(value::StorageTechnology) = value.maximum_duration +"""Get [`StorageTechnology`](@ref) `cluster`.""" +get_cluster(value::StorageTechnology) = value.cluster """Get [`StorageTechnology`](@ref) `initial_capacity_energy`.""" get_initial_capacity_energy(value::StorageTechnology) = value.initial_capacity_energy """Get [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" get_maximum_capacity_energy(value::StorageTechnology) = value.maximum_capacity_energy -"""Get [`StorageTechnology`](@ref) `operations_cost_energy`.""" -get_operations_cost_energy(value::StorageTechnology) = value.operations_cost_energy """Get [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" get_minimum_required_capacity_energy(value::StorageTechnology) = value.minimum_required_capacity_energy """Get [`StorageTechnology`](@ref) `reg_cost`.""" @@ -219,8 +219,6 @@ set_available!(value::StorageTechnology, val) = value.available = val set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val -"""Set [`StorageTechnology`](@ref) `operations_cost_charge`.""" -set_operations_cost_charge!(value::StorageTechnology, val) = value.operations_cost_charge = val """Set [`StorageTechnology`](@ref) `efficiency_down`.""" set_efficiency_down!(value::StorageTechnology, val) = value.efficiency_down = val """Set [`StorageTechnology`](@ref) `self_discharge`.""" @@ -241,16 +239,18 @@ set_ext!(value::StorageTechnology, val) = value.ext = val set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val """Set [`StorageTechnology`](@ref) `region`.""" set_region!(value::StorageTechnology, val) = value.region = val +"""Set [`StorageTechnology`](@ref) `operations_cost`.""" +set_operations_cost!(value::StorageTechnology, val) = value.operations_cost = val """Set [`StorageTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::StorageTechnology, val) = value.maximum_capacity = val """Set [`StorageTechnology`](@ref) `maximum_duration`.""" set_maximum_duration!(value::StorageTechnology, val) = value.maximum_duration = val +"""Set [`StorageTechnology`](@ref) `cluster`.""" +set_cluster!(value::StorageTechnology, val) = value.cluster = val """Set [`StorageTechnology`](@ref) `initial_capacity_energy`.""" set_initial_capacity_energy!(value::StorageTechnology, val) = value.initial_capacity_energy = val """Set [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" set_maximum_capacity_energy!(value::StorageTechnology, val) = value.maximum_capacity_energy = val -"""Set [`StorageTechnology`](@ref) `operations_cost_energy`.""" -set_operations_cost_energy!(value::StorageTechnology, val) = value.operations_cost_energy = val """Set [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" set_minimum_required_capacity_energy!(value::StorageTechnology, val) = value.minimum_required_capacity_energy = val """Set [`StorageTechnology`](@ref) `reg_cost`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index ab637a4..98c5816 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -81,7 +81,6 @@ export get_minimum_required_capacity_power export get_name export get_network_lines export get_operations_cost -export get_operations_cost_charge export get_operations_cost_energy export get_operations_cost_gen export get_operations_cost_inv @@ -180,7 +179,6 @@ export set_minimum_required_capacity_power! export set_name! export set_network_lines! export set_operations_cost! -export set_operations_cost_charge! export set_operations_cost_energy! export set_operations_cost_gen! export set_operations_cost_inv! From 362e2190e8b3bf039d59854773e18cf86d33efa5 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 24 Jul 2024 13:30:01 -0600 Subject: [PATCH 09/69] update TransportTechnology --- src/models/generated/TransportTechnology.jl | 60 +++++++++------------ src/models/generated/includes.jl | 10 ++-- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 0d194fa..402668e 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -9,19 +9,18 @@ This file is auto-generated. Do not edit. capital_cost::PSY.ValueCurve start_region::String available::Bool + name::String capital_recovery_factor::Int64 end_region::String - power_systems_type::String internal::InfrastructureSystemsInternal network_lines::Int64 ext::Dict resistance::Float64 - derate_cap_res::Float64 voltage::Float64 - existing_flow_capacity::Float64 maximum_new_capacity::Float64 + existing_line_capacity::Float64 line_loss::Float64 - cap_res_excl::Int64 + maximum_flow::Float64 end @@ -30,19 +29,18 @@ This file is auto-generated. Do not edit. - `capital_cost::PSY.ValueCurve`: Cost of adding new capacity to the inter-regional transmission line. - `start_region::String`: Start region for transport technology - `available::Bool`: identifies whether the technology is available +- `name::String`: Name - `capital_recovery_factor::Int64`: (default: `0`) Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion. - `end_region::String`: End region for transport technology -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `network_lines::Int64`: Numerical Index - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `resistance::Float64`: (default: `0.0`) Technology resistance in Ohms -- `derate_cap_res::Float64`: (default: `0.0`) value represents the derating of the firm transmission capacity for the capacity reserve margin constraint. - `voltage::Float64`: (default: `0.0`) Technology resistance in Ohms -- `existing_flow_capacity::Float64`: Existing capacity of transport technology (MW) - `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) +- `existing_line_capacity::Float64`: Existing capacity of transport technology (MW) - `line_loss::Float64`: Transmission loss for each transport technology (%) -- `cap_res_excl::Int64`: (default: `0`) (-1,1,0) +- `maximum_flow::Float64`: Maximum line flow (MW) """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology "Cost of adding new capacity to the inter-regional transmission line." @@ -51,12 +49,12 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology start_region::String "identifies whether the technology is available" available::Bool + "Name" + name::String "Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion." capital_recovery_factor::Int64 "End region for transport technology" end_region::String - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Numerical Index" @@ -65,23 +63,21 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology ext::Dict "Technology resistance in Ohms" resistance::Float64 - "value represents the derating of the firm transmission capacity for the capacity reserve margin constraint." - derate_cap_res::Float64 "Technology resistance in Ohms" voltage::Float64 - "Existing capacity of transport technology (MW)" - existing_flow_capacity::Float64 "Maximum capacity that can be added to transmission line (MW)" maximum_new_capacity::Float64 + "Existing capacity of transport technology (MW)" + existing_line_capacity::Float64 "Transmission loss for each transport technology (%)" line_loss::Float64 - "(-1,1,0)" - cap_res_excl::Int64 + "Maximum line flow (MW)" + maximum_flow::Float64 end -function TransportTechnology{T}(; capital_cost, start_region, available, capital_recovery_factor=0, end_region, power_systems_type, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, derate_cap_res=0.0, voltage=0.0, existing_flow_capacity, maximum_new_capacity, line_loss, cap_res_excl=0, ) where T <: PSY.Device - TransportTechnology{T}(capital_cost, start_region, available, capital_recovery_factor, end_region, power_systems_type, internal, network_lines, ext, resistance, derate_cap_res, voltage, existing_flow_capacity, maximum_new_capacity, line_loss, cap_res_excl, ) +function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, line_loss, maximum_flow, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, line_loss, maximum_flow, ) end """Get [`TransportTechnology`](@ref) `capital_cost`.""" @@ -90,12 +86,12 @@ get_capital_cost(value::TransportTechnology) = value.capital_cost get_start_region(value::TransportTechnology) = value.start_region """Get [`TransportTechnology`](@ref) `available`.""" get_available(value::TransportTechnology) = value.available +"""Get [`TransportTechnology`](@ref) `name`.""" +get_name(value::TransportTechnology) = value.name """Get [`TransportTechnology`](@ref) `capital_recovery_factor`.""" get_capital_recovery_factor(value::TransportTechnology) = value.capital_recovery_factor """Get [`TransportTechnology`](@ref) `end_region`.""" get_end_region(value::TransportTechnology) = value.end_region -"""Get [`TransportTechnology`](@ref) `power_systems_type`.""" -get_power_systems_type(value::TransportTechnology) = value.power_systems_type """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal """Get [`TransportTechnology`](@ref) `network_lines`.""" @@ -104,18 +100,16 @@ get_network_lines(value::TransportTechnology) = value.network_lines get_ext(value::TransportTechnology) = value.ext """Get [`TransportTechnology`](@ref) `resistance`.""" get_resistance(value::TransportTechnology) = value.resistance -"""Get [`TransportTechnology`](@ref) `derate_cap_res`.""" -get_derate_cap_res(value::TransportTechnology) = value.derate_cap_res """Get [`TransportTechnology`](@ref) `voltage`.""" get_voltage(value::TransportTechnology) = value.voltage -"""Get [`TransportTechnology`](@ref) `existing_flow_capacity`.""" -get_existing_flow_capacity(value::TransportTechnology) = value.existing_flow_capacity """Get [`TransportTechnology`](@ref) `maximum_new_capacity`.""" get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity +"""Get [`TransportTechnology`](@ref) `existing_line_capacity`.""" +get_existing_line_capacity(value::TransportTechnology) = value.existing_line_capacity """Get [`TransportTechnology`](@ref) `line_loss`.""" get_line_loss(value::TransportTechnology) = value.line_loss -"""Get [`TransportTechnology`](@ref) `cap_res_excl`.""" -get_cap_res_excl(value::TransportTechnology) = value.cap_res_excl +"""Get [`TransportTechnology`](@ref) `maximum_flow`.""" +get_maximum_flow(value::TransportTechnology) = value.maximum_flow """Set [`TransportTechnology`](@ref) `capital_cost`.""" set_capital_cost!(value::TransportTechnology, val) = value.capital_cost = val @@ -123,12 +117,12 @@ set_capital_cost!(value::TransportTechnology, val) = value.capital_cost = val set_start_region!(value::TransportTechnology, val) = value.start_region = val """Set [`TransportTechnology`](@ref) `available`.""" set_available!(value::TransportTechnology, val) = value.available = val +"""Set [`TransportTechnology`](@ref) `name`.""" +set_name!(value::TransportTechnology, val) = value.name = val """Set [`TransportTechnology`](@ref) `capital_recovery_factor`.""" set_capital_recovery_factor!(value::TransportTechnology, val) = value.capital_recovery_factor = val """Set [`TransportTechnology`](@ref) `end_region`.""" set_end_region!(value::TransportTechnology, val) = value.end_region = val -"""Set [`TransportTechnology`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_type = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val """Set [`TransportTechnology`](@ref) `network_lines`.""" @@ -137,15 +131,13 @@ set_network_lines!(value::TransportTechnology, val) = value.network_lines = val set_ext!(value::TransportTechnology, val) = value.ext = val """Set [`TransportTechnology`](@ref) `resistance`.""" set_resistance!(value::TransportTechnology, val) = value.resistance = val -"""Set [`TransportTechnology`](@ref) `derate_cap_res`.""" -set_derate_cap_res!(value::TransportTechnology, val) = value.derate_cap_res = val """Set [`TransportTechnology`](@ref) `voltage`.""" set_voltage!(value::TransportTechnology, val) = value.voltage = val -"""Set [`TransportTechnology`](@ref) `existing_flow_capacity`.""" -set_existing_flow_capacity!(value::TransportTechnology, val) = value.existing_flow_capacity = val """Set [`TransportTechnology`](@ref) `maximum_new_capacity`.""" set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val +"""Set [`TransportTechnology`](@ref) `existing_line_capacity`.""" +set_existing_line_capacity!(value::TransportTechnology, val) = value.existing_line_capacity = val """Set [`TransportTechnology`](@ref) `line_loss`.""" set_line_loss!(value::TransportTechnology, val) = value.line_loss = val -"""Set [`TransportTechnology`](@ref) `cap_res_excl`.""" -set_cap_res_excl!(value::TransportTechnology, val) = value.cap_res_excl = val +"""Set [`TransportTechnology`](@ref) `maximum_flow`.""" +set_maximum_flow!(value::TransportTechnology, val) = value.maximum_flow = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 98c5816..0be9760 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -14,7 +14,6 @@ export get_balancing_topology export get_base_power export get_can_retire export get_can_retrofit -export get_cap_res_excl export get_cap_size export get_capital_cost export get_capital_cost_charge @@ -31,7 +30,6 @@ export get_cofire_start_min export get_cost_of_curtailment export get_demand_energy_efficiency export get_demand_mw_z -export get_derate_cap_res export get_down_time export get_efficiency_down export get_efficiency_down_ac @@ -41,7 +39,7 @@ export get_efficiency_up_ac export get_efficiency_up_dc export get_electrolyzer_min_kt export get_end_region -export get_existing_flow_capacity +export get_existing_line_capacity export get_ext export get_fuel export get_gen_ID @@ -66,6 +64,7 @@ export get_maximum_capacity export get_maximum_capacity_energy export get_maximum_capacity_power export get_maximum_duration +export get_maximum_flow export get_maximum_gen_capacity export get_maximum_inverter_capacity export get_maximum_new_capacity @@ -112,7 +111,6 @@ export set_balancing_topology! export set_base_power! export set_can_retire! export set_can_retrofit! -export set_cap_res_excl! export set_cap_size! export set_capital_cost! export set_capital_cost_charge! @@ -129,7 +127,6 @@ export set_cofire_start_min! export set_cost_of_curtailment! export set_demand_energy_efficiency! export set_demand_mw_z! -export set_derate_cap_res! export set_down_time! export set_efficiency_down! export set_efficiency_down_ac! @@ -139,7 +136,7 @@ export set_efficiency_up_ac! export set_efficiency_up_dc! export set_electrolyzer_min_kt! export set_end_region! -export set_existing_flow_capacity! +export set_existing_line_capacity! export set_ext! export set_fuel! export set_gen_ID! @@ -164,6 +161,7 @@ export set_maximum_capacity! export set_maximum_capacity_energy! export set_maximum_capacity_power! export set_maximum_duration! +export set_maximum_flow! export set_maximum_gen_capacity! export set_maximum_inverter_capacity! export set_maximum_new_capacity! From 376c715919f8ba66ed205d10d07172b37eb46bfb Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 25 Jul 2024 12:45:59 -0600 Subject: [PATCH 10/69] update Demand Requirements --- src/models/generated/DemandRequirement.jl | 58 +++++++++++------------ src/models/generated/includes.jl | 6 ++- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index 146852c..b182c18 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -7,14 +7,14 @@ This file is auto-generated. Do not edit. """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology name::String - power_systems_type::String internal::InfrastructureSystemsInternal demand_mw_z::Float64 value_lost_load::Float64 - max_curtailment::Float64 - ext::Dict - cost_of_curtailment::Float64 + cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}} + cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}} + max_curtailment::Union{Float64, Dict{Int64, Float64}} region::String + ext::Dict available::Bool end @@ -22,82 +22,82 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW - `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy (USD/MWh) -- `max_curtailment::Float64`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period -- `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `cost_of_curtailment::Float64`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load +- `cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load +- `cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load +- `max_curtailment::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period - `region::String`: Corresponding region for peak demand +- `ext::Dict`: (default: `Dict()`) Option for providing additional data - `available::Bool`: (default: `true`) identifies whether the technology is available """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology "The technology name" name::String - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Demand profile in MW" demand_mw_z::Float64 "Value of lost load/non-served energy (USD/MWh)" value_lost_load::Float64 - "Maximum percentage of demand that can be curtailed in an investment period" - max_curtailment::Float64 - "Option for providing additional data" - ext::Dict "Cost of non-served energy, fraction of value of lost load" - cost_of_curtailment::Float64 + cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}} + "Cost of non-served energy, fraction of value of lost load" + cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}} + "Maximum percentage of demand that can be curtailed in an investment period" + max_curtailment::Union{Float64, Dict{Int64, Float64}} "Corresponding region for peak demand" region::String + "Option for providing additional data" + ext::Dict "identifies whether the technology is available" available::Bool end -function DemandRequirement{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, value_lost_load=0.0, max_curtailment=0.0, ext=Dict(), cost_of_curtailment=0.0, region, available=true, ) where T <: PSY.StaticInjection - DemandRequirement{T}(name, power_systems_type, internal, demand_mw_z, value_lost_load, max_curtailment, ext, cost_of_curtailment, region, available, ) +function DemandRequirement{T}(; name, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, value_lost_load=0.0, cost_of_curtailment_mw=0.0, cost_of_curtailment_mwh=0.0, max_curtailment=0.0, region, ext=Dict(), available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, internal, demand_mw_z, value_lost_load, cost_of_curtailment_mw, cost_of_curtailment_mwh, max_curtailment, region, ext, available, ) end """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name -"""Get [`DemandRequirement`](@ref) `power_systems_type`.""" -get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal """Get [`DemandRequirement`](@ref) `demand_mw_z`.""" get_demand_mw_z(value::DemandRequirement) = value.demand_mw_z """Get [`DemandRequirement`](@ref) `value_lost_load`.""" get_value_lost_load(value::DemandRequirement) = value.value_lost_load +"""Get [`DemandRequirement`](@ref) `cost_of_curtailment_mw`.""" +get_cost_of_curtailment_mw(value::DemandRequirement) = value.cost_of_curtailment_mw +"""Get [`DemandRequirement`](@ref) `cost_of_curtailment_mwh`.""" +get_cost_of_curtailment_mwh(value::DemandRequirement) = value.cost_of_curtailment_mwh """Get [`DemandRequirement`](@ref) `max_curtailment`.""" get_max_curtailment(value::DemandRequirement) = value.max_curtailment -"""Get [`DemandRequirement`](@ref) `ext`.""" -get_ext(value::DemandRequirement) = value.ext -"""Get [`DemandRequirement`](@ref) `cost_of_curtailment`.""" -get_cost_of_curtailment(value::DemandRequirement) = value.cost_of_curtailment """Get [`DemandRequirement`](@ref) `region`.""" get_region(value::DemandRequirement) = value.region +"""Get [`DemandRequirement`](@ref) `ext`.""" +get_ext(value::DemandRequirement) = value.ext """Get [`DemandRequirement`](@ref) `available`.""" get_available(value::DemandRequirement) = value.available """Set [`DemandRequirement`](@ref) `name`.""" set_name!(value::DemandRequirement, val) = value.name = val -"""Set [`DemandRequirement`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val """Set [`DemandRequirement`](@ref) `demand_mw_z`.""" set_demand_mw_z!(value::DemandRequirement, val) = value.demand_mw_z = val """Set [`DemandRequirement`](@ref) `value_lost_load`.""" set_value_lost_load!(value::DemandRequirement, val) = value.value_lost_load = val +"""Set [`DemandRequirement`](@ref) `cost_of_curtailment_mw`.""" +set_cost_of_curtailment_mw!(value::DemandRequirement, val) = value.cost_of_curtailment_mw = val +"""Set [`DemandRequirement`](@ref) `cost_of_curtailment_mwh`.""" +set_cost_of_curtailment_mwh!(value::DemandRequirement, val) = value.cost_of_curtailment_mwh = val """Set [`DemandRequirement`](@ref) `max_curtailment`.""" set_max_curtailment!(value::DemandRequirement, val) = value.max_curtailment = val -"""Set [`DemandRequirement`](@ref) `ext`.""" -set_ext!(value::DemandRequirement, val) = value.ext = val -"""Set [`DemandRequirement`](@ref) `cost_of_curtailment`.""" -set_cost_of_curtailment!(value::DemandRequirement, val) = value.cost_of_curtailment = val """Set [`DemandRequirement`](@ref) `region`.""" set_region!(value::DemandRequirement, val) = value.region = val +"""Set [`DemandRequirement`](@ref) `ext`.""" +set_ext!(value::DemandRequirement, val) = value.ext = val """Set [`DemandRequirement`](@ref) `available`.""" set_available!(value::DemandRequirement, val) = value.available = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 0be9760..5f04846 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -27,7 +27,8 @@ export get_cofire_level_max export get_cofire_level_min export get_cofire_start_max export get_cofire_start_min -export get_cost_of_curtailment +export get_cost_of_curtailment_mw +export get_cost_of_curtailment_mwh export get_demand_energy_efficiency export get_demand_mw_z export get_down_time @@ -124,7 +125,8 @@ export set_cofire_level_max! export set_cofire_level_min! export set_cofire_start_max! export set_cofire_start_min! -export set_cost_of_curtailment! +export set_cost_of_curtailment_mw! +export set_cost_of_curtailment_mwh! export set_demand_energy_efficiency! export set_demand_mw_z! export set_down_time! From a3475304aa3ab68d22b4231b68139ad1978adb89 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 29 Jul 2024 10:20:01 -0600 Subject: [PATCH 11/69] additional inputs for TransportTechnology --- src/models/generated/TransportTechnology.jl | 32 +++++++++++++++------ src/models/generated/includes.jl | 4 +++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 402668e..7b543a5 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -7,11 +7,12 @@ This file is auto-generated. Do not edit. """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology capital_cost::PSY.ValueCurve - start_region::String + start_region::Int64 available::Bool name::String capital_recovery_factor::Int64 - end_region::String + end_region::Int64 + angle_limit::Float64 internal::InfrastructureSystemsInternal network_lines::Int64 ext::Dict @@ -19,6 +20,7 @@ This file is auto-generated. Do not edit. voltage::Float64 maximum_new_capacity::Float64 existing_line_capacity::Float64 + wacc::Float64 line_loss::Float64 maximum_flow::Float64 end @@ -27,11 +29,12 @@ This file is auto-generated. Do not edit. # Arguments - `capital_cost::PSY.ValueCurve`: Cost of adding new capacity to the inter-regional transmission line. -- `start_region::String`: Start region for transport technology +- `start_region::Int64`: Start region for transport technology - `available::Bool`: identifies whether the technology is available - `name::String`: Name - `capital_recovery_factor::Int64`: (default: `0`) Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion. -- `end_region::String`: End region for transport technology +- `end_region::Int64`: End region for transport technology +- `angle_limit::Float64`: (default: `0.0`) Votlage angle limit (radians) - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `network_lines::Int64`: Numerical Index - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -39,6 +42,7 @@ This file is auto-generated. Do not edit. - `voltage::Float64`: (default: `0.0`) Technology resistance in Ohms - `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) - `existing_line_capacity::Float64`: Existing capacity of transport technology (MW) +- `wacc::Float64`: (default: `0`) Weighted average cost of capital - `line_loss::Float64`: Transmission loss for each transport technology (%) - `maximum_flow::Float64`: Maximum line flow (MW) """ @@ -46,7 +50,7 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology "Cost of adding new capacity to the inter-regional transmission line." capital_cost::PSY.ValueCurve "Start region for transport technology" - start_region::String + start_region::Int64 "identifies whether the technology is available" available::Bool "Name" @@ -54,7 +58,9 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology "Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion." capital_recovery_factor::Int64 "End region for transport technology" - end_region::String + end_region::Int64 + "Votlage angle limit (radians)" + angle_limit::Float64 "Internal field" internal::InfrastructureSystemsInternal "Numerical Index" @@ -69,6 +75,8 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology maximum_new_capacity::Float64 "Existing capacity of transport technology (MW)" existing_line_capacity::Float64 + "Weighted average cost of capital" + wacc::Float64 "Transmission loss for each transport technology (%)" line_loss::Float64 "Maximum line flow (MW)" @@ -76,8 +84,8 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology end -function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, line_loss, maximum_flow, ) where T <: PSY.Device - TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, line_loss, maximum_flow, ) +function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, angle_limit=0.0, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, maximum_flow, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, angle_limit, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, wacc, line_loss, maximum_flow, ) end """Get [`TransportTechnology`](@ref) `capital_cost`.""" @@ -92,6 +100,8 @@ get_name(value::TransportTechnology) = value.name get_capital_recovery_factor(value::TransportTechnology) = value.capital_recovery_factor """Get [`TransportTechnology`](@ref) `end_region`.""" get_end_region(value::TransportTechnology) = value.end_region +"""Get [`TransportTechnology`](@ref) `angle_limit`.""" +get_angle_limit(value::TransportTechnology) = value.angle_limit """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal """Get [`TransportTechnology`](@ref) `network_lines`.""" @@ -106,6 +116,8 @@ get_voltage(value::TransportTechnology) = value.voltage get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity """Get [`TransportTechnology`](@ref) `existing_line_capacity`.""" get_existing_line_capacity(value::TransportTechnology) = value.existing_line_capacity +"""Get [`TransportTechnology`](@ref) `wacc`.""" +get_wacc(value::TransportTechnology) = value.wacc """Get [`TransportTechnology`](@ref) `line_loss`.""" get_line_loss(value::TransportTechnology) = value.line_loss """Get [`TransportTechnology`](@ref) `maximum_flow`.""" @@ -123,6 +135,8 @@ set_name!(value::TransportTechnology, val) = value.name = val set_capital_recovery_factor!(value::TransportTechnology, val) = value.capital_recovery_factor = val """Set [`TransportTechnology`](@ref) `end_region`.""" set_end_region!(value::TransportTechnology, val) = value.end_region = val +"""Set [`TransportTechnology`](@ref) `angle_limit`.""" +set_angle_limit!(value::TransportTechnology, val) = value.angle_limit = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val """Set [`TransportTechnology`](@ref) `network_lines`.""" @@ -137,6 +151,8 @@ set_voltage!(value::TransportTechnology, val) = value.voltage = val set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val """Set [`TransportTechnology`](@ref) `existing_line_capacity`.""" set_existing_line_capacity!(value::TransportTechnology, val) = value.existing_line_capacity = val +"""Set [`TransportTechnology`](@ref) `wacc`.""" +set_wacc!(value::TransportTechnology, val) = value.wacc = val """Set [`TransportTechnology`](@ref) `line_loss`.""" set_line_loss!(value::TransportTechnology, val) = value.line_loss = val """Set [`TransportTechnology`](@ref) `maximum_flow`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 5f04846..15069b4 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -9,6 +9,7 @@ include("FlexibleDemandTechnology.jl") include("RetrofitTechnology.jl") include("DemandSideTechnology.jl") +export get_angle_limit export get_available export get_balancing_topology export get_base_power @@ -107,6 +108,8 @@ export get_up_time export get_value_lost_load export get_var_cost_per_mwh export get_voltage +export get_wacc +export set_angle_limit! export set_available! export set_balancing_topology! export set_base_power! @@ -205,3 +208,4 @@ export set_up_time! export set_value_lost_load! export set_var_cost_per_mwh! export set_voltage! +export set_wacc! From b852d32f5a8d8bce25805eea979d6e0396dc40fa Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 1 Aug 2024 07:45:13 -0600 Subject: [PATCH 12/69] updating naming convention, data types, and adding CurtailableDemandSideTechnology struct --- src/PowerSystemsInvestmentsPortfolios.jl | 7 + .../CurtailableDemandSideTechnology.jl | 95 ++++++ src/models/generated/DemandRequirement.jl | 60 ++-- src/models/generated/Electrolyzers.jl | 34 +- src/models/generated/StorageTechnology.jl | 306 ++++++++++-------- src/models/generated/SupplyTechnology.jl | 258 ++++++++------- src/models/generated/includes.jl | 109 ++++--- 7 files changed, 514 insertions(+), 355 deletions(-) create mode 100644 src/models/generated/CurtailableDemandSideTechnology.jl diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 9189301..7ef562d 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -21,6 +21,10 @@ import InfrastructureSystems: InfrastructureSystemsComponent import PowerSystems +import PowerSystems: + StorageCost, + LinearCurve + import JSONSchema import JSON3 import PrettyTables @@ -36,7 +40,10 @@ export DemandRequirement export DemandsideTechnology export FlexibleDemandTechnology export Electrolyzers +export CurtailableDemandSideTechnology +export get_technologies +export get_ext export add_technology! export add_technologies! export read_json_data diff --git a/src/models/generated/CurtailableDemandSideTechnology.jl b/src/models/generated/CurtailableDemandSideTechnology.jl new file mode 100644 index 0000000..13900d2 --- /dev/null +++ b/src/models/generated/CurtailableDemandSideTechnology.jl @@ -0,0 +1,95 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology + name::String + curtailment_cost_mwh::Vector{Float64} + internal::InfrastructureSystemsInternal + segments::Vector{Int64} + curtailment_cost::Vector{Float64} + voll::Float64 + ext::Dict + max_demand_curtailment::Vector{Float64} + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `curtailment_cost_mwh::Vector{Float64}`: Energy cost of curtailment +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `segments::Vector{Int64}`: Demand segment IDs +- `curtailment_cost::Vector{Float64}`: Fraction of VOLL for curtailment cost +- `voll::Float64`: value of lost load +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `max_demand_curtailment::Vector{Float64}`: percent of demand that can be curtailed in that segment +- `available::Bool`: identifies whether the technology is available +""" +mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology + "The technology name" + name::String + "Energy cost of curtailment" + curtailment_cost_mwh::Vector{Float64} + "Internal field" + internal::InfrastructureSystemsInternal + "Demand segment IDs" + segments::Vector{Int64} + "Fraction of VOLL for curtailment cost" + curtailment_cost::Vector{Float64} + "value of lost load" + voll::Float64 + "Option for providing additional data" + ext::Dict + "percent of demand that can be curtailed in that segment" + max_demand_curtailment::Vector{Float64} + "identifies whether the technology is available" + available::Bool +end + + +function CurtailableDemandSideTechnology{T}(; name, curtailment_cost_mwh, internal=InfrastructureSystemsInternal(), segments, curtailment_cost, voll, ext=Dict(), max_demand_curtailment, available, ) where T <: PSY.StaticInjection + CurtailableDemandSideTechnology{T}(name, curtailment_cost_mwh, internal, segments, curtailment_cost, voll, ext, max_demand_curtailment, available, ) +end + +"""Get [`CurtailableDemandSideTechnology`](@ref) `name`.""" +get_name(value::CurtailableDemandSideTechnology) = value.name +"""Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" +get_curtailment_cost_mwh(value::CurtailableDemandSideTechnology) = value.curtailment_cost_mwh +"""Get [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +get_internal(value::CurtailableDemandSideTechnology) = value.internal +"""Get [`CurtailableDemandSideTechnology`](@ref) `segments`.""" +get_segments(value::CurtailableDemandSideTechnology) = value.segments +"""Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" +get_curtailment_cost(value::CurtailableDemandSideTechnology) = value.curtailment_cost +"""Get [`CurtailableDemandSideTechnology`](@ref) `voll`.""" +get_voll(value::CurtailableDemandSideTechnology) = value.voll +"""Get [`CurtailableDemandSideTechnology`](@ref) `ext`.""" +get_ext(value::CurtailableDemandSideTechnology) = value.ext +"""Get [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" +get_max_demand_curtailment(value::CurtailableDemandSideTechnology) = value.max_demand_curtailment +"""Get [`CurtailableDemandSideTechnology`](@ref) `available`.""" +get_available(value::CurtailableDemandSideTechnology) = value.available + +"""Set [`CurtailableDemandSideTechnology`](@ref) `name`.""" +set_name!(value::CurtailableDemandSideTechnology, val) = value.name = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" +set_curtailment_cost_mwh!(value::CurtailableDemandSideTechnology, val) = value.curtailment_cost_mwh = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +set_internal!(value::CurtailableDemandSideTechnology, val) = value.internal = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `segments`.""" +set_segments!(value::CurtailableDemandSideTechnology, val) = value.segments = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" +set_curtailment_cost!(value::CurtailableDemandSideTechnology, val) = value.curtailment_cost = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `voll`.""" +set_voll!(value::CurtailableDemandSideTechnology, val) = value.voll = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `ext`.""" +set_ext!(value::CurtailableDemandSideTechnology, val) = value.ext = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" +set_max_demand_curtailment!(value::CurtailableDemandSideTechnology, val) = value.max_demand_curtailment = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `available`.""" +set_available!(value::CurtailableDemandSideTechnology, val) = value.available = val diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index b182c18..3bf9a6e 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -7,14 +7,11 @@ This file is auto-generated. Do not edit. """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology name::String + zone::Int64 internal::InfrastructureSystemsInternal demand_mw_z::Float64 - value_lost_load::Float64 - cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}} - cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}} - max_curtailment::Union{Float64, Dict{Int64, Float64}} - region::String ext::Dict + region::String available::Bool end @@ -22,82 +19,61 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `zone::Int64`: Zone Number - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW -- `value_lost_load::Float64`: (default: `0.0`) Value of lost load/non-served energy (USD/MWh) -- `cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load -- `cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Cost of non-served energy, fraction of value of lost load -- `max_curtailment::Union{Float64, Dict{Int64, Float64}}`: (default: `0.0`) Maximum percentage of demand that can be curtailed in an investment period -- `region::String`: Corresponding region for peak demand - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `region::String`: Corresponding region for peak demand - `available::Bool`: (default: `true`) identifies whether the technology is available """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology "The technology name" name::String + "Zone Number" + zone::Int64 "Internal field" internal::InfrastructureSystemsInternal "Demand profile in MW" demand_mw_z::Float64 - "Value of lost load/non-served energy (USD/MWh)" - value_lost_load::Float64 - "Cost of non-served energy, fraction of value of lost load" - cost_of_curtailment_mw::Union{Float64, Dict{Int64, Float64}} - "Cost of non-served energy, fraction of value of lost load" - cost_of_curtailment_mwh::Union{Float64, Dict{Int64, Float64}} - "Maximum percentage of demand that can be curtailed in an investment period" - max_curtailment::Union{Float64, Dict{Int64, Float64}} - "Corresponding region for peak demand" - region::String "Option for providing additional data" ext::Dict + "Corresponding region for peak demand" + region::String "identifies whether the technology is available" available::Bool end -function DemandRequirement{T}(; name, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, value_lost_load=0.0, cost_of_curtailment_mw=0.0, cost_of_curtailment_mwh=0.0, max_curtailment=0.0, region, ext=Dict(), available=true, ) where T <: PSY.StaticInjection - DemandRequirement{T}(name, internal, demand_mw_z, value_lost_load, cost_of_curtailment_mw, cost_of_curtailment_mwh, max_curtailment, region, ext, available, ) +function DemandRequirement{T}(; name, zone, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, ext=Dict(), region, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, zone, internal, demand_mw_z, ext, region, available, ) end """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name +"""Get [`DemandRequirement`](@ref) `zone`.""" +get_zone(value::DemandRequirement) = value.zone """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal """Get [`DemandRequirement`](@ref) `demand_mw_z`.""" get_demand_mw_z(value::DemandRequirement) = value.demand_mw_z -"""Get [`DemandRequirement`](@ref) `value_lost_load`.""" -get_value_lost_load(value::DemandRequirement) = value.value_lost_load -"""Get [`DemandRequirement`](@ref) `cost_of_curtailment_mw`.""" -get_cost_of_curtailment_mw(value::DemandRequirement) = value.cost_of_curtailment_mw -"""Get [`DemandRequirement`](@ref) `cost_of_curtailment_mwh`.""" -get_cost_of_curtailment_mwh(value::DemandRequirement) = value.cost_of_curtailment_mwh -"""Get [`DemandRequirement`](@ref) `max_curtailment`.""" -get_max_curtailment(value::DemandRequirement) = value.max_curtailment -"""Get [`DemandRequirement`](@ref) `region`.""" -get_region(value::DemandRequirement) = value.region """Get [`DemandRequirement`](@ref) `ext`.""" get_ext(value::DemandRequirement) = value.ext +"""Get [`DemandRequirement`](@ref) `region`.""" +get_region(value::DemandRequirement) = value.region """Get [`DemandRequirement`](@ref) `available`.""" get_available(value::DemandRequirement) = value.available """Set [`DemandRequirement`](@ref) `name`.""" set_name!(value::DemandRequirement, val) = value.name = val +"""Set [`DemandRequirement`](@ref) `zone`.""" +set_zone!(value::DemandRequirement, val) = value.zone = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val """Set [`DemandRequirement`](@ref) `demand_mw_z`.""" set_demand_mw_z!(value::DemandRequirement, val) = value.demand_mw_z = val -"""Set [`DemandRequirement`](@ref) `value_lost_load`.""" -set_value_lost_load!(value::DemandRequirement, val) = value.value_lost_load = val -"""Set [`DemandRequirement`](@ref) `cost_of_curtailment_mw`.""" -set_cost_of_curtailment_mw!(value::DemandRequirement, val) = value.cost_of_curtailment_mw = val -"""Set [`DemandRequirement`](@ref) `cost_of_curtailment_mwh`.""" -set_cost_of_curtailment_mwh!(value::DemandRequirement, val) = value.cost_of_curtailment_mwh = val -"""Set [`DemandRequirement`](@ref) `max_curtailment`.""" -set_max_curtailment!(value::DemandRequirement, val) = value.max_curtailment = val -"""Set [`DemandRequirement`](@ref) `region`.""" -set_region!(value::DemandRequirement, val) = value.region = val """Set [`DemandRequirement`](@ref) `ext`.""" set_ext!(value::DemandRequirement, val) = value.ext = val +"""Set [`DemandRequirement`](@ref) `region`.""" +set_region!(value::DemandRequirement, val) = value.region = val """Set [`DemandRequirement`](@ref) `available`.""" set_available!(value::DemandRequirement, val) = value.available = val diff --git a/src/models/generated/Electrolyzers.jl b/src/models/generated/Electrolyzers.jl index 32bb403..ae02cd8 100644 --- a/src/models/generated/Electrolyzers.jl +++ b/src/models/generated/Electrolyzers.jl @@ -6,9 +6,9 @@ This file is auto-generated. Do not edit. """ mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology + ramp_dn_percentage::Float64 available::Bool name::String - ramp_down::Float64 hydrogen_mwh_per_tonne::PSY.ValueCurve power_systems_type::String internal::InfrastructureSystemsInternal @@ -16,15 +16,15 @@ This file is auto-generated. Do not edit. ext::Dict electrolyzer_min_kt::Float64 min_power::Float64 - ramp_up::Float64 + ramp_up_percentage::Float64 end # Arguments +- `ramp_dn_percentage::Float64`: Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. - `available::Bool`: identifies whether the technology is available - `name::String`: The technology name -- `ramp_down::Float64`: Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. - `hydrogen_mwh_per_tonne::PSY.ValueCurve`: Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t) - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field @@ -32,15 +32,15 @@ This file is auto-generated. Do not edit. - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `electrolyzer_min_kt::Float64`: Minimum annual quantity of hydrogen that must be produced by electrolyzer in kilotonnes (kt) - `min_power::Float64`: The minimum generation level for a unit as a fraction of total capacity. -- `ramp_up::Float64`: Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. +- `ramp_up_percentage::Float64`: Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. """ mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology + "Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." + ramp_dn_percentage::Float64 "identifies whether the technology is available" available::Bool "The technology name" name::String - "Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." - ramp_down::Float64 "Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t)" hydrogen_mwh_per_tonne::PSY.ValueCurve "maps to a valid PowerSystems.jl for PCM modeling" @@ -56,20 +56,20 @@ mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology "The minimum generation level for a unit as a fraction of total capacity." min_power::Float64 "Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." - ramp_up::Float64 + ramp_up_percentage::Float64 end -function Electrolyzers{T}(; available, name, ramp_down, hydrogen_mwh_per_tonne, power_systems_type, internal=InfrastructureSystemsInternal(), hydrogen_price_per_tonne, ext=Dict(), electrolyzer_min_kt, min_power, ramp_up, ) where T <: PSY.StaticInjection - Electrolyzers{T}(available, name, ramp_down, hydrogen_mwh_per_tonne, power_systems_type, internal, hydrogen_price_per_tonne, ext, electrolyzer_min_kt, min_power, ramp_up, ) +function Electrolyzers{T}(; ramp_dn_percentage, available, name, hydrogen_mwh_per_tonne, power_systems_type, internal=InfrastructureSystemsInternal(), hydrogen_price_per_tonne, ext=Dict(), electrolyzer_min_kt, min_power, ramp_up_percentage, ) where T <: PSY.StaticInjection + Electrolyzers{T}(ramp_dn_percentage, available, name, hydrogen_mwh_per_tonne, power_systems_type, internal, hydrogen_price_per_tonne, ext, electrolyzer_min_kt, min_power, ramp_up_percentage, ) end +"""Get [`Electrolyzers`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::Electrolyzers) = value.ramp_dn_percentage """Get [`Electrolyzers`](@ref) `available`.""" get_available(value::Electrolyzers) = value.available """Get [`Electrolyzers`](@ref) `name`.""" get_name(value::Electrolyzers) = value.name -"""Get [`Electrolyzers`](@ref) `ramp_down`.""" -get_ramp_down(value::Electrolyzers) = value.ramp_down """Get [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" get_hydrogen_mwh_per_tonne(value::Electrolyzers) = value.hydrogen_mwh_per_tonne """Get [`Electrolyzers`](@ref) `power_systems_type`.""" @@ -84,15 +84,15 @@ get_ext(value::Electrolyzers) = value.ext get_electrolyzer_min_kt(value::Electrolyzers) = value.electrolyzer_min_kt """Get [`Electrolyzers`](@ref) `min_power`.""" get_min_power(value::Electrolyzers) = value.min_power -"""Get [`Electrolyzers`](@ref) `ramp_up`.""" -get_ramp_up(value::Electrolyzers) = value.ramp_up +"""Get [`Electrolyzers`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::Electrolyzers) = value.ramp_up_percentage +"""Set [`Electrolyzers`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::Electrolyzers, val) = value.ramp_dn_percentage = val """Set [`Electrolyzers`](@ref) `available`.""" set_available!(value::Electrolyzers, val) = value.available = val """Set [`Electrolyzers`](@ref) `name`.""" set_name!(value::Electrolyzers, val) = value.name = val -"""Set [`Electrolyzers`](@ref) `ramp_down`.""" -set_ramp_down!(value::Electrolyzers, val) = value.ramp_down = val """Set [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" set_hydrogen_mwh_per_tonne!(value::Electrolyzers, val) = value.hydrogen_mwh_per_tonne = val """Set [`Electrolyzers`](@ref) `power_systems_type`.""" @@ -107,5 +107,5 @@ set_ext!(value::Electrolyzers, val) = value.ext = val set_electrolyzer_min_kt!(value::Electrolyzers, val) = value.electrolyzer_min_kt = val """Set [`Electrolyzers`](@ref) `min_power`.""" set_min_power!(value::Electrolyzers, val) = value.min_power = val -"""Set [`Electrolyzers`](@ref) `ramp_up`.""" -set_ramp_up!(value::Electrolyzers, val) = value.ramp_up = val +"""Set [`Electrolyzers`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::Electrolyzers, val) = value.ramp_up_percentage = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index f9dba82..851332b 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -7,257 +7,305 @@ This file is auto-generated. Do not edit. """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology base_power::Float64 - capital_cost_energy::PSY.ValueCurve + om_costs_charge::PSY.OperationalCost + zone::Int64 prime_mover_type::PrimeMovers rsv_cost::Float64 - gen_ID::String - minimum_required_capacity_charge::Float64 available::Bool + fixed_om_cost_per_mwhyr::PSY.ValueCurve name::String storage_tech::StorageTech - efficiency_down::Float64 - self_discharge::Float64 - minimum_duration::Float64 + max_duration::Float64 + max_cap_mw::Float64 + inv_cost_charge_per_mwyr::PSY.ValueCurve + id::Int64 + existing_cap_mw::Float64 + existing_cap_mwh::Float64 + self_disch::Float64 + eff_down::Float64 + max_cap_mwh::Float64 rsv_max::Float64 - efficiency_up::Float64 + inv_cost_per_mwhyr::PSY.ValueCurve power_systems_type::String internal::InfrastructureSystemsInternal - ext::Dict + min_charge_cap_mw::Float64 balancing_topology::String + ext::Dict region::String - operations_cost::PSY.OperationalCost - maximum_capacity::Float64 - maximum_duration::Float64 + eff_up::Float64 + max_charge_cap_mw::Float64 + min_cap_mw::Float64 + inv_cost_per_mwyr::PSY.ValueCurve cluster::Int64 - initial_capacity_energy::Float64 - maximum_capacity_energy::Float64 - minimum_required_capacity_energy::Float64 reg_cost::Float64 + min_duration::Float64 + min_cap_mwh::Float64 reg_max::Float64 - capital_cost_charge::PSY.ValueCurve - initial_capacity_charge::Float64 + om_costs::PSY.OperationalCost end # Arguments - `base_power::Float64`: Base power -- `capital_cost_energy::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology +- `om_costs_charge::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology +- `zone::Int64`: Zone number - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves -- `gen_ID::String`: ID for individual generator -- `minimum_required_capacity_charge::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology - `available::Bool`: identifies whether the technology is available +- `fixed_om_cost_per_mwhyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Fixed and variable O&M costs for a technology - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type -- `efficiency_down::Float64`: (default: `1.0`) Efficiency of discharging storage -- `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage -- `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `max_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `max_cap_mw::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology +- `inv_cost_charge_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `id::Int64`: ID for individual generator +- `existing_cap_mw::Float64`: Pre-existing power capacity for a technology (MW) +- `existing_cap_mwh::Float64`: Pre-existing energy capacity for a technology (MWh) +- `self_disch::Float64`: (default: `1.0`) Efficiency of discharging storage +- `eff_down::Float64`: (default: `1.0`) Efficiency of discharging storage +- `max_cap_mwh::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. -- `efficiency_up::Float64`: (default: `1.0`) Efficiency of charging storage +- `inv_cost_per_mwhyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for energy capacity of storage technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `min_charge_cap_mw::Float64`: (default: `-1`) Minimum required charge capacity for a storage technology - `balancing_topology::String`: Set of balancing nodes -- `region::String`: (default: `1.0`) Region/zone technology operates in -- `operations_cost::PSY.OperationalCost`: Fixed O&M costs for a technology -- `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed power capacity for a storage technology -- `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `region::String`: Region/zone technology operates in +- `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage +- `max_charge_cap_mw::Float64`: (default: `-1`) Maximum allowable installed charge capacity for a storage technology +- `min_cap_mw::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology +- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. - `cluster::Int64`: (default: `0`) Cluster -- `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) -- `maximum_capacity_energy::Float64`: (default: `Inf`) Maximum allowable installed energy capacity for a storage technology -- `minimum_required_capacity_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `min_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `min_cap_mwh::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves -- `capital_cost_charge::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. -- `initial_capacity_charge::Float64`: Pre-existing power capacity for a technology (MW) +- `om_costs::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology "Base power" base_power::Float64 - "Capital costs for energy capacity of storage technology" - capital_cost_energy::PSY.ValueCurve + "Fixed and variable O&M costs for a technology" + om_costs_charge::PSY.OperationalCost + "Zone number" + zone::Int64 "Prime mover for generator" prime_mover_type::PrimeMovers "Cost of providing upwards spinning or contingency reserves" rsv_cost::Float64 - "ID for individual generator" - gen_ID::String - "Minimum required power capacity for a storage technology" - minimum_required_capacity_charge::Float64 "identifies whether the technology is available" available::Bool + "Fixed and variable O&M costs for a technology" + fixed_om_cost_per_mwhyr::PSY.ValueCurve "The technology name" name::String "Storage Technology Type" storage_tech::StorageTech + "Maximum allowable durection for a storage technology" + max_duration::Float64 + "Maximum allowable installed power capacity for a storage technology" + max_cap_mw::Float64 + "Capital costs for investing in a technology." + inv_cost_charge_per_mwyr::PSY.ValueCurve + "ID for individual generator" + id::Int64 + "Pre-existing power capacity for a technology (MW)" + existing_cap_mw::Float64 + "Pre-existing energy capacity for a technology (MWh)" + existing_cap_mwh::Float64 "Efficiency of discharging storage" - efficiency_down::Float64 + self_disch::Float64 "Efficiency of discharging storage" - self_discharge::Float64 - "Minimum required durection for a storage technology" - minimum_duration::Float64 + eff_down::Float64 + "Maximum allowable installed energy capacity for a storage technology" + max_cap_mwh::Float64 "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." rsv_max::Float64 - "Efficiency of charging storage" - efficiency_up::Float64 + "Capital costs for energy capacity of storage technology" + inv_cost_per_mwhyr::PSY.ValueCurve "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal - "Option for providing additional data" - ext::Dict + "Minimum required charge capacity for a storage technology" + min_charge_cap_mw::Float64 "Set of balancing nodes" balancing_topology::String + "Option for providing additional data" + ext::Dict "Region/zone technology operates in" region::String - "Fixed O&M costs for a technology" - operations_cost::PSY.OperationalCost - "Maximum allowable installed power capacity for a storage technology" - maximum_capacity::Float64 - "Maximum allowable durection for a storage technology" - maximum_duration::Float64 + "Efficiency of charging storage" + eff_up::Float64 + "Maximum allowable installed charge capacity for a storage technology" + max_charge_cap_mw::Float64 + "Minimum required power capacity for a storage technology" + min_cap_mw::Float64 + "Capital costs for investing in a technology." + inv_cost_per_mwyr::PSY.ValueCurve "Cluster" cluster::Int64 - "Pre-existing energy capacity for a technology (MWh)" - initial_capacity_energy::Float64 - "Maximum allowable installed energy capacity for a storage technology" - maximum_capacity_energy::Float64 - "Minimum required energy capacity for a storage technology" - minimum_required_capacity_energy::Float64 "Cost of providing regulation reserves " reg_cost::Float64 + "Minimum required durection for a storage technology" + min_duration::Float64 + "Minimum required energy capacity for a storage technology" + min_cap_mwh::Float64 "Fraction of nameplate capacity that can committed to provided regulation reserves" reg_max::Float64 - "Capital costs for investing in a technology." - capital_cost_charge::PSY.ValueCurve - "Pre-existing power capacity for a technology (MW)" - initial_capacity_charge::Float64 + "Fixed and variable O&M costs for a technology" + om_costs::PSY.OperationalCost end -function StorageTechnology{T}(; base_power, capital_cost_energy=0.0, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, gen_ID, minimum_required_capacity_charge=0.0, available, name, storage_tech, efficiency_down=1.0, self_discharge=1.0, minimum_duration=0.0, rsv_max=0.0, efficiency_up=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region=1.0, operations_cost, maximum_capacity=Inf, maximum_duration=1000.0, cluster=0, initial_capacity_energy, maximum_capacity_energy=Inf, minimum_required_capacity_energy=0.0, reg_cost=0.0, reg_max=0.0, capital_cost_charge=0.0, initial_capacity_charge, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, capital_cost_energy, prime_mover_type, rsv_cost, gen_ID, minimum_required_capacity_charge, available, name, storage_tech, efficiency_down, self_discharge, minimum_duration, rsv_max, efficiency_up, power_systems_type, internal, ext, balancing_topology, region, operations_cost, maximum_capacity, maximum_duration, cluster, initial_capacity_energy, maximum_capacity_energy, minimum_required_capacity_energy, reg_cost, reg_max, capital_cost_charge, initial_capacity_charge, ) +function StorageTechnology{T}(; base_power, om_costs_charge=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, available, fixed_om_cost_per_mwhyr=LinearCurve(0.0), name, storage_tech, max_duration=1000.0, max_cap_mw=-1, inv_cost_charge_per_mwyr=LinearCurve(0.0), id, existing_cap_mw, existing_cap_mwh, self_disch=1.0, eff_down=1.0, max_cap_mwh=-1, rsv_max=0.0, inv_cost_per_mwhyr=LinearCurve(0.0), power_systems_type, internal=InfrastructureSystemsInternal(), min_charge_cap_mw=-1, balancing_topology, ext=Dict(), region, eff_up=1.0, max_charge_cap_mw=-1, min_cap_mw=0.0, inv_cost_per_mwyr=LinearCurve(0.0), cluster=0, reg_cost=0.0, min_duration=0.0, min_cap_mwh=0.0, reg_max=0.0, om_costs=StorageCost(), ) where T <: PSY.Storage + StorageTechnology{T}(base_power, om_costs_charge, zone, prime_mover_type, rsv_cost, available, fixed_om_cost_per_mwhyr, name, storage_tech, max_duration, max_cap_mw, inv_cost_charge_per_mwyr, id, existing_cap_mw, existing_cap_mwh, self_disch, eff_down, max_cap_mwh, rsv_max, inv_cost_per_mwhyr, power_systems_type, internal, min_charge_cap_mw, balancing_topology, ext, region, eff_up, max_charge_cap_mw, min_cap_mw, inv_cost_per_mwyr, cluster, reg_cost, min_duration, min_cap_mwh, reg_max, om_costs, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" get_base_power(value::StorageTechnology) = value.base_power -"""Get [`StorageTechnology`](@ref) `capital_cost_energy`.""" -get_capital_cost_energy(value::StorageTechnology) = value.capital_cost_energy +"""Get [`StorageTechnology`](@ref) `om_costs_charge`.""" +get_om_costs_charge(value::StorageTechnology) = value.om_costs_charge +"""Get [`StorageTechnology`](@ref) `zone`.""" +get_zone(value::StorageTechnology) = value.zone """Get [`StorageTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type """Get [`StorageTechnology`](@ref) `rsv_cost`.""" get_rsv_cost(value::StorageTechnology) = value.rsv_cost -"""Get [`StorageTechnology`](@ref) `gen_ID`.""" -get_gen_ID(value::StorageTechnology) = value.gen_ID -"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_charge`.""" -get_minimum_required_capacity_charge(value::StorageTechnology) = value.minimum_required_capacity_charge """Get [`StorageTechnology`](@ref) `available`.""" get_available(value::StorageTechnology) = value.available +"""Get [`StorageTechnology`](@ref) `fixed_om_cost_per_mwhyr`.""" +get_fixed_om_cost_per_mwhyr(value::StorageTechnology) = value.fixed_om_cost_per_mwhyr """Get [`StorageTechnology`](@ref) `name`.""" get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech -"""Get [`StorageTechnology`](@ref) `efficiency_down`.""" -get_efficiency_down(value::StorageTechnology) = value.efficiency_down -"""Get [`StorageTechnology`](@ref) `self_discharge`.""" -get_self_discharge(value::StorageTechnology) = value.self_discharge -"""Get [`StorageTechnology`](@ref) `minimum_duration`.""" -get_minimum_duration(value::StorageTechnology) = value.minimum_duration +"""Get [`StorageTechnology`](@ref) `max_duration`.""" +get_max_duration(value::StorageTechnology) = value.max_duration +"""Get [`StorageTechnology`](@ref) `max_cap_mw`.""" +get_max_cap_mw(value::StorageTechnology) = value.max_cap_mw +"""Get [`StorageTechnology`](@ref) `inv_cost_charge_per_mwyr`.""" +get_inv_cost_charge_per_mwyr(value::StorageTechnology) = value.inv_cost_charge_per_mwyr +"""Get [`StorageTechnology`](@ref) `id`.""" +get_id(value::StorageTechnology) = value.id +"""Get [`StorageTechnology`](@ref) `existing_cap_mw`.""" +get_existing_cap_mw(value::StorageTechnology) = value.existing_cap_mw +"""Get [`StorageTechnology`](@ref) `existing_cap_mwh`.""" +get_existing_cap_mwh(value::StorageTechnology) = value.existing_cap_mwh +"""Get [`StorageTechnology`](@ref) `self_disch`.""" +get_self_disch(value::StorageTechnology) = value.self_disch +"""Get [`StorageTechnology`](@ref) `eff_down`.""" +get_eff_down(value::StorageTechnology) = value.eff_down +"""Get [`StorageTechnology`](@ref) `max_cap_mwh`.""" +get_max_cap_mwh(value::StorageTechnology) = value.max_cap_mwh """Get [`StorageTechnology`](@ref) `rsv_max`.""" get_rsv_max(value::StorageTechnology) = value.rsv_max -"""Get [`StorageTechnology`](@ref) `efficiency_up`.""" -get_efficiency_up(value::StorageTechnology) = value.efficiency_up +"""Get [`StorageTechnology`](@ref) `inv_cost_per_mwhyr`.""" +get_inv_cost_per_mwhyr(value::StorageTechnology) = value.inv_cost_per_mwhyr """Get [`StorageTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::StorageTechnology) = value.power_systems_type """Get [`StorageTechnology`](@ref) `internal`.""" get_internal(value::StorageTechnology) = value.internal -"""Get [`StorageTechnology`](@ref) `ext`.""" -get_ext(value::StorageTechnology) = value.ext +"""Get [`StorageTechnology`](@ref) `min_charge_cap_mw`.""" +get_min_charge_cap_mw(value::StorageTechnology) = value.min_charge_cap_mw """Get [`StorageTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::StorageTechnology) = value.balancing_topology +"""Get [`StorageTechnology`](@ref) `ext`.""" +get_ext(value::StorageTechnology) = value.ext """Get [`StorageTechnology`](@ref) `region`.""" get_region(value::StorageTechnology) = value.region -"""Get [`StorageTechnology`](@ref) `operations_cost`.""" -get_operations_cost(value::StorageTechnology) = value.operations_cost -"""Get [`StorageTechnology`](@ref) `maximum_capacity`.""" -get_maximum_capacity(value::StorageTechnology) = value.maximum_capacity -"""Get [`StorageTechnology`](@ref) `maximum_duration`.""" -get_maximum_duration(value::StorageTechnology) = value.maximum_duration +"""Get [`StorageTechnology`](@ref) `eff_up`.""" +get_eff_up(value::StorageTechnology) = value.eff_up +"""Get [`StorageTechnology`](@ref) `max_charge_cap_mw`.""" +get_max_charge_cap_mw(value::StorageTechnology) = value.max_charge_cap_mw +"""Get [`StorageTechnology`](@ref) `min_cap_mw`.""" +get_min_cap_mw(value::StorageTechnology) = value.min_cap_mw +"""Get [`StorageTechnology`](@ref) `inv_cost_per_mwyr`.""" +get_inv_cost_per_mwyr(value::StorageTechnology) = value.inv_cost_per_mwyr """Get [`StorageTechnology`](@ref) `cluster`.""" get_cluster(value::StorageTechnology) = value.cluster -"""Get [`StorageTechnology`](@ref) `initial_capacity_energy`.""" -get_initial_capacity_energy(value::StorageTechnology) = value.initial_capacity_energy -"""Get [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" -get_maximum_capacity_energy(value::StorageTechnology) = value.maximum_capacity_energy -"""Get [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" -get_minimum_required_capacity_energy(value::StorageTechnology) = value.minimum_required_capacity_energy """Get [`StorageTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::StorageTechnology) = value.reg_cost +"""Get [`StorageTechnology`](@ref) `min_duration`.""" +get_min_duration(value::StorageTechnology) = value.min_duration +"""Get [`StorageTechnology`](@ref) `min_cap_mwh`.""" +get_min_cap_mwh(value::StorageTechnology) = value.min_cap_mwh """Get [`StorageTechnology`](@ref) `reg_max`.""" get_reg_max(value::StorageTechnology) = value.reg_max -"""Get [`StorageTechnology`](@ref) `capital_cost_charge`.""" -get_capital_cost_charge(value::StorageTechnology) = value.capital_cost_charge -"""Get [`StorageTechnology`](@ref) `initial_capacity_charge`.""" -get_initial_capacity_charge(value::StorageTechnology) = value.initial_capacity_charge +"""Get [`StorageTechnology`](@ref) `om_costs`.""" +get_om_costs(value::StorageTechnology) = value.om_costs """Set [`StorageTechnology`](@ref) `base_power`.""" set_base_power!(value::StorageTechnology, val) = value.base_power = val -"""Set [`StorageTechnology`](@ref) `capital_cost_energy`.""" -set_capital_cost_energy!(value::StorageTechnology, val) = value.capital_cost_energy = val +"""Set [`StorageTechnology`](@ref) `om_costs_charge`.""" +set_om_costs_charge!(value::StorageTechnology, val) = value.om_costs_charge = val +"""Set [`StorageTechnology`](@ref) `zone`.""" +set_zone!(value::StorageTechnology, val) = value.zone = val """Set [`StorageTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val """Set [`StorageTechnology`](@ref) `rsv_cost`.""" set_rsv_cost!(value::StorageTechnology, val) = value.rsv_cost = val -"""Set [`StorageTechnology`](@ref) `gen_ID`.""" -set_gen_ID!(value::StorageTechnology, val) = value.gen_ID = val -"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_charge`.""" -set_minimum_required_capacity_charge!(value::StorageTechnology, val) = value.minimum_required_capacity_charge = val """Set [`StorageTechnology`](@ref) `available`.""" set_available!(value::StorageTechnology, val) = value.available = val +"""Set [`StorageTechnology`](@ref) `fixed_om_cost_per_mwhyr`.""" +set_fixed_om_cost_per_mwhyr!(value::StorageTechnology, val) = value.fixed_om_cost_per_mwhyr = val """Set [`StorageTechnology`](@ref) `name`.""" set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val -"""Set [`StorageTechnology`](@ref) `efficiency_down`.""" -set_efficiency_down!(value::StorageTechnology, val) = value.efficiency_down = val -"""Set [`StorageTechnology`](@ref) `self_discharge`.""" -set_self_discharge!(value::StorageTechnology, val) = value.self_discharge = val -"""Set [`StorageTechnology`](@ref) `minimum_duration`.""" -set_minimum_duration!(value::StorageTechnology, val) = value.minimum_duration = val +"""Set [`StorageTechnology`](@ref) `max_duration`.""" +set_max_duration!(value::StorageTechnology, val) = value.max_duration = val +"""Set [`StorageTechnology`](@ref) `max_cap_mw`.""" +set_max_cap_mw!(value::StorageTechnology, val) = value.max_cap_mw = val +"""Set [`StorageTechnology`](@ref) `inv_cost_charge_per_mwyr`.""" +set_inv_cost_charge_per_mwyr!(value::StorageTechnology, val) = value.inv_cost_charge_per_mwyr = val +"""Set [`StorageTechnology`](@ref) `id`.""" +set_id!(value::StorageTechnology, val) = value.id = val +"""Set [`StorageTechnology`](@ref) `existing_cap_mw`.""" +set_existing_cap_mw!(value::StorageTechnology, val) = value.existing_cap_mw = val +"""Set [`StorageTechnology`](@ref) `existing_cap_mwh`.""" +set_existing_cap_mwh!(value::StorageTechnology, val) = value.existing_cap_mwh = val +"""Set [`StorageTechnology`](@ref) `self_disch`.""" +set_self_disch!(value::StorageTechnology, val) = value.self_disch = val +"""Set [`StorageTechnology`](@ref) `eff_down`.""" +set_eff_down!(value::StorageTechnology, val) = value.eff_down = val +"""Set [`StorageTechnology`](@ref) `max_cap_mwh`.""" +set_max_cap_mwh!(value::StorageTechnology, val) = value.max_cap_mwh = val """Set [`StorageTechnology`](@ref) `rsv_max`.""" set_rsv_max!(value::StorageTechnology, val) = value.rsv_max = val -"""Set [`StorageTechnology`](@ref) `efficiency_up`.""" -set_efficiency_up!(value::StorageTechnology, val) = value.efficiency_up = val +"""Set [`StorageTechnology`](@ref) `inv_cost_per_mwhyr`.""" +set_inv_cost_per_mwhyr!(value::StorageTechnology, val) = value.inv_cost_per_mwhyr = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::StorageTechnology, val) = value.power_systems_type = val """Set [`StorageTechnology`](@ref) `internal`.""" set_internal!(value::StorageTechnology, val) = value.internal = val -"""Set [`StorageTechnology`](@ref) `ext`.""" -set_ext!(value::StorageTechnology, val) = value.ext = val +"""Set [`StorageTechnology`](@ref) `min_charge_cap_mw`.""" +set_min_charge_cap_mw!(value::StorageTechnology, val) = value.min_charge_cap_mw = val """Set [`StorageTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val +"""Set [`StorageTechnology`](@ref) `ext`.""" +set_ext!(value::StorageTechnology, val) = value.ext = val """Set [`StorageTechnology`](@ref) `region`.""" set_region!(value::StorageTechnology, val) = value.region = val -"""Set [`StorageTechnology`](@ref) `operations_cost`.""" -set_operations_cost!(value::StorageTechnology, val) = value.operations_cost = val -"""Set [`StorageTechnology`](@ref) `maximum_capacity`.""" -set_maximum_capacity!(value::StorageTechnology, val) = value.maximum_capacity = val -"""Set [`StorageTechnology`](@ref) `maximum_duration`.""" -set_maximum_duration!(value::StorageTechnology, val) = value.maximum_duration = val +"""Set [`StorageTechnology`](@ref) `eff_up`.""" +set_eff_up!(value::StorageTechnology, val) = value.eff_up = val +"""Set [`StorageTechnology`](@ref) `max_charge_cap_mw`.""" +set_max_charge_cap_mw!(value::StorageTechnology, val) = value.max_charge_cap_mw = val +"""Set [`StorageTechnology`](@ref) `min_cap_mw`.""" +set_min_cap_mw!(value::StorageTechnology, val) = value.min_cap_mw = val +"""Set [`StorageTechnology`](@ref) `inv_cost_per_mwyr`.""" +set_inv_cost_per_mwyr!(value::StorageTechnology, val) = value.inv_cost_per_mwyr = val """Set [`StorageTechnology`](@ref) `cluster`.""" set_cluster!(value::StorageTechnology, val) = value.cluster = val -"""Set [`StorageTechnology`](@ref) `initial_capacity_energy`.""" -set_initial_capacity_energy!(value::StorageTechnology, val) = value.initial_capacity_energy = val -"""Set [`StorageTechnology`](@ref) `maximum_capacity_energy`.""" -set_maximum_capacity_energy!(value::StorageTechnology, val) = value.maximum_capacity_energy = val -"""Set [`StorageTechnology`](@ref) `minimum_required_capacity_energy`.""" -set_minimum_required_capacity_energy!(value::StorageTechnology, val) = value.minimum_required_capacity_energy = val """Set [`StorageTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val +"""Set [`StorageTechnology`](@ref) `min_duration`.""" +set_min_duration!(value::StorageTechnology, val) = value.min_duration = val +"""Set [`StorageTechnology`](@ref) `min_cap_mwh`.""" +set_min_cap_mwh!(value::StorageTechnology, val) = value.min_cap_mwh = val """Set [`StorageTechnology`](@ref) `reg_max`.""" set_reg_max!(value::StorageTechnology, val) = value.reg_max = val -"""Set [`StorageTechnology`](@ref) `capital_cost_charge`.""" -set_capital_cost_charge!(value::StorageTechnology, val) = value.capital_cost_charge = val -"""Set [`StorageTechnology`](@ref) `initial_capacity_charge`.""" -set_initial_capacity_charge!(value::StorageTechnology, val) = value.initial_capacity_charge = val +"""Set [`StorageTechnology`](@ref) `om_costs`.""" +set_om_costs!(value::StorageTechnology, val) = value.om_costs = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index d539471..7659c6a 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -7,41 +7,42 @@ This file is auto-generated. Do not edit. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 - outage_factor::Float64 + heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + zone::Int64 prime_mover_type::PrimeMovers - capital_cost::PSY.ValueCurve + outage_factor::Float64 cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} - minimum_required_capacity::Float64 rsv_cost::Float64 cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} - gen_ID::String - cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + ramp_dn_percentage::Float64 available::Bool + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} name::String - ramp_down::Float64 + max_cap_mw::Float64 + id::Int64 + existing_cap_mw::Float64 down_time::Float64 - initial_capacity::Float64 + start_fuel_mmbtu_per_mw::Float64 rsv_max::Float64 - fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} + fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} - start_fuel::Float64 - heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} - minimum_generation::Float64 + internal::InfrastructureSystemsInternal ext::Dict balancing_topology::String - internal::InfrastructureSystemsInternal region::String - operations_cost::PSY.OperationalCost - maximum_capacity::Float64 + min_power::Float64 cluster::Int64 + inv_cost_per_mwyr::PSY.ValueCurve + min_cap_mw::Float64 + ramp_up_percentage::Float64 maintenance_duration::Int64 - start_cost::Float64 maintenance_cycle_length_years::Int64 reg_cost::Float64 + start_cost_per_mw::Float64 cap_size::Float64 reg_max::Float64 up_time::Float64 - ramp_up::Float64 + om_costs::PSY.OperationalCost maintenance_begin_cadence::Int64 end @@ -49,271 +50,278 @@ This file is auto-generated. Do not edit. # Arguments - `base_power::Float64`: Base power -- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology +- `heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh +- `zone::Int64`: Zone number where tech operates in - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator -- `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator -- `gen_ID::String`: ID for individual generator -- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator +- `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `available::Bool`: (default: `True`) identifies whether the technology is available +- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator - `name::String`: The technology name -- `ramp_down::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity +- `max_cap_mw::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology +- `id::Int64`: ID for individual generator +- `existing_cap_mw::Float64`: (default: `0.0`) Pre-existing capacity for a technology - `down_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to remain in the shutdown state. -- `initial_capacity::Float64`: Pre-existing capacity for a technology +- `start_fuel_mmbtu_per_mw::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. -- `fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA +- `fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during normal generation process for multi-fuel generator -- `start_fuel::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) -- `heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh -- `minimum_generation::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `region::String`: Region/zone technology operates in -- `operations_cost::PSY.OperationalCost`: Fixed O&M costs for a technology -- `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology +- `min_power::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. +- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `min_cap_mw::Float64`: (default: `0.0`) Minimum required capacity for a technology +- `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity - `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. -- `start_cost::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). - `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `start_cost_per_mw::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). - `cap_size::Float64`: (default: `1.0`) Cap_size - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves - `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. -- `ramp_up::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity +- `om_costs::PSY.OperationalCost`: (default: `ThermalGenerationCost()`) Fixed and variable O&M costs for a technology - `maintenance_begin_cadence::Int64`: (default: `1`) Cadence of timesteps in which scheduled maintenance can begin. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Base power" base_power::Float64 - "Derating factor to account for planned or forced outages of a technology" - outage_factor::Float64 + "Heat rate of generator, MMBTU/MWh" + heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + "Zone number where tech operates in" + zone::Int64 "Prime mover for generator" prime_mover_type::PrimeMovers - "Capital costs for investing in a technology." - capital_cost::PSY.ValueCurve + "Derating factor to account for planned or forced outages of a technology" + outage_factor::Float64 "Minimum blending level of each fuel during normal generation process for multi-fuel generator" cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} - "Minimum required capacity for a technology" - minimum_required_capacity::Float64 "Cost of providing upwards spinning or contingency reserves" rsv_cost::Float64 "Maximum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} - "ID for individual generator" - gen_ID::String - "Minimum blending level of each fuel during start-up process for multi-fuel generator" - cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_dn_percentage::Float64 "identifies whether the technology is available" available::Bool + "Minimum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} "The technology name" name::String - "Maximum decrease in output between operation periods. Fraction of total capacity" - ramp_down::Float64 + "Maximum allowable installed capacity for a technology" + max_cap_mw::Float64 + "ID for individual generator" + id::Int64 + "Pre-existing capacity for a technology" + existing_cap_mw::Float64 "Minimum amount of time a resource has to remain in the shutdown state." down_time::Float64 - "Pre-existing capacity for a technology" - initial_capacity::Float64 + "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" + start_fuel_mmbtu_per_mw::Float64 "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." rsv_max::Float64 "Fuel type according to IEA" - fuel::Union{ThermalFuels, Dict{ThermalFuels, ThermalFuels}} + fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} "Maximum blending level of each fuel during normal generation process for multi-fuel generator" cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} - "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" - start_fuel::Float64 - "Heat rate of generator, MMBTU/MWh" - heat_rate::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} - "Minimum generation as a fraction of total capacity" - minimum_generation::Float64 + "Internal field" + internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict "Set of balancing nodes" balancing_topology::String - "Internal field" - internal::InfrastructureSystemsInternal "Region/zone technology operates in" region::String - "Fixed O&M costs for a technology" - operations_cost::PSY.OperationalCost - "Maximum allowable installed capacity for a technology" - maximum_capacity::Float64 + "Minimum generation as a fraction of total capacity" + min_power::Float64 "Number of the cluster when representing multiple clusters of a given technology in a given region." cluster::Int64 + "Capital costs for investing in a technology." + inv_cost_per_mwyr::PSY.ValueCurve + "Minimum required capacity for a technology" + min_cap_mw::Float64 + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up_percentage::Float64 "Duration of the maintenance period, in number of timesteps." maintenance_duration::Int64 - "Cost per MW of nameplate capacity to start a generator (/MW per start)." - start_cost::Float64 "Length of scheduled maintenance cycle, in years." maintenance_cycle_length_years::Int64 "Cost of providing regulation reserves " reg_cost::Float64 + "Cost per MW of nameplate capacity to start a generator (/MW per start)." + start_cost_per_mw::Float64 "Cap_size" cap_size::Float64 "Fraction of nameplate capacity that can committed to provided regulation reserves" reg_max::Float64 "Minimum amount of time a resource has to stay in the committed state." up_time::Float64 - "Maximum increase in output between operation periods. Fraction of total capacity" - ramp_up::Float64 + "Fixed and variable O&M costs for a technology" + om_costs::PSY.OperationalCost "Cadence of timesteps in which scheduled maintenance can begin." maintenance_begin_cadence::Int64 end -function SupplyTechnology{T}(; base_power, outage_factor=1.0, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, cofire_level_min=nothing, minimum_required_capacity=0.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, cofire_start_min=nothing, available=True, name, ramp_down=100.0, down_time=0.0, initial_capacity, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, start_fuel=0.0, heat_rate=0.0, minimum_generation=0.0, ext=Dict(), balancing_topology, internal=InfrastructureSystemsInternal(), region, operations_cost, maximum_capacity=Inf, cluster=1, maintenance_duration=0, start_cost=0.0, maintenance_cycle_length_years=0, reg_cost=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, ramp_up=100.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, outage_factor, prime_mover_type, capital_cost, cofire_level_min, minimum_required_capacity, rsv_cost, cofire_start_max, gen_ID, cofire_start_min, available, name, ramp_down, down_time, initial_capacity, rsv_max, fuel, cofire_level_max, start_fuel, heat_rate, minimum_generation, ext, balancing_topology, internal, region, operations_cost, maximum_capacity, cluster, maintenance_duration, start_cost, maintenance_cycle_length_years, reg_cost, cap_size, reg_max, up_time, ramp_up, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, ramp_dn_percentage=100.0, available=True, cofire_start_min=nothing, name, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, ramp_dn_percentage, available, cofire_start_min, name, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" get_base_power(value::SupplyTechnology) = value.base_power -"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" -get_outage_factor(value::SupplyTechnology) = value.outage_factor +"""Get [`SupplyTechnology`](@ref) `heat_rate_mmbtu_per_mwh`.""" +get_heat_rate_mmbtu_per_mwh(value::SupplyTechnology) = value.heat_rate_mmbtu_per_mwh +"""Get [`SupplyTechnology`](@ref) `zone`.""" +get_zone(value::SupplyTechnology) = value.zone """Get [`SupplyTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::SupplyTechnology) = value.prime_mover_type -"""Get [`SupplyTechnology`](@ref) `capital_cost`.""" -get_capital_cost(value::SupplyTechnology) = value.capital_cost +"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" +get_outage_factor(value::SupplyTechnology) = value.outage_factor """Get [`SupplyTechnology`](@ref) `cofire_level_min`.""" get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min -"""Get [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" -get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_capacity """Get [`SupplyTechnology`](@ref) `rsv_cost`.""" get_rsv_cost(value::SupplyTechnology) = value.rsv_cost """Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max -"""Get [`SupplyTechnology`](@ref) `gen_ID`.""" -get_gen_ID(value::SupplyTechnology) = value.gen_ID -"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" -get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min +"""Get [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::SupplyTechnology) = value.ramp_dn_percentage """Get [`SupplyTechnology`](@ref) `available`.""" get_available(value::SupplyTechnology) = value.available +"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" +get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name -"""Get [`SupplyTechnology`](@ref) `ramp_down`.""" -get_ramp_down(value::SupplyTechnology) = value.ramp_down +"""Get [`SupplyTechnology`](@ref) `max_cap_mw`.""" +get_max_cap_mw(value::SupplyTechnology) = value.max_cap_mw +"""Get [`SupplyTechnology`](@ref) `id`.""" +get_id(value::SupplyTechnology) = value.id +"""Get [`SupplyTechnology`](@ref) `existing_cap_mw`.""" +get_existing_cap_mw(value::SupplyTechnology) = value.existing_cap_mw """Get [`SupplyTechnology`](@ref) `down_time`.""" get_down_time(value::SupplyTechnology) = value.down_time -"""Get [`SupplyTechnology`](@ref) `initial_capacity`.""" -get_initial_capacity(value::SupplyTechnology) = value.initial_capacity +"""Get [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" +get_start_fuel_mmbtu_per_mw(value::SupplyTechnology) = value.start_fuel_mmbtu_per_mw """Get [`SupplyTechnology`](@ref) `rsv_max`.""" get_rsv_max(value::SupplyTechnology) = value.rsv_max """Get [`SupplyTechnology`](@ref) `fuel`.""" get_fuel(value::SupplyTechnology) = value.fuel """Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" get_cofire_level_max(value::SupplyTechnology) = value.cofire_level_max -"""Get [`SupplyTechnology`](@ref) `start_fuel`.""" -get_start_fuel(value::SupplyTechnology) = value.start_fuel -"""Get [`SupplyTechnology`](@ref) `heat_rate`.""" -get_heat_rate(value::SupplyTechnology) = value.heat_rate -"""Get [`SupplyTechnology`](@ref) `minimum_generation`.""" -get_minimum_generation(value::SupplyTechnology) = value.minimum_generation +"""Get [`SupplyTechnology`](@ref) `internal`.""" +get_internal(value::SupplyTechnology) = value.internal """Get [`SupplyTechnology`](@ref) `ext`.""" get_ext(value::SupplyTechnology) = value.ext """Get [`SupplyTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::SupplyTechnology) = value.balancing_topology -"""Get [`SupplyTechnology`](@ref) `internal`.""" -get_internal(value::SupplyTechnology) = value.internal """Get [`SupplyTechnology`](@ref) `region`.""" get_region(value::SupplyTechnology) = value.region -"""Get [`SupplyTechnology`](@ref) `operations_cost`.""" -get_operations_cost(value::SupplyTechnology) = value.operations_cost -"""Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" -get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity +"""Get [`SupplyTechnology`](@ref) `min_power`.""" +get_min_power(value::SupplyTechnology) = value.min_power """Get [`SupplyTechnology`](@ref) `cluster`.""" get_cluster(value::SupplyTechnology) = value.cluster +"""Get [`SupplyTechnology`](@ref) `inv_cost_per_mwyr`.""" +get_inv_cost_per_mwyr(value::SupplyTechnology) = value.inv_cost_per_mwyr +"""Get [`SupplyTechnology`](@ref) `min_cap_mw`.""" +get_min_cap_mw(value::SupplyTechnology) = value.min_cap_mw +"""Get [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::SupplyTechnology) = value.ramp_up_percentage """Get [`SupplyTechnology`](@ref) `maintenance_duration`.""" get_maintenance_duration(value::SupplyTechnology) = value.maintenance_duration -"""Get [`SupplyTechnology`](@ref) `start_cost`.""" -get_start_cost(value::SupplyTechnology) = value.start_cost """Get [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years """Get [`SupplyTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::SupplyTechnology) = value.reg_cost +"""Get [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" +get_start_cost_per_mw(value::SupplyTechnology) = value.start_cost_per_mw """Get [`SupplyTechnology`](@ref) `cap_size`.""" get_cap_size(value::SupplyTechnology) = value.cap_size """Get [`SupplyTechnology`](@ref) `reg_max`.""" get_reg_max(value::SupplyTechnology) = value.reg_max """Get [`SupplyTechnology`](@ref) `up_time`.""" get_up_time(value::SupplyTechnology) = value.up_time -"""Get [`SupplyTechnology`](@ref) `ramp_up`.""" -get_ramp_up(value::SupplyTechnology) = value.ramp_up +"""Get [`SupplyTechnology`](@ref) `om_costs`.""" +get_om_costs(value::SupplyTechnology) = value.om_costs """Get [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" get_maintenance_begin_cadence(value::SupplyTechnology) = value.maintenance_begin_cadence """Set [`SupplyTechnology`](@ref) `base_power`.""" set_base_power!(value::SupplyTechnology, val) = value.base_power = val -"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" -set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val +"""Set [`SupplyTechnology`](@ref) `heat_rate_mmbtu_per_mwh`.""" +set_heat_rate_mmbtu_per_mwh!(value::SupplyTechnology, val) = value.heat_rate_mmbtu_per_mwh = val +"""Set [`SupplyTechnology`](@ref) `zone`.""" +set_zone!(value::SupplyTechnology, val) = value.zone = val """Set [`SupplyTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::SupplyTechnology, val) = value.prime_mover_type = val -"""Set [`SupplyTechnology`](@ref) `capital_cost`.""" -set_capital_cost!(value::SupplyTechnology, val) = value.capital_cost = val +"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" +set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val """Set [`SupplyTechnology`](@ref) `cofire_level_min`.""" set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val -"""Set [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" -set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_required_capacity = val """Set [`SupplyTechnology`](@ref) `rsv_cost`.""" set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val """Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val -"""Set [`SupplyTechnology`](@ref) `gen_ID`.""" -set_gen_ID!(value::SupplyTechnology, val) = value.gen_ID = val -"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" -set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val +"""Set [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::SupplyTechnology, val) = value.ramp_dn_percentage = val """Set [`SupplyTechnology`](@ref) `available`.""" set_available!(value::SupplyTechnology, val) = value.available = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" +set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val -"""Set [`SupplyTechnology`](@ref) `ramp_down`.""" -set_ramp_down!(value::SupplyTechnology, val) = value.ramp_down = val +"""Set [`SupplyTechnology`](@ref) `max_cap_mw`.""" +set_max_cap_mw!(value::SupplyTechnology, val) = value.max_cap_mw = val +"""Set [`SupplyTechnology`](@ref) `id`.""" +set_id!(value::SupplyTechnology, val) = value.id = val +"""Set [`SupplyTechnology`](@ref) `existing_cap_mw`.""" +set_existing_cap_mw!(value::SupplyTechnology, val) = value.existing_cap_mw = val """Set [`SupplyTechnology`](@ref) `down_time`.""" set_down_time!(value::SupplyTechnology, val) = value.down_time = val -"""Set [`SupplyTechnology`](@ref) `initial_capacity`.""" -set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val +"""Set [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" +set_start_fuel_mmbtu_per_mw!(value::SupplyTechnology, val) = value.start_fuel_mmbtu_per_mw = val """Set [`SupplyTechnology`](@ref) `rsv_max`.""" set_rsv_max!(value::SupplyTechnology, val) = value.rsv_max = val """Set [`SupplyTechnology`](@ref) `fuel`.""" set_fuel!(value::SupplyTechnology, val) = value.fuel = val """Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" set_cofire_level_max!(value::SupplyTechnology, val) = value.cofire_level_max = val -"""Set [`SupplyTechnology`](@ref) `start_fuel`.""" -set_start_fuel!(value::SupplyTechnology, val) = value.start_fuel = val -"""Set [`SupplyTechnology`](@ref) `heat_rate`.""" -set_heat_rate!(value::SupplyTechnology, val) = value.heat_rate = val -"""Set [`SupplyTechnology`](@ref) `minimum_generation`.""" -set_minimum_generation!(value::SupplyTechnology, val) = value.minimum_generation = val +"""Set [`SupplyTechnology`](@ref) `internal`.""" +set_internal!(value::SupplyTechnology, val) = value.internal = val """Set [`SupplyTechnology`](@ref) `ext`.""" set_ext!(value::SupplyTechnology, val) = value.ext = val """Set [`SupplyTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val -"""Set [`SupplyTechnology`](@ref) `internal`.""" -set_internal!(value::SupplyTechnology, val) = value.internal = val """Set [`SupplyTechnology`](@ref) `region`.""" set_region!(value::SupplyTechnology, val) = value.region = val -"""Set [`SupplyTechnology`](@ref) `operations_cost`.""" -set_operations_cost!(value::SupplyTechnology, val) = value.operations_cost = val -"""Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" -set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val +"""Set [`SupplyTechnology`](@ref) `min_power`.""" +set_min_power!(value::SupplyTechnology, val) = value.min_power = val """Set [`SupplyTechnology`](@ref) `cluster`.""" set_cluster!(value::SupplyTechnology, val) = value.cluster = val +"""Set [`SupplyTechnology`](@ref) `inv_cost_per_mwyr`.""" +set_inv_cost_per_mwyr!(value::SupplyTechnology, val) = value.inv_cost_per_mwyr = val +"""Set [`SupplyTechnology`](@ref) `min_cap_mw`.""" +set_min_cap_mw!(value::SupplyTechnology, val) = value.min_cap_mw = val +"""Set [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::SupplyTechnology, val) = value.ramp_up_percentage = val """Set [`SupplyTechnology`](@ref) `maintenance_duration`.""" set_maintenance_duration!(value::SupplyTechnology, val) = value.maintenance_duration = val -"""Set [`SupplyTechnology`](@ref) `start_cost`.""" -set_start_cost!(value::SupplyTechnology, val) = value.start_cost = val """Set [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val """Set [`SupplyTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val +"""Set [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" +set_start_cost_per_mw!(value::SupplyTechnology, val) = value.start_cost_per_mw = val """Set [`SupplyTechnology`](@ref) `cap_size`.""" set_cap_size!(value::SupplyTechnology, val) = value.cap_size = val """Set [`SupplyTechnology`](@ref) `reg_max`.""" set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val """Set [`SupplyTechnology`](@ref) `up_time`.""" set_up_time!(value::SupplyTechnology, val) = value.up_time = val -"""Set [`SupplyTechnology`](@ref) `ramp_up`.""" -set_ramp_up!(value::SupplyTechnology, val) = value.ramp_up = val +"""Set [`SupplyTechnology`](@ref) `om_costs`.""" +set_om_costs!(value::SupplyTechnology, val) = value.om_costs = val """Set [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" set_maintenance_begin_cadence!(value::SupplyTechnology, val) = value.maintenance_begin_cadence = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 15069b4..bf3efef 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,13 +1,14 @@ include("Electrolyzers.jl") -include("TransportTechnology.jl") include("SupplyTechnology.jl") include("RetireableTechnology.jl") -include("CoLocatedSupplyStorageTechnology.jl") include("DemandRequirement.jl") -include("StorageTechnology.jl") -include("FlexibleDemandTechnology.jl") include("RetrofitTechnology.jl") +include("CoLocatedSupplyStorageTechnology.jl") include("DemandSideTechnology.jl") +include("StorageTechnology.jl") +include("TransportTechnology.jl") +include("CurtailableDemandSideTechnology.jl") +include("FlexibleDemandTechnology.jl") export get_angle_limit export get_available @@ -17,7 +18,6 @@ export get_can_retire export get_can_retrofit export get_cap_size export get_capital_cost -export get_capital_cost_charge export get_capital_cost_energy export get_capital_cost_gen export get_capital_cost_inv @@ -28,41 +28,49 @@ export get_cofire_level_max export get_cofire_level_min export get_cofire_start_max export get_cofire_start_min -export get_cost_of_curtailment_mw -export get_cost_of_curtailment_mwh +export get_curtailment_cost +export get_curtailment_cost_mwh export get_demand_energy_efficiency export get_demand_mw_z export get_down_time -export get_efficiency_down +export get_eff_down +export get_eff_up export get_efficiency_down_ac export get_efficiency_down_dc -export get_efficiency_up export get_efficiency_up_ac export get_efficiency_up_dc export get_electrolyzer_min_kt export get_end_region +export get_existing_cap_mw +export get_existing_cap_mwh export get_existing_line_capacity export get_ext +export get_fixed_om_cost_per_mwhyr export get_fuel export get_gen_ID -export get_heat_rate +export get_heat_rate_mmbtu_per_mwh export get_hydrogen_mwh_per_tonne export get_hydrogen_price_per_tonne -export get_initial_capacity -export get_initial_capacity_charge +export get_id export get_initial_capacity_energy export get_initial_capacity_inverter export get_initial_capacity_power export get_initial_gen_capacity +export get_inv_cost_charge_per_mwyr +export get_inv_cost_per_mwhyr +export get_inv_cost_per_mwyr export get_inverter_ratio export get_line_loss export get_maintenance_begin_cadence export get_maintenance_cycle_length_years export get_maintenance_duration -export get_max_curtailment +export get_max_cap_mw +export get_max_cap_mwh +export get_max_charge_cap_mw export get_max_demand_advance +export get_max_demand_curtailment export get_max_demand_delay -export get_maximum_capacity +export get_max_duration export get_maximum_capacity_energy export get_maximum_capacity_power export get_maximum_duration @@ -70,18 +78,20 @@ export get_maximum_flow export get_maximum_gen_capacity export get_maximum_inverter_capacity export get_maximum_new_capacity +export get_min_cap_mw +export get_min_cap_mwh +export get_min_charge_cap_mw +export get_min_duration export get_min_power export get_minimum_duration -export get_minimum_generation export get_minimum_inverter_capacity -export get_minimum_required_capacity -export get_minimum_required_capacity_charge export get_minimum_required_capacity_energy export get_minimum_required_capacity_gen export get_minimum_required_capacity_power export get_name export get_network_lines -export get_operations_cost +export get_om_costs +export get_om_costs_charge export get_operations_cost_energy export get_operations_cost_gen export get_operations_cost_inv @@ -89,8 +99,8 @@ export get_operations_cost_power export get_outage_factor export get_power_systems_type export get_prime_mover_type -export get_ramp_down -export get_ramp_up +export get_ramp_dn_percentage +export get_ramp_up_percentage export get_reg_cost export get_reg_max export get_region @@ -99,16 +109,19 @@ export get_retrofit_efficiency export get_retrofit_id export get_rsv_cost export get_rsv_max +export get_segments +export get_self_disch export get_self_discharge -export get_start_cost -export get_start_fuel +export get_start_cost_per_mw +export get_start_fuel_mmbtu_per_mw export get_start_region export get_storage_tech export get_up_time -export get_value_lost_load export get_var_cost_per_mwh +export get_voll export get_voltage export get_wacc +export get_zone export set_angle_limit! export set_available! export set_balancing_topology! @@ -117,7 +130,6 @@ export set_can_retire! export set_can_retrofit! export set_cap_size! export set_capital_cost! -export set_capital_cost_charge! export set_capital_cost_energy! export set_capital_cost_gen! export set_capital_cost_inv! @@ -128,41 +140,49 @@ export set_cofire_level_max! export set_cofire_level_min! export set_cofire_start_max! export set_cofire_start_min! -export set_cost_of_curtailment_mw! -export set_cost_of_curtailment_mwh! +export set_curtailment_cost! +export set_curtailment_cost_mwh! export set_demand_energy_efficiency! export set_demand_mw_z! export set_down_time! -export set_efficiency_down! +export set_eff_down! +export set_eff_up! export set_efficiency_down_ac! export set_efficiency_down_dc! -export set_efficiency_up! export set_efficiency_up_ac! export set_efficiency_up_dc! export set_electrolyzer_min_kt! export set_end_region! +export set_existing_cap_mw! +export set_existing_cap_mwh! export set_existing_line_capacity! export set_ext! +export set_fixed_om_cost_per_mwhyr! export set_fuel! export set_gen_ID! -export set_heat_rate! +export set_heat_rate_mmbtu_per_mwh! export set_hydrogen_mwh_per_tonne! export set_hydrogen_price_per_tonne! -export set_initial_capacity! -export set_initial_capacity_charge! +export set_id! export set_initial_capacity_energy! export set_initial_capacity_inverter! export set_initial_capacity_power! export set_initial_gen_capacity! +export set_inv_cost_charge_per_mwyr! +export set_inv_cost_per_mwhyr! +export set_inv_cost_per_mwyr! export set_inverter_ratio! export set_line_loss! export set_maintenance_begin_cadence! export set_maintenance_cycle_length_years! export set_maintenance_duration! -export set_max_curtailment! +export set_max_cap_mw! +export set_max_cap_mwh! +export set_max_charge_cap_mw! export set_max_demand_advance! +export set_max_demand_curtailment! export set_max_demand_delay! -export set_maximum_capacity! +export set_max_duration! export set_maximum_capacity_energy! export set_maximum_capacity_power! export set_maximum_duration! @@ -170,18 +190,20 @@ export set_maximum_flow! export set_maximum_gen_capacity! export set_maximum_inverter_capacity! export set_maximum_new_capacity! +export set_min_cap_mw! +export set_min_cap_mwh! +export set_min_charge_cap_mw! +export set_min_duration! export set_min_power! export set_minimum_duration! -export set_minimum_generation! export set_minimum_inverter_capacity! -export set_minimum_required_capacity! -export set_minimum_required_capacity_charge! export set_minimum_required_capacity_energy! export set_minimum_required_capacity_gen! export set_minimum_required_capacity_power! export set_name! export set_network_lines! -export set_operations_cost! +export set_om_costs! +export set_om_costs_charge! export set_operations_cost_energy! export set_operations_cost_gen! export set_operations_cost_inv! @@ -189,8 +211,8 @@ export set_operations_cost_power! export set_outage_factor! export set_power_systems_type! export set_prime_mover_type! -export set_ramp_down! -export set_ramp_up! +export set_ramp_dn_percentage! +export set_ramp_up_percentage! export set_reg_cost! export set_reg_max! export set_region! @@ -199,13 +221,16 @@ export set_retrofit_efficiency! export set_retrofit_id! export set_rsv_cost! export set_rsv_max! +export set_segments! +export set_self_disch! export set_self_discharge! -export set_start_cost! -export set_start_fuel! +export set_start_cost_per_mw! +export set_start_fuel_mmbtu_per_mw! export set_start_region! export set_storage_tech! export set_up_time! -export set_value_lost_load! export set_var_cost_per_mwh! +export set_voll! export set_voltage! export set_wacc! +export set_zone! From 8f9b0bc90dce83b684a9846ce01b3616467c8ba5 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 1 Aug 2024 08:16:37 -0600 Subject: [PATCH 13/69] add co2 to SupplyTechnology --- src/models/generated/SupplyTechnology.jl | 28 +++++++++++++++--------- src/models/generated/includes.jl | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 7659c6a..d964374 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -14,10 +14,11 @@ This file is auto-generated. Do not edit. cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} rsv_cost::Float64 cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} - ramp_dn_percentage::Float64 available::Bool cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + co2::Float64 name::String + ramp_dn_percentage::Float64 max_cap_mw::Float64 id::Int64 existing_cap_mw::Float64 @@ -57,10 +58,11 @@ This file is auto-generated. Do not edit. - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator -- `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `available::Bool`: (default: `True`) identifies whether the technology is available - `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator +- `co2::Float64`: (default: `0.0`) Carbon Intensity of fuel - `name::String`: The technology name +- `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `max_cap_mw::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology - `id::Int64`: ID for individual generator - `existing_cap_mw::Float64`: (default: `0.0`) Pre-existing capacity for a technology @@ -105,14 +107,16 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology rsv_cost::Float64 "Maximum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} - "Maximum decrease in output between operation periods. Fraction of total capacity" - ramp_dn_percentage::Float64 "identifies whether the technology is available" available::Bool "Minimum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + "Carbon Intensity of fuel" + co2::Float64 "The technology name" name::String + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_dn_percentage::Float64 "Maximum allowable installed capacity for a technology" max_cap_mw::Float64 "ID for individual generator" @@ -168,8 +172,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, ramp_dn_percentage=100.0, available=True, cofire_start_min=nothing, name, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, ramp_dn_percentage, available, cofire_start_min, name, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -188,14 +192,16 @@ get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min get_rsv_cost(value::SupplyTechnology) = value.rsv_cost """Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max -"""Get [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" -get_ramp_dn_percentage(value::SupplyTechnology) = value.ramp_dn_percentage """Get [`SupplyTechnology`](@ref) `available`.""" get_available(value::SupplyTechnology) = value.available """Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min +"""Get [`SupplyTechnology`](@ref) `co2`.""" +get_co2(value::SupplyTechnology) = value.co2 """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name +"""Get [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::SupplyTechnology) = value.ramp_dn_percentage """Get [`SupplyTechnology`](@ref) `max_cap_mw`.""" get_max_cap_mw(value::SupplyTechnology) = value.max_cap_mw """Get [`SupplyTechnology`](@ref) `id`.""" @@ -265,14 +271,16 @@ set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = v set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val """Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val -"""Set [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" -set_ramp_dn_percentage!(value::SupplyTechnology, val) = value.ramp_dn_percentage = val """Set [`SupplyTechnology`](@ref) `available`.""" set_available!(value::SupplyTechnology, val) = value.available = val """Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val +"""Set [`SupplyTechnology`](@ref) `co2`.""" +set_co2!(value::SupplyTechnology, val) = value.co2 = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val +"""Set [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::SupplyTechnology, val) = value.ramp_dn_percentage = val """Set [`SupplyTechnology`](@ref) `max_cap_mw`.""" set_max_cap_mw!(value::SupplyTechnology, val) = value.max_cap_mw = val """Set [`SupplyTechnology`](@ref) `id`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index bf3efef..875ac77 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -24,6 +24,7 @@ export get_capital_cost_inv export get_capital_cost_power export get_capital_recovery_factor export get_cluster +export get_co2 export get_cofire_level_max export get_cofire_level_min export get_cofire_start_max @@ -136,6 +137,7 @@ export set_capital_cost_inv! export set_capital_cost_power! export set_capital_recovery_factor! export set_cluster! +export set_co2! export set_cofire_level_max! export set_cofire_level_min! export set_cofire_start_max! From b7fc4d87d58ff4cf7d473b5ec35a59de9a63b3bb Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 1 Aug 2024 09:25:11 -0600 Subject: [PATCH 14/69] typo --- src/models/generated/SupplyTechnology.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index d964374..8d46a8d 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -16,7 +16,7 @@ This file is auto-generated. Do not edit. cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} available::Bool cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} - co2::Float64 + co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} name::String ramp_dn_percentage::Float64 max_cap_mw::Float64 @@ -60,7 +60,7 @@ This file is auto-generated. Do not edit. - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator - `available::Bool`: (default: `True`) identifies whether the technology is available - `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator -- `co2::Float64`: (default: `0.0`) Carbon Intensity of fuel +- `co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}}`: (default: `0.0`) Carbon Intensity of fuel - `name::String`: The technology name - `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `max_cap_mw::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology @@ -112,7 +112,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Minimum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Carbon Intensity of fuel" - co2::Float64 + co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} "The technology name" name::String "Maximum decrease in output between operation periods. Fraction of total capacity" From 82acc1f69b3e6c6d20d683aba014a37eb71b0c8c Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 1 Aug 2024 14:24:02 -0600 Subject: [PATCH 15/69] export retrofit and retire structs --- src/PowerSystemsInvestmentsPortfolios.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 7ef562d..d5c1a25 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -41,6 +41,8 @@ export DemandsideTechnology export FlexibleDemandTechnology export Electrolyzers export CurtailableDemandSideTechnology +export RetireableTechnology +export RetrofitTechnology export get_technologies export get_ext From ccc2ccd7fa17dfc55c2ef38d3fc7be430cd392f8 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 09:11:05 -0600 Subject: [PATCH 16/69] add name field to retrofits and retirements --- src/models/generated/RetireableTechnology.jl | 21 +++++++++--------- src/models/generated/RetrofitTechnology.jl | 23 +++++++++----------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/models/generated/RetireableTechnology.jl b/src/models/generated/RetireableTechnology.jl index 398491b..d9f94fb 100644 --- a/src/models/generated/RetireableTechnology.jl +++ b/src/models/generated/RetireableTechnology.jl @@ -6,6 +6,7 @@ This file is auto-generated. Do not edit. """ mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology + name::String can_retire::Dict{PrimeMovers,Dict{String, Int64}} internal::InfrastructureSystemsInternal ext::Dict @@ -14,11 +15,14 @@ This file is auto-generated. Do not edit. # Arguments +- `name::String`: The technology name - `can_retire::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data """ mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology + "The technology name" + name::String "Dictionary of PrimeMovers in each region that can retire" can_retire::Dict{PrimeMovers,Dict{String, Int64}} "Internal field" @@ -28,19 +32,12 @@ mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology end -function RetireableTechnology{T}(; can_retire=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator - RetireableTechnology{T}(can_retire, internal, ext, ) -end - -# Constructor for demo purposes; non-functional. -function RetireableTechnology{T}(::Nothing) where T <: PSY.Generator - RetireableTechnology{T}(; - can_retire=Dict(), - internal=Dict(), - ext=Dict(), - ) +function RetireableTechnology{T}(; name, can_retire=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator + RetireableTechnology{T}(name, can_retire, internal, ext, ) end +"""Get [`RetireableTechnology`](@ref) `name`.""" +get_name(value::RetireableTechnology) = value.name """Get [`RetireableTechnology`](@ref) `can_retire`.""" get_can_retire(value::RetireableTechnology) = value.can_retire """Get [`RetireableTechnology`](@ref) `internal`.""" @@ -48,6 +45,8 @@ get_internal(value::RetireableTechnology) = value.internal """Get [`RetireableTechnology`](@ref) `ext`.""" get_ext(value::RetireableTechnology) = value.ext +"""Set [`RetireableTechnology`](@ref) `name`.""" +set_name!(value::RetireableTechnology, val) = value.name = val """Set [`RetireableTechnology`](@ref) `can_retire`.""" set_can_retire!(value::RetireableTechnology, val) = value.can_retire = val """Set [`RetireableTechnology`](@ref) `internal`.""" diff --git a/src/models/generated/RetrofitTechnology.jl b/src/models/generated/RetrofitTechnology.jl index 1afb463..db9f7aa 100644 --- a/src/models/generated/RetrofitTechnology.jl +++ b/src/models/generated/RetrofitTechnology.jl @@ -6,6 +6,7 @@ This file is auto-generated. Do not edit. """ mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology + name::String retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} internal::InfrastructureSystemsInternal @@ -16,6 +17,7 @@ This file is auto-generated. Do not edit. # Arguments +- `name::String`: The technology name - `retrofit_id::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone. - `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field @@ -23,6 +25,8 @@ This file is auto-generated. Do not edit. - `can_retrofit::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire """ mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology + "The technology name" + name::String "Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone." retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} "Dictionary of Efficiency of the retrofit technology." @@ -36,21 +40,12 @@ mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology end -function RetrofitTechnology{T}(; retrofit_id=Dict(), retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator - RetrofitTechnology{T}(retrofit_id, retrofit_efficiency, internal, ext, can_retrofit, ) -end - -# Constructor for demo purposes; non-functional. -function RetrofitTechnology{T}(::Nothing) where T <: PSY.Generator - RetrofitTechnology{T}(; - retrofit_id=Dict(), - retrofit_efficiency=Dict(), - internal=Dict(), - ext=Dict(), - can_retrofit=Dict(), - ) +function RetrofitTechnology{T}(; name, retrofit_id=Dict(), retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator + RetrofitTechnology{T}(name, retrofit_id, retrofit_efficiency, internal, ext, can_retrofit, ) end +"""Get [`RetrofitTechnology`](@ref) `name`.""" +get_name(value::RetrofitTechnology) = value.name """Get [`RetrofitTechnology`](@ref) `retrofit_id`.""" get_retrofit_id(value::RetrofitTechnology) = value.retrofit_id """Get [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" @@ -62,6 +57,8 @@ get_ext(value::RetrofitTechnology) = value.ext """Get [`RetrofitTechnology`](@ref) `can_retrofit`.""" get_can_retrofit(value::RetrofitTechnology) = value.can_retrofit +"""Set [`RetrofitTechnology`](@ref) `name`.""" +set_name!(value::RetrofitTechnology, val) = value.name = val """Set [`RetrofitTechnology`](@ref) `retrofit_id`.""" set_retrofit_id!(value::RetrofitTechnology, val) = value.retrofit_id = val """Set [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" From 8d0de2cd96c1231452fb788bc334ed8faf76ab17 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 09:11:13 -0600 Subject: [PATCH 17/69] export get_technology --- src/PowerSystemsInvestmentsPortfolios.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index d5c1a25..aeb0e73 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -45,6 +45,7 @@ export RetireableTechnology export RetrofitTechnology export get_technologies +export get_technology export get_ext export add_technology! export add_technologies! From 0a3028384fbb80dab3e20094c2db44f4d0d43dd9 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 11:16:07 -0600 Subject: [PATCH 18/69] add requirements --- src/models/requirements.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/models/requirements.jl diff --git a/src/models/requirements.jl b/src/models/requirements.jl new file mode 100644 index 0000000..7815dd8 --- /dev/null +++ b/src/models/requirements.jl @@ -0,0 +1,12 @@ +""" +Supertype for all system requirements + +Requirements include policies or other regional factors that may constrain +long-term grid planning. Common requirements are carbon caps and system +capacity requirements. +""" + +abstract type Requirements <: InfrastructureSystemsComponent end + +supports_time_series(::Requirements) = true +supports_supplemental_attributes(::Requirements) = true \ No newline at end of file From 9a795be0d95ade0ec6804a6261464ebc646b16a5 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 11:47:46 -0600 Subject: [PATCH 19/69] make parametric an optional field for schema --- src/generate_structs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 06228b7..ac66afb 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -27,8 +27,8 @@ function generate_invest_structs(directory, data::JSONSchema.Schema; print_resul item["struct_name"] = struct_name item["closing_constructor_text"] = "" - item["parametric"] = input["parametric"] - if haskey(item, "parametric") + if haskey(input, "parametric") + item["parametric"] = input["parametric"] item["constructor_func"] *= "{T}" item["closing_constructor_text"] = " where T <: $(item["parametric"])" end From 872270c9f90346997f3e3dc5c1f0277298061f0e Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 11:48:14 -0600 Subject: [PATCH 20/69] add policy requirements --- src/models/generated/CarbonCaps.jl | 87 +++++++++++++++++++ .../generated/MinimumCapacityRequirements.jl | 71 +++++++++++++++ src/models/generated/includes.jl | 14 +++ 3 files changed, 172 insertions(+) create mode 100644 src/models/generated/CarbonCaps.jl create mode 100644 src/models/generated/MinimumCapacityRequirements.jl diff --git a/src/models/generated/CarbonCaps.jl b/src/models/generated/CarbonCaps.jl new file mode 100644 index 0000000..8113f72 --- /dev/null +++ b/src/models/generated/CarbonCaps.jl @@ -0,0 +1,87 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct CarbonCaps <: PSY.Service + name::String + internal::InfrastructureSystemsInternal + eligible_zones::Vector{Int64} + co_2_max_tons_mwh::Float64 + ext::Dict + co_2_max_mtons::Float64 + slack::Float64 + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `eligible_zones::Vector{Int64}`: (default: `Vector{Int64}()`) List of zones that contribute to the carbon cap constraint. +- `co_2_max_tons_mwh::Float64`: (default: `1`) Emission limit in terms of rate (tCO@/MWh) +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `co_2_max_mtons::Float64`: (default: `Vector{Int64}()`) Emission limit in absolute values, in Million of tons +- `slack::Float64`: Slack value for carbon caps +- `available::Bool`: Availability +""" +mutable struct CarbonCaps <: PSY.Service + "The technology name" + name::String + "Internal field" + internal::InfrastructureSystemsInternal + "List of zones that contribute to the carbon cap constraint." + eligible_zones::Vector{Int64} + "Emission limit in terms of rate (tCO@/MWh)" + co_2_max_tons_mwh::Float64 + "Option for providing additional data" + ext::Dict + "Emission limit in absolute values, in Million of tons" + co_2_max_mtons::Float64 + "Slack value for carbon caps" + slack::Float64 + "Availability" + available::Bool +end + + +function CarbonCaps(; name, internal=InfrastructureSystemsInternal(), eligible_zones=Vector{Int64}(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), slack, available, ) + CarbonCaps(name, internal, eligible_zones, co_2_max_tons_mwh, ext, co_2_max_mtons, slack, available, ) +end + +"""Get [`CarbonCaps`](@ref) `name`.""" +get_name(value::CarbonCaps) = value.name +"""Get [`CarbonCaps`](@ref) `internal`.""" +get_internal(value::CarbonCaps) = value.internal +"""Get [`CarbonCaps`](@ref) `eligible_zones`.""" +get_eligible_zones(value::CarbonCaps) = value.eligible_zones +"""Get [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" +get_co_2_max_tons_mwh(value::CarbonCaps) = value.co_2_max_tons_mwh +"""Get [`CarbonCaps`](@ref) `ext`.""" +get_ext(value::CarbonCaps) = value.ext +"""Get [`CarbonCaps`](@ref) `co_2_max_mtons`.""" +get_co_2_max_mtons(value::CarbonCaps) = value.co_2_max_mtons +"""Get [`CarbonCaps`](@ref) `slack`.""" +get_slack(value::CarbonCaps) = value.slack +"""Get [`CarbonCaps`](@ref) `available`.""" +get_available(value::CarbonCaps) = value.available + +"""Set [`CarbonCaps`](@ref) `name`.""" +set_name!(value::CarbonCaps, val) = value.name = val +"""Set [`CarbonCaps`](@ref) `internal`.""" +set_internal!(value::CarbonCaps, val) = value.internal = val +"""Set [`CarbonCaps`](@ref) `eligible_zones`.""" +set_eligible_zones!(value::CarbonCaps, val) = value.eligible_zones = val +"""Set [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" +set_co_2_max_tons_mwh!(value::CarbonCaps, val) = value.co_2_max_tons_mwh = val +"""Set [`CarbonCaps`](@ref) `ext`.""" +set_ext!(value::CarbonCaps, val) = value.ext = val +"""Set [`CarbonCaps`](@ref) `co_2_max_mtons`.""" +set_co_2_max_mtons!(value::CarbonCaps, val) = value.co_2_max_mtons = val +"""Set [`CarbonCaps`](@ref) `slack`.""" +set_slack!(value::CarbonCaps, val) = value.slack = val +"""Set [`CarbonCaps`](@ref) `available`.""" +set_available!(value::CarbonCaps, val) = value.available = val diff --git a/src/models/generated/MinimumCapacityRequirements.jl b/src/models/generated/MinimumCapacityRequirements.jl new file mode 100644 index 0000000..ce9798f --- /dev/null +++ b/src/models/generated/MinimumCapacityRequirements.jl @@ -0,0 +1,71 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct MinimumCapacityRequirements <: PSY.Service + name::String + internal::InfrastructureSystemsInternal + ext::Dict + min_mw::Float64 + eligible_resources::Vector{String} + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `min_mw::Float64`: (default: `0`) Minimum total capacity across all eligible resources +- `eligible_resources::Vector{String}`: (default: `Vector{String}()`) List of resources that contribute to the carbon cap constraint. +- `available::Bool`: Availability +""" +mutable struct MinimumCapacityRequirements <: PSY.Service + "The technology name" + name::String + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Minimum total capacity across all eligible resources" + min_mw::Float64 + "List of resources that contribute to the carbon cap constraint." + eligible_resources::Vector{String} + "Availability" + available::Bool +end + + +function MinimumCapacityRequirements(; name, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0, eligible_resources=Vector{String}(), available, ) + MinimumCapacityRequirements(name, internal, ext, min_mw, eligible_resources, available, ) +end + +"""Get [`MinimumCapacityRequirements`](@ref) `name`.""" +get_name(value::MinimumCapacityRequirements) = value.name +"""Get [`MinimumCapacityRequirements`](@ref) `internal`.""" +get_internal(value::MinimumCapacityRequirements) = value.internal +"""Get [`MinimumCapacityRequirements`](@ref) `ext`.""" +get_ext(value::MinimumCapacityRequirements) = value.ext +"""Get [`MinimumCapacityRequirements`](@ref) `min_mw`.""" +get_min_mw(value::MinimumCapacityRequirements) = value.min_mw +"""Get [`MinimumCapacityRequirements`](@ref) `eligible_resources`.""" +get_eligible_resources(value::MinimumCapacityRequirements) = value.eligible_resources +"""Get [`MinimumCapacityRequirements`](@ref) `available`.""" +get_available(value::MinimumCapacityRequirements) = value.available + +"""Set [`MinimumCapacityRequirements`](@ref) `name`.""" +set_name!(value::MinimumCapacityRequirements, val) = value.name = val +"""Set [`MinimumCapacityRequirements`](@ref) `internal`.""" +set_internal!(value::MinimumCapacityRequirements, val) = value.internal = val +"""Set [`MinimumCapacityRequirements`](@ref) `ext`.""" +set_ext!(value::MinimumCapacityRequirements, val) = value.ext = val +"""Set [`MinimumCapacityRequirements`](@ref) `min_mw`.""" +set_min_mw!(value::MinimumCapacityRequirements, val) = value.min_mw = val +"""Set [`MinimumCapacityRequirements`](@ref) `eligible_resources`.""" +set_eligible_resources!(value::MinimumCapacityRequirements, val) = value.eligible_resources = val +"""Set [`MinimumCapacityRequirements`](@ref) `available`.""" +set_available!(value::MinimumCapacityRequirements, val) = value.available = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 875ac77..b792db1 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,4 +1,5 @@ include("Electrolyzers.jl") +include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") include("RetireableTechnology.jl") include("DemandRequirement.jl") @@ -6,6 +7,7 @@ include("RetrofitTechnology.jl") include("CoLocatedSupplyStorageTechnology.jl") include("DemandSideTechnology.jl") include("StorageTechnology.jl") +include("CarbonCaps.jl") include("TransportTechnology.jl") include("CurtailableDemandSideTechnology.jl") include("FlexibleDemandTechnology.jl") @@ -25,6 +27,8 @@ export get_capital_cost_power export get_capital_recovery_factor export get_cluster export get_co2 +export get_co_2_max_mtons +export get_co_2_max_tons_mwh export get_cofire_level_max export get_cofire_level_min export get_cofire_start_max @@ -41,6 +45,8 @@ export get_efficiency_down_dc export get_efficiency_up_ac export get_efficiency_up_dc export get_electrolyzer_min_kt +export get_eligible_resources +export get_eligible_zones export get_end_region export get_existing_cap_mw export get_existing_cap_mwh @@ -83,6 +89,7 @@ export get_min_cap_mw export get_min_cap_mwh export get_min_charge_cap_mw export get_min_duration +export get_min_mw export get_min_power export get_minimum_duration export get_minimum_inverter_capacity @@ -113,6 +120,7 @@ export get_rsv_max export get_segments export get_self_disch export get_self_discharge +export get_slack export get_start_cost_per_mw export get_start_fuel_mmbtu_per_mw export get_start_region @@ -138,6 +146,8 @@ export set_capital_cost_power! export set_capital_recovery_factor! export set_cluster! export set_co2! +export set_co_2_max_mtons! +export set_co_2_max_tons_mwh! export set_cofire_level_max! export set_cofire_level_min! export set_cofire_start_max! @@ -154,6 +164,8 @@ export set_efficiency_down_dc! export set_efficiency_up_ac! export set_efficiency_up_dc! export set_electrolyzer_min_kt! +export set_eligible_resources! +export set_eligible_zones! export set_end_region! export set_existing_cap_mw! export set_existing_cap_mwh! @@ -196,6 +208,7 @@ export set_min_cap_mw! export set_min_cap_mwh! export set_min_charge_cap_mw! export set_min_duration! +export set_min_mw! export set_min_power! export set_minimum_duration! export set_minimum_inverter_capacity! @@ -226,6 +239,7 @@ export set_rsv_max! export set_segments! export set_self_disch! export set_self_discharge! +export set_slack! export set_start_cost_per_mw! export set_start_fuel_mmbtu_per_mw! export set_start_region! From 645453ca0d44c82aaa0dc693c0af4c1755fab3d7 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 17:34:13 -0600 Subject: [PATCH 21/69] change requirements to subset of Service --- src/models/generated/CarbonCaps.jl | 4 ++-- src/models/generated/MinimumCapacityRequirements.jl | 4 ++-- src/models/requirements.jl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/generated/CarbonCaps.jl b/src/models/generated/CarbonCaps.jl index 8113f72..e54a6ca 100644 --- a/src/models/generated/CarbonCaps.jl +++ b/src/models/generated/CarbonCaps.jl @@ -5,7 +5,7 @@ This file is auto-generated. Do not edit. #! format: off """ - mutable struct CarbonCaps <: PSY.Service + mutable struct CarbonCaps <: Requirements name::String internal::InfrastructureSystemsInternal eligible_zones::Vector{Int64} @@ -28,7 +28,7 @@ This file is auto-generated. Do not edit. - `slack::Float64`: Slack value for carbon caps - `available::Bool`: Availability """ -mutable struct CarbonCaps <: PSY.Service +mutable struct CarbonCaps <: Requirements "The technology name" name::String "Internal field" diff --git a/src/models/generated/MinimumCapacityRequirements.jl b/src/models/generated/MinimumCapacityRequirements.jl index ce9798f..fb96227 100644 --- a/src/models/generated/MinimumCapacityRequirements.jl +++ b/src/models/generated/MinimumCapacityRequirements.jl @@ -5,7 +5,7 @@ This file is auto-generated. Do not edit. #! format: off """ - mutable struct MinimumCapacityRequirements <: PSY.Service + mutable struct MinimumCapacityRequirements <: Requirements name::String internal::InfrastructureSystemsInternal ext::Dict @@ -24,7 +24,7 @@ This file is auto-generated. Do not edit. - `eligible_resources::Vector{String}`: (default: `Vector{String}()`) List of resources that contribute to the carbon cap constraint. - `available::Bool`: Availability """ -mutable struct MinimumCapacityRequirements <: PSY.Service +mutable struct MinimumCapacityRequirements <: Requirements "The technology name" name::String "Internal field" diff --git a/src/models/requirements.jl b/src/models/requirements.jl index 7815dd8..4402193 100644 --- a/src/models/requirements.jl +++ b/src/models/requirements.jl @@ -2,11 +2,11 @@ Supertype for all system requirements Requirements include policies or other regional factors that may constrain -long-term grid planning. Common requirements are carbon caps and system +expansion decisions. Common requirements are carbon caps and system capacity requirements. """ -abstract type Requirements <: InfrastructureSystemsComponent end +abstract type Requirements <: PSY.Service end supports_time_series(::Requirements) = true supports_supplemental_attributes(::Requirements) = true \ No newline at end of file From 91f3fccfd57bd56c090e3b4be7a965bf43941ab3 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Mon, 5 Aug 2024 17:34:45 -0600 Subject: [PATCH 22/69] add utility functions for requirements --- src/portfolio.jl | 14 +++++++++++++ src/utils/print.jl | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/portfolio.jl b/src/portfolio.jl index d040976..ed73fe9 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -577,3 +577,17 @@ function Portfolio(file_path::AbstractString; assign_new_uuids=false, kwargs...) throw(DataFormatError("$file_path is not a supported file type")) end end + +################################ +######### Requirements ######### +################################ + +""" +Add policy requirement to portfolio +""" +function add_requirement!(portfolio::Portfolio, req::Requirements) + #return PSY.add_service!(portfolio.data, req) + #skip_validation = false + #skip_validation = _validate_or_skip!(sys, service, skip_validation) + return IS.add_component!(portfolio.data, req, skip_validation = false) +end \ No newline at end of file diff --git a/src/utils/print.jl b/src/utils/print.jl index 523e795..2a41b61 100644 --- a/src/utils/print.jl +++ b/src/utils/print.jl @@ -40,6 +40,57 @@ function Base.show(io::IO, ::MIME"text/html", p::Portfolio) return end +function Base.show(io::IO, ::MIME"text/plain", ist::PSY.Component) + default_units = false + if !PSY.has_units_setting(ist) + print(io, "\n") + @warn( + "SystemUnitSetting not defined, using NATURAL_UNITS for displaying device specification." + ) + PSY.set_units_setting!( + ist, + PSY.SystemUnitsSettings(100.0, PSY.UNIT_SYSTEM_MAPPING["NATURAL_UNITS"]), + ) + default_units = true + end + try + print(io, summary(ist), ":") + for name in fieldnames(typeof(ist)) + obj = getproperty(ist, name) + getter_name = Symbol("get_$name") + if (obj isa InfrastructureSystemsInternal) && !default_units + print(io, "\n ") + show(io, MIME"text/plain"(), obj.units_info) + continue + elseif obj isa IS.InfrastructureSystemsType || + obj isa Vector{<:IS.InfrastructureSystemsComponent} + val = summary(getproperty(ist, name)) + elseif PSY.hasproperty(PowerSystemsInvestmentsPortfolios, getter_name) + getter_func = PSY.getproperty(PowerSystemsInvestmentsPortfolios, getter_name) + #print(getter_func) + val = getter_func(ist) + else + val = getproperty(ist, name) + end + print(io, "\n ", name, ": ", val) + end + print( + io, + "\n ", + "has_supplemental_attributes", + ": ", + string(PSY.has_supplemental_attributes(ist)), + ) + print(io, "\n ", "has_time_series", ": ", string(PSY.has_time_series(ist))) + finally + if default_units + PSY.set_units_setting!(ist, nothing) + end + end + return +end + + function show_portfolio_table(io::IO, p::Portfolio; kwargs...) header = ["Property", "Value"] table = [ From c823c763ac4a16c81eaf07b7ddb7bed2167dd7af Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 6 Aug 2024 09:25:41 -0600 Subject: [PATCH 23/69] change Requirements to IS System Component --- src/models/requirements.jl | 2 +- src/portfolio.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/requirements.jl b/src/models/requirements.jl index 4402193..0f4a318 100644 --- a/src/models/requirements.jl +++ b/src/models/requirements.jl @@ -6,7 +6,7 @@ expansion decisions. Common requirements are carbon caps and system capacity requirements. """ -abstract type Requirements <: PSY.Service end +abstract type Requirements <: IS.InfrastructureSystemsComponent end supports_time_series(::Requirements) = true supports_supplemental_attributes(::Requirements) = true \ No newline at end of file diff --git a/src/portfolio.jl b/src/portfolio.jl index ed73fe9..969d4c2 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -590,4 +590,8 @@ function add_requirement!(portfolio::Portfolio, req::Requirements) #skip_validation = false #skip_validation = _validate_or_skip!(sys, service, skip_validation) return IS.add_component!(portfolio.data, req, skip_validation = false) +end + +function get_requirements(::Type{T}, portfolio::Portfolio;) where {T <: Requirements} + return IS.get_components(T, portfolio.data) end \ No newline at end of file From 6999958a92d481cd0e6a2c7f25a7eded7684ac38 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 6 Aug 2024 09:25:58 -0600 Subject: [PATCH 24/69] add pricecap field --- .../generated/MinimumCapacityRequirements.jl | 14 +++++++++++--- src/models/generated/includes.jl | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/models/generated/MinimumCapacityRequirements.jl b/src/models/generated/MinimumCapacityRequirements.jl index fb96227..a9b2b2d 100644 --- a/src/models/generated/MinimumCapacityRequirements.jl +++ b/src/models/generated/MinimumCapacityRequirements.jl @@ -7,6 +7,7 @@ This file is auto-generated. Do not edit. """ mutable struct MinimumCapacityRequirements <: Requirements name::String + pricecap::Float64 internal::InfrastructureSystemsInternal ext::Dict min_mw::Float64 @@ -18,15 +19,18 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `pricecap::Float64`: (default: `Inf`) price threshold for policy constraint, USD/MW - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `min_mw::Float64`: (default: `0`) Minimum total capacity across all eligible resources +- `min_mw::Float64`: (default: `0.0`) Minimum total capacity across all eligible resources - `eligible_resources::Vector{String}`: (default: `Vector{String}()`) List of resources that contribute to the carbon cap constraint. - `available::Bool`: Availability """ mutable struct MinimumCapacityRequirements <: Requirements "The technology name" name::String + "price threshold for policy constraint, USD/MW" + pricecap::Float64 "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" @@ -40,12 +44,14 @@ mutable struct MinimumCapacityRequirements <: Requirements end -function MinimumCapacityRequirements(; name, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0, eligible_resources=Vector{String}(), available, ) - MinimumCapacityRequirements(name, internal, ext, min_mw, eligible_resources, available, ) +function MinimumCapacityRequirements(; name, pricecap=Inf, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0.0, eligible_resources=Vector{String}(), available, ) + MinimumCapacityRequirements(name, pricecap, internal, ext, min_mw, eligible_resources, available, ) end """Get [`MinimumCapacityRequirements`](@ref) `name`.""" get_name(value::MinimumCapacityRequirements) = value.name +"""Get [`MinimumCapacityRequirements`](@ref) `pricecap`.""" +get_pricecap(value::MinimumCapacityRequirements) = value.pricecap """Get [`MinimumCapacityRequirements`](@ref) `internal`.""" get_internal(value::MinimumCapacityRequirements) = value.internal """Get [`MinimumCapacityRequirements`](@ref) `ext`.""" @@ -59,6 +65,8 @@ get_available(value::MinimumCapacityRequirements) = value.available """Set [`MinimumCapacityRequirements`](@ref) `name`.""" set_name!(value::MinimumCapacityRequirements, val) = value.name = val +"""Set [`MinimumCapacityRequirements`](@ref) `pricecap`.""" +set_pricecap!(value::MinimumCapacityRequirements, val) = value.pricecap = val """Set [`MinimumCapacityRequirements`](@ref) `internal`.""" set_internal!(value::MinimumCapacityRequirements, val) = value.internal = val """Set [`MinimumCapacityRequirements`](@ref) `ext`.""" diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index b792db1..33f5a5a 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -106,6 +106,7 @@ export get_operations_cost_inv export get_operations_cost_power export get_outage_factor export get_power_systems_type +export get_pricecap export get_prime_mover_type export get_ramp_dn_percentage export get_ramp_up_percentage @@ -225,6 +226,7 @@ export set_operations_cost_inv! export set_operations_cost_power! export set_outage_factor! export set_power_systems_type! +export set_pricecap! export set_prime_mover_type! export set_ramp_dn_percentage! export set_ramp_up_percentage! From c9e9979c436a365c68a0524f13cf69277faac268 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 6 Aug 2024 09:26:04 -0600 Subject: [PATCH 25/69] update exports --- src/PowerSystemsInvestmentsPortfolios.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index aeb0e73..54b9351 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -33,6 +33,7 @@ import DataFrames export Portfolio export Technology +export Requirements export SupplyTechnology export TransportTechnology export StorageTechnology @@ -43,9 +44,12 @@ export Electrolyzers export CurtailableDemandSideTechnology export RetireableTechnology export RetrofitTechnology +export CarbonCaps +export MinimumCapacityRequirements export get_technologies export get_technology +export get_requirements export get_ext export add_technology! export add_technologies! @@ -72,6 +76,7 @@ export PrimeMovers export StorageTech include("models/technologies.jl") +include("models/requirements.jl") include("models/generated/includes.jl") include("portfolio.jl") include("serialization.jl") From 3953c626040109a9f9a2eba15fd0a4255d74939d Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 6 Aug 2024 14:35:18 -0600 Subject: [PATCH 26/69] empty function for blobs --- src/generate_structs.jl | 44 +++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index ac66afb..a6d1afa 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -217,7 +217,7 @@ function db_to_dataframes(db_path::String) tables = SQLite.tables(db) # Create a dictionary to store DataFrames for each table - dfs = Dict{String, DataFrame}() + dfs = Dict() #Will adjust queries to only pull a subset of data for table in tables @@ -267,25 +267,44 @@ function dataframe_to_structs(df_dict::Dict) #Populate SupplyTechnology structs from database for row in eachrow(df_dict["supply_technologies"]) + #start with piecewiselinear + #extract blob (THIS THE PIECEWISE COST CURVE) + #take entity_attribute id to find entity_id + #then go to supplytechnology and do the rest t = SupplyTechnology{ThermalStandard}(; #Data pulled from DB name=string(row["technology_id"]), - gen_ID=string(row["technology_id"]), - capital_cost=LinearFunctionData(row["capital_cost"]), - variable_cost=LinearFunctionData(row["vom_cost"]), + id=row["technology_id"], + inv_cost_per_mwyr=LinearFunctionData(row["capital_cost"]), + om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row["vom_cost"])), fixed=row["fom_cost"], start_up=91.0, shut_down=0.0), balancing_topology=string(row["balancing_topology"]), - operations_cost=LinearFunctionData(row["fom_cost"]), prime_mover_type=map_prime_mover(row["prime_mover"]), - #Placeholder values + #Placeholder or default values + ramp_dn_percentage = 0.64, + ramp_up_percentage = 0.64, base_power=100.0, - minimum_required_capacity=0.0, + min_cap_mw=0.0, available=true, - initial_capacity=200.0, + existing_cap_mw = 0.0, fuel=ThermalFuels.COAL, power_systems_type="ThermalStandard", - maximum_capacity=10000.0, - capacity_factor=0.98, + max_cap_mw=10000.0, + co2 = 0.05306, + cap_size=250.0, + heat_rate_mmbtu_per_mwh = 7.43, + min_power = 0.468, + balancing_topology="Region", + region = "MA", + zone = 1, + max_cap_mw = -1, + cluster = 1, + start_fuel_mmbtu_per_mw = 2.0, + start_cost_per_mw = 91.0, + up_time = 6.0, + down_time = 6.0, + reg_max = 0.25, + rsv_max = 0.5, ) add_technology!(p, t) end @@ -308,3 +327,8 @@ function dataframe_to_structs(df_dict::Dict) return p end + +function extract_supply_curve() + + +end \ No newline at end of file From 9f4eb9aa216fa420147f8e046f8f35d0f871e03b Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 08:29:37 -0600 Subject: [PATCH 27/69] change slack to pricecap --- src/models/generated/CarbonCaps.jl | 20 ++++++++++---------- src/models/generated/includes.jl | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/models/generated/CarbonCaps.jl b/src/models/generated/CarbonCaps.jl index e54a6ca..3207e63 100644 --- a/src/models/generated/CarbonCaps.jl +++ b/src/models/generated/CarbonCaps.jl @@ -7,12 +7,12 @@ This file is auto-generated. Do not edit. """ mutable struct CarbonCaps <: Requirements name::String + pricecap::Float64 internal::InfrastructureSystemsInternal eligible_zones::Vector{Int64} co_2_max_tons_mwh::Float64 ext::Dict co_2_max_mtons::Float64 - slack::Float64 available::Bool end @@ -20,17 +20,19 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `pricecap::Float64`: (default: `Inf`) pricecap value for carbon caps - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `eligible_zones::Vector{Int64}`: (default: `Vector{Int64}()`) List of zones that contribute to the carbon cap constraint. - `co_2_max_tons_mwh::Float64`: (default: `1`) Emission limit in terms of rate (tCO@/MWh) - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `co_2_max_mtons::Float64`: (default: `Vector{Int64}()`) Emission limit in absolute values, in Million of tons -- `slack::Float64`: Slack value for carbon caps - `available::Bool`: Availability """ mutable struct CarbonCaps <: Requirements "The technology name" name::String + "pricecap value for carbon caps" + pricecap::Float64 "Internal field" internal::InfrastructureSystemsInternal "List of zones that contribute to the carbon cap constraint." @@ -41,19 +43,19 @@ mutable struct CarbonCaps <: Requirements ext::Dict "Emission limit in absolute values, in Million of tons" co_2_max_mtons::Float64 - "Slack value for carbon caps" - slack::Float64 "Availability" available::Bool end -function CarbonCaps(; name, internal=InfrastructureSystemsInternal(), eligible_zones=Vector{Int64}(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), slack, available, ) - CarbonCaps(name, internal, eligible_zones, co_2_max_tons_mwh, ext, co_2_max_mtons, slack, available, ) +function CarbonCaps(; name, pricecap=Inf, internal=InfrastructureSystemsInternal(), eligible_zones=Vector{Int64}(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), available, ) + CarbonCaps(name, pricecap, internal, eligible_zones, co_2_max_tons_mwh, ext, co_2_max_mtons, available, ) end """Get [`CarbonCaps`](@ref) `name`.""" get_name(value::CarbonCaps) = value.name +"""Get [`CarbonCaps`](@ref) `pricecap`.""" +get_pricecap(value::CarbonCaps) = value.pricecap """Get [`CarbonCaps`](@ref) `internal`.""" get_internal(value::CarbonCaps) = value.internal """Get [`CarbonCaps`](@ref) `eligible_zones`.""" @@ -64,13 +66,13 @@ get_co_2_max_tons_mwh(value::CarbonCaps) = value.co_2_max_tons_mwh get_ext(value::CarbonCaps) = value.ext """Get [`CarbonCaps`](@ref) `co_2_max_mtons`.""" get_co_2_max_mtons(value::CarbonCaps) = value.co_2_max_mtons -"""Get [`CarbonCaps`](@ref) `slack`.""" -get_slack(value::CarbonCaps) = value.slack """Get [`CarbonCaps`](@ref) `available`.""" get_available(value::CarbonCaps) = value.available """Set [`CarbonCaps`](@ref) `name`.""" set_name!(value::CarbonCaps, val) = value.name = val +"""Set [`CarbonCaps`](@ref) `pricecap`.""" +set_pricecap!(value::CarbonCaps, val) = value.pricecap = val """Set [`CarbonCaps`](@ref) `internal`.""" set_internal!(value::CarbonCaps, val) = value.internal = val """Set [`CarbonCaps`](@ref) `eligible_zones`.""" @@ -81,7 +83,5 @@ set_co_2_max_tons_mwh!(value::CarbonCaps, val) = value.co_2_max_tons_mwh = val set_ext!(value::CarbonCaps, val) = value.ext = val """Set [`CarbonCaps`](@ref) `co_2_max_mtons`.""" set_co_2_max_mtons!(value::CarbonCaps, val) = value.co_2_max_mtons = val -"""Set [`CarbonCaps`](@ref) `slack`.""" -set_slack!(value::CarbonCaps, val) = value.slack = val """Set [`CarbonCaps`](@ref) `available`.""" set_available!(value::CarbonCaps, val) = value.available = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 33f5a5a..40aec56 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -121,7 +121,6 @@ export get_rsv_max export get_segments export get_self_disch export get_self_discharge -export get_slack export get_start_cost_per_mw export get_start_fuel_mmbtu_per_mw export get_start_region @@ -241,7 +240,6 @@ export set_rsv_max! export set_segments! export set_self_disch! export set_self_discharge! -export set_slack! export set_start_cost_per_mw! export set_start_fuel_mmbtu_per_mw! export set_start_region! From 023e14e308353b208011af2d7f16be0a8f74bbd3 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 08:30:06 -0600 Subject: [PATCH 28/69] add dependencies for database pipeline --- Project.toml | 2 ++ src/PowerSystemsInvestmentsPortfolios.jl | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Project.toml b/Project.toml index c423882..d931fd1 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ authors = ["Jose Daniel Lara"] version = "0.1.0" [deps] +DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" @@ -11,6 +12,7 @@ JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" [compat] diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 54b9351..81e0c38 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -30,6 +30,9 @@ import JSON3 import PrettyTables import SQLite import DataFrames +import DBInterface + +using DataFrames export Portfolio export Technology From c12675fea39291af96c212ea3a3f2bb6846739a5 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 08:30:45 -0600 Subject: [PATCH 29/69] initialize empty functions and added transmission to db pipeline --- src/generate_structs.jl | 86 ++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index a6d1afa..0bdd261 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -191,9 +191,9 @@ function db_to_portfolio_parser(database_filepath::AbstractString) #Goal will be be able to read in database and populate structs simultaneously dfs = db_to_dataframes(database_filepath) - p = dataframe_to_structs(dfs) + portfolio = dataframe_to_structs(dfs) - return p + return portfolio end """ @@ -217,7 +217,7 @@ function db_to_dataframes(db_path::String) tables = SQLite.tables(db) # Create a dictionary to store DataFrames for each table - dfs = Dict() + dfs = Dict{String, DataFrame}() #Will adjust queries to only pull a subset of data for table in tables @@ -268,9 +268,10 @@ function dataframe_to_structs(df_dict::Dict) #Populate SupplyTechnology structs from database for row in eachrow(df_dict["supply_technologies"]) #start with piecewiselinear - #extract blob (THIS THE PIECEWISE COST CURVE) + #extract blob (THIS IS THE PIECEWISE COST CURVE) #take entity_attribute id to find entity_id #then go to supplytechnology and do the rest + t = SupplyTechnology{ThermalStandard}(; #Data pulled from DB name=string(row["technology_id"]), @@ -279,30 +280,32 @@ function dataframe_to_structs(df_dict::Dict) om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row["vom_cost"])), fixed=row["fom_cost"], start_up=91.0, shut_down=0.0), balancing_topology=string(row["balancing_topology"]), prime_mover_type=map_prime_mover(row["prime_mover"]), - - #Placeholder or default values - ramp_dn_percentage = 0.64, - ramp_up_percentage = 0.64, + fuel=ThermalFuels.COAL, base_power=100.0, - min_cap_mw=0.0, - available=true, + + #Problem ones, need to write functions to extract existing_cap_mw = 0.0, - fuel=ThermalFuels.COAL, - power_systems_type="ThermalStandard", - max_cap_mw=10000.0, - co2 = 0.05306, cap_size=250.0, - heat_rate_mmbtu_per_mwh = 7.43, - min_power = 0.468, - balancing_topology="Region", region = "MA", zone = 1, - max_cap_mw = -1, - cluster = 1, + + # Data we should have but dont currently start_fuel_mmbtu_per_mw = 2.0, start_cost_per_mw = 91.0, up_time = 6.0, down_time = 6.0, + heat_rate_mmbtu_per_mwh = 7.43, + co2 = 0.05306, + ramp_dn_percentage = 0.64, + ramp_up_percentage = 0.64, + + #Placeholder or default values (modeling assumptions) + available=true, + min_cap_mw=0.0, + min_power = 0.468, + max_cap_mw = -1, + power_systems_type="ThermalStandard", + cluster = 1, reg_max = 0.25, rsv_max = 0.5, ) @@ -311,6 +314,9 @@ function dataframe_to_structs(df_dict::Dict) #Populate DemandRequirement structs from database for row in eachrow(df_dict["demand_requirements"]) + #start in time_series + #extract entity_attribute_id + #match to demand_requirements d = DemandRequirement{ElectricLoad}( #Data pulled from DB name=string(row["entity_attribute_id"]), @@ -325,10 +331,52 @@ function dataframe_to_structs(df_dict::Dict) add_technology!(p, d) end + topologies = df_dict["balancing_topologies"] + lines = df_dict["transmission_lines"] + for row in eachrow(df_dict["transmission_interchange"]) + + # get list of balancing topologies that correspond to the areas for line tx + topologies_from = filter("area" => isequal(row["area_from"]), topologies)[!, "name"] + topologies_to = filter("area" => isequal(row["area_to"]), topologies)[!, "name"] + + existing_capacity = 0.0 + for from in topologies_from + for to in topologies_to + + line_cap = lines[(lines[!,"balancing_topology_from"] .== from) .& (lines[!,"balancing_topology_to"] .== to), "continuous_rating"][1] + existing_capacity += line_cap + end + end + + tx = TransportTechnology{Branch}(; + name = string(rownumber(row)), + network_lines = rownumber(row), + available=true, + start_region = parse(Int64, row["area_from"]), + end_region = parse(Int64, row["area_to"]), + maximum_new_capacity = row["max_flow_from"], + maximum_flow = row["max_flow_from"], + existing_line_capacity = existing_capacity, + + #stuff we don't have, but probably should + capital_cost = LinearCurve(19261), + line_loss = 0.019653847, + ) + add_technology!(p, tx) + end + return p end +#function for reading timeseries + +#convert blob to supply curves function extract_supply_curve() +end + +# map tables to one another based on entity_attribute_id +function table_mapping() + end \ No newline at end of file From 245f60a48da7f231914f61f40a5058f75b4b28e3 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 08:58:33 -0600 Subject: [PATCH 30/69] fixed empty transmission line vector --- src/generate_structs.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 0bdd261..0f24f7b 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -331,6 +331,7 @@ function dataframe_to_structs(df_dict::Dict) add_technology!(p, d) end + #Transmission Lines topologies = df_dict["balancing_topologies"] lines = df_dict["transmission_lines"] for row in eachrow(df_dict["transmission_interchange"]) @@ -342,9 +343,10 @@ function dataframe_to_structs(df_dict::Dict) existing_capacity = 0.0 for from in topologies_from for to in topologies_to - line_cap = lines[(lines[!,"balancing_topology_from"] .== from) .& (lines[!,"balancing_topology_to"] .== to), "continuous_rating"][1] - existing_capacity += line_cap + if length(line_cap) == 1 + existing_capacity += line_cap[1] + end end end From 679c31ae69357618a5697abdec79fe316588791c Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 09:14:54 -0600 Subject: [PATCH 31/69] add power_systems_type back to structs --- src/models/generated/CarbonCaps.jl | 28 ++++++++++++------- .../CurtailableDemandSideTechnology.jl | 28 ++++++++++++------- src/models/generated/DemandRequirement.jl | 12 ++++++-- .../generated/MinimumCapacityRequirements.jl | 12 ++++++-- src/models/generated/RetireableTechnology.jl | 12 ++++++-- src/models/generated/RetrofitTechnology.jl | 12 ++++++-- src/models/generated/SupplyTechnology.jl | 12 ++++++-- src/models/generated/TransportTechnology.jl | 12 ++++++-- 8 files changed, 96 insertions(+), 32 deletions(-) diff --git a/src/models/generated/CarbonCaps.jl b/src/models/generated/CarbonCaps.jl index 3207e63..a4a1cb3 100644 --- a/src/models/generated/CarbonCaps.jl +++ b/src/models/generated/CarbonCaps.jl @@ -7,9 +7,10 @@ This file is auto-generated. Do not edit. """ mutable struct CarbonCaps <: Requirements name::String + power_systems_type::String pricecap::Float64 - internal::InfrastructureSystemsInternal eligible_zones::Vector{Int64} + internal::InfrastructureSystemsInternal co_2_max_tons_mwh::Float64 ext::Dict co_2_max_mtons::Float64 @@ -20,9 +21,10 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `pricecap::Float64`: (default: `Inf`) pricecap value for carbon caps -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `eligible_zones::Vector{Int64}`: (default: `Vector{Int64}()`) List of zones that contribute to the carbon cap constraint. +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `co_2_max_tons_mwh::Float64`: (default: `1`) Emission limit in terms of rate (tCO@/MWh) - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `co_2_max_mtons::Float64`: (default: `Vector{Int64}()`) Emission limit in absolute values, in Million of tons @@ -31,12 +33,14 @@ This file is auto-generated. Do not edit. mutable struct CarbonCaps <: Requirements "The technology name" name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "pricecap value for carbon caps" pricecap::Float64 - "Internal field" - internal::InfrastructureSystemsInternal "List of zones that contribute to the carbon cap constraint." eligible_zones::Vector{Int64} + "Internal field" + internal::InfrastructureSystemsInternal "Emission limit in terms of rate (tCO@/MWh)" co_2_max_tons_mwh::Float64 "Option for providing additional data" @@ -48,18 +52,20 @@ mutable struct CarbonCaps <: Requirements end -function CarbonCaps(; name, pricecap=Inf, internal=InfrastructureSystemsInternal(), eligible_zones=Vector{Int64}(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), available, ) - CarbonCaps(name, pricecap, internal, eligible_zones, co_2_max_tons_mwh, ext, co_2_max_mtons, available, ) +function CarbonCaps(; name, power_systems_type, pricecap=Inf, eligible_zones=Vector{Int64}(), internal=InfrastructureSystemsInternal(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), available, ) + CarbonCaps(name, power_systems_type, pricecap, eligible_zones, internal, co_2_max_tons_mwh, ext, co_2_max_mtons, available, ) end """Get [`CarbonCaps`](@ref) `name`.""" get_name(value::CarbonCaps) = value.name +"""Get [`CarbonCaps`](@ref) `power_systems_type`.""" +get_power_systems_type(value::CarbonCaps) = value.power_systems_type """Get [`CarbonCaps`](@ref) `pricecap`.""" get_pricecap(value::CarbonCaps) = value.pricecap -"""Get [`CarbonCaps`](@ref) `internal`.""" -get_internal(value::CarbonCaps) = value.internal """Get [`CarbonCaps`](@ref) `eligible_zones`.""" get_eligible_zones(value::CarbonCaps) = value.eligible_zones +"""Get [`CarbonCaps`](@ref) `internal`.""" +get_internal(value::CarbonCaps) = value.internal """Get [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" get_co_2_max_tons_mwh(value::CarbonCaps) = value.co_2_max_tons_mwh """Get [`CarbonCaps`](@ref) `ext`.""" @@ -71,12 +77,14 @@ get_available(value::CarbonCaps) = value.available """Set [`CarbonCaps`](@ref) `name`.""" set_name!(value::CarbonCaps, val) = value.name = val +"""Set [`CarbonCaps`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::CarbonCaps, val) = value.power_systems_type = val """Set [`CarbonCaps`](@ref) `pricecap`.""" set_pricecap!(value::CarbonCaps, val) = value.pricecap = val -"""Set [`CarbonCaps`](@ref) `internal`.""" -set_internal!(value::CarbonCaps, val) = value.internal = val """Set [`CarbonCaps`](@ref) `eligible_zones`.""" set_eligible_zones!(value::CarbonCaps, val) = value.eligible_zones = val +"""Set [`CarbonCaps`](@ref) `internal`.""" +set_internal!(value::CarbonCaps, val) = value.internal = val """Set [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" set_co_2_max_tons_mwh!(value::CarbonCaps, val) = value.co_2_max_tons_mwh = val """Set [`CarbonCaps`](@ref) `ext`.""" diff --git a/src/models/generated/CurtailableDemandSideTechnology.jl b/src/models/generated/CurtailableDemandSideTechnology.jl index 13900d2..475d0b6 100644 --- a/src/models/generated/CurtailableDemandSideTechnology.jl +++ b/src/models/generated/CurtailableDemandSideTechnology.jl @@ -7,12 +7,13 @@ This file is auto-generated. Do not edit. """ mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology name::String + power_systems_type::String curtailment_cost_mwh::Vector{Float64} - internal::InfrastructureSystemsInternal segments::Vector{Int64} curtailment_cost::Vector{Float64} voll::Float64 ext::Dict + internal::InfrastructureSystemsInternal max_demand_curtailment::Vector{Float64} available::Bool end @@ -21,22 +22,23 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `curtailment_cost_mwh::Vector{Float64}`: Energy cost of curtailment -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `segments::Vector{Int64}`: Demand segment IDs - `curtailment_cost::Vector{Float64}`: Fraction of VOLL for curtailment cost - `voll::Float64`: value of lost load - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `max_demand_curtailment::Vector{Float64}`: percent of demand that can be curtailed in that segment - `available::Bool`: identifies whether the technology is available """ mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology "The technology name" name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Energy cost of curtailment" curtailment_cost_mwh::Vector{Float64} - "Internal field" - internal::InfrastructureSystemsInternal "Demand segment IDs" segments::Vector{Int64} "Fraction of VOLL for curtailment cost" @@ -45,6 +47,8 @@ mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Tech voll::Float64 "Option for providing additional data" ext::Dict + "Internal field" + internal::InfrastructureSystemsInternal "percent of demand that can be curtailed in that segment" max_demand_curtailment::Vector{Float64} "identifies whether the technology is available" @@ -52,16 +56,16 @@ mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Tech end -function CurtailableDemandSideTechnology{T}(; name, curtailment_cost_mwh, internal=InfrastructureSystemsInternal(), segments, curtailment_cost, voll, ext=Dict(), max_demand_curtailment, available, ) where T <: PSY.StaticInjection - CurtailableDemandSideTechnology{T}(name, curtailment_cost_mwh, internal, segments, curtailment_cost, voll, ext, max_demand_curtailment, available, ) +function CurtailableDemandSideTechnology{T}(; name, power_systems_type, curtailment_cost_mwh, segments, curtailment_cost, voll, ext=Dict(), internal=InfrastructureSystemsInternal(), max_demand_curtailment, available, ) where T <: PSY.StaticInjection + CurtailableDemandSideTechnology{T}(name, power_systems_type, curtailment_cost_mwh, segments, curtailment_cost, voll, ext, internal, max_demand_curtailment, available, ) end """Get [`CurtailableDemandSideTechnology`](@ref) `name`.""" get_name(value::CurtailableDemandSideTechnology) = value.name +"""Get [`CurtailableDemandSideTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::CurtailableDemandSideTechnology) = value.power_systems_type """Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" get_curtailment_cost_mwh(value::CurtailableDemandSideTechnology) = value.curtailment_cost_mwh -"""Get [`CurtailableDemandSideTechnology`](@ref) `internal`.""" -get_internal(value::CurtailableDemandSideTechnology) = value.internal """Get [`CurtailableDemandSideTechnology`](@ref) `segments`.""" get_segments(value::CurtailableDemandSideTechnology) = value.segments """Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" @@ -70,6 +74,8 @@ get_curtailment_cost(value::CurtailableDemandSideTechnology) = value.curtailment get_voll(value::CurtailableDemandSideTechnology) = value.voll """Get [`CurtailableDemandSideTechnology`](@ref) `ext`.""" get_ext(value::CurtailableDemandSideTechnology) = value.ext +"""Get [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +get_internal(value::CurtailableDemandSideTechnology) = value.internal """Get [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" get_max_demand_curtailment(value::CurtailableDemandSideTechnology) = value.max_demand_curtailment """Get [`CurtailableDemandSideTechnology`](@ref) `available`.""" @@ -77,10 +83,10 @@ get_available(value::CurtailableDemandSideTechnology) = value.available """Set [`CurtailableDemandSideTechnology`](@ref) `name`.""" set_name!(value::CurtailableDemandSideTechnology, val) = value.name = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::CurtailableDemandSideTechnology, val) = value.power_systems_type = val """Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" set_curtailment_cost_mwh!(value::CurtailableDemandSideTechnology, val) = value.curtailment_cost_mwh = val -"""Set [`CurtailableDemandSideTechnology`](@ref) `internal`.""" -set_internal!(value::CurtailableDemandSideTechnology, val) = value.internal = val """Set [`CurtailableDemandSideTechnology`](@ref) `segments`.""" set_segments!(value::CurtailableDemandSideTechnology, val) = value.segments = val """Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" @@ -89,6 +95,8 @@ set_curtailment_cost!(value::CurtailableDemandSideTechnology, val) = value.curta set_voll!(value::CurtailableDemandSideTechnology, val) = value.voll = val """Set [`CurtailableDemandSideTechnology`](@ref) `ext`.""" set_ext!(value::CurtailableDemandSideTechnology, val) = value.ext = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +set_internal!(value::CurtailableDemandSideTechnology, val) = value.internal = val """Set [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" set_max_demand_curtailment!(value::CurtailableDemandSideTechnology, val) = value.max_demand_curtailment = val """Set [`CurtailableDemandSideTechnology`](@ref) `available`.""" diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index 3bf9a6e..96fc8de 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -8,6 +8,7 @@ This file is auto-generated. Do not edit. mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology name::String zone::Int64 + power_systems_type::String internal::InfrastructureSystemsInternal demand_mw_z::Float64 ext::Dict @@ -20,6 +21,7 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name - `zone::Int64`: Zone Number +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -31,6 +33,8 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology name::String "Zone Number" zone::Int64 + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Demand profile in MW" @@ -44,14 +48,16 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology end -function DemandRequirement{T}(; name, zone, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, ext=Dict(), region, available=true, ) where T <: PSY.StaticInjection - DemandRequirement{T}(name, zone, internal, demand_mw_z, ext, region, available, ) +function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, ext=Dict(), region, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, zone, power_systems_type, internal, demand_mw_z, ext, region, available, ) end """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name """Get [`DemandRequirement`](@ref) `zone`.""" get_zone(value::DemandRequirement) = value.zone +"""Get [`DemandRequirement`](@ref) `power_systems_type`.""" +get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal """Get [`DemandRequirement`](@ref) `demand_mw_z`.""" @@ -67,6 +73,8 @@ get_available(value::DemandRequirement) = value.available set_name!(value::DemandRequirement, val) = value.name = val """Set [`DemandRequirement`](@ref) `zone`.""" set_zone!(value::DemandRequirement, val) = value.zone = val +"""Set [`DemandRequirement`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val """Set [`DemandRequirement`](@ref) `demand_mw_z`.""" diff --git a/src/models/generated/MinimumCapacityRequirements.jl b/src/models/generated/MinimumCapacityRequirements.jl index a9b2b2d..05dd274 100644 --- a/src/models/generated/MinimumCapacityRequirements.jl +++ b/src/models/generated/MinimumCapacityRequirements.jl @@ -7,6 +7,7 @@ This file is auto-generated. Do not edit. """ mutable struct MinimumCapacityRequirements <: Requirements name::String + power_systems_type::String pricecap::Float64 internal::InfrastructureSystemsInternal ext::Dict @@ -19,6 +20,7 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `pricecap::Float64`: (default: `Inf`) price threshold for policy constraint, USD/MW - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -29,6 +31,8 @@ This file is auto-generated. Do not edit. mutable struct MinimumCapacityRequirements <: Requirements "The technology name" name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "price threshold for policy constraint, USD/MW" pricecap::Float64 "Internal field" @@ -44,12 +48,14 @@ mutable struct MinimumCapacityRequirements <: Requirements end -function MinimumCapacityRequirements(; name, pricecap=Inf, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0.0, eligible_resources=Vector{String}(), available, ) - MinimumCapacityRequirements(name, pricecap, internal, ext, min_mw, eligible_resources, available, ) +function MinimumCapacityRequirements(; name, power_systems_type, pricecap=Inf, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0.0, eligible_resources=Vector{String}(), available, ) + MinimumCapacityRequirements(name, power_systems_type, pricecap, internal, ext, min_mw, eligible_resources, available, ) end """Get [`MinimumCapacityRequirements`](@ref) `name`.""" get_name(value::MinimumCapacityRequirements) = value.name +"""Get [`MinimumCapacityRequirements`](@ref) `power_systems_type`.""" +get_power_systems_type(value::MinimumCapacityRequirements) = value.power_systems_type """Get [`MinimumCapacityRequirements`](@ref) `pricecap`.""" get_pricecap(value::MinimumCapacityRequirements) = value.pricecap """Get [`MinimumCapacityRequirements`](@ref) `internal`.""" @@ -65,6 +71,8 @@ get_available(value::MinimumCapacityRequirements) = value.available """Set [`MinimumCapacityRequirements`](@ref) `name`.""" set_name!(value::MinimumCapacityRequirements, val) = value.name = val +"""Set [`MinimumCapacityRequirements`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::MinimumCapacityRequirements, val) = value.power_systems_type = val """Set [`MinimumCapacityRequirements`](@ref) `pricecap`.""" set_pricecap!(value::MinimumCapacityRequirements, val) = value.pricecap = val """Set [`MinimumCapacityRequirements`](@ref) `internal`.""" diff --git a/src/models/generated/RetireableTechnology.jl b/src/models/generated/RetireableTechnology.jl index d9f94fb..0acfd3b 100644 --- a/src/models/generated/RetireableTechnology.jl +++ b/src/models/generated/RetireableTechnology.jl @@ -8,6 +8,7 @@ This file is auto-generated. Do not edit. mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology name::String can_retire::Dict{PrimeMovers,Dict{String, Int64}} + power_systems_type::String internal::InfrastructureSystemsInternal ext::Dict end @@ -17,6 +18,7 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name - `can_retire::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data """ @@ -25,6 +27,8 @@ mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology name::String "Dictionary of PrimeMovers in each region that can retire" can_retire::Dict{PrimeMovers,Dict{String, Int64}} + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" @@ -32,14 +36,16 @@ mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology end -function RetireableTechnology{T}(; name, can_retire=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator - RetireableTechnology{T}(name, can_retire, internal, ext, ) +function RetireableTechnology{T}(; name, can_retire=Dict(), power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator + RetireableTechnology{T}(name, can_retire, power_systems_type, internal, ext, ) end """Get [`RetireableTechnology`](@ref) `name`.""" get_name(value::RetireableTechnology) = value.name """Get [`RetireableTechnology`](@ref) `can_retire`.""" get_can_retire(value::RetireableTechnology) = value.can_retire +"""Get [`RetireableTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::RetireableTechnology) = value.power_systems_type """Get [`RetireableTechnology`](@ref) `internal`.""" get_internal(value::RetireableTechnology) = value.internal """Get [`RetireableTechnology`](@ref) `ext`.""" @@ -49,6 +55,8 @@ get_ext(value::RetireableTechnology) = value.ext set_name!(value::RetireableTechnology, val) = value.name = val """Set [`RetireableTechnology`](@ref) `can_retire`.""" set_can_retire!(value::RetireableTechnology, val) = value.can_retire = val +"""Set [`RetireableTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::RetireableTechnology, val) = value.power_systems_type = val """Set [`RetireableTechnology`](@ref) `internal`.""" set_internal!(value::RetireableTechnology, val) = value.internal = val """Set [`RetireableTechnology`](@ref) `ext`.""" diff --git a/src/models/generated/RetrofitTechnology.jl b/src/models/generated/RetrofitTechnology.jl index db9f7aa..7493f32 100644 --- a/src/models/generated/RetrofitTechnology.jl +++ b/src/models/generated/RetrofitTechnology.jl @@ -8,6 +8,7 @@ This file is auto-generated. Do not edit. mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology name::String retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} + power_systems_type::String retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} internal::InfrastructureSystemsInternal ext::Dict @@ -19,6 +20,7 @@ This file is auto-generated. Do not edit. # Arguments - `name::String`: The technology name - `retrofit_id::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone. +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -29,6 +31,8 @@ mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology name::String "Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone." retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Dictionary of Efficiency of the retrofit technology." retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} "Internal field" @@ -40,14 +44,16 @@ mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology end -function RetrofitTechnology{T}(; name, retrofit_id=Dict(), retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator - RetrofitTechnology{T}(name, retrofit_id, retrofit_efficiency, internal, ext, can_retrofit, ) +function RetrofitTechnology{T}(; name, retrofit_id=Dict(), power_systems_type, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator + RetrofitTechnology{T}(name, retrofit_id, power_systems_type, retrofit_efficiency, internal, ext, can_retrofit, ) end """Get [`RetrofitTechnology`](@ref) `name`.""" get_name(value::RetrofitTechnology) = value.name """Get [`RetrofitTechnology`](@ref) `retrofit_id`.""" get_retrofit_id(value::RetrofitTechnology) = value.retrofit_id +"""Get [`RetrofitTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::RetrofitTechnology) = value.power_systems_type """Get [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" get_retrofit_efficiency(value::RetrofitTechnology) = value.retrofit_efficiency """Get [`RetrofitTechnology`](@ref) `internal`.""" @@ -61,6 +67,8 @@ get_can_retrofit(value::RetrofitTechnology) = value.can_retrofit set_name!(value::RetrofitTechnology, val) = value.name = val """Set [`RetrofitTechnology`](@ref) `retrofit_id`.""" set_retrofit_id!(value::RetrofitTechnology, val) = value.retrofit_id = val +"""Set [`RetrofitTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::RetrofitTechnology, val) = value.power_systems_type = val """Set [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" set_retrofit_efficiency!(value::RetrofitTechnology, val) = value.retrofit_efficiency = val """Set [`RetrofitTechnology`](@ref) `internal`.""" diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 8d46a8d..12b584d 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -26,6 +26,7 @@ This file is auto-generated. Do not edit. start_fuel_mmbtu_per_mw::Float64 rsv_max::Float64 fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} + power_systems_type::String cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} internal::InfrastructureSystemsInternal ext::Dict @@ -70,6 +71,7 @@ This file is auto-generated. Do not edit. - `start_fuel_mmbtu_per_mw::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during normal generation process for multi-fuel generator - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data @@ -131,6 +133,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology rsv_max::Float64 "Fuel type according to IEA" fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Maximum blending level of each fuel during normal generation process for multi-fuel generator" cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} "Internal field" @@ -172,8 +176,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -216,6 +220,8 @@ get_start_fuel_mmbtu_per_mw(value::SupplyTechnology) = value.start_fuel_mmbtu_pe get_rsv_max(value::SupplyTechnology) = value.rsv_max """Get [`SupplyTechnology`](@ref) `fuel`.""" get_fuel(value::SupplyTechnology) = value.fuel +"""Get [`SupplyTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::SupplyTechnology) = value.power_systems_type """Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" get_cofire_level_max(value::SupplyTechnology) = value.cofire_level_max """Get [`SupplyTechnology`](@ref) `internal`.""" @@ -295,6 +301,8 @@ set_start_fuel_mmbtu_per_mw!(value::SupplyTechnology, val) = value.start_fuel_mm set_rsv_max!(value::SupplyTechnology, val) = value.rsv_max = val """Set [`SupplyTechnology`](@ref) `fuel`.""" set_fuel!(value::SupplyTechnology, val) = value.fuel = val +"""Set [`SupplyTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::SupplyTechnology, val) = value.power_systems_type = val """Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" set_cofire_level_max!(value::SupplyTechnology, val) = value.cofire_level_max = val """Set [`SupplyTechnology`](@ref) `internal`.""" diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 7b543a5..21e2f2d 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -12,6 +12,7 @@ This file is auto-generated. Do not edit. name::String capital_recovery_factor::Int64 end_region::Int64 + power_systems_type::String angle_limit::Float64 internal::InfrastructureSystemsInternal network_lines::Int64 @@ -34,6 +35,7 @@ This file is auto-generated. Do not edit. - `name::String`: Name - `capital_recovery_factor::Int64`: (default: `0`) Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion. - `end_region::Int64`: End region for transport technology +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `angle_limit::Float64`: (default: `0.0`) Votlage angle limit (radians) - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `network_lines::Int64`: Numerical Index @@ -59,6 +61,8 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology capital_recovery_factor::Int64 "End region for transport technology" end_region::Int64 + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String "Votlage angle limit (radians)" angle_limit::Float64 "Internal field" @@ -84,8 +88,8 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology end -function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, angle_limit=0.0, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, maximum_flow, ) where T <: PSY.Device - TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, angle_limit, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, wacc, line_loss, maximum_flow, ) +function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, power_systems_type, angle_limit=0.0, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, maximum_flow, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, power_systems_type, angle_limit, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, wacc, line_loss, maximum_flow, ) end """Get [`TransportTechnology`](@ref) `capital_cost`.""" @@ -100,6 +104,8 @@ get_name(value::TransportTechnology) = value.name get_capital_recovery_factor(value::TransportTechnology) = value.capital_recovery_factor """Get [`TransportTechnology`](@ref) `end_region`.""" get_end_region(value::TransportTechnology) = value.end_region +"""Get [`TransportTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::TransportTechnology) = value.power_systems_type """Get [`TransportTechnology`](@ref) `angle_limit`.""" get_angle_limit(value::TransportTechnology) = value.angle_limit """Get [`TransportTechnology`](@ref) `internal`.""" @@ -135,6 +141,8 @@ set_name!(value::TransportTechnology, val) = value.name = val set_capital_recovery_factor!(value::TransportTechnology, val) = value.capital_recovery_factor = val """Set [`TransportTechnology`](@ref) `end_region`.""" set_end_region!(value::TransportTechnology, val) = value.end_region = val +"""Set [`TransportTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_type = val """Set [`TransportTechnology`](@ref) `angle_limit`.""" set_angle_limit!(value::TransportTechnology, val) = value.angle_limit = val """Set [`TransportTechnology`](@ref) `internal`.""" From 366bfd3f8915750b9917192bdcbf21cb0973e3e8 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 12:37:33 -0600 Subject: [PATCH 32/69] fix imports --- src/PowerSystemsInvestmentsPortfolios.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 81e0c38..d90b7ad 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -18,12 +18,14 @@ import InfrastructureSystems: MultiLogger, LogEventTracker, StructField, + CostCurve, + LinearCurve, InfrastructureSystemsComponent import PowerSystems import PowerSystems: StorageCost, - LinearCurve + ThermalGenerationCost import JSONSchema import JSON3 @@ -32,7 +34,9 @@ import SQLite import DataFrames import DBInterface +# Temporary, imports not working properly for some reason? using DataFrames +using PowerSystems export Portfolio export Technology From 148160220067cf889580d928a8fa01591ce678e2 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 12:37:46 -0600 Subject: [PATCH 33/69] add pre existing generation units --- src/generate_structs.jl | 133 ++++++++++++++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 26 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 0f24f7b..0d82dde 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -251,44 +251,117 @@ function map_prime_mover(prime_mover::String) "CSP" => PrimeMovers.CP, "RTPV" => PrimeMovers.PVe, "WIND" => PrimeMovers.WT, + "Wind" => PrimeMovers.WT, "STORAGE" => PrimeMovers.BA, ) return mapping_dict[prime_mover] end +function map_prime_mover_to_parametric(prime_mover::String) + mapping_dict = Dict( + "CT" => PSY.ThermalStandard, + "STEAM" => PSY.ThermalStandard, + "CC" => PSY.ThermalStandard, + "SYNC_COND" => PSY.ThermalStandard, + "NUCLEAR" => PSY.ThermalStandard, + "HYDRO" => PSY.ThermalStandard, + "ROR" => PSY.RenewableDispatch, + "PV" => PSY.RenewableDispatch, + "CSP" => PSY.RenewableDispatch, + "RTPV" => PSY.RenewableDispatch, + "WIND" => PSY.RenewableDispatch, + "Wind" => PSY.RenewableDispatch, + ) + + return mapping_dict[prime_mover] +end + function dataframe_to_structs(df_dict::Dict) #Initialize Portfolio p = Portfolio(0.07) - #Temporary measure for small database, will go into - #more complex query based methods once database is expanded - - #Populate SupplyTechnology structs from database + #Populate SupplyTechnology structs from database (new builds) + topologies = df_dict["balancing_topologies"] for row in eachrow(df_dict["supply_technologies"]) - #start with piecewiselinear - #extract blob (THIS IS THE PIECEWISE COST CURVE) - #take entity_attribute id to find entity_id - #then go to supplytechnology and do the rest - t = SupplyTechnology{ThermalStandard}(; + #extract area + area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area_int = parse(Int64, area) + + #extract supply curve, does every supply_technology have a supply curve? + #id = row["technology_id"] + #eaid = df_dict["attributes"][df_dict["attributes"] .== id, "entity_attribute_id"][1] + #supply_curve = df_dict["time_series"][df_dict["entity_attribute_id"] .== eaid, "piecewise_linear_blob"][1] + #Now just need to parse the blob + + parametric = map_prime_mover_to_parametric(row["prime_mover"]) + t = SupplyTechnology{parametric}(; #Data pulled from DB name=string(row["technology_id"]), id=row["technology_id"], - inv_cost_per_mwyr=LinearFunctionData(row["capital_cost"]), - om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row["vom_cost"])), fixed=row["fom_cost"], start_up=91.0, shut_down=0.0), + inv_cost_per_mwyr=LinearCurve(20000), + om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row["vom_cost"])), fixed=row["fom_cost"], start_up=0.0, shut_down=0.0), balancing_topology=string(row["balancing_topology"]), prime_mover_type=map_prime_mover(row["prime_mover"]), - fuel=ThermalFuels.COAL, - base_power=100.0, + fuel=row["fuel_type"], + zone = area_int, #Problem ones, need to write functions to extract + base_power=100.0, existing_cap_mw = 0.0, cap_size=250.0, - region = "MA", - zone = 1, + + # Data we should have but dont currently + start_fuel_mmbtu_per_mw = 2.0, + start_cost_per_mw = 91.0, + up_time = 6.0, + down_time = 6.0, + heat_rate_mmbtu_per_mwh = 7.43, + co2 = 0.05306, + ramp_dn_percentage = 0.64, + ramp_up_percentage = 0.64, + + #Placeholder or default values (modeling assumptions) + region = "MA", #this one can probably just be removed from the structs, just descriptor for GenX + available=true, + min_cap_mw=0.0, + min_power = 0.0, + max_cap_mw = -1, + power_systems_type=string(parametric), + cluster = 1, + reg_max = 0.25, + rsv_max = 0.5, + #new_build = 1 + ) + add_technology!(p, t) + end + + # Get existing generation units + for row in eachrow(df_dict["generation_units"]) + + #extract area + area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area_int = parse(Int64, area) + + parametric = map_prime_mover_to_parametric(row["prime_mover"]) + t = SupplyTechnology{parametric}(; + #Data pulled from DB + name=row["name"], + id=row["unit_id"], + inv_cost_per_mwyr=LinearCurve(0.0), #just assume zero since pre-existing? + om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), + balancing_topology=string(row["balancing_topology"]), + prime_mover_type=map_prime_mover(row["prime_mover"]), + fuel=row["fuel_type"], + zone = area_int, + base_power=row["base_power"], + existing_cap_mw = row["rating"], + #Problem ones, need to write functions to extract + cap_size=250.0, + # Data we should have but dont currently start_fuel_mmbtu_per_mw = 2.0, start_cost_per_mw = 91.0, @@ -300,31 +373,39 @@ function dataframe_to_structs(df_dict::Dict) ramp_up_percentage = 0.64, #Placeholder or default values (modeling assumptions) + region = "MA", available=true, min_cap_mw=0.0, - min_power = 0.468, + min_power = 0.0, max_cap_mw = -1, - power_systems_type="ThermalStandard", + power_systems_type=string(parametric), cluster = 1, reg_max = 0.25, rsv_max = 0.5, + #new_build = 0#0 for existing builds ) add_technology!(p, t) end + # Get existing generation units + #for row in eachrow(df_dict["generation_units"]) + + #Populate DemandRequirement structs from database for row in eachrow(df_dict["demand_requirements"]) #start in time_series - #extract entity_attribute_id - #match to demand_requirements + eaid = row["entity_attribute_id"] + ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[!,"time_series_blob"][1] + + #How to parse this timestamp stuff?? + d = DemandRequirement{ElectricLoad}( #Data pulled from DB name=string(row["entity_attribute_id"]), - region=string(row["area"]), - peak_load=row["peak_load"], - - #Placeholder values - load_growth=0.05, + region=row["area"], + zone = parse(Int64, row["area"]), + + #Placeholder/default values available=true, power_systems_type="ElectricLoad", ) @@ -332,7 +413,6 @@ function dataframe_to_structs(df_dict::Dict) end #Transmission Lines - topologies = df_dict["balancing_topologies"] lines = df_dict["transmission_lines"] for row in eachrow(df_dict["transmission_interchange"]) @@ -343,7 +423,7 @@ function dataframe_to_structs(df_dict::Dict) existing_capacity = 0.0 for from in topologies_from for to in topologies_to - line_cap = lines[(lines[!,"balancing_topology_from"] .== from) .& (lines[!,"balancing_topology_to"] .== to), "continuous_rating"][1] + line_cap = lines[(lines[!,"balancing_topology_from"] .== from) .& (lines[!,"balancing_topology_to"] .== to), "continuous_rating"] if length(line_cap) == 1 existing_capacity += line_cap[1] end @@ -363,6 +443,7 @@ function dataframe_to_structs(df_dict::Dict) #stuff we don't have, but probably should capital_cost = LinearCurve(19261), line_loss = 0.019653847, + power_systems_type = "Branch" ) add_technology!(p, tx) end From 513c2707326b90b8824d35d628787226b8c3eb7c Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 12:49:39 -0600 Subject: [PATCH 34/69] added storage to portfolio --- src/generate_structs.jl | 47 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 0d82dde..349ab4d 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -387,9 +387,52 @@ function dataframe_to_structs(df_dict::Dict) add_technology!(p, t) end - # Get existing generation units - #for row in eachrow(df_dict["generation_units"]) + # Get storage units + for row in eachrow(df_dict["storage_units"]) + + #extract area + area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area_int = parse(Int64, area) + s = StorageTechnology{Storage}(; + #Data pulled from DB + name=row["name"], + base_power=row["base_power"], # Natural Units + id=row["storage_unit_id"], + zone = area_int, + prime_mover_type=map_prime_mover(row["prime_mover"]), + inv_cost_per_mwyr=LinearCurve(0.0), + inv_cost_charge_per_mwyr=LinearCurve(0.0), + inv_cost_per_mwhyr=LinearCurve(0.0), + om_costs = StorageCost(charge_variable_cost=CostCurve(LinearCurve(0.0)), discharge_variable_cost=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), + fixed_om_cost_per_mwhyr = LinearCurve(0.0), + balancing_topology=row["balancing_topology"], + + + #stuff we dont have but probably should + existing_cap_mw = 0.0, + existing_cap_mwh = 0.0, + eff_up = 0.92, + eff_down = 0.92, + storage_tech = StorageTech.LIB, + + #Default or placeholder values + available=true, + region = "ME", + cluster = 0, + self_disch = 0.0, + min_duration = 1.0, + max_duration = 10.0, + min_cap_mwh=0.0, + min_cap_mw=0.0, + min_charge_cap_mw=-1, + max_cap_mw = -1, + max_charge_cap_mw = -1, + max_cap_mwh = -1, + power_systems_type = "Test", + ) + add_technology!(p, s) + end #Populate DemandRequirement structs from database for row in eachrow(df_dict["demand_requirements"]) From 9c1899a1a59f122c1d6d6282e92968ff879bfeb7 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 12:52:09 -0600 Subject: [PATCH 35/69] add existing capacity to StorageTechnology --- src/generate_structs.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 349ab4d..0661772 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -407,11 +407,10 @@ function dataframe_to_structs(df_dict::Dict) om_costs = StorageCost(charge_variable_cost=CostCurve(LinearCurve(0.0)), discharge_variable_cost=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), fixed_om_cost_per_mwhyr = LinearCurve(0.0), balancing_topology=row["balancing_topology"], - + existing_cap_mw = row["rating"], + existing_cap_mwh = row["max_capacity"], #stuff we dont have but probably should - existing_cap_mw = 0.0, - existing_cap_mwh = 0.0, eff_up = 0.92, eff_down = 0.92, storage_tech = StorageTech.LIB, From db4d3677630e8f29176757d4db42f6dd6d3c7cee Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 13:05:01 -0600 Subject: [PATCH 36/69] formatting --- src/generate_structs.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 0661772..8b61c47 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -347,11 +347,10 @@ function dataframe_to_structs(df_dict::Dict) parametric = map_prime_mover_to_parametric(row["prime_mover"]) t = SupplyTechnology{parametric}(; - #Data pulled from DB + # Data pulled from DB name=row["name"], id=row["unit_id"], inv_cost_per_mwyr=LinearCurve(0.0), #just assume zero since pre-existing? - om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), balancing_topology=string(row["balancing_topology"]), prime_mover_type=map_prime_mover(row["prime_mover"]), fuel=row["fuel_type"], @@ -359,10 +358,11 @@ function dataframe_to_structs(df_dict::Dict) base_power=row["base_power"], existing_cap_mw = row["rating"], - #Problem ones, need to write functions to extract + # Problem ones, need to write functions to extract cap_size=250.0, # Data we should have but dont currently + om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), start_fuel_mmbtu_per_mw = 2.0, start_cost_per_mw = 91.0, up_time = 6.0, @@ -401,21 +401,21 @@ function dataframe_to_structs(df_dict::Dict) id=row["storage_unit_id"], zone = area_int, prime_mover_type=map_prime_mover(row["prime_mover"]), - inv_cost_per_mwyr=LinearCurve(0.0), - inv_cost_charge_per_mwyr=LinearCurve(0.0), - inv_cost_per_mwhyr=LinearCurve(0.0), - om_costs = StorageCost(charge_variable_cost=CostCurve(LinearCurve(0.0)), discharge_variable_cost=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), - fixed_om_cost_per_mwhyr = LinearCurve(0.0), balancing_topology=row["balancing_topology"], existing_cap_mw = row["rating"], existing_cap_mwh = row["max_capacity"], #stuff we dont have but probably should + om_costs = StorageCost(charge_variable_cost=CostCurve(LinearCurve(0.0)), discharge_variable_cost=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), + fixed_om_cost_per_mwhyr = LinearCurve(0.0), eff_up = 0.92, eff_down = 0.92, storage_tech = StorageTech.LIB, #Default or placeholder values + inv_cost_per_mwyr=LinearCurve(0.0), + inv_cost_charge_per_mwyr=LinearCurve(0.0), + inv_cost_per_mwhyr=LinearCurve(0.0), available=true, region = "ME", cluster = 0, From 81c5096e5e0ff67d632a03690a59b0bda4a06eea Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 15:34:47 -0600 Subject: [PATCH 37/69] add parsers for blobs --- src/generate_structs.jl | 51 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 8b61c47..7f30a29 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -277,6 +277,48 @@ function map_prime_mover_to_parametric(prime_mover::String) return mapping_dict[prime_mover] end +function parse_timestamps_and_values(json_str::String) + # Parse the JSON string into a Julia object + data = JSON.parse(json_str) + + # Initialize arrays to store timestamps and values + timestamps = String[] + values = Float64[] + + # Iterate over each dictionary in the parsed JSON data + for item in data + # Append the timestamp to the timestamps array + push!(timestamps, item["timestamp"]) + + # Append the value to the values array + push!(values, item["value"]) + end + + return timestamps, values +end + +function parse_json_to_arrays(json_str::String) + # Parse the JSON string into a Julia object + data = JSON.parse(json_str) + + # Initialize arrays to store x and y values + x_values = Float64[] + y_values = Float64[] + + # Iterate over each dictionary in the parsed JSON data + for item in data + # Append the x values to x_values array + push!(x_values, item["from_x"]) + push!(x_values, item["to_x"]) + + # Append the y values to y_values array + push!(y_values, item["from_y"]) + push!(y_values, item["to_y"]) + end + + return unique(x_values), unique(y_values) +end + function dataframe_to_structs(df_dict::Dict) #Initialize Portfolio @@ -284,8 +326,15 @@ function dataframe_to_structs(df_dict::Dict) #Populate SupplyTechnology structs from database (new builds) topologies = df_dict["balancing_topologies"] - for row in eachrow(df_dict["supply_technologies"]) + for row_pw in eachrow(df_dict["piecewise_linear"]) + # Extract supply curves and IDs + eaid = row_pw["entity_attribute_id"] + supply_curve = row_pw["piecewise_linear_blob"] + id = df_dict["attributes"][df_dict["attributes"][!, "entity_attribute_id"] .== eaid, "entity_id"] + + # Find corresponding supply technology for that supply curve + row = df_dict["supply_technologies"][df_dict["supply_technologies"][!, "technology_id"] .== id, :] #extract area area = topologies[topologies.name .== row["balancing_topology"], "area"][1] area_int = parse(Int64, area) From e17d16a4b2e589992edf670100c341a883c05968 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 7 Aug 2024 15:59:11 -0600 Subject: [PATCH 38/69] add demand timeseries --- src/generate_structs.jl | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 7f30a29..8bdb3eb 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -326,7 +326,8 @@ function dataframe_to_structs(df_dict::Dict) #Populate SupplyTechnology structs from database (new builds) topologies = df_dict["balancing_topologies"] - for row_pw in eachrow(df_dict["piecewise_linear"]) + supply_curves = filter("description" => contains("Supply"), df_dict["piecewise_linear"]) + for row_pw in eachrow(supply_curves) # Extract supply curves and IDs eaid = row_pw["entity_attribute_id"] @@ -336,7 +337,7 @@ function dataframe_to_structs(df_dict::Dict) # Find corresponding supply technology for that supply curve row = df_dict["supply_technologies"][df_dict["supply_technologies"][!, "technology_id"] .== id, :] #extract area - area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area = topologies[topologies.name .== row[!,"balancing_topology"][1], "area"][1] area_int = parse(Int64, area) #extract supply curve, does every supply_technology have a supply curve? @@ -345,16 +346,16 @@ function dataframe_to_structs(df_dict::Dict) #supply_curve = df_dict["time_series"][df_dict["entity_attribute_id"] .== eaid, "piecewise_linear_blob"][1] #Now just need to parse the blob - parametric = map_prime_mover_to_parametric(row["prime_mover"]) + parametric = map_prime_mover_to_parametric(row[!, "prime_mover"][1]) t = SupplyTechnology{parametric}(; #Data pulled from DB - name=string(row["technology_id"]), - id=row["technology_id"], + name=string(row[!,"technology_id"][1]), + id=row[!,"technology_id"][1], inv_cost_per_mwyr=LinearCurve(20000), - om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row["vom_cost"])), fixed=row["fom_cost"], start_up=0.0, shut_down=0.0), - balancing_topology=string(row["balancing_topology"]), - prime_mover_type=map_prime_mover(row["prime_mover"]), - fuel=row["fuel_type"], + om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row[!,"vom_cost"][1])), fixed=row[!,"fom_cost"][1], start_up=0.0, shut_down=0.0), + balancing_topology=string(row[!,"balancing_topology"][1]), + prime_mover_type=map_prime_mover(row[!,"prime_mover"][1]), + fuel=row[!,"fuel_type"][1], zone = area_int, #Problem ones, need to write functions to extract @@ -487,7 +488,12 @@ function dataframe_to_structs(df_dict::Dict) #start in time_series eaid = row["entity_attribute_id"] ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[!,"time_series_blob"][1] - + ts_parsed = parse_timestamps_and_values(s) + dates = ts_parsed[1] #fix this later, dates syntax is inconsistent so hard to parse + dates = DateTime("2020-01-01T00:00:00"):Hour(1):DateTime("2020-12-31T23:00:00") + demand = ts_parsed[2] + demand_array = TimeArray(dates, demand) + ts = SingleTimeSeries(string(row["entity_attribute_id"]), demand_array) #How to parse this timestamp stuff?? d = DemandRequirement{ElectricLoad}( @@ -501,6 +507,7 @@ function dataframe_to_structs(df_dict::Dict) power_systems_type="ElectricLoad", ) add_technology!(p, d) + IS.add_time_series!(p.data, d, ts) end #Transmission Lines From 05387fcb3de4d8683ae3513bad2681a07521b733 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 08:26:45 -0600 Subject: [PATCH 39/69] add system to portfolio --- src/portfolio.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/portfolio.jl b/src/portfolio.jl index 969d4c2..6086925 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -17,13 +17,15 @@ mutable struct PortfolioMetadata <: IS.InfrastructureSystemsType end #TODO: Define if we are going to support unit systems -struct Portfolio <: IS.InfrastructureSystemsType +#TODO: Make immutable +mutable struct Portfolio <: IS.InfrastructureSystemsType aggregation::Type{<:Union{PSY.ACBus, PSY.AggregationTopology}} discount_rate::Float64 data::IS.SystemData # Inputs to the model investment_schedule::Dict # Investment decisions container i.e., model outputs. Container TBD #units_settings::IS.SystemUnitsSettings time_series_directory::Union{Nothing, String} + base_system::Union{Nothing, System} metadata::PortfolioMetadata internal::IS.InfrastructureSystemsInternal @@ -38,6 +40,7 @@ struct Portfolio <: IS.InfrastructureSystemsType name=nothing, description=nothing, data_source=nothing, + base_system=nothing, kwargs..., ) #TODO: Provide support to kwargs @@ -57,6 +60,7 @@ struct Portfolio <: IS.InfrastructureSystemsType investment_schedule, #units_settings, time_series_directory, + base_system, PortfolioMetadata(name, description, data_source), internal, ) From fbee5115bee7086825cdc45c5c1d95ccd0a41ab8 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 08:26:57 -0600 Subject: [PATCH 40/69] change json to json3 in parsers --- src/generate_structs.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 8bdb3eb..2414228 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -279,7 +279,7 @@ end function parse_timestamps_and_values(json_str::String) # Parse the JSON string into a Julia object - data = JSON.parse(json_str) + data = JSON3.read(json_str) # Initialize arrays to store timestamps and values timestamps = String[] @@ -299,7 +299,7 @@ end function parse_json_to_arrays(json_str::String) # Parse the JSON string into a Julia object - data = JSON.parse(json_str) + data = JSON3.read(json_str) # Initialize arrays to store x and y values x_values = Float64[] @@ -488,7 +488,7 @@ function dataframe_to_structs(df_dict::Dict) #start in time_series eaid = row["entity_attribute_id"] ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[!,"time_series_blob"][1] - ts_parsed = parse_timestamps_and_values(s) + ts_parsed = parse_timestamps_and_values(ts_blob) dates = ts_parsed[1] #fix this later, dates syntax is inconsistent so hard to parse dates = DateTime("2020-01-01T00:00:00"):Hour(1):DateTime("2020-12-31T23:00:00") demand = ts_parsed[2] From 7d11e38aa7381e3d8d02fa43d5a844697096f0c8 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 08:27:07 -0600 Subject: [PATCH 41/69] add dates and timeseries --- Project.toml | 2 ++ src/PowerSystemsInvestmentsPortfolios.jl | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Project.toml b/Project.toml index d931fd1..4e6b32a 100644 --- a/Project.toml +++ b/Project.toml @@ -6,6 +6,7 @@ version = "0.1.0" [deps] DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" @@ -14,6 +15,7 @@ PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" +TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e" [compat] DocStringExtensions = "~0.9" diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index d90b7ad..852be87 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -33,10 +33,14 @@ import PrettyTables import SQLite import DataFrames import DBInterface +import TimeSeries +import Dates # Temporary, imports not working properly for some reason? using DataFrames using PowerSystems +using Dates +using TimeSeries export Portfolio export Technology From 0c0bde3463e1857b4f3a2de45c26faf212f86d30 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 09:05:42 -0600 Subject: [PATCH 42/69] change supply curve parser to produce tuple of XY_COORDS --- src/generate_structs.jl | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 2414228..9c7e0a4 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -301,22 +301,17 @@ function parse_json_to_arrays(json_str::String) # Parse the JSON string into a Julia object data = JSON3.read(json_str) - # Initialize arrays to store x and y values - x_values = Float64[] - y_values = Float64[] - + # Initialize array to store x and y values + xy_values = [] + # Iterate over each dictionary in the parsed JSON data for item in data - # Append the x values to x_values array - push!(x_values, item["from_x"]) - push!(x_values, item["to_x"]) - - # Append the y values to y_values array - push!(y_values, item["from_y"]) - push!(y_values, item["to_y"]) + # Append the x values to x_values array as vector of named tuples + push!(xy_values, IS.XY_COORDS((Float64(item["from_x"]),Float64(item["from_y"])))) + push!(xy_values, IS.XY_COORDS((Float64(item["to_x"]),Float64(item["to_y"])))) end - return unique(x_values), unique(y_values) + return unique(xy_values) end function dataframe_to_structs(df_dict::Dict) From d584afe5aab6de2ca85b8985f22dd4945217fbc1 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 09:09:11 -0600 Subject: [PATCH 43/69] remove empty functions --- src/generate_structs.jl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 9c7e0a4..3257a07 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -542,17 +542,4 @@ function dataframe_to_structs(df_dict::Dict) end return p -end - -#function for reading timeseries - -#convert blob to supply curves -function extract_supply_curve() - - -end - -# map tables to one another based on entity_attribute_id -function table_mapping() - end \ No newline at end of file From c9a1953eafed2834ac48cfd3fd82e5565b764eed Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 8 Aug 2024 09:25:26 -0600 Subject: [PATCH 44/69] update investment cost to supply curve --- src/generate_structs.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 3257a07..a7a0767 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -327,10 +327,13 @@ function dataframe_to_structs(df_dict::Dict) # Extract supply curves and IDs eaid = row_pw["entity_attribute_id"] supply_curve = row_pw["piecewise_linear_blob"] + supply_curve_parsed = parse_json_to_arrays(supply_curve) + id = df_dict["attributes"][df_dict["attributes"][!, "entity_attribute_id"] .== eaid, "entity_id"] # Find corresponding supply technology for that supply curve row = df_dict["supply_technologies"][df_dict["supply_technologies"][!, "technology_id"] .== id, :] + #extract area area = topologies[topologies.name .== row[!,"balancing_topology"][1], "area"][1] area_int = parse(Int64, area) @@ -346,7 +349,7 @@ function dataframe_to_structs(df_dict::Dict) #Data pulled from DB name=string(row[!,"technology_id"][1]), id=row[!,"technology_id"][1], - inv_cost_per_mwyr=LinearCurve(20000), + inv_cost_per_mwyr=InputOutputCurve(PiecewiseLinearData(supply_curve_parsed)), om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row[!,"vom_cost"][1])), fixed=row[!,"fom_cost"][1], start_up=0.0, shut_down=0.0), balancing_topology=string(row[!,"balancing_topology"][1]), prime_mover_type=map_prime_mover(row[!,"prime_mover"][1]), From d4c82124741801e0c2e37402269c7f1e56f44547 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 22 Aug 2024 10:38:22 -0600 Subject: [PATCH 45/69] add supplemental attributes --- src/PowerSystemsInvestmentsPortfolios.jl | 2 ++ src/portfolio.jl | 45 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 852be87..44105b6 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -71,6 +71,8 @@ export db_to_dataframes export map_prime_mover export dataframe_to_structs export db_to_portfolio_parser +export add_supplemental_attribute! +export remove_supplemental_attribute! const PSY = PowerSystems const IS = InfrastructureSystems diff --git a/src/portfolio.jl b/src/portfolio.jl index 6086925..31a9f21 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -598,4 +598,49 @@ end function get_requirements(::Type{T}, portfolio::Portfolio;) where {T <: Requirements} return IS.get_components(T, portfolio.data) +end + +########################################### +######### Supplemental Attributes ######### +########################################### + +""" +Add a supplemental attribute to the component. The attribute may already be attached to a +different component. +""" +function add_supplemental_attribute!( + p::Portfolio, + technology::Technology, + attribute::IS.SupplementalAttribute, +) + return IS.add_supplemental_attribute!(p.data, technology, attribute) +end + +""" +Remove the supplemental attribute from the component. The attribute will be removed from the +system if it is not attached to any other component. +""" +function remove_supplemental_attribute!( + p::Portfolio, + technology::Technology, + attribute::IS.SupplementalAttribute, +) + return IS.remove_supplemental_attribute!(p.data, technology, attribute) +end + +""" +Remove the supplemental attribute from the system and all attached components. +""" +function remove_supplemental_attribute!(p::Portfolio, attribute::IS.SupplementalAttribute) + return IS.remove_supplemental_attribute!(p.data, attribute) +end + +""" +Remove all supplemental attributes with the given type from the system. +""" +function remove_supplemental_attributes!( + ::Type{T}, + p::Portfolio, +) where {T <: IS.SupplementalAttribute} + return IS.remove_supplemental_attributes!(T, p.data) end \ No newline at end of file From 79bb71400395dc3e9d3c58ee3691a91164d32fe0 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:17:56 -0600 Subject: [PATCH 46/69] add zone struct --- src/models/generated/Zone.jl | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/models/generated/Zone.jl diff --git a/src/models/generated/Zone.jl b/src/models/generated/Zone.jl new file mode 100644 index 0000000..99e2274 --- /dev/null +++ b/src/models/generated/Zone.jl @@ -0,0 +1,55 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct Zone <: Region + name::String + internal::InfrastructureSystemsInternal + id::Int64 + ext::Dict + end + + + +# Arguments +- `name::String`: Name of region +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `id::Int64`: A unique zone identification number (positive integer) +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct Zone <: Region + "Name of region" + name::String + "Internal field" + internal::InfrastructureSystemsInternal + "A unique zone identification number (positive integer)" + id::Int64 + "Option for providing additional data" + ext::Dict +end + + +function Zone(; name, internal=InfrastructureSystemsInternal(), id, ext=Dict(), ) + Zone(name, internal, id, ext, ) +end + +"""Get [`Zone`](@ref) `name`.""" +get_name(value::Zone) = value.name +"""Get [`Zone`](@ref) `internal`.""" +get_internal(value::Zone) = value.internal +"""Get [`Zone`](@ref) `id`.""" +get_id(value::Zone) = value.id +"""Get [`Zone`](@ref) `ext`.""" +get_ext(value::Zone) = value.ext + +"""Set [`Zone`](@ref) `name`.""" +set_name!(value::Zone, val) = value.name = val +"""Set [`Zone`](@ref) `internal`.""" +set_internal!(value::Zone, val) = value.internal = val +"""Set [`Zone`](@ref) `id`.""" +set_id!(value::Zone, val) = value.id = val +"""Set [`Zone`](@ref) `ext`.""" +set_ext!(value::Zone, val) = value.ext = val From f571f3b7c5b62532f920e0c832ceca6ffd5dfca1 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:18:13 -0600 Subject: [PATCH 47/69] add Region abstract type --- src/models/regions.jl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/models/regions.jl diff --git a/src/models/regions.jl b/src/models/regions.jl new file mode 100644 index 0000000..18e7341 --- /dev/null +++ b/src/models/regions.jl @@ -0,0 +1,21 @@ +""" +abstract type to represent regions for the CEM. + +Required fields for a Region Type + + - name + - id + - time_series_container + - supplemental_attributes_container + - internal +""" +abstract type Region <: IS.InfrastructureSystemsComponent end + +get_name(val::Region) = val.name +get_id(val::Region) = val.id +get_internal(val::Region) = val.internal +get_ext(val::Region) = get_ext(get_internal(val)) +get_time_series_container(val::Region) = val.time_series_container +get_supplemental_attributes_container(val::Region) = + val.supplemental_attributes_container +supports_time_series(::Region) = true From 83d1422f663d5b0d2516fbe542260748137c9dba Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:18:28 -0600 Subject: [PATCH 48/69] generalize supplemental_attribute functions --- src/portfolio.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/portfolio.jl b/src/portfolio.jl index 31a9f21..b74abbb 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -605,15 +605,15 @@ end ########################################### """ -Add a supplemental attribute to the component. The attribute may already be attached to a +Add a supplemental attribute to a technology. The attribute may already be attached to a different component. """ function add_supplemental_attribute!( p::Portfolio, - technology::Technology, + component::IS.InfrastructureSystemsComponent, attribute::IS.SupplementalAttribute, ) - return IS.add_supplemental_attribute!(p.data, technology, attribute) + return IS.add_supplemental_attribute!(p.data, component, attribute) end """ @@ -622,10 +622,10 @@ system if it is not attached to any other component. """ function remove_supplemental_attribute!( p::Portfolio, - technology::Technology, + component::IS.InfrastructureSystemsComponent, attribute::IS.SupplementalAttribute, ) - return IS.remove_supplemental_attribute!(p.data, technology, attribute) + return IS.remove_supplemental_attribute!(p.data, component, attribute) end """ From c2612cbe6fc834a493f5b2d23a834854cfdd99f0 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:18:38 -0600 Subject: [PATCH 49/69] updaet include --- src/PowerSystemsInvestmentsPortfolios.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 44105b6..a351e1b 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -89,6 +89,7 @@ export PrimeMovers export StorageTech include("models/technologies.jl") +include("models/regions.jl") include("models/requirements.jl") include("models/generated/includes.jl") include("portfolio.jl") From f43645dacf85fe34ab858c4648e1279dc507b1ca Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:19:54 -0600 Subject: [PATCH 50/69] change retrofits and retirements to supplemental attributes --- src/models/generated/RetireableTechnology.jl | 40 ++++++-------------- src/models/generated/RetrofitTechnology.jl | 40 ++++++++------------ 2 files changed, 28 insertions(+), 52 deletions(-) diff --git a/src/models/generated/RetireableTechnology.jl b/src/models/generated/RetireableTechnology.jl index 0acfd3b..91f3ded 100644 --- a/src/models/generated/RetireableTechnology.jl +++ b/src/models/generated/RetireableTechnology.jl @@ -5,59 +5,43 @@ This file is auto-generated. Do not edit. #! format: off """ - mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology + mutable struct RetireableTechnology <: IS.SupplementalAttribute name::String - can_retire::Dict{PrimeMovers,Dict{String, Int64}} - power_systems_type::String internal::InfrastructureSystemsInternal - ext::Dict + retireable_capacity::Dict{String, Float64} end # Arguments - `name::String`: The technology name -- `can_retire::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retireable_capacity::Dict{String, Float64}`: (default: `0.0`) Amount of existing capacity for technology that can retire """ -mutable struct RetireableTechnology{T <: PSY.Generator} <: Technology +mutable struct RetireableTechnology <: IS.SupplementalAttribute "The technology name" name::String - "Dictionary of PrimeMovers in each region that can retire" - can_retire::Dict{PrimeMovers,Dict{String, Int64}} - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal - "Option for providing additional data" - ext::Dict + "Amount of existing capacity for technology that can retire" + retireable_capacity::Dict{String, Float64} end -function RetireableTechnology{T}(; name, can_retire=Dict(), power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), ) where T <: PSY.Generator - RetireableTechnology{T}(name, can_retire, power_systems_type, internal, ext, ) +function RetireableTechnology(; name, internal=InfrastructureSystemsInternal(), retireable_capacity=0.0, ) + RetireableTechnology(name, internal, retireable_capacity, ) end """Get [`RetireableTechnology`](@ref) `name`.""" get_name(value::RetireableTechnology) = value.name -"""Get [`RetireableTechnology`](@ref) `can_retire`.""" -get_can_retire(value::RetireableTechnology) = value.can_retire -"""Get [`RetireableTechnology`](@ref) `power_systems_type`.""" -get_power_systems_type(value::RetireableTechnology) = value.power_systems_type """Get [`RetireableTechnology`](@ref) `internal`.""" get_internal(value::RetireableTechnology) = value.internal -"""Get [`RetireableTechnology`](@ref) `ext`.""" -get_ext(value::RetireableTechnology) = value.ext +"""Get [`RetireableTechnology`](@ref) `retireable_capacity`.""" +get_retireable_capacity(value::RetireableTechnology) = value.retireable_capacity """Set [`RetireableTechnology`](@ref) `name`.""" set_name!(value::RetireableTechnology, val) = value.name = val -"""Set [`RetireableTechnology`](@ref) `can_retire`.""" -set_can_retire!(value::RetireableTechnology, val) = value.can_retire = val -"""Set [`RetireableTechnology`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::RetireableTechnology, val) = value.power_systems_type = val """Set [`RetireableTechnology`](@ref) `internal`.""" set_internal!(value::RetireableTechnology, val) = value.internal = val -"""Set [`RetireableTechnology`](@ref) `ext`.""" -set_ext!(value::RetireableTechnology, val) = value.ext = val +"""Set [`RetireableTechnology`](@ref) `retireable_capacity`.""" +set_retireable_capacity!(value::RetireableTechnology, val) = value.retireable_capacity = val diff --git a/src/models/generated/RetrofitTechnology.jl b/src/models/generated/RetrofitTechnology.jl index 7493f32..61a2a1c 100644 --- a/src/models/generated/RetrofitTechnology.jl +++ b/src/models/generated/RetrofitTechnology.jl @@ -5,75 +5,67 @@ This file is auto-generated. Do not edit. #! format: off """ - mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology + mutable struct RetrofitTechnology <: IS.SupplementalAttribute name::String - retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} - power_systems_type::String + retrofit_id::Int64 retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} internal::InfrastructureSystemsInternal ext::Dict - can_retrofit::Dict{PrimeMovers,Dict{String, Int64}} + retrofit_capacity::Float64 end # Arguments - `name::String`: The technology name -- `retrofit_id::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone. -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. - `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `can_retrofit::Dict{PrimeMovers,Dict{String, Int64}}`: (default: `Dict()`) Dictionary of PrimeMovers in each region that can retire +- `retrofit_capacity::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted """ -mutable struct RetrofitTechnology{T <: PSY.Generator} <: Technology +mutable struct RetrofitTechnology <: IS.SupplementalAttribute "The technology name" name::String - "Dictionary of unique identifiers to group retrofittable source technologies with retrofit options inside the same zone." - retrofit_id::Dict{PrimeMovers,Dict{String, Int64}} - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String + "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." + retrofit_id::Int64 "Dictionary of Efficiency of the retrofit technology." retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "Dictionary of PrimeMovers in each region that can retire" - can_retrofit::Dict{PrimeMovers,Dict{String, Int64}} + "Amount of existing capacity for technology that can be retrofitted" + retrofit_capacity::Float64 end -function RetrofitTechnology{T}(; name, retrofit_id=Dict(), power_systems_type, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), can_retrofit=Dict(), ) where T <: PSY.Generator - RetrofitTechnology{T}(name, retrofit_id, power_systems_type, retrofit_efficiency, internal, ext, can_retrofit, ) +function RetrofitTechnology(; name, retrofit_id=0, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), retrofit_capacity=0.0, ) + RetrofitTechnology(name, retrofit_id, retrofit_efficiency, internal, ext, retrofit_capacity, ) end """Get [`RetrofitTechnology`](@ref) `name`.""" get_name(value::RetrofitTechnology) = value.name """Get [`RetrofitTechnology`](@ref) `retrofit_id`.""" get_retrofit_id(value::RetrofitTechnology) = value.retrofit_id -"""Get [`RetrofitTechnology`](@ref) `power_systems_type`.""" -get_power_systems_type(value::RetrofitTechnology) = value.power_systems_type """Get [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" get_retrofit_efficiency(value::RetrofitTechnology) = value.retrofit_efficiency """Get [`RetrofitTechnology`](@ref) `internal`.""" get_internal(value::RetrofitTechnology) = value.internal """Get [`RetrofitTechnology`](@ref) `ext`.""" get_ext(value::RetrofitTechnology) = value.ext -"""Get [`RetrofitTechnology`](@ref) `can_retrofit`.""" -get_can_retrofit(value::RetrofitTechnology) = value.can_retrofit +"""Get [`RetrofitTechnology`](@ref) `retrofit_capacity`.""" +get_retrofit_capacity(value::RetrofitTechnology) = value.retrofit_capacity """Set [`RetrofitTechnology`](@ref) `name`.""" set_name!(value::RetrofitTechnology, val) = value.name = val """Set [`RetrofitTechnology`](@ref) `retrofit_id`.""" set_retrofit_id!(value::RetrofitTechnology, val) = value.retrofit_id = val -"""Set [`RetrofitTechnology`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::RetrofitTechnology, val) = value.power_systems_type = val """Set [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" set_retrofit_efficiency!(value::RetrofitTechnology, val) = value.retrofit_efficiency = val """Set [`RetrofitTechnology`](@ref) `internal`.""" set_internal!(value::RetrofitTechnology, val) = value.internal = val """Set [`RetrofitTechnology`](@ref) `ext`.""" set_ext!(value::RetrofitTechnology, val) = value.ext = val -"""Set [`RetrofitTechnology`](@ref) `can_retrofit`.""" -set_can_retrofit!(value::RetrofitTechnology, val) = value.can_retrofit = val +"""Set [`RetrofitTechnology`](@ref) `retrofit_capacity`.""" +set_retrofit_capacity!(value::RetrofitTechnology, val) = value.retrofit_capacity = val From ca01ca53a58d46bf51345236c789005ede7c4e27 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:35:58 -0600 Subject: [PATCH 51/69] name change --- src/models/generated/RetireableCapacity.jl | 47 +++++++++++++ src/models/generated/RetireableTechnology.jl | 47 ------------- src/models/generated/RetrofitCapacity.jl | 71 ++++++++++++++++++++ src/models/generated/RetrofitTechnology.jl | 71 -------------------- 4 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 src/models/generated/RetireableCapacity.jl delete mode 100644 src/models/generated/RetireableTechnology.jl create mode 100644 src/models/generated/RetrofitCapacity.jl delete mode 100644 src/models/generated/RetrofitTechnology.jl diff --git a/src/models/generated/RetireableCapacity.jl b/src/models/generated/RetireableCapacity.jl new file mode 100644 index 0000000..e23d0a8 --- /dev/null +++ b/src/models/generated/RetireableCapacity.jl @@ -0,0 +1,47 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetireableCapacity <: IS.SupplementalAttribute + name::String + internal::InfrastructureSystemsInternal + retireable_capacity::Dict{String, Float64} + end + + + +# Arguments +- `name::String`: The technology name +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `retireable_capacity::Dict{String, Float64}`: (default: `Dict()`) Amount of existing capacity for technology that can retire +""" +mutable struct RetireableCapacity <: IS.SupplementalAttribute + "The technology name" + name::String + "Internal field" + internal::InfrastructureSystemsInternal + "Amount of existing capacity for technology that can retire" + retireable_capacity::Dict{String, Float64} +end + + +function RetireableCapacity(; name, internal=InfrastructureSystemsInternal(), retireable_capacity=Dict(), ) + RetireableCapacity(name, internal, retireable_capacity, ) +end + +"""Get [`RetireableCapacity`](@ref) `name`.""" +get_name(value::RetireableCapacity) = value.name +"""Get [`RetireableCapacity`](@ref) `internal`.""" +get_internal(value::RetireableCapacity) = value.internal +"""Get [`RetireableCapacity`](@ref) `retireable_capacity`.""" +get_retireable_capacity(value::RetireableCapacity) = value.retireable_capacity + +"""Set [`RetireableCapacity`](@ref) `name`.""" +set_name!(value::RetireableCapacity, val) = value.name = val +"""Set [`RetireableCapacity`](@ref) `internal`.""" +set_internal!(value::RetireableCapacity, val) = value.internal = val +"""Set [`RetireableCapacity`](@ref) `retireable_capacity`.""" +set_retireable_capacity!(value::RetireableCapacity, val) = value.retireable_capacity = val diff --git a/src/models/generated/RetireableTechnology.jl b/src/models/generated/RetireableTechnology.jl deleted file mode 100644 index 91f3ded..0000000 --- a/src/models/generated/RetireableTechnology.jl +++ /dev/null @@ -1,47 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct RetireableTechnology <: IS.SupplementalAttribute - name::String - internal::InfrastructureSystemsInternal - retireable_capacity::Dict{String, Float64} - end - - - -# Arguments -- `name::String`: The technology name -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `retireable_capacity::Dict{String, Float64}`: (default: `0.0`) Amount of existing capacity for technology that can retire -""" -mutable struct RetireableTechnology <: IS.SupplementalAttribute - "The technology name" - name::String - "Internal field" - internal::InfrastructureSystemsInternal - "Amount of existing capacity for technology that can retire" - retireable_capacity::Dict{String, Float64} -end - - -function RetireableTechnology(; name, internal=InfrastructureSystemsInternal(), retireable_capacity=0.0, ) - RetireableTechnology(name, internal, retireable_capacity, ) -end - -"""Get [`RetireableTechnology`](@ref) `name`.""" -get_name(value::RetireableTechnology) = value.name -"""Get [`RetireableTechnology`](@ref) `internal`.""" -get_internal(value::RetireableTechnology) = value.internal -"""Get [`RetireableTechnology`](@ref) `retireable_capacity`.""" -get_retireable_capacity(value::RetireableTechnology) = value.retireable_capacity - -"""Set [`RetireableTechnology`](@ref) `name`.""" -set_name!(value::RetireableTechnology, val) = value.name = val -"""Set [`RetireableTechnology`](@ref) `internal`.""" -set_internal!(value::RetireableTechnology, val) = value.internal = val -"""Set [`RetireableTechnology`](@ref) `retireable_capacity`.""" -set_retireable_capacity!(value::RetireableTechnology, val) = value.retireable_capacity = val diff --git a/src/models/generated/RetrofitCapacity.jl b/src/models/generated/RetrofitCapacity.jl new file mode 100644 index 0000000..838391b --- /dev/null +++ b/src/models/generated/RetrofitCapacity.jl @@ -0,0 +1,71 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetrofitCapacity <: IS.SupplementalAttribute + name::String + retrofit_id::Int64 + retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} + internal::InfrastructureSystemsInternal + ext::Dict + retrofit_capacity::Float64 + end + + + +# Arguments +- `name::String`: The technology name +- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. +- `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retrofit_capacity::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted +""" +mutable struct RetrofitCapacity <: IS.SupplementalAttribute + "The technology name" + name::String + "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." + retrofit_id::Int64 + "Dictionary of Efficiency of the retrofit technology." + retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Amount of existing capacity for technology that can be retrofitted" + retrofit_capacity::Float64 +end + + +function RetrofitCapacity(; name, retrofit_id=0, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), retrofit_capacity=0.0, ) + RetrofitCapacity(name, retrofit_id, retrofit_efficiency, internal, ext, retrofit_capacity, ) +end + +"""Get [`RetrofitCapacity`](@ref) `name`.""" +get_name(value::RetrofitCapacity) = value.name +"""Get [`RetrofitCapacity`](@ref) `retrofit_id`.""" +get_retrofit_id(value::RetrofitCapacity) = value.retrofit_id +"""Get [`RetrofitCapacity`](@ref) `retrofit_efficiency`.""" +get_retrofit_efficiency(value::RetrofitCapacity) = value.retrofit_efficiency +"""Get [`RetrofitCapacity`](@ref) `internal`.""" +get_internal(value::RetrofitCapacity) = value.internal +"""Get [`RetrofitCapacity`](@ref) `ext`.""" +get_ext(value::RetrofitCapacity) = value.ext +"""Get [`RetrofitCapacity`](@ref) `retrofit_capacity`.""" +get_retrofit_capacity(value::RetrofitCapacity) = value.retrofit_capacity + +"""Set [`RetrofitCapacity`](@ref) `name`.""" +set_name!(value::RetrofitCapacity, val) = value.name = val +"""Set [`RetrofitCapacity`](@ref) `retrofit_id`.""" +set_retrofit_id!(value::RetrofitCapacity, val) = value.retrofit_id = val +"""Set [`RetrofitCapacity`](@ref) `retrofit_efficiency`.""" +set_retrofit_efficiency!(value::RetrofitCapacity, val) = value.retrofit_efficiency = val +"""Set [`RetrofitCapacity`](@ref) `internal`.""" +set_internal!(value::RetrofitCapacity, val) = value.internal = val +"""Set [`RetrofitCapacity`](@ref) `ext`.""" +set_ext!(value::RetrofitCapacity, val) = value.ext = val +"""Set [`RetrofitCapacity`](@ref) `retrofit_capacity`.""" +set_retrofit_capacity!(value::RetrofitCapacity, val) = value.retrofit_capacity = val diff --git a/src/models/generated/RetrofitTechnology.jl b/src/models/generated/RetrofitTechnology.jl deleted file mode 100644 index 61a2a1c..0000000 --- a/src/models/generated/RetrofitTechnology.jl +++ /dev/null @@ -1,71 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct RetrofitTechnology <: IS.SupplementalAttribute - name::String - retrofit_id::Int64 - retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} - internal::InfrastructureSystemsInternal - ext::Dict - retrofit_capacity::Float64 - end - - - -# Arguments -- `name::String`: The technology name -- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. -- `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `retrofit_capacity::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted -""" -mutable struct RetrofitTechnology <: IS.SupplementalAttribute - "The technology name" - name::String - "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." - retrofit_id::Int64 - "Dictionary of Efficiency of the retrofit technology." - retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} - "Internal field" - internal::InfrastructureSystemsInternal - "Option for providing additional data" - ext::Dict - "Amount of existing capacity for technology that can be retrofitted" - retrofit_capacity::Float64 -end - - -function RetrofitTechnology(; name, retrofit_id=0, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), retrofit_capacity=0.0, ) - RetrofitTechnology(name, retrofit_id, retrofit_efficiency, internal, ext, retrofit_capacity, ) -end - -"""Get [`RetrofitTechnology`](@ref) `name`.""" -get_name(value::RetrofitTechnology) = value.name -"""Get [`RetrofitTechnology`](@ref) `retrofit_id`.""" -get_retrofit_id(value::RetrofitTechnology) = value.retrofit_id -"""Get [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" -get_retrofit_efficiency(value::RetrofitTechnology) = value.retrofit_efficiency -"""Get [`RetrofitTechnology`](@ref) `internal`.""" -get_internal(value::RetrofitTechnology) = value.internal -"""Get [`RetrofitTechnology`](@ref) `ext`.""" -get_ext(value::RetrofitTechnology) = value.ext -"""Get [`RetrofitTechnology`](@ref) `retrofit_capacity`.""" -get_retrofit_capacity(value::RetrofitTechnology) = value.retrofit_capacity - -"""Set [`RetrofitTechnology`](@ref) `name`.""" -set_name!(value::RetrofitTechnology, val) = value.name = val -"""Set [`RetrofitTechnology`](@ref) `retrofit_id`.""" -set_retrofit_id!(value::RetrofitTechnology, val) = value.retrofit_id = val -"""Set [`RetrofitTechnology`](@ref) `retrofit_efficiency`.""" -set_retrofit_efficiency!(value::RetrofitTechnology, val) = value.retrofit_efficiency = val -"""Set [`RetrofitTechnology`](@ref) `internal`.""" -set_internal!(value::RetrofitTechnology, val) = value.internal = val -"""Set [`RetrofitTechnology`](@ref) `ext`.""" -set_ext!(value::RetrofitTechnology, val) = value.ext = val -"""Set [`RetrofitTechnology`](@ref) `retrofit_capacity`.""" -set_retrofit_capacity!(value::RetrofitTechnology, val) = value.retrofit_capacity = val From e7e48106051e80152522ca96eeb4ed8cf639d603 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:36:19 -0600 Subject: [PATCH 52/69] add existing capacity supplemental attribute --- src/models/generated/ExistingCapacity.jl | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/models/generated/ExistingCapacity.jl diff --git a/src/models/generated/ExistingCapacity.jl b/src/models/generated/ExistingCapacity.jl new file mode 100644 index 0000000..b33a417 --- /dev/null +++ b/src/models/generated/ExistingCapacity.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct ExistingCapacity <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + existing_capacity::Dict{String, Dict{String, Float64}} + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `existing_capacity::Dict{String, Dict{String, Float64}}`: (default: `Dict()`) Map SupplyTechnologies to individual units in a zone and their existing capacity +""" +mutable struct ExistingCapacity <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Map SupplyTechnologies to individual units in a zone and their existing capacity" + existing_capacity::Dict{String, Dict{String, Float64}} +end + + +function ExistingCapacity(; internal=InfrastructureSystemsInternal(), ext=Dict(), existing_capacity=Dict(), ) + ExistingCapacity(internal, ext, existing_capacity, ) +end + +# Constructor for demo purposes; non-functional. +function ExistingCapacity(::Nothing) + ExistingCapacity(; + internal=Dict(), + ext=Dict(), + existing_capacity=Dict(), + ) +end + +"""Get [`ExistingCapacity`](@ref) `internal`.""" +get_internal(value::ExistingCapacity) = value.internal +"""Get [`ExistingCapacity`](@ref) `ext`.""" +get_ext(value::ExistingCapacity) = value.ext +"""Get [`ExistingCapacity`](@ref) `existing_capacity`.""" +get_existing_capacity(value::ExistingCapacity) = value.existing_capacity + +"""Set [`ExistingCapacity`](@ref) `internal`.""" +set_internal!(value::ExistingCapacity, val) = value.internal = val +"""Set [`ExistingCapacity`](@ref) `ext`.""" +set_ext!(value::ExistingCapacity, val) = value.ext = val +"""Set [`ExistingCapacity`](@ref) `existing_capacity`.""" +set_existing_capacity!(value::ExistingCapacity, val) = value.existing_capacity = val From fdb1d5bd99326c5fc86f53ea48b0942921b010b2 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Wed, 28 Aug 2024 10:36:30 -0600 Subject: [PATCH 53/69] typos --- src/models/generated/SupplyTechnology.jl | 4 ++-- src/models/generated/includes.jl | 16 ++++++++++------ src/models/requirements.jl | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 12b584d..00308ce 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -79,7 +79,7 @@ This file is auto-generated. Do not edit. - `region::String`: Region/zone technology operates in - `min_power::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. -- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. +- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. - `min_cap_mw::Float64`: (default: `0.0`) Minimum required capacity for a technology - `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity - `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. @@ -176,7 +176,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=0.0, min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=LinearCurve(0.0), min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) end diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 40aec56..135e643 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,14 +1,16 @@ include("Electrolyzers.jl") include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") -include("RetireableTechnology.jl") include("DemandRequirement.jl") -include("RetrofitTechnology.jl") +include("ExistingCapacity.jl") include("CoLocatedSupplyStorageTechnology.jl") include("DemandSideTechnology.jl") +include("Zone.jl") +include("RetrofitCapacity.jl") include("StorageTechnology.jl") include("CarbonCaps.jl") include("TransportTechnology.jl") +include("RetireableCapacity.jl") include("CurtailableDemandSideTechnology.jl") include("FlexibleDemandTechnology.jl") @@ -16,8 +18,6 @@ export get_angle_limit export get_available export get_balancing_topology export get_base_power -export get_can_retire -export get_can_retrofit export get_cap_size export get_capital_cost export get_capital_cost_energy @@ -50,6 +50,7 @@ export get_eligible_zones export get_end_region export get_existing_cap_mw export get_existing_cap_mwh +export get_existing_capacity export get_existing_line_capacity export get_ext export get_fixed_om_cost_per_mwhyr @@ -114,6 +115,8 @@ export get_reg_cost export get_reg_max export get_region export get_resistance +export get_retireable_capacity +export get_retrofit_capacity export get_retrofit_efficiency export get_retrofit_id export get_rsv_cost @@ -135,8 +138,6 @@ export set_angle_limit! export set_available! export set_balancing_topology! export set_base_power! -export set_can_retire! -export set_can_retrofit! export set_cap_size! export set_capital_cost! export set_capital_cost_energy! @@ -169,6 +170,7 @@ export set_eligible_zones! export set_end_region! export set_existing_cap_mw! export set_existing_cap_mwh! +export set_existing_capacity! export set_existing_line_capacity! export set_ext! export set_fixed_om_cost_per_mwhyr! @@ -233,6 +235,8 @@ export set_reg_cost! export set_reg_max! export set_region! export set_resistance! +export set_retireable_capacity! +export set_retrofit_capacity! export set_retrofit_efficiency! export set_retrofit_id! export set_rsv_cost! diff --git a/src/models/requirements.jl b/src/models/requirements.jl index 0f4a318..a55aba6 100644 --- a/src/models/requirements.jl +++ b/src/models/requirements.jl @@ -1,5 +1,5 @@ """ -Supertype for all system requirements +Supertype for all portfolio requirements Requirements include policies or other regional factors that may constrain expansion decisions. Common requirements are carbon caps and system From b7213408b7794595c093ffe94872adc574776a83 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Thu, 29 Aug 2024 12:25:11 -0600 Subject: [PATCH 54/69] updating data types and exports for zones --- src/PowerSystemsInvestmentsPortfolios.jl | 8 ++++-- src/models/generated/SupplyTechnology.jl | 10 +++---- src/models/generated/includes.jl | 2 +- src/portfolio.jl | 36 ++++++++++++++++++++++-- 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index a351e1b..315191f 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -53,10 +53,13 @@ export DemandsideTechnology export FlexibleDemandTechnology export Electrolyzers export CurtailableDemandSideTechnology -export RetireableTechnology -export RetrofitTechnology +export RetireableCapacity +export RetrofitCapacity +export ExistingCapacity export CarbonCaps export MinimumCapacityRequirements +export Region +export Zone export get_technologies export get_technology @@ -73,6 +76,7 @@ export dataframe_to_structs export db_to_portfolio_parser export add_supplemental_attribute! export remove_supplemental_attribute! +export get_supplemental_attribute const PSY = PowerSystems const IS = InfrastructureSystems diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 00308ce..1c20a02 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -8,7 +8,7 @@ This file is auto-generated. Do not edit. mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} - zone::Int64 + zone::Zone prime_mover_type::PrimeMovers outage_factor::Float64 cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} @@ -53,7 +53,7 @@ This file is auto-generated. Do not edit. # Arguments - `base_power::Float64`: Base power - `heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh -- `zone::Int64`: Zone number where tech operates in +- `zone::Zone`: (default: `nothing`) Zone where tech operates in - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator @@ -97,8 +97,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 "Heat rate of generator, MMBTU/MWh" heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} - "Zone number where tech operates in" - zone::Int64 + "Zone where tech operates in" + zone::Zone "Prime mover for generator" prime_mover_type::PrimeMovers "Derating factor to account for planned or forced outages of a technology" @@ -176,7 +176,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=LinearCurve(0.0), min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=LinearCurve(0.0), min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) end diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 135e643..c35fdbc 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,3 +1,4 @@ +include("Zone.jl") include("Electrolyzers.jl") include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") @@ -5,7 +6,6 @@ include("DemandRequirement.jl") include("ExistingCapacity.jl") include("CoLocatedSupplyStorageTechnology.jl") include("DemandSideTechnology.jl") -include("Zone.jl") include("RetrofitCapacity.jl") include("StorageTechnology.jl") include("CarbonCaps.jl") diff --git a/src/portfolio.jl b/src/portfolio.jl index b74abbb..ecc7d75 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -173,8 +173,26 @@ function add_technology!( return end +function add_region!( + portfolio::Portfolio, + zone::T; + skip_validation=false, + kwargs..., +) where {T <: Region} + #deserialization_in_progress = _is_deserialization_in_progress(portfolio) + IS.add_component!( + portfolio.data, + zone; + #allow_existing_time_series=deserialization_in_progress, + skip_validation=skip_validation, + kwargs..., + ) + + return +end + """ -Add many technologies to the portfoliotem at once. +Add many technologies to the portfolio at once. Throws ArgumentError if the technology's name is already stored for its concrete type. Throws ArgumentError if any Technology-specific rule is violated. @@ -643,4 +661,18 @@ function remove_supplemental_attributes!( p::Portfolio, ) where {T <: IS.SupplementalAttribute} return IS.remove_supplemental_attributes!(T, p.data) -end \ No newline at end of file +end + +""" +Return the supplemental attribute with the given uuid. + +Throws ArgumentError if the attribute is not stored. +""" +function get_supplemental_attribute(p::Portfolio, uuid::Base.UUID) + return IS.get_supplemental_attribute(p.data, uuid) +end + +""" +Return the internal of a supplemental attribute, required to add to IS for SupplementalAttributes to work +""" +IS.get_internal(val::IS.SupplementalAttribute) = val.internal \ No newline at end of file From bc5505fe7c5afa231f835357662d531ef224ab89 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 3 Sep 2024 08:10:08 -0600 Subject: [PATCH 55/69] remove Revise --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4e6b32a..e7b2528 100644 --- a/Project.toml +++ b/Project.toml @@ -13,7 +13,6 @@ JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e" From 37a0f081275233727d5aa93a7095298f524f4395 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 3 Sep 2024 09:12:41 -0600 Subject: [PATCH 56/69] update retirements and retrofits to match structure of existingcapacity --- src/models/generated/RetireableCapacity.jl | 47 -------------- src/models/generated/RetirementPotential.jl | 56 ++++++++++++++++ src/models/generated/RetrofitCapacity.jl | 71 --------------------- src/models/generated/RetrofitPotential.jl | 56 ++++++++++++++++ src/models/generated/includes.jl | 20 +++--- 5 files changed, 123 insertions(+), 127 deletions(-) delete mode 100644 src/models/generated/RetireableCapacity.jl create mode 100644 src/models/generated/RetirementPotential.jl delete mode 100644 src/models/generated/RetrofitCapacity.jl create mode 100644 src/models/generated/RetrofitPotential.jl diff --git a/src/models/generated/RetireableCapacity.jl b/src/models/generated/RetireableCapacity.jl deleted file mode 100644 index e23d0a8..0000000 --- a/src/models/generated/RetireableCapacity.jl +++ /dev/null @@ -1,47 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct RetireableCapacity <: IS.SupplementalAttribute - name::String - internal::InfrastructureSystemsInternal - retireable_capacity::Dict{String, Float64} - end - - - -# Arguments -- `name::String`: The technology name -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `retireable_capacity::Dict{String, Float64}`: (default: `Dict()`) Amount of existing capacity for technology that can retire -""" -mutable struct RetireableCapacity <: IS.SupplementalAttribute - "The technology name" - name::String - "Internal field" - internal::InfrastructureSystemsInternal - "Amount of existing capacity for technology that can retire" - retireable_capacity::Dict{String, Float64} -end - - -function RetireableCapacity(; name, internal=InfrastructureSystemsInternal(), retireable_capacity=Dict(), ) - RetireableCapacity(name, internal, retireable_capacity, ) -end - -"""Get [`RetireableCapacity`](@ref) `name`.""" -get_name(value::RetireableCapacity) = value.name -"""Get [`RetireableCapacity`](@ref) `internal`.""" -get_internal(value::RetireableCapacity) = value.internal -"""Get [`RetireableCapacity`](@ref) `retireable_capacity`.""" -get_retireable_capacity(value::RetireableCapacity) = value.retireable_capacity - -"""Set [`RetireableCapacity`](@ref) `name`.""" -set_name!(value::RetireableCapacity, val) = value.name = val -"""Set [`RetireableCapacity`](@ref) `internal`.""" -set_internal!(value::RetireableCapacity, val) = value.internal = val -"""Set [`RetireableCapacity`](@ref) `retireable_capacity`.""" -set_retireable_capacity!(value::RetireableCapacity, val) = value.retireable_capacity = val diff --git a/src/models/generated/RetirementPotential.jl b/src/models/generated/RetirementPotential.jl new file mode 100644 index 0000000..ab1e8e8 --- /dev/null +++ b/src/models/generated/RetirementPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetirementPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + retirement_potential::Vector{PSY.Generator} + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retirement_potential::Vector{PSY.Generator}`: (default: `Vector()`) Individual generation units mapped to a technology that are eligible for retirement +""" +mutable struct RetirementPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Individual generation units mapped to a technology that are eligible for retirement" + retirement_potential::Vector{PSY.Generator} +end + + +function RetirementPotential(; internal=InfrastructureSystemsInternal(), ext=Dict(), retirement_potential=Vector(), ) + RetirementPotential(internal, ext, retirement_potential, ) +end + +# Constructor for demo purposes; non-functional. +function RetirementPotential(::Nothing) + RetirementPotential(; + internal=Vector(), + ext=Vector(), + retirement_potential=Vector(), + ) +end + +"""Get [`RetirementPotential`](@ref) `internal`.""" +get_internal(value::RetirementPotential) = value.internal +"""Get [`RetirementPotential`](@ref) `ext`.""" +get_ext(value::RetirementPotential) = value.ext +"""Get [`RetirementPotential`](@ref) `retirement_potential`.""" +get_retirement_potential(value::RetirementPotential) = value.retirement_potential + +"""Set [`RetirementPotential`](@ref) `internal`.""" +set_internal!(value::RetirementPotential, val) = value.internal = val +"""Set [`RetirementPotential`](@ref) `ext`.""" +set_ext!(value::RetirementPotential, val) = value.ext = val +"""Set [`RetirementPotential`](@ref) `retirement_potential`.""" +set_retirement_potential!(value::RetirementPotential, val) = value.retirement_potential = val diff --git a/src/models/generated/RetrofitCapacity.jl b/src/models/generated/RetrofitCapacity.jl deleted file mode 100644 index 838391b..0000000 --- a/src/models/generated/RetrofitCapacity.jl +++ /dev/null @@ -1,71 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct RetrofitCapacity <: IS.SupplementalAttribute - name::String - retrofit_id::Int64 - retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} - internal::InfrastructureSystemsInternal - ext::Dict - retrofit_capacity::Float64 - end - - - -# Arguments -- `name::String`: The technology name -- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. -- `retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}}`: (default: `Dict()`) Dictionary of Efficiency of the retrofit technology. -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `retrofit_capacity::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted -""" -mutable struct RetrofitCapacity <: IS.SupplementalAttribute - "The technology name" - name::String - "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." - retrofit_id::Int64 - "Dictionary of Efficiency of the retrofit technology." - retrofit_efficiency::Dict{PrimeMovers,Dict{String, Float64}} - "Internal field" - internal::InfrastructureSystemsInternal - "Option for providing additional data" - ext::Dict - "Amount of existing capacity for technology that can be retrofitted" - retrofit_capacity::Float64 -end - - -function RetrofitCapacity(; name, retrofit_id=0, retrofit_efficiency=Dict(), internal=InfrastructureSystemsInternal(), ext=Dict(), retrofit_capacity=0.0, ) - RetrofitCapacity(name, retrofit_id, retrofit_efficiency, internal, ext, retrofit_capacity, ) -end - -"""Get [`RetrofitCapacity`](@ref) `name`.""" -get_name(value::RetrofitCapacity) = value.name -"""Get [`RetrofitCapacity`](@ref) `retrofit_id`.""" -get_retrofit_id(value::RetrofitCapacity) = value.retrofit_id -"""Get [`RetrofitCapacity`](@ref) `retrofit_efficiency`.""" -get_retrofit_efficiency(value::RetrofitCapacity) = value.retrofit_efficiency -"""Get [`RetrofitCapacity`](@ref) `internal`.""" -get_internal(value::RetrofitCapacity) = value.internal -"""Get [`RetrofitCapacity`](@ref) `ext`.""" -get_ext(value::RetrofitCapacity) = value.ext -"""Get [`RetrofitCapacity`](@ref) `retrofit_capacity`.""" -get_retrofit_capacity(value::RetrofitCapacity) = value.retrofit_capacity - -"""Set [`RetrofitCapacity`](@ref) `name`.""" -set_name!(value::RetrofitCapacity, val) = value.name = val -"""Set [`RetrofitCapacity`](@ref) `retrofit_id`.""" -set_retrofit_id!(value::RetrofitCapacity, val) = value.retrofit_id = val -"""Set [`RetrofitCapacity`](@ref) `retrofit_efficiency`.""" -set_retrofit_efficiency!(value::RetrofitCapacity, val) = value.retrofit_efficiency = val -"""Set [`RetrofitCapacity`](@ref) `internal`.""" -set_internal!(value::RetrofitCapacity, val) = value.internal = val -"""Set [`RetrofitCapacity`](@ref) `ext`.""" -set_ext!(value::RetrofitCapacity, val) = value.ext = val -"""Set [`RetrofitCapacity`](@ref) `retrofit_capacity`.""" -set_retrofit_capacity!(value::RetrofitCapacity, val) = value.retrofit_capacity = val diff --git a/src/models/generated/RetrofitPotential.jl b/src/models/generated/RetrofitPotential.jl new file mode 100644 index 0000000..adf9902 --- /dev/null +++ b/src/models/generated/RetrofitPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetrofitPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + retrofit_potential::Vector{PSY.Generator} + ext::Dict + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `retrofit_potential::Vector{PSY.Generator}`: (default: `Vector()`) Individual generation units mapped to this technology that can be retrofitted +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct RetrofitPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Individual generation units mapped to this technology that can be retrofitted" + retrofit_potential::Vector{PSY.Generator} + "Option for providing additional data" + ext::Dict +end + + +function RetrofitPotential(; internal=InfrastructureSystemsInternal(), retrofit_potential=Vector(), ext=Dict(), ) + RetrofitPotential(internal, retrofit_potential, ext, ) +end + +# Constructor for demo purposes; non-functional. +function RetrofitPotential(::Nothing) + RetrofitPotential(; + internal=Dict(), + retrofit_potential=Dict(), + ext=Dict(), + ) +end + +"""Get [`RetrofitPotential`](@ref) `internal`.""" +get_internal(value::RetrofitPotential) = value.internal +"""Get [`RetrofitPotential`](@ref) `retrofit_potential`.""" +get_retrofit_potential(value::RetrofitPotential) = value.retrofit_potential +"""Get [`RetrofitPotential`](@ref) `ext`.""" +get_ext(value::RetrofitPotential) = value.ext + +"""Set [`RetrofitPotential`](@ref) `internal`.""" +set_internal!(value::RetrofitPotential, val) = value.internal = val +"""Set [`RetrofitPotential`](@ref) `retrofit_potential`.""" +set_retrofit_potential!(value::RetrofitPotential, val) = value.retrofit_potential = val +"""Set [`RetrofitPotential`](@ref) `ext`.""" +set_ext!(value::RetrofitPotential, val) = value.ext = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index c35fdbc..7d4d1bd 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,16 +1,18 @@ -include("Zone.jl") include("Electrolyzers.jl") include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") include("DemandRequirement.jl") +include("RetirementPotential.jl") include("ExistingCapacity.jl") include("CoLocatedSupplyStorageTechnology.jl") +include("AggregateRetrofitPotential.jl") include("DemandSideTechnology.jl") -include("RetrofitCapacity.jl") +include("AggregateRetirementPotential.jl") +include("Zone.jl") include("StorageTechnology.jl") include("CarbonCaps.jl") include("TransportTechnology.jl") -include("RetireableCapacity.jl") +include("RetrofitPotential.jl") include("CurtailableDemandSideTechnology.jl") include("FlexibleDemandTechnology.jl") @@ -115,10 +117,10 @@ export get_reg_cost export get_reg_max export get_region export get_resistance -export get_retireable_capacity -export get_retrofit_capacity -export get_retrofit_efficiency +export get_retirement_potential +export get_retrofit_fraction export get_retrofit_id +export get_retrofit_potential export get_rsv_cost export get_rsv_max export get_segments @@ -235,10 +237,10 @@ export set_reg_cost! export set_reg_max! export set_region! export set_resistance! -export set_retireable_capacity! -export set_retrofit_capacity! -export set_retrofit_efficiency! +export set_retirement_potential! +export set_retrofit_fraction! export set_retrofit_id! +export set_retrofit_potential! export set_rsv_cost! export set_rsv_max! export set_segments! From bbf33c7111b89a4a72f149455064bd2eb82f1a93 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 3 Sep 2024 09:12:58 -0600 Subject: [PATCH 57/69] add aggregated versions of retirements and retrofits --- .../generated/AggregateRetirementPotential.jl | 56 ++++++++++++++ .../generated/AggregateRetrofitPotential.jl | 74 +++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 src/models/generated/AggregateRetirementPotential.jl create mode 100644 src/models/generated/AggregateRetrofitPotential.jl diff --git a/src/models/generated/AggregateRetirementPotential.jl b/src/models/generated/AggregateRetirementPotential.jl new file mode 100644 index 0000000..66f7cbe --- /dev/null +++ b/src/models/generated/AggregateRetirementPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct AggregateRetirementPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + retirement_potential::Float64 + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retirement_potential::Float64`: (default: `0.0`) Amount of pre-existing capacity for a technology that is eligible for retirement +""" +mutable struct AggregateRetirementPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Amount of pre-existing capacity for a technology that is eligible for retirement" + retirement_potential::Float64 +end + + +function AggregateRetirementPotential(; internal=InfrastructureSystemsInternal(), ext=Dict(), retirement_potential=0.0, ) + AggregateRetirementPotential(internal, ext, retirement_potential, ) +end + +# Constructor for demo purposes; non-functional. +function AggregateRetirementPotential(::Nothing) + AggregateRetirementPotential(; + internal=0.0, + ext=0.0, + retirement_potential=0.0, + ) +end + +"""Get [`AggregateRetirementPotential`](@ref) `internal`.""" +get_internal(value::AggregateRetirementPotential) = value.internal +"""Get [`AggregateRetirementPotential`](@ref) `ext`.""" +get_ext(value::AggregateRetirementPotential) = value.ext +"""Get [`AggregateRetirementPotential`](@ref) `retirement_potential`.""" +get_retirement_potential(value::AggregateRetirementPotential) = value.retirement_potential + +"""Set [`AggregateRetirementPotential`](@ref) `internal`.""" +set_internal!(value::AggregateRetirementPotential, val) = value.internal = val +"""Set [`AggregateRetirementPotential`](@ref) `ext`.""" +set_ext!(value::AggregateRetirementPotential, val) = value.ext = val +"""Set [`AggregateRetirementPotential`](@ref) `retirement_potential`.""" +set_retirement_potential!(value::AggregateRetirementPotential, val) = value.retirement_potential = val diff --git a/src/models/generated/AggregateRetrofitPotential.jl b/src/models/generated/AggregateRetrofitPotential.jl new file mode 100644 index 0000000..5f553f8 --- /dev/null +++ b/src/models/generated/AggregateRetrofitPotential.jl @@ -0,0 +1,74 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct AggregateRetrofitPotential <: IS.SupplementalAttribute + retrofit_id::Int64 + retrofit_fraction::Float64 + internal::InfrastructureSystemsInternal + retrofit_potential::Float64 + ext::Dict + end + + + +# Arguments +- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. +- `retrofit_fraction::Float64`: (default: `Dict()`) Fraction of existing capacity that is eligible for retrofits. Alternative to retrofit_potential +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `retrofit_potential::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct AggregateRetrofitPotential <: IS.SupplementalAttribute + "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." + retrofit_id::Int64 + "Fraction of existing capacity that is eligible for retrofits. Alternative to retrofit_potential" + retrofit_fraction::Float64 + "Internal field" + internal::InfrastructureSystemsInternal + "Amount of existing capacity for technology that can be retrofitted" + retrofit_potential::Float64 + "Option for providing additional data" + ext::Dict +end + + +function AggregateRetrofitPotential(; retrofit_id=0, retrofit_fraction=Dict(), internal=InfrastructureSystemsInternal(), retrofit_potential=0.0, ext=Dict(), ) + AggregateRetrofitPotential(retrofit_id, retrofit_fraction, internal, retrofit_potential, ext, ) +end + +# Constructor for demo purposes; non-functional. +function AggregateRetrofitPotential(::Nothing) + AggregateRetrofitPotential(; + retrofit_id=Dict(), + retrofit_fraction=Dict(), + internal=Dict(), + retrofit_potential=Dict(), + ext=Dict(), + ) +end + +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_id`.""" +get_retrofit_id(value::AggregateRetrofitPotential) = value.retrofit_id +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_fraction`.""" +get_retrofit_fraction(value::AggregateRetrofitPotential) = value.retrofit_fraction +"""Get [`AggregateRetrofitPotential`](@ref) `internal`.""" +get_internal(value::AggregateRetrofitPotential) = value.internal +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_potential`.""" +get_retrofit_potential(value::AggregateRetrofitPotential) = value.retrofit_potential +"""Get [`AggregateRetrofitPotential`](@ref) `ext`.""" +get_ext(value::AggregateRetrofitPotential) = value.ext + +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_id`.""" +set_retrofit_id!(value::AggregateRetrofitPotential, val) = value.retrofit_id = val +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_fraction`.""" +set_retrofit_fraction!(value::AggregateRetrofitPotential, val) = value.retrofit_fraction = val +"""Set [`AggregateRetrofitPotential`](@ref) `internal`.""" +set_internal!(value::AggregateRetrofitPotential, val) = value.internal = val +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_potential`.""" +set_retrofit_potential!(value::AggregateRetrofitPotential, val) = value.retrofit_potential = val +"""Set [`AggregateRetrofitPotential`](@ref) `ext`.""" +set_ext!(value::AggregateRetrofitPotential, val) = value.ext = val From 0d5c338a2e2aeb13c0647ab466ba7c31c0d524c3 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 3 Sep 2024 09:13:12 -0600 Subject: [PATCH 58/69] cahnge dictionary to vector in existingcapacity --- src/models/generated/ExistingCapacity.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/models/generated/ExistingCapacity.jl b/src/models/generated/ExistingCapacity.jl index b33a417..c61b8f9 100644 --- a/src/models/generated/ExistingCapacity.jl +++ b/src/models/generated/ExistingCapacity.jl @@ -8,7 +8,7 @@ This file is auto-generated. Do not edit. mutable struct ExistingCapacity <: IS.SupplementalAttribute internal::InfrastructureSystemsInternal ext::Dict - existing_capacity::Dict{String, Dict{String, Float64}} + existing_capacity::Vector{PSY.Generator} end @@ -16,28 +16,28 @@ This file is auto-generated. Do not edit. # Arguments - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `existing_capacity::Dict{String, Dict{String, Float64}}`: (default: `Dict()`) Map SupplyTechnologies to individual units in a zone and their existing capacity +- `existing_capacity::Vector{PSY.Generator}`: (default: `Vector()`) List of individual units to map to a specific SupplyTechnology """ mutable struct ExistingCapacity <: IS.SupplementalAttribute "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "Map SupplyTechnologies to individual units in a zone and their existing capacity" - existing_capacity::Dict{String, Dict{String, Float64}} + "List of individual units to map to a specific SupplyTechnology" + existing_capacity::Vector{PSY.Generator} end -function ExistingCapacity(; internal=InfrastructureSystemsInternal(), ext=Dict(), existing_capacity=Dict(), ) +function ExistingCapacity(; internal=InfrastructureSystemsInternal(), ext=Dict(), existing_capacity=Vector(), ) ExistingCapacity(internal, ext, existing_capacity, ) end # Constructor for demo purposes; non-functional. function ExistingCapacity(::Nothing) ExistingCapacity(; - internal=Dict(), - ext=Dict(), - existing_capacity=Dict(), + internal=Vector(), + ext=Vector(), + existing_capacity=Vector(), ) end From 5013ed641f2b8fe625f4bf63a04d96f99b2cf4c5 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 3 Sep 2024 09:54:11 -0600 Subject: [PATCH 59/69] merged electrolyzers with DemandsideTechnology --- src/models/generated/DemandsideTechnology.jl | 44 +++++++- src/models/generated/Electrolyzers.jl | 111 ------------------- src/models/generated/includes.jl | 13 +-- 3 files changed, 47 insertions(+), 121 deletions(-) delete mode 100644 src/models/generated/Electrolyzers.jl diff --git a/src/models/generated/DemandsideTechnology.jl b/src/models/generated/DemandsideTechnology.jl index 3e6be7d..546f601 100644 --- a/src/models/generated/DemandsideTechnology.jl +++ b/src/models/generated/DemandsideTechnology.jl @@ -6,58 +6,98 @@ This file is auto-generated. Do not edit. """ mutable struct DemandSideTechnology{T <: PSY.StaticInjection} <: Technology + min_power::Float64 name::String + ramp_up_percentage::Float64 power_systems_type::String internal::InfrastructureSystemsInternal + price_per_unit::Float64 ext::Dict + technology_efficiency::Float64 + ramp_dn_percentage::Float64 available::Bool end # Arguments +- `min_power::Float64`: (default: `0.0`) Minimum operation of demandside unit as a fraction of total capacity - `name::String`: The technology name +- `ramp_up_percentage::Float64`: (default: `1.0`) Maximum increase in output between operation periods. Fraction of total capacity - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `price_per_unit::Float64`: (default: `0.0`) Price or value per unit of output. Ex: USD per ton of hydrogen for electrolyzers - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `technology_efficiency::Float64`: (default: `0.0`) MWh of electricity per unit of output. Ex: MWh per ton of hydrogen for electrolyzers +- `ramp_dn_percentage::Float64`: (default: `1.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `available::Bool`: identifies whether the technology is available """ mutable struct DemandSideTechnology{T <: PSY.StaticInjection} <: Technology + "Minimum operation of demandside unit as a fraction of total capacity" + min_power::Float64 "The technology name" name::String + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up_percentage::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal + "Price or value per unit of output. Ex: USD per ton of hydrogen for electrolyzers" + price_per_unit::Float64 "Option for providing additional data" ext::Dict + "MWh of electricity per unit of output. Ex: MWh per ton of hydrogen for electrolyzers" + technology_efficiency::Float64 + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_dn_percentage::Float64 "identifies whether the technology is available" available::Bool end -function DemandSideTechnology{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.StaticInjection - DemandSideTechnology{T}(name, power_systems_type, internal, ext, available, ) +function DemandSideTechnology{T}(; min_power=0.0, name, ramp_up_percentage=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), price_per_unit=0.0, ext=Dict(), technology_efficiency=0.0, ramp_dn_percentage=1.0, available, ) where T <: PSY.StaticInjection + DemandSideTechnology{T}(min_power, name, ramp_up_percentage, power_systems_type, internal, price_per_unit, ext, technology_efficiency, ramp_dn_percentage, available, ) end +"""Get [`DemandSideTechnology`](@ref) `min_power`.""" +get_min_power(value::DemandSideTechnology) = value.min_power """Get [`DemandSideTechnology`](@ref) `name`.""" get_name(value::DemandSideTechnology) = value.name +"""Get [`DemandSideTechnology`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::DemandSideTechnology) = value.ramp_up_percentage """Get [`DemandSideTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::DemandSideTechnology) = value.power_systems_type """Get [`DemandSideTechnology`](@ref) `internal`.""" get_internal(value::DemandSideTechnology) = value.internal +"""Get [`DemandSideTechnology`](@ref) `price_per_unit`.""" +get_price_per_unit(value::DemandSideTechnology) = value.price_per_unit """Get [`DemandSideTechnology`](@ref) `ext`.""" get_ext(value::DemandSideTechnology) = value.ext +"""Get [`DemandSideTechnology`](@ref) `technology_efficiency`.""" +get_technology_efficiency(value::DemandSideTechnology) = value.technology_efficiency +"""Get [`DemandSideTechnology`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::DemandSideTechnology) = value.ramp_dn_percentage """Get [`DemandSideTechnology`](@ref) `available`.""" get_available(value::DemandSideTechnology) = value.available +"""Set [`DemandSideTechnology`](@ref) `min_power`.""" +set_min_power!(value::DemandSideTechnology, val) = value.min_power = val """Set [`DemandSideTechnology`](@ref) `name`.""" set_name!(value::DemandSideTechnology, val) = value.name = val +"""Set [`DemandSideTechnology`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::DemandSideTechnology, val) = value.ramp_up_percentage = val """Set [`DemandSideTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::DemandSideTechnology, val) = value.power_systems_type = val """Set [`DemandSideTechnology`](@ref) `internal`.""" set_internal!(value::DemandSideTechnology, val) = value.internal = val +"""Set [`DemandSideTechnology`](@ref) `price_per_unit`.""" +set_price_per_unit!(value::DemandSideTechnology, val) = value.price_per_unit = val """Set [`DemandSideTechnology`](@ref) `ext`.""" set_ext!(value::DemandSideTechnology, val) = value.ext = val +"""Set [`DemandSideTechnology`](@ref) `technology_efficiency`.""" +set_technology_efficiency!(value::DemandSideTechnology, val) = value.technology_efficiency = val +"""Set [`DemandSideTechnology`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::DemandSideTechnology, val) = value.ramp_dn_percentage = val """Set [`DemandSideTechnology`](@ref) `available`.""" set_available!(value::DemandSideTechnology, val) = value.available = val diff --git a/src/models/generated/Electrolyzers.jl b/src/models/generated/Electrolyzers.jl deleted file mode 100644 index ae02cd8..0000000 --- a/src/models/generated/Electrolyzers.jl +++ /dev/null @@ -1,111 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology - ramp_dn_percentage::Float64 - available::Bool - name::String - hydrogen_mwh_per_tonne::PSY.ValueCurve - power_systems_type::String - internal::InfrastructureSystemsInternal - hydrogen_price_per_tonne::Float64 - ext::Dict - electrolyzer_min_kt::Float64 - min_power::Float64 - ramp_up_percentage::Float64 - end - - - -# Arguments -- `ramp_dn_percentage::Float64`: Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. -- `available::Bool`: identifies whether the technology is available -- `name::String`: The technology name -- `hydrogen_mwh_per_tonne::PSY.ValueCurve`: Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t) -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `hydrogen_price_per_tonne::Float64`: Price (or value) of hydrogen per metric tonne (/t) -- `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `electrolyzer_min_kt::Float64`: Minimum annual quantity of hydrogen that must be produced by electrolyzer in kilotonnes (kt) -- `min_power::Float64`: The minimum generation level for a unit as a fraction of total capacity. -- `ramp_up_percentage::Float64`: Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity. -""" -mutable struct Electrolyzers{T <: PSY.StaticInjection} <: Technology - "Maximum decrease in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." - ramp_dn_percentage::Float64 - "identifies whether the technology is available" - available::Bool - "The technology name" - name::String - "Electrolyzer efficiency in megawatt-hours (MWh) of electricity per metric tonne of hydrogen produced (MWh/t)" - hydrogen_mwh_per_tonne::PSY.ValueCurve - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String - "Internal field" - internal::InfrastructureSystemsInternal - "Price (or value) of hydrogen per metric tonne (/t)" - hydrogen_price_per_tonne::Float64 - "Option for providing additional data" - ext::Dict - "Minimum annual quantity of hydrogen that must be produced by electrolyzer in kilotonnes (kt)" - electrolyzer_min_kt::Float64 - "The minimum generation level for a unit as a fraction of total capacity." - min_power::Float64 - "Maximum increase in power output from between two periods (typically hours), reported as a fraction of nameplate capacity." - ramp_up_percentage::Float64 -end - - -function Electrolyzers{T}(; ramp_dn_percentage, available, name, hydrogen_mwh_per_tonne, power_systems_type, internal=InfrastructureSystemsInternal(), hydrogen_price_per_tonne, ext=Dict(), electrolyzer_min_kt, min_power, ramp_up_percentage, ) where T <: PSY.StaticInjection - Electrolyzers{T}(ramp_dn_percentage, available, name, hydrogen_mwh_per_tonne, power_systems_type, internal, hydrogen_price_per_tonne, ext, electrolyzer_min_kt, min_power, ramp_up_percentage, ) -end - -"""Get [`Electrolyzers`](@ref) `ramp_dn_percentage`.""" -get_ramp_dn_percentage(value::Electrolyzers) = value.ramp_dn_percentage -"""Get [`Electrolyzers`](@ref) `available`.""" -get_available(value::Electrolyzers) = value.available -"""Get [`Electrolyzers`](@ref) `name`.""" -get_name(value::Electrolyzers) = value.name -"""Get [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" -get_hydrogen_mwh_per_tonne(value::Electrolyzers) = value.hydrogen_mwh_per_tonne -"""Get [`Electrolyzers`](@ref) `power_systems_type`.""" -get_power_systems_type(value::Electrolyzers) = value.power_systems_type -"""Get [`Electrolyzers`](@ref) `internal`.""" -get_internal(value::Electrolyzers) = value.internal -"""Get [`Electrolyzers`](@ref) `hydrogen_price_per_tonne`.""" -get_hydrogen_price_per_tonne(value::Electrolyzers) = value.hydrogen_price_per_tonne -"""Get [`Electrolyzers`](@ref) `ext`.""" -get_ext(value::Electrolyzers) = value.ext -"""Get [`Electrolyzers`](@ref) `electrolyzer_min_kt`.""" -get_electrolyzer_min_kt(value::Electrolyzers) = value.electrolyzer_min_kt -"""Get [`Electrolyzers`](@ref) `min_power`.""" -get_min_power(value::Electrolyzers) = value.min_power -"""Get [`Electrolyzers`](@ref) `ramp_up_percentage`.""" -get_ramp_up_percentage(value::Electrolyzers) = value.ramp_up_percentage - -"""Set [`Electrolyzers`](@ref) `ramp_dn_percentage`.""" -set_ramp_dn_percentage!(value::Electrolyzers, val) = value.ramp_dn_percentage = val -"""Set [`Electrolyzers`](@ref) `available`.""" -set_available!(value::Electrolyzers, val) = value.available = val -"""Set [`Electrolyzers`](@ref) `name`.""" -set_name!(value::Electrolyzers, val) = value.name = val -"""Set [`Electrolyzers`](@ref) `hydrogen_mwh_per_tonne`.""" -set_hydrogen_mwh_per_tonne!(value::Electrolyzers, val) = value.hydrogen_mwh_per_tonne = val -"""Set [`Electrolyzers`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::Electrolyzers, val) = value.power_systems_type = val -"""Set [`Electrolyzers`](@ref) `internal`.""" -set_internal!(value::Electrolyzers, val) = value.internal = val -"""Set [`Electrolyzers`](@ref) `hydrogen_price_per_tonne`.""" -set_hydrogen_price_per_tonne!(value::Electrolyzers, val) = value.hydrogen_price_per_tonne = val -"""Set [`Electrolyzers`](@ref) `ext`.""" -set_ext!(value::Electrolyzers, val) = value.ext = val -"""Set [`Electrolyzers`](@ref) `electrolyzer_min_kt`.""" -set_electrolyzer_min_kt!(value::Electrolyzers, val) = value.electrolyzer_min_kt = val -"""Set [`Electrolyzers`](@ref) `min_power`.""" -set_min_power!(value::Electrolyzers, val) = value.min_power = val -"""Set [`Electrolyzers`](@ref) `ramp_up_percentage`.""" -set_ramp_up_percentage!(value::Electrolyzers, val) = value.ramp_up_percentage = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 7d4d1bd..25bd809 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,4 +1,4 @@ -include("Electrolyzers.jl") +include("Zone.jl") include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") include("DemandRequirement.jl") @@ -8,7 +8,6 @@ include("CoLocatedSupplyStorageTechnology.jl") include("AggregateRetrofitPotential.jl") include("DemandSideTechnology.jl") include("AggregateRetirementPotential.jl") -include("Zone.jl") include("StorageTechnology.jl") include("CarbonCaps.jl") include("TransportTechnology.jl") @@ -46,7 +45,6 @@ export get_efficiency_down_ac export get_efficiency_down_dc export get_efficiency_up_ac export get_efficiency_up_dc -export get_electrolyzer_min_kt export get_eligible_resources export get_eligible_zones export get_end_region @@ -59,8 +57,6 @@ export get_fixed_om_cost_per_mwhyr export get_fuel export get_gen_ID export get_heat_rate_mmbtu_per_mwh -export get_hydrogen_mwh_per_tonne -export get_hydrogen_price_per_tonne export get_id export get_initial_capacity_energy export get_initial_capacity_inverter @@ -109,6 +105,7 @@ export get_operations_cost_inv export get_operations_cost_power export get_outage_factor export get_power_systems_type +export get_price_per_unit export get_pricecap export get_prime_mover_type export get_ramp_dn_percentage @@ -130,6 +127,7 @@ export get_start_cost_per_mw export get_start_fuel_mmbtu_per_mw export get_start_region export get_storage_tech +export get_technology_efficiency export get_up_time export get_var_cost_per_mwh export get_voll @@ -166,7 +164,6 @@ export set_efficiency_down_ac! export set_efficiency_down_dc! export set_efficiency_up_ac! export set_efficiency_up_dc! -export set_electrolyzer_min_kt! export set_eligible_resources! export set_eligible_zones! export set_end_region! @@ -179,8 +176,6 @@ export set_fixed_om_cost_per_mwhyr! export set_fuel! export set_gen_ID! export set_heat_rate_mmbtu_per_mwh! -export set_hydrogen_mwh_per_tonne! -export set_hydrogen_price_per_tonne! export set_id! export set_initial_capacity_energy! export set_initial_capacity_inverter! @@ -229,6 +224,7 @@ export set_operations_cost_inv! export set_operations_cost_power! export set_outage_factor! export set_power_systems_type! +export set_price_per_unit! export set_pricecap! export set_prime_mover_type! export set_ramp_dn_percentage! @@ -250,6 +246,7 @@ export set_start_cost_per_mw! export set_start_fuel_mmbtu_per_mw! export set_start_region! export set_storage_tech! +export set_technology_efficiency! export set_up_time! export set_var_cost_per_mwh! export set_voll! From 33168332983b2a264d94c9cca44f6e42abab302a Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 14:00:44 -0600 Subject: [PATCH 60/69] update field names --- src/models/generated/DemandRequirement.jl | 20 +- src/models/generated/StorageTechnology.jl | 224 ++++++++++------------ src/models/generated/SupplyTechnology.jl | 164 ++++++++-------- 3 files changed, 188 insertions(+), 220 deletions(-) diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index 96fc8de..d9485ba 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -10,8 +10,8 @@ This file is auto-generated. Do not edit. zone::Int64 power_systems_type::String internal::InfrastructureSystemsInternal - demand_mw_z::Float64 ext::Dict + demand_mw::Float64 region::String available::Bool end @@ -23,8 +23,8 @@ This file is auto-generated. Do not edit. - `zone::Int64`: Zone Number - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `demand_mw_z::Float64`: (default: `0.0`) Demand profile in MW - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `demand_mw::Float64`: (default: `0.0`) Demand profile in MW - `region::String`: Corresponding region for peak demand - `available::Bool`: (default: `true`) identifies whether the technology is available """ @@ -37,10 +37,10 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal - "Demand profile in MW" - demand_mw_z::Float64 "Option for providing additional data" ext::Dict + "Demand profile in MW" + demand_mw::Float64 "Corresponding region for peak demand" region::String "identifies whether the technology is available" @@ -48,8 +48,8 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology end -function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), demand_mw_z=0.0, ext=Dict(), region, available=true, ) where T <: PSY.StaticInjection - DemandRequirement{T}(name, zone, power_systems_type, internal, demand_mw_z, ext, region, available, ) +function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), demand_mw=0.0, region, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, zone, power_systems_type, internal, ext, demand_mw, region, available, ) end """Get [`DemandRequirement`](@ref) `name`.""" @@ -60,10 +60,10 @@ get_zone(value::DemandRequirement) = value.zone get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal -"""Get [`DemandRequirement`](@ref) `demand_mw_z`.""" -get_demand_mw_z(value::DemandRequirement) = value.demand_mw_z """Get [`DemandRequirement`](@ref) `ext`.""" get_ext(value::DemandRequirement) = value.ext +"""Get [`DemandRequirement`](@ref) `demand_mw`.""" +get_demand_mw(value::DemandRequirement) = value.demand_mw """Get [`DemandRequirement`](@ref) `region`.""" get_region(value::DemandRequirement) = value.region """Get [`DemandRequirement`](@ref) `available`.""" @@ -77,10 +77,10 @@ set_zone!(value::DemandRequirement, val) = value.zone = val set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val -"""Set [`DemandRequirement`](@ref) `demand_mw_z`.""" -set_demand_mw_z!(value::DemandRequirement, val) = value.demand_mw_z = val """Set [`DemandRequirement`](@ref) `ext`.""" set_ext!(value::DemandRequirement, val) = value.ext = val +"""Set [`DemandRequirement`](@ref) `demand_mw`.""" +set_demand_mw!(value::DemandRequirement, val) = value.demand_mw = val """Set [`DemandRequirement`](@ref) `region`.""" set_region!(value::DemandRequirement, val) = value.region = val """Set [`DemandRequirement`](@ref) `available`.""" diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 851332b..93fc914 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -7,305 +7,273 @@ This file is auto-generated. Do not edit. """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology base_power::Float64 - om_costs_charge::PSY.OperationalCost + om_costs_energy::PSY.OperationalCost zone::Int64 prime_mover_type::PrimeMovers + existing_cap_energy::Float64 rsv_cost::Float64 available::Bool - fixed_om_cost_per_mwhyr::PSY.ValueCurve + existing_cap_power::Float64 name::String storage_tech::StorageTech + capital_costs_power::PSY.ValueCurve max_duration::Float64 - max_cap_mw::Float64 - inv_cost_charge_per_mwyr::PSY.ValueCurve id::Int64 - existing_cap_mw::Float64 - existing_cap_mwh::Float64 - self_disch::Float64 + min_cap_power::Float64 + capital_costs_energy::PSY.ValueCurve + losses::Float64 eff_down::Float64 - max_cap_mwh::Float64 rsv_max::Float64 - inv_cost_per_mwhyr::PSY.ValueCurve + max_cap_power::Float64 power_systems_type::String internal::InfrastructureSystemsInternal - min_charge_cap_mw::Float64 + om_costs_power::PSY.OperationalCost balancing_topology::String - ext::Dict + min_cap_energy::Float64 region::String eff_up::Float64 - max_charge_cap_mw::Float64 - min_cap_mw::Float64 - inv_cost_per_mwyr::PSY.ValueCurve + ext::Dict cluster::Int64 reg_cost::Float64 min_duration::Float64 - min_cap_mwh::Float64 + max_cap_energy::Float64 reg_max::Float64 - om_costs::PSY.OperationalCost end # Arguments - `base_power::Float64`: Base power -- `om_costs_charge::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology +- `om_costs_energy::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology - `zone::Int64`: Zone number - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator +- `existing_cap_energy::Float64`: Pre-existing energy capacity for a technology (MWh) - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `available::Bool`: identifies whether the technology is available -- `fixed_om_cost_per_mwhyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Fixed and variable O&M costs for a technology +- `existing_cap_power::Float64`: Pre-existing power capacity for a technology (MW) - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type +- `capital_costs_power::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. - `max_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology -- `max_cap_mw::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology -- `inv_cost_charge_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. - `id::Int64`: ID for individual generator -- `existing_cap_mw::Float64`: Pre-existing power capacity for a technology (MW) -- `existing_cap_mwh::Float64`: Pre-existing energy capacity for a technology (MWh) -- `self_disch::Float64`: (default: `1.0`) Efficiency of discharging storage +- `min_cap_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology +- `capital_costs_energy::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `losses::Float64`: (default: `1.0`) Efficiency of discharging storage - `eff_down::Float64`: (default: `1.0`) Efficiency of discharging storage -- `max_cap_mwh::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. -- `inv_cost_per_mwhyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for energy capacity of storage technology +- `max_cap_power::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `min_charge_cap_mw::Float64`: (default: `-1`) Minimum required charge capacity for a storage technology +- `om_costs_power::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology - `balancing_topology::String`: Set of balancing nodes -- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `min_cap_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology - `region::String`: Region/zone technology operates in - `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage -- `max_charge_cap_mw::Float64`: (default: `-1`) Maximum allowable installed charge capacity for a storage technology -- `min_cap_mw::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology -- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `ext::Dict`: (default: `Dict()`) Option for providing additional data - `cluster::Int64`: (default: `0`) Cluster - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves - `min_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology -- `min_cap_mwh::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology +- `max_cap_energy::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves -- `om_costs::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology "Base power" base_power::Float64 "Fixed and variable O&M costs for a technology" - om_costs_charge::PSY.OperationalCost + om_costs_energy::PSY.OperationalCost "Zone number" zone::Int64 "Prime mover for generator" prime_mover_type::PrimeMovers + "Pre-existing energy capacity for a technology (MWh)" + existing_cap_energy::Float64 "Cost of providing upwards spinning or contingency reserves" rsv_cost::Float64 "identifies whether the technology is available" available::Bool - "Fixed and variable O&M costs for a technology" - fixed_om_cost_per_mwhyr::PSY.ValueCurve + "Pre-existing power capacity for a technology (MW)" + existing_cap_power::Float64 "The technology name" name::String "Storage Technology Type" storage_tech::StorageTech + "Capital costs for investing in a technology." + capital_costs_power::PSY.ValueCurve "Maximum allowable durection for a storage technology" max_duration::Float64 - "Maximum allowable installed power capacity for a storage technology" - max_cap_mw::Float64 - "Capital costs for investing in a technology." - inv_cost_charge_per_mwyr::PSY.ValueCurve "ID for individual generator" id::Int64 - "Pre-existing power capacity for a technology (MW)" - existing_cap_mw::Float64 - "Pre-existing energy capacity for a technology (MWh)" - existing_cap_mwh::Float64 + "Minimum required power capacity for a storage technology" + min_cap_power::Float64 + "Capital costs for investing in a technology." + capital_costs_energy::PSY.ValueCurve "Efficiency of discharging storage" - self_disch::Float64 + losses::Float64 "Efficiency of discharging storage" eff_down::Float64 - "Maximum allowable installed energy capacity for a storage technology" - max_cap_mwh::Float64 "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." rsv_max::Float64 - "Capital costs for energy capacity of storage technology" - inv_cost_per_mwhyr::PSY.ValueCurve + "Maximum allowable installed power capacity for a storage technology" + max_cap_power::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal - "Minimum required charge capacity for a storage technology" - min_charge_cap_mw::Float64 + "Fixed and variable O&M costs for a technology" + om_costs_power::PSY.OperationalCost "Set of balancing nodes" balancing_topology::String - "Option for providing additional data" - ext::Dict + "Minimum required energy capacity for a storage technology" + min_cap_energy::Float64 "Region/zone technology operates in" region::String "Efficiency of charging storage" eff_up::Float64 - "Maximum allowable installed charge capacity for a storage technology" - max_charge_cap_mw::Float64 - "Minimum required power capacity for a storage technology" - min_cap_mw::Float64 - "Capital costs for investing in a technology." - inv_cost_per_mwyr::PSY.ValueCurve + "Option for providing additional data" + ext::Dict "Cluster" cluster::Int64 "Cost of providing regulation reserves " reg_cost::Float64 "Minimum required durection for a storage technology" min_duration::Float64 - "Minimum required energy capacity for a storage technology" - min_cap_mwh::Float64 + "Maximum allowable installed energy capacity for a storage technology" + max_cap_energy::Float64 "Fraction of nameplate capacity that can committed to provided regulation reserves" reg_max::Float64 - "Fixed and variable O&M costs for a technology" - om_costs::PSY.OperationalCost end -function StorageTechnology{T}(; base_power, om_costs_charge=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, rsv_cost=0.0, available, fixed_om_cost_per_mwhyr=LinearCurve(0.0), name, storage_tech, max_duration=1000.0, max_cap_mw=-1, inv_cost_charge_per_mwyr=LinearCurve(0.0), id, existing_cap_mw, existing_cap_mwh, self_disch=1.0, eff_down=1.0, max_cap_mwh=-1, rsv_max=0.0, inv_cost_per_mwhyr=LinearCurve(0.0), power_systems_type, internal=InfrastructureSystemsInternal(), min_charge_cap_mw=-1, balancing_topology, ext=Dict(), region, eff_up=1.0, max_charge_cap_mw=-1, min_cap_mw=0.0, inv_cost_per_mwyr=LinearCurve(0.0), cluster=0, reg_cost=0.0, min_duration=0.0, min_cap_mwh=0.0, reg_max=0.0, om_costs=StorageCost(), ) where T <: PSY.Storage - StorageTechnology{T}(base_power, om_costs_charge, zone, prime_mover_type, rsv_cost, available, fixed_om_cost_per_mwhyr, name, storage_tech, max_duration, max_cap_mw, inv_cost_charge_per_mwyr, id, existing_cap_mw, existing_cap_mwh, self_disch, eff_down, max_cap_mwh, rsv_max, inv_cost_per_mwhyr, power_systems_type, internal, min_charge_cap_mw, balancing_topology, ext, region, eff_up, max_charge_cap_mw, min_cap_mw, inv_cost_per_mwyr, cluster, reg_cost, min_duration, min_cap_mwh, reg_max, om_costs, ) +function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy, rsv_cost=0.0, available, existing_cap_power, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=-1, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, region, eff_up=1.0, ext=Dict(), cluster=0, reg_cost=0.0, min_duration=0.0, max_cap_energy=-1, reg_max=0.0, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, region, eff_up, ext, cluster, reg_cost, min_duration, max_cap_energy, reg_max, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" get_base_power(value::StorageTechnology) = value.base_power -"""Get [`StorageTechnology`](@ref) `om_costs_charge`.""" -get_om_costs_charge(value::StorageTechnology) = value.om_costs_charge +"""Get [`StorageTechnology`](@ref) `om_costs_energy`.""" +get_om_costs_energy(value::StorageTechnology) = value.om_costs_energy """Get [`StorageTechnology`](@ref) `zone`.""" get_zone(value::StorageTechnology) = value.zone """Get [`StorageTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type +"""Get [`StorageTechnology`](@ref) `existing_cap_energy`.""" +get_existing_cap_energy(value::StorageTechnology) = value.existing_cap_energy """Get [`StorageTechnology`](@ref) `rsv_cost`.""" get_rsv_cost(value::StorageTechnology) = value.rsv_cost """Get [`StorageTechnology`](@ref) `available`.""" get_available(value::StorageTechnology) = value.available -"""Get [`StorageTechnology`](@ref) `fixed_om_cost_per_mwhyr`.""" -get_fixed_om_cost_per_mwhyr(value::StorageTechnology) = value.fixed_om_cost_per_mwhyr +"""Get [`StorageTechnology`](@ref) `existing_cap_power`.""" +get_existing_cap_power(value::StorageTechnology) = value.existing_cap_power """Get [`StorageTechnology`](@ref) `name`.""" get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech +"""Get [`StorageTechnology`](@ref) `capital_costs_power`.""" +get_capital_costs_power(value::StorageTechnology) = value.capital_costs_power """Get [`StorageTechnology`](@ref) `max_duration`.""" get_max_duration(value::StorageTechnology) = value.max_duration -"""Get [`StorageTechnology`](@ref) `max_cap_mw`.""" -get_max_cap_mw(value::StorageTechnology) = value.max_cap_mw -"""Get [`StorageTechnology`](@ref) `inv_cost_charge_per_mwyr`.""" -get_inv_cost_charge_per_mwyr(value::StorageTechnology) = value.inv_cost_charge_per_mwyr """Get [`StorageTechnology`](@ref) `id`.""" get_id(value::StorageTechnology) = value.id -"""Get [`StorageTechnology`](@ref) `existing_cap_mw`.""" -get_existing_cap_mw(value::StorageTechnology) = value.existing_cap_mw -"""Get [`StorageTechnology`](@ref) `existing_cap_mwh`.""" -get_existing_cap_mwh(value::StorageTechnology) = value.existing_cap_mwh -"""Get [`StorageTechnology`](@ref) `self_disch`.""" -get_self_disch(value::StorageTechnology) = value.self_disch +"""Get [`StorageTechnology`](@ref) `min_cap_power`.""" +get_min_cap_power(value::StorageTechnology) = value.min_cap_power +"""Get [`StorageTechnology`](@ref) `capital_costs_energy`.""" +get_capital_costs_energy(value::StorageTechnology) = value.capital_costs_energy +"""Get [`StorageTechnology`](@ref) `losses`.""" +get_losses(value::StorageTechnology) = value.losses """Get [`StorageTechnology`](@ref) `eff_down`.""" get_eff_down(value::StorageTechnology) = value.eff_down -"""Get [`StorageTechnology`](@ref) `max_cap_mwh`.""" -get_max_cap_mwh(value::StorageTechnology) = value.max_cap_mwh """Get [`StorageTechnology`](@ref) `rsv_max`.""" get_rsv_max(value::StorageTechnology) = value.rsv_max -"""Get [`StorageTechnology`](@ref) `inv_cost_per_mwhyr`.""" -get_inv_cost_per_mwhyr(value::StorageTechnology) = value.inv_cost_per_mwhyr +"""Get [`StorageTechnology`](@ref) `max_cap_power`.""" +get_max_cap_power(value::StorageTechnology) = value.max_cap_power """Get [`StorageTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::StorageTechnology) = value.power_systems_type """Get [`StorageTechnology`](@ref) `internal`.""" get_internal(value::StorageTechnology) = value.internal -"""Get [`StorageTechnology`](@ref) `min_charge_cap_mw`.""" -get_min_charge_cap_mw(value::StorageTechnology) = value.min_charge_cap_mw +"""Get [`StorageTechnology`](@ref) `om_costs_power`.""" +get_om_costs_power(value::StorageTechnology) = value.om_costs_power """Get [`StorageTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::StorageTechnology) = value.balancing_topology -"""Get [`StorageTechnology`](@ref) `ext`.""" -get_ext(value::StorageTechnology) = value.ext +"""Get [`StorageTechnology`](@ref) `min_cap_energy`.""" +get_min_cap_energy(value::StorageTechnology) = value.min_cap_energy """Get [`StorageTechnology`](@ref) `region`.""" get_region(value::StorageTechnology) = value.region """Get [`StorageTechnology`](@ref) `eff_up`.""" get_eff_up(value::StorageTechnology) = value.eff_up -"""Get [`StorageTechnology`](@ref) `max_charge_cap_mw`.""" -get_max_charge_cap_mw(value::StorageTechnology) = value.max_charge_cap_mw -"""Get [`StorageTechnology`](@ref) `min_cap_mw`.""" -get_min_cap_mw(value::StorageTechnology) = value.min_cap_mw -"""Get [`StorageTechnology`](@ref) `inv_cost_per_mwyr`.""" -get_inv_cost_per_mwyr(value::StorageTechnology) = value.inv_cost_per_mwyr +"""Get [`StorageTechnology`](@ref) `ext`.""" +get_ext(value::StorageTechnology) = value.ext """Get [`StorageTechnology`](@ref) `cluster`.""" get_cluster(value::StorageTechnology) = value.cluster """Get [`StorageTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::StorageTechnology) = value.reg_cost """Get [`StorageTechnology`](@ref) `min_duration`.""" get_min_duration(value::StorageTechnology) = value.min_duration -"""Get [`StorageTechnology`](@ref) `min_cap_mwh`.""" -get_min_cap_mwh(value::StorageTechnology) = value.min_cap_mwh +"""Get [`StorageTechnology`](@ref) `max_cap_energy`.""" +get_max_cap_energy(value::StorageTechnology) = value.max_cap_energy """Get [`StorageTechnology`](@ref) `reg_max`.""" get_reg_max(value::StorageTechnology) = value.reg_max -"""Get [`StorageTechnology`](@ref) `om_costs`.""" -get_om_costs(value::StorageTechnology) = value.om_costs """Set [`StorageTechnology`](@ref) `base_power`.""" set_base_power!(value::StorageTechnology, val) = value.base_power = val -"""Set [`StorageTechnology`](@ref) `om_costs_charge`.""" -set_om_costs_charge!(value::StorageTechnology, val) = value.om_costs_charge = val +"""Set [`StorageTechnology`](@ref) `om_costs_energy`.""" +set_om_costs_energy!(value::StorageTechnology, val) = value.om_costs_energy = val """Set [`StorageTechnology`](@ref) `zone`.""" set_zone!(value::StorageTechnology, val) = value.zone = val """Set [`StorageTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val +"""Set [`StorageTechnology`](@ref) `existing_cap_energy`.""" +set_existing_cap_energy!(value::StorageTechnology, val) = value.existing_cap_energy = val """Set [`StorageTechnology`](@ref) `rsv_cost`.""" set_rsv_cost!(value::StorageTechnology, val) = value.rsv_cost = val """Set [`StorageTechnology`](@ref) `available`.""" set_available!(value::StorageTechnology, val) = value.available = val -"""Set [`StorageTechnology`](@ref) `fixed_om_cost_per_mwhyr`.""" -set_fixed_om_cost_per_mwhyr!(value::StorageTechnology, val) = value.fixed_om_cost_per_mwhyr = val +"""Set [`StorageTechnology`](@ref) `existing_cap_power`.""" +set_existing_cap_power!(value::StorageTechnology, val) = value.existing_cap_power = val """Set [`StorageTechnology`](@ref) `name`.""" set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val +"""Set [`StorageTechnology`](@ref) `capital_costs_power`.""" +set_capital_costs_power!(value::StorageTechnology, val) = value.capital_costs_power = val """Set [`StorageTechnology`](@ref) `max_duration`.""" set_max_duration!(value::StorageTechnology, val) = value.max_duration = val -"""Set [`StorageTechnology`](@ref) `max_cap_mw`.""" -set_max_cap_mw!(value::StorageTechnology, val) = value.max_cap_mw = val -"""Set [`StorageTechnology`](@ref) `inv_cost_charge_per_mwyr`.""" -set_inv_cost_charge_per_mwyr!(value::StorageTechnology, val) = value.inv_cost_charge_per_mwyr = val """Set [`StorageTechnology`](@ref) `id`.""" set_id!(value::StorageTechnology, val) = value.id = val -"""Set [`StorageTechnology`](@ref) `existing_cap_mw`.""" -set_existing_cap_mw!(value::StorageTechnology, val) = value.existing_cap_mw = val -"""Set [`StorageTechnology`](@ref) `existing_cap_mwh`.""" -set_existing_cap_mwh!(value::StorageTechnology, val) = value.existing_cap_mwh = val -"""Set [`StorageTechnology`](@ref) `self_disch`.""" -set_self_disch!(value::StorageTechnology, val) = value.self_disch = val +"""Set [`StorageTechnology`](@ref) `min_cap_power`.""" +set_min_cap_power!(value::StorageTechnology, val) = value.min_cap_power = val +"""Set [`StorageTechnology`](@ref) `capital_costs_energy`.""" +set_capital_costs_energy!(value::StorageTechnology, val) = value.capital_costs_energy = val +"""Set [`StorageTechnology`](@ref) `losses`.""" +set_losses!(value::StorageTechnology, val) = value.losses = val """Set [`StorageTechnology`](@ref) `eff_down`.""" set_eff_down!(value::StorageTechnology, val) = value.eff_down = val -"""Set [`StorageTechnology`](@ref) `max_cap_mwh`.""" -set_max_cap_mwh!(value::StorageTechnology, val) = value.max_cap_mwh = val """Set [`StorageTechnology`](@ref) `rsv_max`.""" set_rsv_max!(value::StorageTechnology, val) = value.rsv_max = val -"""Set [`StorageTechnology`](@ref) `inv_cost_per_mwhyr`.""" -set_inv_cost_per_mwhyr!(value::StorageTechnology, val) = value.inv_cost_per_mwhyr = val +"""Set [`StorageTechnology`](@ref) `max_cap_power`.""" +set_max_cap_power!(value::StorageTechnology, val) = value.max_cap_power = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::StorageTechnology, val) = value.power_systems_type = val """Set [`StorageTechnology`](@ref) `internal`.""" set_internal!(value::StorageTechnology, val) = value.internal = val -"""Set [`StorageTechnology`](@ref) `min_charge_cap_mw`.""" -set_min_charge_cap_mw!(value::StorageTechnology, val) = value.min_charge_cap_mw = val +"""Set [`StorageTechnology`](@ref) `om_costs_power`.""" +set_om_costs_power!(value::StorageTechnology, val) = value.om_costs_power = val """Set [`StorageTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val -"""Set [`StorageTechnology`](@ref) `ext`.""" -set_ext!(value::StorageTechnology, val) = value.ext = val +"""Set [`StorageTechnology`](@ref) `min_cap_energy`.""" +set_min_cap_energy!(value::StorageTechnology, val) = value.min_cap_energy = val """Set [`StorageTechnology`](@ref) `region`.""" set_region!(value::StorageTechnology, val) = value.region = val """Set [`StorageTechnology`](@ref) `eff_up`.""" set_eff_up!(value::StorageTechnology, val) = value.eff_up = val -"""Set [`StorageTechnology`](@ref) `max_charge_cap_mw`.""" -set_max_charge_cap_mw!(value::StorageTechnology, val) = value.max_charge_cap_mw = val -"""Set [`StorageTechnology`](@ref) `min_cap_mw`.""" -set_min_cap_mw!(value::StorageTechnology, val) = value.min_cap_mw = val -"""Set [`StorageTechnology`](@ref) `inv_cost_per_mwyr`.""" -set_inv_cost_per_mwyr!(value::StorageTechnology, val) = value.inv_cost_per_mwyr = val +"""Set [`StorageTechnology`](@ref) `ext`.""" +set_ext!(value::StorageTechnology, val) = value.ext = val """Set [`StorageTechnology`](@ref) `cluster`.""" set_cluster!(value::StorageTechnology, val) = value.cluster = val """Set [`StorageTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val """Set [`StorageTechnology`](@ref) `min_duration`.""" set_min_duration!(value::StorageTechnology, val) = value.min_duration = val -"""Set [`StorageTechnology`](@ref) `min_cap_mwh`.""" -set_min_cap_mwh!(value::StorageTechnology, val) = value.min_cap_mwh = val +"""Set [`StorageTechnology`](@ref) `max_cap_energy`.""" +set_max_cap_energy!(value::StorageTechnology, val) = value.max_cap_energy = val """Set [`StorageTechnology`](@ref) `reg_max`.""" set_reg_max!(value::StorageTechnology, val) = value.reg_max = val -"""Set [`StorageTechnology`](@ref) `om_costs`.""" -set_om_costs!(value::StorageTechnology, val) = value.om_costs = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 1c20a02..c6c8b1d 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -10,20 +10,21 @@ This file is auto-generated. Do not edit. heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} zone::Zone prime_mover_type::PrimeMovers - outage_factor::Float64 + minimum_required_capacity::Float64 cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} + capital_costs::PSY.ValueCurve rsv_cost::Float64 cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} + gen_ID::Int64 available::Bool - cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} name::String + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} ramp_dn_percentage::Float64 - max_cap_mw::Float64 - id::Int64 - existing_cap_mw::Float64 down_time::Float64 + initial_capacity::Float64 start_fuel_mmbtu_per_mw::Float64 + operation_costs::PSY.OperationalCost rsv_max::Float64 fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} power_systems_type::String @@ -32,19 +33,18 @@ This file is auto-generated. Do not edit. ext::Dict balancing_topology::String region::String + maximum_capacity::Float64 min_power::Float64 cluster::Int64 - inv_cost_per_mwyr::PSY.ValueCurve - min_cap_mw::Float64 - ramp_up_percentage::Float64 maintenance_duration::Int64 + ramp_up_percentage::Float64 maintenance_cycle_length_years::Int64 reg_cost::Float64 start_cost_per_mw::Float64 cap_size::Float64 - reg_max::Float64 + capacity_factor::Float64 up_time::Float64 - om_costs::PSY.OperationalCost + reg_max::Float64 maintenance_begin_cadence::Int64 end @@ -55,20 +55,21 @@ This file is auto-generated. Do not edit. - `heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh - `zone::Zone`: (default: `nothing`) Zone where tech operates in - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology +- `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator +- `capital_costs::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator +- `gen_ID::Int64`: ID for individual generator - `available::Bool`: (default: `True`) identifies whether the technology is available -- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator - `co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}}`: (default: `0.0`) Carbon Intensity of fuel - `name::String`: The technology name +- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator - `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity -- `max_cap_mw::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology -- `id::Int64`: ID for individual generator -- `existing_cap_mw::Float64`: (default: `0.0`) Pre-existing capacity for a technology - `down_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to remain in the shutdown state. +- `initial_capacity::Float64`: (default: `0.0`) Pre-existing capacity for a technology - `start_fuel_mmbtu_per_mw::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) +- `operation_costs::PSY.OperationalCost`: (default: `ThermalGenerationCost()`) Fixed and variable O&M costs for a technology - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling @@ -77,19 +78,18 @@ This file is auto-generated. Do not edit. - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes - `region::String`: Region/zone technology operates in +- `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology - `min_power::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. -- `inv_cost_per_mwyr::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. -- `min_cap_mw::Float64`: (default: `0.0`) Minimum required capacity for a technology -- `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity - `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. +- `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity - `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves - `start_cost_per_mw::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). - `cap_size::Float64`: (default: `1.0`) Cap_size -- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves +- `capacity_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. -- `om_costs::PSY.OperationalCost`: (default: `ThermalGenerationCost()`) Fixed and variable O&M costs for a technology +- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves - `maintenance_begin_cadence::Int64`: (default: `1`) Cadence of timesteps in which scheduled maintenance can begin. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology @@ -101,34 +101,36 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology zone::Zone "Prime mover for generator" prime_mover_type::PrimeMovers - "Derating factor to account for planned or forced outages of a technology" - outage_factor::Float64 + "Minimum required capacity for a technology" + minimum_required_capacity::Float64 "Minimum blending level of each fuel during normal generation process for multi-fuel generator" cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} + "Capital costs for investing in a technology." + capital_costs::PSY.ValueCurve "Cost of providing upwards spinning or contingency reserves" rsv_cost::Float64 "Maximum blending level of each fuel during start-up process for multi-fuel generator" cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} + "ID for individual generator" + gen_ID::Int64 "identifies whether the technology is available" available::Bool - "Minimum blending level of each fuel during start-up process for multi-fuel generator" - cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Carbon Intensity of fuel" co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} "The technology name" name::String + "Minimum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Maximum decrease in output between operation periods. Fraction of total capacity" ramp_dn_percentage::Float64 - "Maximum allowable installed capacity for a technology" - max_cap_mw::Float64 - "ID for individual generator" - id::Int64 - "Pre-existing capacity for a technology" - existing_cap_mw::Float64 "Minimum amount of time a resource has to remain in the shutdown state." down_time::Float64 + "Pre-existing capacity for a technology" + initial_capacity::Float64 "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" start_fuel_mmbtu_per_mw::Float64 + "Fixed and variable O&M costs for a technology" + operation_costs::PSY.OperationalCost "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." rsv_max::Float64 "Fuel type according to IEA" @@ -145,18 +147,16 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology balancing_topology::String "Region/zone technology operates in" region::String + "Maximum allowable installed capacity for a technology" + maximum_capacity::Float64 "Minimum generation as a fraction of total capacity" min_power::Float64 "Number of the cluster when representing multiple clusters of a given technology in a given region." cluster::Int64 - "Capital costs for investing in a technology." - inv_cost_per_mwyr::PSY.ValueCurve - "Minimum required capacity for a technology" - min_cap_mw::Float64 - "Maximum increase in output between operation periods. Fraction of total capacity" - ramp_up_percentage::Float64 "Duration of the maintenance period, in number of timesteps." maintenance_duration::Int64 + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up_percentage::Float64 "Length of scheduled maintenance cycle, in years." maintenance_cycle_length_years::Int64 "Cost of providing regulation reserves " @@ -165,19 +165,19 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology start_cost_per_mw::Float64 "Cap_size" cap_size::Float64 - "Fraction of nameplate capacity that can committed to provided regulation reserves" - reg_max::Float64 + "Derating factor to account for planned or forced outages of a technology" + capacity_factor::Float64 "Minimum amount of time a resource has to stay in the committed state." up_time::Float64 - "Fixed and variable O&M costs for a technology" - om_costs::PSY.OperationalCost + "Fraction of nameplate capacity that can committed to provided regulation reserves" + reg_max::Float64 "Cadence of timesteps in which scheduled maintenance can begin." maintenance_begin_cadence::Int64 end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, outage_factor=1.0, cofire_level_min=nothing, rsv_cost=0.0, cofire_start_max=nothing, available=True, cofire_start_min=nothing, co2=0.0, name, ramp_dn_percentage=100.0, max_cap_mw=Inf, id, existing_cap_mw=0.0, down_time=0.0, start_fuel_mmbtu_per_mw=0.0, rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, min_power=0.0, cluster=1, inv_cost_per_mwyr=LinearCurve(0.0), min_cap_mw=0.0, ramp_up_percentage=100.0, maintenance_duration=0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, reg_max=0.0, up_time=0.0, om_costs=ThermalGenerationCost(), maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, outage_factor, cofire_level_min, rsv_cost, cofire_start_max, available, cofire_start_min, co2, name, ramp_dn_percentage, max_cap_mw, id, existing_cap_mw, down_time, start_fuel_mmbtu_per_mw, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, min_power, cluster, inv_cost_per_mwyr, min_cap_mw, ramp_up_percentage, maintenance_duration, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, reg_max, up_time, om_costs, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, maximum_capacity=Inf, min_power=0.0, cluster=1, maintenance_duration=0, ramp_up_percentage=100.0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, capacity_factor=1.0, up_time=0.0, reg_max=0.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, maximum_capacity, min_power, cluster, maintenance_duration, ramp_up_percentage, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, capacity_factor, up_time, reg_max, maintenance_begin_cadence, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -188,34 +188,36 @@ get_heat_rate_mmbtu_per_mwh(value::SupplyTechnology) = value.heat_rate_mmbtu_per get_zone(value::SupplyTechnology) = value.zone """Get [`SupplyTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::SupplyTechnology) = value.prime_mover_type -"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" -get_outage_factor(value::SupplyTechnology) = value.outage_factor +"""Get [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" +get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_capacity """Get [`SupplyTechnology`](@ref) `cofire_level_min`.""" get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min +"""Get [`SupplyTechnology`](@ref) `capital_costs`.""" +get_capital_costs(value::SupplyTechnology) = value.capital_costs """Get [`SupplyTechnology`](@ref) `rsv_cost`.""" get_rsv_cost(value::SupplyTechnology) = value.rsv_cost """Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max +"""Get [`SupplyTechnology`](@ref) `gen_ID`.""" +get_gen_ID(value::SupplyTechnology) = value.gen_ID """Get [`SupplyTechnology`](@ref) `available`.""" get_available(value::SupplyTechnology) = value.available -"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" -get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min """Get [`SupplyTechnology`](@ref) `co2`.""" get_co2(value::SupplyTechnology) = value.co2 """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name +"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" +get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min """Get [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" get_ramp_dn_percentage(value::SupplyTechnology) = value.ramp_dn_percentage -"""Get [`SupplyTechnology`](@ref) `max_cap_mw`.""" -get_max_cap_mw(value::SupplyTechnology) = value.max_cap_mw -"""Get [`SupplyTechnology`](@ref) `id`.""" -get_id(value::SupplyTechnology) = value.id -"""Get [`SupplyTechnology`](@ref) `existing_cap_mw`.""" -get_existing_cap_mw(value::SupplyTechnology) = value.existing_cap_mw """Get [`SupplyTechnology`](@ref) `down_time`.""" get_down_time(value::SupplyTechnology) = value.down_time +"""Get [`SupplyTechnology`](@ref) `initial_capacity`.""" +get_initial_capacity(value::SupplyTechnology) = value.initial_capacity """Get [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" get_start_fuel_mmbtu_per_mw(value::SupplyTechnology) = value.start_fuel_mmbtu_per_mw +"""Get [`SupplyTechnology`](@ref) `operation_costs`.""" +get_operation_costs(value::SupplyTechnology) = value.operation_costs """Get [`SupplyTechnology`](@ref) `rsv_max`.""" get_rsv_max(value::SupplyTechnology) = value.rsv_max """Get [`SupplyTechnology`](@ref) `fuel`.""" @@ -232,18 +234,16 @@ get_ext(value::SupplyTechnology) = value.ext get_balancing_topology(value::SupplyTechnology) = value.balancing_topology """Get [`SupplyTechnology`](@ref) `region`.""" get_region(value::SupplyTechnology) = value.region +"""Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" +get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity """Get [`SupplyTechnology`](@ref) `min_power`.""" get_min_power(value::SupplyTechnology) = value.min_power """Get [`SupplyTechnology`](@ref) `cluster`.""" get_cluster(value::SupplyTechnology) = value.cluster -"""Get [`SupplyTechnology`](@ref) `inv_cost_per_mwyr`.""" -get_inv_cost_per_mwyr(value::SupplyTechnology) = value.inv_cost_per_mwyr -"""Get [`SupplyTechnology`](@ref) `min_cap_mw`.""" -get_min_cap_mw(value::SupplyTechnology) = value.min_cap_mw -"""Get [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" -get_ramp_up_percentage(value::SupplyTechnology) = value.ramp_up_percentage """Get [`SupplyTechnology`](@ref) `maintenance_duration`.""" get_maintenance_duration(value::SupplyTechnology) = value.maintenance_duration +"""Get [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::SupplyTechnology) = value.ramp_up_percentage """Get [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years """Get [`SupplyTechnology`](@ref) `reg_cost`.""" @@ -252,12 +252,12 @@ get_reg_cost(value::SupplyTechnology) = value.reg_cost get_start_cost_per_mw(value::SupplyTechnology) = value.start_cost_per_mw """Get [`SupplyTechnology`](@ref) `cap_size`.""" get_cap_size(value::SupplyTechnology) = value.cap_size -"""Get [`SupplyTechnology`](@ref) `reg_max`.""" -get_reg_max(value::SupplyTechnology) = value.reg_max +"""Get [`SupplyTechnology`](@ref) `capacity_factor`.""" +get_capacity_factor(value::SupplyTechnology) = value.capacity_factor """Get [`SupplyTechnology`](@ref) `up_time`.""" get_up_time(value::SupplyTechnology) = value.up_time -"""Get [`SupplyTechnology`](@ref) `om_costs`.""" -get_om_costs(value::SupplyTechnology) = value.om_costs +"""Get [`SupplyTechnology`](@ref) `reg_max`.""" +get_reg_max(value::SupplyTechnology) = value.reg_max """Get [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" get_maintenance_begin_cadence(value::SupplyTechnology) = value.maintenance_begin_cadence @@ -269,34 +269,36 @@ set_heat_rate_mmbtu_per_mwh!(value::SupplyTechnology, val) = value.heat_rate_mmb set_zone!(value::SupplyTechnology, val) = value.zone = val """Set [`SupplyTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::SupplyTechnology, val) = value.prime_mover_type = val -"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" -set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val +"""Set [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" +set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_required_capacity = val """Set [`SupplyTechnology`](@ref) `cofire_level_min`.""" set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val +"""Set [`SupplyTechnology`](@ref) `capital_costs`.""" +set_capital_costs!(value::SupplyTechnology, val) = value.capital_costs = val """Set [`SupplyTechnology`](@ref) `rsv_cost`.""" set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val """Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val +"""Set [`SupplyTechnology`](@ref) `gen_ID`.""" +set_gen_ID!(value::SupplyTechnology, val) = value.gen_ID = val """Set [`SupplyTechnology`](@ref) `available`.""" set_available!(value::SupplyTechnology, val) = value.available = val -"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" -set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val """Set [`SupplyTechnology`](@ref) `co2`.""" set_co2!(value::SupplyTechnology, val) = value.co2 = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" +set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val """Set [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" set_ramp_dn_percentage!(value::SupplyTechnology, val) = value.ramp_dn_percentage = val -"""Set [`SupplyTechnology`](@ref) `max_cap_mw`.""" -set_max_cap_mw!(value::SupplyTechnology, val) = value.max_cap_mw = val -"""Set [`SupplyTechnology`](@ref) `id`.""" -set_id!(value::SupplyTechnology, val) = value.id = val -"""Set [`SupplyTechnology`](@ref) `existing_cap_mw`.""" -set_existing_cap_mw!(value::SupplyTechnology, val) = value.existing_cap_mw = val """Set [`SupplyTechnology`](@ref) `down_time`.""" set_down_time!(value::SupplyTechnology, val) = value.down_time = val +"""Set [`SupplyTechnology`](@ref) `initial_capacity`.""" +set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val """Set [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" set_start_fuel_mmbtu_per_mw!(value::SupplyTechnology, val) = value.start_fuel_mmbtu_per_mw = val +"""Set [`SupplyTechnology`](@ref) `operation_costs`.""" +set_operation_costs!(value::SupplyTechnology, val) = value.operation_costs = val """Set [`SupplyTechnology`](@ref) `rsv_max`.""" set_rsv_max!(value::SupplyTechnology, val) = value.rsv_max = val """Set [`SupplyTechnology`](@ref) `fuel`.""" @@ -313,18 +315,16 @@ set_ext!(value::SupplyTechnology, val) = value.ext = val set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val """Set [`SupplyTechnology`](@ref) `region`.""" set_region!(value::SupplyTechnology, val) = value.region = val +"""Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" +set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val """Set [`SupplyTechnology`](@ref) `min_power`.""" set_min_power!(value::SupplyTechnology, val) = value.min_power = val """Set [`SupplyTechnology`](@ref) `cluster`.""" set_cluster!(value::SupplyTechnology, val) = value.cluster = val -"""Set [`SupplyTechnology`](@ref) `inv_cost_per_mwyr`.""" -set_inv_cost_per_mwyr!(value::SupplyTechnology, val) = value.inv_cost_per_mwyr = val -"""Set [`SupplyTechnology`](@ref) `min_cap_mw`.""" -set_min_cap_mw!(value::SupplyTechnology, val) = value.min_cap_mw = val -"""Set [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" -set_ramp_up_percentage!(value::SupplyTechnology, val) = value.ramp_up_percentage = val """Set [`SupplyTechnology`](@ref) `maintenance_duration`.""" set_maintenance_duration!(value::SupplyTechnology, val) = value.maintenance_duration = val +"""Set [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::SupplyTechnology, val) = value.ramp_up_percentage = val """Set [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val """Set [`SupplyTechnology`](@ref) `reg_cost`.""" @@ -333,11 +333,11 @@ set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val set_start_cost_per_mw!(value::SupplyTechnology, val) = value.start_cost_per_mw = val """Set [`SupplyTechnology`](@ref) `cap_size`.""" set_cap_size!(value::SupplyTechnology, val) = value.cap_size = val -"""Set [`SupplyTechnology`](@ref) `reg_max`.""" -set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val +"""Set [`SupplyTechnology`](@ref) `capacity_factor`.""" +set_capacity_factor!(value::SupplyTechnology, val) = value.capacity_factor = val """Set [`SupplyTechnology`](@ref) `up_time`.""" set_up_time!(value::SupplyTechnology, val) = value.up_time = val -"""Set [`SupplyTechnology`](@ref) `om_costs`.""" -set_om_costs!(value::SupplyTechnology, val) = value.om_costs = val +"""Set [`SupplyTechnology`](@ref) `reg_max`.""" +set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val """Set [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" set_maintenance_begin_cadence!(value::SupplyTechnology, val) = value.maintenance_begin_cadence = val From 378a3f89efb8df3e8de7ec2bf7e0e0111bee7648 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 14:08:20 -0600 Subject: [PATCH 61/69] update includes --- src/models/generated/includes.jl | 70 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 25bd809..9ae316c 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -20,11 +20,15 @@ export get_available export get_balancing_topology export get_base_power export get_cap_size +export get_capacity_factor export get_capital_cost export get_capital_cost_energy export get_capital_cost_gen export get_capital_cost_inv export get_capital_cost_power +export get_capital_costs +export get_capital_costs_energy +export get_capital_costs_power export get_capital_recovery_factor export get_cluster export get_co2 @@ -37,7 +41,7 @@ export get_cofire_start_min export get_curtailment_cost export get_curtailment_cost_mwh export get_demand_energy_efficiency -export get_demand_mw_z +export get_demand_mw export get_down_time export get_eff_down export get_eff_up @@ -48,35 +52,33 @@ export get_efficiency_up_dc export get_eligible_resources export get_eligible_zones export get_end_region -export get_existing_cap_mw -export get_existing_cap_mwh +export get_existing_cap_energy +export get_existing_cap_power export get_existing_capacity export get_existing_line_capacity export get_ext -export get_fixed_om_cost_per_mwhyr export get_fuel export get_gen_ID export get_heat_rate_mmbtu_per_mwh export get_id +export get_initial_capacity export get_initial_capacity_energy export get_initial_capacity_inverter export get_initial_capacity_power export get_initial_gen_capacity -export get_inv_cost_charge_per_mwyr -export get_inv_cost_per_mwhyr -export get_inv_cost_per_mwyr export get_inverter_ratio export get_line_loss +export get_losses export get_maintenance_begin_cadence export get_maintenance_cycle_length_years export get_maintenance_duration -export get_max_cap_mw -export get_max_cap_mwh -export get_max_charge_cap_mw +export get_max_cap_energy +export get_max_cap_power export get_max_demand_advance export get_max_demand_curtailment export get_max_demand_delay export get_max_duration +export get_maximum_capacity export get_maximum_capacity_energy export get_maximum_capacity_power export get_maximum_duration @@ -84,26 +86,26 @@ export get_maximum_flow export get_maximum_gen_capacity export get_maximum_inverter_capacity export get_maximum_new_capacity -export get_min_cap_mw -export get_min_cap_mwh -export get_min_charge_cap_mw +export get_min_cap_energy +export get_min_cap_power export get_min_duration export get_min_mw export get_min_power export get_minimum_duration export get_minimum_inverter_capacity +export get_minimum_required_capacity export get_minimum_required_capacity_energy export get_minimum_required_capacity_gen export get_minimum_required_capacity_power export get_name export get_network_lines -export get_om_costs -export get_om_costs_charge +export get_om_costs_energy +export get_om_costs_power +export get_operation_costs export get_operations_cost_energy export get_operations_cost_gen export get_operations_cost_inv export get_operations_cost_power -export get_outage_factor export get_power_systems_type export get_price_per_unit export get_pricecap @@ -121,7 +123,6 @@ export get_retrofit_potential export get_rsv_cost export get_rsv_max export get_segments -export get_self_disch export get_self_discharge export get_start_cost_per_mw export get_start_fuel_mmbtu_per_mw @@ -139,11 +140,15 @@ export set_available! export set_balancing_topology! export set_base_power! export set_cap_size! +export set_capacity_factor! export set_capital_cost! export set_capital_cost_energy! export set_capital_cost_gen! export set_capital_cost_inv! export set_capital_cost_power! +export set_capital_costs! +export set_capital_costs_energy! +export set_capital_costs_power! export set_capital_recovery_factor! export set_cluster! export set_co2! @@ -156,7 +161,7 @@ export set_cofire_start_min! export set_curtailment_cost! export set_curtailment_cost_mwh! export set_demand_energy_efficiency! -export set_demand_mw_z! +export set_demand_mw! export set_down_time! export set_eff_down! export set_eff_up! @@ -167,35 +172,33 @@ export set_efficiency_up_dc! export set_eligible_resources! export set_eligible_zones! export set_end_region! -export set_existing_cap_mw! -export set_existing_cap_mwh! +export set_existing_cap_energy! +export set_existing_cap_power! export set_existing_capacity! export set_existing_line_capacity! export set_ext! -export set_fixed_om_cost_per_mwhyr! export set_fuel! export set_gen_ID! export set_heat_rate_mmbtu_per_mwh! export set_id! +export set_initial_capacity! export set_initial_capacity_energy! export set_initial_capacity_inverter! export set_initial_capacity_power! export set_initial_gen_capacity! -export set_inv_cost_charge_per_mwyr! -export set_inv_cost_per_mwhyr! -export set_inv_cost_per_mwyr! export set_inverter_ratio! export set_line_loss! +export set_losses! export set_maintenance_begin_cadence! export set_maintenance_cycle_length_years! export set_maintenance_duration! -export set_max_cap_mw! -export set_max_cap_mwh! -export set_max_charge_cap_mw! +export set_max_cap_energy! +export set_max_cap_power! export set_max_demand_advance! export set_max_demand_curtailment! export set_max_demand_delay! export set_max_duration! +export set_maximum_capacity! export set_maximum_capacity_energy! export set_maximum_capacity_power! export set_maximum_duration! @@ -203,26 +206,26 @@ export set_maximum_flow! export set_maximum_gen_capacity! export set_maximum_inverter_capacity! export set_maximum_new_capacity! -export set_min_cap_mw! -export set_min_cap_mwh! -export set_min_charge_cap_mw! +export set_min_cap_energy! +export set_min_cap_power! export set_min_duration! export set_min_mw! export set_min_power! export set_minimum_duration! export set_minimum_inverter_capacity! +export set_minimum_required_capacity! export set_minimum_required_capacity_energy! export set_minimum_required_capacity_gen! export set_minimum_required_capacity_power! export set_name! export set_network_lines! -export set_om_costs! -export set_om_costs_charge! +export set_om_costs_energy! +export set_om_costs_power! +export set_operation_costs! export set_operations_cost_energy! export set_operations_cost_gen! export set_operations_cost_inv! export set_operations_cost_power! -export set_outage_factor! export set_power_systems_type! export set_price_per_unit! export set_pricecap! @@ -240,7 +243,6 @@ export set_retrofit_potential! export set_rsv_cost! export set_rsv_max! export set_segments! -export set_self_disch! export set_self_discharge! export set_start_cost_per_mw! export set_start_fuel_mmbtu_per_mw! From d6b0c5870de6af4649dc031c948fc6c398b9e657 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 16:11:10 -0600 Subject: [PATCH 62/69] update names and remove unecessary fields --- .../CoLocatedSupplyStorageTechnology.jl | 335 ------------------ src/models/generated/StorageTechnology.jl | 16 +- src/models/generated/SupplyTechnology.jl | 84 ++--- src/models/generated/TransportTechnology.jl | 28 +- src/models/generated/includes.jl | 77 +--- 5 files changed, 46 insertions(+), 494 deletions(-) delete mode 100644 src/models/generated/CoLocatedSupplyStorageTechnology.jl diff --git a/src/models/generated/CoLocatedSupplyStorageTechnology.jl b/src/models/generated/CoLocatedSupplyStorageTechnology.jl deleted file mode 100644 index 10220a0..0000000 --- a/src/models/generated/CoLocatedSupplyStorageTechnology.jl +++ /dev/null @@ -1,335 +0,0 @@ -#= -This file is auto-generated. Do not edit. -=# - -#! format: off - -""" - mutable struct CoLocatedSupplyStorageTechnology{T <: PSY.Generator} <: Technology - base_power::Float64 - capital_cost_energy::PSY.ValueCurve - initial_capacity_power::Float64 - prime_mover_type::PrimeMovers - capital_cost_gen::PSY.ValueCurve - efficiency_up_dc::Float64 - capital_cost_inv::PSY.ValueCurve - capital_cost_power::PSY.ValueCurve - maximum_capacity_power::Float64 - operations_cost_inv::PSY.OperationalCost - efficiency_up_ac::Float64 - efficiency_down_dc::Float64 - gen_ID::String - available::Bool - name::String - storage_tech::StorageTech - minimum_required_capacity_gen::Float64 - self_discharge::Float64 - initial_gen_capacity::Float64 - minimum_inverter_capacity::Float64 - minimum_required_capacity_power::Float64 - operations_cost_gen::PSY.OperationalCost - minimum_duration::Float64 - inverter_ratio::Float64 - power_systems_type::String - internal::InfrastructureSystemsInternal - ext::Dict - balancing_topology::String - initial_capacity_inverter::Float64 - region::String - maximum_inverter_capacity::Float64 - maximum_duration::Float64 - initial_capacity_energy::Float64 - operations_cost_power::PSY.OperationalCost - maximum_capacity_energy::Float64 - operations_cost_energy::PSY.OperationalCost - minimum_required_capacity_energy::Float64 - maximum_gen_capacity::Float64 - efficiency_down_ac::Float64 - end - - - -# Arguments -- `base_power::Float64`: Base power -- `capital_cost_energy::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology -- `initial_capacity_power::Float64`: Pre-existing power capacity for a technology (MW) -- `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `capital_cost_gen::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. -- `efficiency_up_dc::Float64`: (default: `1.0`) Efficiency of charging storage -- `capital_cost_inv::PSY.ValueCurve`: (default: `0.0`) Capital costs for energy capacity of storage technology -- `capital_cost_power::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. -- `maximum_capacity_power::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology -- `operations_cost_inv::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology -- `efficiency_up_ac::Float64`: (default: `1.0`) Efficiency of charging storage -- `efficiency_down_dc::Float64`: (default: `1.0`) Efficiency of discharging storage -- `gen_ID::String`: ID for individual generator -- `available::Bool`: identifies whether the technology is available -- `name::String`: The technology name -- `storage_tech::StorageTech`: Storage Technology Type -- `minimum_required_capacity_gen::Float64`: (default: `-1`) Minimum required capacity for a technology -- `self_discharge::Float64`: (default: `1.0`) Efficiency of discharging storage -- `initial_gen_capacity::Float64`: Pre-existing capacity for a technology -- `minimum_inverter_capacity::Float64`: (default: `-1`) Minimum allowable installed capacity for a technology -- `minimum_required_capacity_power::Float64`: (default: `-1`) Minimum required power capacity for a storage technology -- `operations_cost_gen::PSY.OperationalCost`: Fixed O&M costs for a technology -- `minimum_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology -- `inverter_ratio::Float64`: (default: `-1.0`) Ratio of generation capacity to grid connection capacity built -- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling -- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `balancing_topology::String`: Set of balancing nodes -- `initial_capacity_inverter::Float64`: The existing capacity of co-located VRE-STOR resource's inverter in MW (AC) -- `region::String`: (default: `1.0`) Region/zone technology operates in -- `maximum_inverter_capacity::Float64`: (default: `-1`) Maximum allowable installed capacity for a technology -- `maximum_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology -- `initial_capacity_energy::Float64`: Pre-existing energy capacity for a technology (MWh) -- `operations_cost_power::PSY.OperationalCost`: Fixed O&M costs for a technology -- `maximum_capacity_energy::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology -- `operations_cost_energy::PSY.OperationalCost`: Fixed O&M costs for energy capacity of storage technology -- `minimum_required_capacity_energy::Float64`: (default: `-1`) Minimum required energy capacity for a storage technology -- `maximum_gen_capacity::Float64`: (default: `-1`) Maximum allowable installed capacity for a technology -- `efficiency_down_ac::Float64`: (default: `1.0`) Efficiency of discharging storage -""" -mutable struct CoLocatedSupplyStorageTechnology{T <: PSY.Generator} <: Technology - "Base power" - base_power::Float64 - "Capital costs for energy capacity of storage technology" - capital_cost_energy::PSY.ValueCurve - "Pre-existing power capacity for a technology (MW)" - initial_capacity_power::Float64 - "Prime mover for generator" - prime_mover_type::PrimeMovers - "Capital costs for investing in a technology." - capital_cost_gen::PSY.ValueCurve - "Efficiency of charging storage" - efficiency_up_dc::Float64 - "Capital costs for energy capacity of storage technology" - capital_cost_inv::PSY.ValueCurve - "Capital costs for investing in a technology." - capital_cost_power::PSY.ValueCurve - "Maximum allowable installed power capacity for a storage technology" - maximum_capacity_power::Float64 - "Fixed O&M costs for energy capacity of storage technology" - operations_cost_inv::PSY.OperationalCost - "Efficiency of charging storage" - efficiency_up_ac::Float64 - "Efficiency of discharging storage" - efficiency_down_dc::Float64 - "ID for individual generator" - gen_ID::String - "identifies whether the technology is available" - available::Bool - "The technology name" - name::String - "Storage Technology Type" - storage_tech::StorageTech - "Minimum required capacity for a technology" - minimum_required_capacity_gen::Float64 - "Efficiency of discharging storage" - self_discharge::Float64 - "Pre-existing capacity for a technology" - initial_gen_capacity::Float64 - "Minimum allowable installed capacity for a technology" - minimum_inverter_capacity::Float64 - "Minimum required power capacity for a storage technology" - minimum_required_capacity_power::Float64 - "Fixed O&M costs for a technology" - operations_cost_gen::PSY.OperationalCost - "Minimum required durection for a storage technology" - minimum_duration::Float64 - "Ratio of generation capacity to grid connection capacity built" - inverter_ratio::Float64 - "maps to a valid PowerSystems.jl for PCM modeling" - power_systems_type::String - "Internal field" - internal::InfrastructureSystemsInternal - "Option for providing additional data" - ext::Dict - "Set of balancing nodes" - balancing_topology::String - "The existing capacity of co-located VRE-STOR resource's inverter in MW (AC)" - initial_capacity_inverter::Float64 - "Region/zone technology operates in" - region::String - "Maximum allowable installed capacity for a technology" - maximum_inverter_capacity::Float64 - "Maximum allowable durection for a storage technology" - maximum_duration::Float64 - "Pre-existing energy capacity for a technology (MWh)" - initial_capacity_energy::Float64 - "Fixed O&M costs for a technology" - operations_cost_power::PSY.OperationalCost - "Maximum allowable installed energy capacity for a storage technology" - maximum_capacity_energy::Float64 - "Fixed O&M costs for energy capacity of storage technology" - operations_cost_energy::PSY.OperationalCost - "Minimum required energy capacity for a storage technology" - minimum_required_capacity_energy::Float64 - "Maximum allowable installed capacity for a technology" - maximum_gen_capacity::Float64 - "Efficiency of discharging storage" - efficiency_down_ac::Float64 -end - - -function CoLocatedSupplyStorageTechnology{T}(; base_power, capital_cost_energy=0.0, initial_capacity_power, prime_mover_type=PrimeMovers.OT, capital_cost_gen=0.0, efficiency_up_dc=1.0, capital_cost_inv=0.0, capital_cost_power=0.0, maximum_capacity_power=-1, operations_cost_inv, efficiency_up_ac=1.0, efficiency_down_dc=1.0, gen_ID, available, name, storage_tech, minimum_required_capacity_gen=-1, self_discharge=1.0, initial_gen_capacity, minimum_inverter_capacity=-1, minimum_required_capacity_power=-1, operations_cost_gen, minimum_duration=0.0, inverter_ratio=-1.0, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, initial_capacity_inverter, region=1.0, maximum_inverter_capacity=-1, maximum_duration=1000.0, initial_capacity_energy, operations_cost_power, maximum_capacity_energy=-1, operations_cost_energy, minimum_required_capacity_energy=-1, maximum_gen_capacity=-1, efficiency_down_ac=1.0, ) where T <: PSY.Generator - CoLocatedSupplyStorageTechnology{T}(base_power, capital_cost_energy, initial_capacity_power, prime_mover_type, capital_cost_gen, efficiency_up_dc, capital_cost_inv, capital_cost_power, maximum_capacity_power, operations_cost_inv, efficiency_up_ac, efficiency_down_dc, gen_ID, available, name, storage_tech, minimum_required_capacity_gen, self_discharge, initial_gen_capacity, minimum_inverter_capacity, minimum_required_capacity_power, operations_cost_gen, minimum_duration, inverter_ratio, power_systems_type, internal, ext, balancing_topology, initial_capacity_inverter, region, maximum_inverter_capacity, maximum_duration, initial_capacity_energy, operations_cost_power, maximum_capacity_energy, operations_cost_energy, minimum_required_capacity_energy, maximum_gen_capacity, efficiency_down_ac, ) -end - -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `base_power`.""" -get_base_power(value::CoLocatedSupplyStorageTechnology) = value.base_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_energy`.""" -get_capital_cost_energy(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_energy -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_power`.""" -get_initial_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `prime_mover_type`.""" -get_prime_mover_type(value::CoLocatedSupplyStorageTechnology) = value.prime_mover_type -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_gen`.""" -get_capital_cost_gen(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_gen -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_dc`.""" -get_efficiency_up_dc(value::CoLocatedSupplyStorageTechnology) = value.efficiency_up_dc -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_inv`.""" -get_capital_cost_inv(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_inv -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_power`.""" -get_capital_cost_power(value::CoLocatedSupplyStorageTechnology) = value.capital_cost_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_power`.""" -get_maximum_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.maximum_capacity_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_inv`.""" -get_operations_cost_inv(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_inv -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_ac`.""" -get_efficiency_up_ac(value::CoLocatedSupplyStorageTechnology) = value.efficiency_up_ac -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_dc`.""" -get_efficiency_down_dc(value::CoLocatedSupplyStorageTechnology) = value.efficiency_down_dc -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `gen_ID`.""" -get_gen_ID(value::CoLocatedSupplyStorageTechnology) = value.gen_ID -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `available`.""" -get_available(value::CoLocatedSupplyStorageTechnology) = value.available -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `name`.""" -get_name(value::CoLocatedSupplyStorageTechnology) = value.name -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `storage_tech`.""" -get_storage_tech(value::CoLocatedSupplyStorageTechnology) = value.storage_tech -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_gen`.""" -get_minimum_required_capacity_gen(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_gen -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `self_discharge`.""" -get_self_discharge(value::CoLocatedSupplyStorageTechnology) = value.self_discharge -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_gen_capacity`.""" -get_initial_gen_capacity(value::CoLocatedSupplyStorageTechnology) = value.initial_gen_capacity -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_inverter_capacity`.""" -get_minimum_inverter_capacity(value::CoLocatedSupplyStorageTechnology) = value.minimum_inverter_capacity -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_power`.""" -get_minimum_required_capacity_power(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_gen`.""" -get_operations_cost_gen(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_gen -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_duration`.""" -get_minimum_duration(value::CoLocatedSupplyStorageTechnology) = value.minimum_duration -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `inverter_ratio`.""" -get_inverter_ratio(value::CoLocatedSupplyStorageTechnology) = value.inverter_ratio -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `power_systems_type`.""" -get_power_systems_type(value::CoLocatedSupplyStorageTechnology) = value.power_systems_type -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `internal`.""" -get_internal(value::CoLocatedSupplyStorageTechnology) = value.internal -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `ext`.""" -get_ext(value::CoLocatedSupplyStorageTechnology) = value.ext -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `balancing_topology`.""" -get_balancing_topology(value::CoLocatedSupplyStorageTechnology) = value.balancing_topology -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_inverter`.""" -get_initial_capacity_inverter(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_inverter -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `region`.""" -get_region(value::CoLocatedSupplyStorageTechnology) = value.region -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_inverter_capacity`.""" -get_maximum_inverter_capacity(value::CoLocatedSupplyStorageTechnology) = value.maximum_inverter_capacity -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_duration`.""" -get_maximum_duration(value::CoLocatedSupplyStorageTechnology) = value.maximum_duration -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_energy`.""" -get_initial_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.initial_capacity_energy -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_power`.""" -get_operations_cost_power(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_power -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_energy`.""" -get_maximum_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.maximum_capacity_energy -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_energy`.""" -get_operations_cost_energy(value::CoLocatedSupplyStorageTechnology) = value.operations_cost_energy -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_energy`.""" -get_minimum_required_capacity_energy(value::CoLocatedSupplyStorageTechnology) = value.minimum_required_capacity_energy -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_gen_capacity`.""" -get_maximum_gen_capacity(value::CoLocatedSupplyStorageTechnology) = value.maximum_gen_capacity -"""Get [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_ac`.""" -get_efficiency_down_ac(value::CoLocatedSupplyStorageTechnology) = value.efficiency_down_ac - -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `base_power`.""" -set_base_power!(value::CoLocatedSupplyStorageTechnology, val) = value.base_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_energy`.""" -set_capital_cost_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_energy = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_power`.""" -set_initial_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `prime_mover_type`.""" -set_prime_mover_type!(value::CoLocatedSupplyStorageTechnology, val) = value.prime_mover_type = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_gen`.""" -set_capital_cost_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_gen = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_dc`.""" -set_efficiency_up_dc!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_up_dc = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_inv`.""" -set_capital_cost_inv!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_inv = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `capital_cost_power`.""" -set_capital_cost_power!(value::CoLocatedSupplyStorageTechnology, val) = value.capital_cost_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_power`.""" -set_maximum_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_capacity_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_inv`.""" -set_operations_cost_inv!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_inv = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_up_ac`.""" -set_efficiency_up_ac!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_up_ac = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_dc`.""" -set_efficiency_down_dc!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_down_dc = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `gen_ID`.""" -set_gen_ID!(value::CoLocatedSupplyStorageTechnology, val) = value.gen_ID = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `available`.""" -set_available!(value::CoLocatedSupplyStorageTechnology, val) = value.available = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `name`.""" -set_name!(value::CoLocatedSupplyStorageTechnology, val) = value.name = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `storage_tech`.""" -set_storage_tech!(value::CoLocatedSupplyStorageTechnology, val) = value.storage_tech = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_gen`.""" -set_minimum_required_capacity_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_gen = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `self_discharge`.""" -set_self_discharge!(value::CoLocatedSupplyStorageTechnology, val) = value.self_discharge = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_gen_capacity`.""" -set_initial_gen_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_gen_capacity = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_inverter_capacity`.""" -set_minimum_inverter_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_inverter_capacity = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_power`.""" -set_minimum_required_capacity_power!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_gen`.""" -set_operations_cost_gen!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_gen = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_duration`.""" -set_minimum_duration!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_duration = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `inverter_ratio`.""" -set_inverter_ratio!(value::CoLocatedSupplyStorageTechnology, val) = value.inverter_ratio = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `power_systems_type`.""" -set_power_systems_type!(value::CoLocatedSupplyStorageTechnology, val) = value.power_systems_type = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `internal`.""" -set_internal!(value::CoLocatedSupplyStorageTechnology, val) = value.internal = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `ext`.""" -set_ext!(value::CoLocatedSupplyStorageTechnology, val) = value.ext = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `balancing_topology`.""" -set_balancing_topology!(value::CoLocatedSupplyStorageTechnology, val) = value.balancing_topology = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_inverter`.""" -set_initial_capacity_inverter!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_inverter = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `region`.""" -set_region!(value::CoLocatedSupplyStorageTechnology, val) = value.region = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_inverter_capacity`.""" -set_maximum_inverter_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_inverter_capacity = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_duration`.""" -set_maximum_duration!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_duration = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `initial_capacity_energy`.""" -set_initial_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.initial_capacity_energy = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_power`.""" -set_operations_cost_power!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_power = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_capacity_energy`.""" -set_maximum_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_capacity_energy = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `operations_cost_energy`.""" -set_operations_cost_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.operations_cost_energy = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `minimum_required_capacity_energy`.""" -set_minimum_required_capacity_energy!(value::CoLocatedSupplyStorageTechnology, val) = value.minimum_required_capacity_energy = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `maximum_gen_capacity`.""" -set_maximum_gen_capacity!(value::CoLocatedSupplyStorageTechnology, val) = value.maximum_gen_capacity = val -"""Set [`CoLocatedSupplyStorageTechnology`](@ref) `efficiency_down_ac`.""" -set_efficiency_down_ac!(value::CoLocatedSupplyStorageTechnology, val) = value.efficiency_down_ac = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 93fc914..4644341 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -33,7 +33,6 @@ This file is auto-generated. Do not edit. region::String eff_up::Float64 ext::Dict - cluster::Int64 reg_cost::Float64 min_duration::Float64 max_cap_energy::Float64 @@ -58,7 +57,7 @@ This file is auto-generated. Do not edit. - `id::Int64`: ID for individual generator - `min_cap_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology - `capital_costs_energy::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. -- `losses::Float64`: (default: `1.0`) Efficiency of discharging storage +- `losses::Float64`: (default: `1.0`) Power loss (pct per hour) - `eff_down::Float64`: (default: `1.0`) Efficiency of discharging storage - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. - `max_cap_power::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology @@ -70,7 +69,6 @@ This file is auto-generated. Do not edit. - `region::String`: Region/zone technology operates in - `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `cluster::Int64`: (default: `0`) Cluster - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves - `min_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology - `max_cap_energy::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology @@ -107,7 +105,7 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology min_cap_power::Float64 "Capital costs for investing in a technology." capital_costs_energy::PSY.ValueCurve - "Efficiency of discharging storage" + "Power loss (pct per hour)" losses::Float64 "Efficiency of discharging storage" eff_down::Float64 @@ -131,8 +129,6 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology eff_up::Float64 "Option for providing additional data" ext::Dict - "Cluster" - cluster::Int64 "Cost of providing regulation reserves " reg_cost::Float64 "Minimum required durection for a storage technology" @@ -144,8 +140,8 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology end -function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy, rsv_cost=0.0, available, existing_cap_power, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=-1, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, region, eff_up=1.0, ext=Dict(), cluster=0, reg_cost=0.0, min_duration=0.0, max_cap_energy=-1, reg_max=0.0, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, region, eff_up, ext, cluster, reg_cost, min_duration, max_cap_energy, reg_max, ) +function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy, rsv_cost=0.0, available, existing_cap_power, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=-1, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, region, eff_up=1.0, ext=Dict(), reg_cost=0.0, min_duration=0.0, max_cap_energy=-1, reg_max=0.0, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, region, eff_up, ext, reg_cost, min_duration, max_cap_energy, reg_max, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" @@ -202,8 +198,6 @@ get_region(value::StorageTechnology) = value.region get_eff_up(value::StorageTechnology) = value.eff_up """Get [`StorageTechnology`](@ref) `ext`.""" get_ext(value::StorageTechnology) = value.ext -"""Get [`StorageTechnology`](@ref) `cluster`.""" -get_cluster(value::StorageTechnology) = value.cluster """Get [`StorageTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::StorageTechnology) = value.reg_cost """Get [`StorageTechnology`](@ref) `min_duration`.""" @@ -267,8 +261,6 @@ set_region!(value::StorageTechnology, val) = value.region = val set_eff_up!(value::StorageTechnology, val) = value.eff_up = val """Set [`StorageTechnology`](@ref) `ext`.""" set_ext!(value::StorageTechnology, val) = value.ext = val -"""Set [`StorageTechnology`](@ref) `cluster`.""" -set_cluster!(value::StorageTechnology, val) = value.cluster = val """Set [`StorageTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val """Set [`StorageTechnology`](@ref) `min_duration`.""" diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index c6c8b1d..0e60ae9 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -13,6 +13,7 @@ This file is auto-generated. Do not edit. minimum_required_capacity::Float64 cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} capital_costs::PSY.ValueCurve + outage_factor::Float64 rsv_cost::Float64 cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} gen_ID::Int64 @@ -34,18 +35,13 @@ This file is auto-generated. Do not edit. balancing_topology::String region::String maximum_capacity::Float64 - min_power::Float64 cluster::Int64 - maintenance_duration::Int64 ramp_up_percentage::Float64 - maintenance_cycle_length_years::Int64 reg_cost::Float64 + min_generation_percentage::Float64 start_cost_per_mw::Float64 - cap_size::Float64 - capacity_factor::Float64 - up_time::Float64 reg_max::Float64 - maintenance_begin_cadence::Int64 + up_time::Float64 end @@ -58,6 +54,7 @@ This file is auto-generated. Do not edit. - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator - `capital_costs::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator - `gen_ID::Int64`: ID for individual generator @@ -79,18 +76,13 @@ This file is auto-generated. Do not edit. - `balancing_topology::String`: Set of balancing nodes - `region::String`: Region/zone technology operates in - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology -- `min_power::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. -- `maintenance_duration::Int64`: (default: `0`) Duration of the maintenance period, in number of timesteps. - `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity -- `maintenance_cycle_length_years::Int64`: (default: `0`) Length of scheduled maintenance cycle, in years. - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `min_generation_percentage::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity - `start_cost_per_mw::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). -- `cap_size::Float64`: (default: `1.0`) Cap_size -- `capacity_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology -- `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves -- `maintenance_begin_cadence::Int64`: (default: `1`) Cadence of timesteps in which scheduled maintenance can begin. +- `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Base power" @@ -107,6 +99,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} "Capital costs for investing in a technology." capital_costs::PSY.ValueCurve + "Derating factor to account for planned or forced outages of a technology" + outage_factor::Float64 "Cost of providing upwards spinning or contingency reserves" rsv_cost::Float64 "Maximum blending level of each fuel during start-up process for multi-fuel generator" @@ -149,35 +143,25 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology region::String "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 - "Minimum generation as a fraction of total capacity" - min_power::Float64 "Number of the cluster when representing multiple clusters of a given technology in a given region." cluster::Int64 - "Duration of the maintenance period, in number of timesteps." - maintenance_duration::Int64 "Maximum increase in output between operation periods. Fraction of total capacity" ramp_up_percentage::Float64 - "Length of scheduled maintenance cycle, in years." - maintenance_cycle_length_years::Int64 "Cost of providing regulation reserves " reg_cost::Float64 + "Minimum generation as a fraction of total capacity" + min_generation_percentage::Float64 "Cost per MW of nameplate capacity to start a generator (/MW per start)." start_cost_per_mw::Float64 - "Cap_size" - cap_size::Float64 - "Derating factor to account for planned or forced outages of a technology" - capacity_factor::Float64 - "Minimum amount of time a resource has to stay in the committed state." - up_time::Float64 "Fraction of nameplate capacity that can committed to provided regulation reserves" reg_max::Float64 - "Cadence of timesteps in which scheduled maintenance can begin." - maintenance_begin_cadence::Int64 + "Minimum amount of time a resource has to stay in the committed state." + up_time::Float64 end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, maximum_capacity=Inf, min_power=0.0, cluster=1, maintenance_duration=0, ramp_up_percentage=100.0, maintenance_cycle_length_years=0, reg_cost=0.0, start_cost_per_mw=0.0, cap_size=1.0, capacity_factor=1.0, up_time=0.0, reg_max=0.0, maintenance_begin_cadence=1, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, maximum_capacity, min_power, cluster, maintenance_duration, ramp_up_percentage, maintenance_cycle_length_years, reg_cost, start_cost_per_mw, cap_size, capacity_factor, up_time, reg_max, maintenance_begin_cadence, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), outage_factor=1.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, maximum_capacity=Inf, cluster=1, ramp_up_percentage=100.0, reg_cost=0.0, min_generation_percentage=0.0, start_cost_per_mw=0.0, reg_max=0.0, up_time=0.0, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, outage_factor, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, maximum_capacity, cluster, ramp_up_percentage, reg_cost, min_generation_percentage, start_cost_per_mw, reg_max, up_time, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -194,6 +178,8 @@ get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_ get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min """Get [`SupplyTechnology`](@ref) `capital_costs`.""" get_capital_costs(value::SupplyTechnology) = value.capital_costs +"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" +get_outage_factor(value::SupplyTechnology) = value.outage_factor """Get [`SupplyTechnology`](@ref) `rsv_cost`.""" get_rsv_cost(value::SupplyTechnology) = value.rsv_cost """Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" @@ -236,30 +222,20 @@ get_balancing_topology(value::SupplyTechnology) = value.balancing_topology get_region(value::SupplyTechnology) = value.region """Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity -"""Get [`SupplyTechnology`](@ref) `min_power`.""" -get_min_power(value::SupplyTechnology) = value.min_power """Get [`SupplyTechnology`](@ref) `cluster`.""" get_cluster(value::SupplyTechnology) = value.cluster -"""Get [`SupplyTechnology`](@ref) `maintenance_duration`.""" -get_maintenance_duration(value::SupplyTechnology) = value.maintenance_duration """Get [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" get_ramp_up_percentage(value::SupplyTechnology) = value.ramp_up_percentage -"""Get [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" -get_maintenance_cycle_length_years(value::SupplyTechnology) = value.maintenance_cycle_length_years """Get [`SupplyTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::SupplyTechnology) = value.reg_cost +"""Get [`SupplyTechnology`](@ref) `min_generation_percentage`.""" +get_min_generation_percentage(value::SupplyTechnology) = value.min_generation_percentage """Get [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" get_start_cost_per_mw(value::SupplyTechnology) = value.start_cost_per_mw -"""Get [`SupplyTechnology`](@ref) `cap_size`.""" -get_cap_size(value::SupplyTechnology) = value.cap_size -"""Get [`SupplyTechnology`](@ref) `capacity_factor`.""" -get_capacity_factor(value::SupplyTechnology) = value.capacity_factor -"""Get [`SupplyTechnology`](@ref) `up_time`.""" -get_up_time(value::SupplyTechnology) = value.up_time """Get [`SupplyTechnology`](@ref) `reg_max`.""" get_reg_max(value::SupplyTechnology) = value.reg_max -"""Get [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" -get_maintenance_begin_cadence(value::SupplyTechnology) = value.maintenance_begin_cadence +"""Get [`SupplyTechnology`](@ref) `up_time`.""" +get_up_time(value::SupplyTechnology) = value.up_time """Set [`SupplyTechnology`](@ref) `base_power`.""" set_base_power!(value::SupplyTechnology, val) = value.base_power = val @@ -275,6 +251,8 @@ set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_req set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val """Set [`SupplyTechnology`](@ref) `capital_costs`.""" set_capital_costs!(value::SupplyTechnology, val) = value.capital_costs = val +"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" +set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val """Set [`SupplyTechnology`](@ref) `rsv_cost`.""" set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val """Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" @@ -317,27 +295,17 @@ set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology set_region!(value::SupplyTechnology, val) = value.region = val """Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val -"""Set [`SupplyTechnology`](@ref) `min_power`.""" -set_min_power!(value::SupplyTechnology, val) = value.min_power = val """Set [`SupplyTechnology`](@ref) `cluster`.""" set_cluster!(value::SupplyTechnology, val) = value.cluster = val -"""Set [`SupplyTechnology`](@ref) `maintenance_duration`.""" -set_maintenance_duration!(value::SupplyTechnology, val) = value.maintenance_duration = val """Set [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" set_ramp_up_percentage!(value::SupplyTechnology, val) = value.ramp_up_percentage = val -"""Set [`SupplyTechnology`](@ref) `maintenance_cycle_length_years`.""" -set_maintenance_cycle_length_years!(value::SupplyTechnology, val) = value.maintenance_cycle_length_years = val """Set [`SupplyTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val +"""Set [`SupplyTechnology`](@ref) `min_generation_percentage`.""" +set_min_generation_percentage!(value::SupplyTechnology, val) = value.min_generation_percentage = val """Set [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" set_start_cost_per_mw!(value::SupplyTechnology, val) = value.start_cost_per_mw = val -"""Set [`SupplyTechnology`](@ref) `cap_size`.""" -set_cap_size!(value::SupplyTechnology, val) = value.cap_size = val -"""Set [`SupplyTechnology`](@ref) `capacity_factor`.""" -set_capacity_factor!(value::SupplyTechnology, val) = value.capacity_factor = val -"""Set [`SupplyTechnology`](@ref) `up_time`.""" -set_up_time!(value::SupplyTechnology, val) = value.up_time = val """Set [`SupplyTechnology`](@ref) `reg_max`.""" set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val -"""Set [`SupplyTechnology`](@ref) `maintenance_begin_cadence`.""" -set_maintenance_begin_cadence!(value::SupplyTechnology, val) = value.maintenance_begin_cadence = val +"""Set [`SupplyTechnology`](@ref) `up_time`.""" +set_up_time!(value::SupplyTechnology, val) = value.up_time = val diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 21e2f2d..2aa9784 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -15,15 +15,14 @@ This file is auto-generated. Do not edit. power_systems_type::String angle_limit::Float64 internal::InfrastructureSystemsInternal - network_lines::Int64 ext::Dict resistance::Float64 voltage::Float64 + network_id::Int64 maximum_new_capacity::Float64 existing_line_capacity::Float64 wacc::Float64 line_loss::Float64 - maximum_flow::Float64 end @@ -38,15 +37,14 @@ This file is auto-generated. Do not edit. - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `angle_limit::Float64`: (default: `0.0`) Votlage angle limit (radians) - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `network_lines::Int64`: Numerical Index - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `resistance::Float64`: (default: `0.0`) Technology resistance in Ohms - `voltage::Float64`: (default: `0.0`) Technology resistance in Ohms +- `network_id::Int64`: Numerical Index - `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) - `existing_line_capacity::Float64`: Existing capacity of transport technology (MW) - `wacc::Float64`: (default: `0`) Weighted average cost of capital - `line_loss::Float64`: Transmission loss for each transport technology (%) -- `maximum_flow::Float64`: Maximum line flow (MW) """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology "Cost of adding new capacity to the inter-regional transmission line." @@ -67,14 +65,14 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology angle_limit::Float64 "Internal field" internal::InfrastructureSystemsInternal - "Numerical Index" - network_lines::Int64 "Option for providing additional data" ext::Dict "Technology resistance in Ohms" resistance::Float64 "Technology resistance in Ohms" voltage::Float64 + "Numerical Index" + network_id::Int64 "Maximum capacity that can be added to transmission line (MW)" maximum_new_capacity::Float64 "Existing capacity of transport technology (MW)" @@ -83,13 +81,11 @@ mutable struct TransportTechnology{T <: PSY.Device} <: Technology wacc::Float64 "Transmission loss for each transport technology (%)" line_loss::Float64 - "Maximum line flow (MW)" - maximum_flow::Float64 end -function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, power_systems_type, angle_limit=0.0, internal=InfrastructureSystemsInternal(), network_lines, ext=Dict(), resistance=0.0, voltage=0.0, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, maximum_flow, ) where T <: PSY.Device - TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, power_systems_type, angle_limit, internal, network_lines, ext, resistance, voltage, maximum_new_capacity, existing_line_capacity, wacc, line_loss, maximum_flow, ) +function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, power_systems_type, angle_limit=0.0, internal=InfrastructureSystemsInternal(), ext=Dict(), resistance=0.0, voltage=0.0, network_id, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, power_systems_type, angle_limit, internal, ext, resistance, voltage, network_id, maximum_new_capacity, existing_line_capacity, wacc, line_loss, ) end """Get [`TransportTechnology`](@ref) `capital_cost`.""" @@ -110,14 +106,14 @@ get_power_systems_type(value::TransportTechnology) = value.power_systems_type get_angle_limit(value::TransportTechnology) = value.angle_limit """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal -"""Get [`TransportTechnology`](@ref) `network_lines`.""" -get_network_lines(value::TransportTechnology) = value.network_lines """Get [`TransportTechnology`](@ref) `ext`.""" get_ext(value::TransportTechnology) = value.ext """Get [`TransportTechnology`](@ref) `resistance`.""" get_resistance(value::TransportTechnology) = value.resistance """Get [`TransportTechnology`](@ref) `voltage`.""" get_voltage(value::TransportTechnology) = value.voltage +"""Get [`TransportTechnology`](@ref) `network_id`.""" +get_network_id(value::TransportTechnology) = value.network_id """Get [`TransportTechnology`](@ref) `maximum_new_capacity`.""" get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity """Get [`TransportTechnology`](@ref) `existing_line_capacity`.""" @@ -126,8 +122,6 @@ get_existing_line_capacity(value::TransportTechnology) = value.existing_line_cap get_wacc(value::TransportTechnology) = value.wacc """Get [`TransportTechnology`](@ref) `line_loss`.""" get_line_loss(value::TransportTechnology) = value.line_loss -"""Get [`TransportTechnology`](@ref) `maximum_flow`.""" -get_maximum_flow(value::TransportTechnology) = value.maximum_flow """Set [`TransportTechnology`](@ref) `capital_cost`.""" set_capital_cost!(value::TransportTechnology, val) = value.capital_cost = val @@ -147,14 +141,14 @@ set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_t set_angle_limit!(value::TransportTechnology, val) = value.angle_limit = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val -"""Set [`TransportTechnology`](@ref) `network_lines`.""" -set_network_lines!(value::TransportTechnology, val) = value.network_lines = val """Set [`TransportTechnology`](@ref) `ext`.""" set_ext!(value::TransportTechnology, val) = value.ext = val """Set [`TransportTechnology`](@ref) `resistance`.""" set_resistance!(value::TransportTechnology, val) = value.resistance = val """Set [`TransportTechnology`](@ref) `voltage`.""" set_voltage!(value::TransportTechnology, val) = value.voltage = val +"""Set [`TransportTechnology`](@ref) `network_id`.""" +set_network_id!(value::TransportTechnology, val) = value.network_id = val """Set [`TransportTechnology`](@ref) `maximum_new_capacity`.""" set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val """Set [`TransportTechnology`](@ref) `existing_line_capacity`.""" @@ -163,5 +157,3 @@ set_existing_line_capacity!(value::TransportTechnology, val) = value.existing_li set_wacc!(value::TransportTechnology, val) = value.wacc = val """Set [`TransportTechnology`](@ref) `line_loss`.""" set_line_loss!(value::TransportTechnology, val) = value.line_loss = val -"""Set [`TransportTechnology`](@ref) `maximum_flow`.""" -set_maximum_flow!(value::TransportTechnology, val) = value.maximum_flow = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 9ae316c..448f6e7 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -4,7 +4,6 @@ include("SupplyTechnology.jl") include("DemandRequirement.jl") include("RetirementPotential.jl") include("ExistingCapacity.jl") -include("CoLocatedSupplyStorageTechnology.jl") include("AggregateRetrofitPotential.jl") include("DemandSideTechnology.jl") include("AggregateRetirementPotential.jl") @@ -19,13 +18,7 @@ export get_angle_limit export get_available export get_balancing_topology export get_base_power -export get_cap_size -export get_capacity_factor export get_capital_cost -export get_capital_cost_energy -export get_capital_cost_gen -export get_capital_cost_inv -export get_capital_cost_power export get_capital_costs export get_capital_costs_energy export get_capital_costs_power @@ -45,10 +38,6 @@ export get_demand_mw export get_down_time export get_eff_down export get_eff_up -export get_efficiency_down_ac -export get_efficiency_down_dc -export get_efficiency_up_ac -export get_efficiency_up_dc export get_eligible_resources export get_eligible_zones export get_end_region @@ -62,16 +51,8 @@ export get_gen_ID export get_heat_rate_mmbtu_per_mwh export get_id export get_initial_capacity -export get_initial_capacity_energy -export get_initial_capacity_inverter -export get_initial_capacity_power -export get_initial_gen_capacity -export get_inverter_ratio export get_line_loss export get_losses -export get_maintenance_begin_cadence -export get_maintenance_cycle_length_years -export get_maintenance_duration export get_max_cap_energy export get_max_cap_power export get_max_demand_advance @@ -79,33 +60,20 @@ export get_max_demand_curtailment export get_max_demand_delay export get_max_duration export get_maximum_capacity -export get_maximum_capacity_energy -export get_maximum_capacity_power -export get_maximum_duration -export get_maximum_flow -export get_maximum_gen_capacity -export get_maximum_inverter_capacity export get_maximum_new_capacity export get_min_cap_energy export get_min_cap_power export get_min_duration +export get_min_generation_percentage export get_min_mw export get_min_power -export get_minimum_duration -export get_minimum_inverter_capacity export get_minimum_required_capacity -export get_minimum_required_capacity_energy -export get_minimum_required_capacity_gen -export get_minimum_required_capacity_power export get_name -export get_network_lines +export get_network_id export get_om_costs_energy export get_om_costs_power export get_operation_costs -export get_operations_cost_energy -export get_operations_cost_gen -export get_operations_cost_inv -export get_operations_cost_power +export get_outage_factor export get_power_systems_type export get_price_per_unit export get_pricecap @@ -123,7 +91,6 @@ export get_retrofit_potential export get_rsv_cost export get_rsv_max export get_segments -export get_self_discharge export get_start_cost_per_mw export get_start_fuel_mmbtu_per_mw export get_start_region @@ -139,13 +106,7 @@ export set_angle_limit! export set_available! export set_balancing_topology! export set_base_power! -export set_cap_size! -export set_capacity_factor! export set_capital_cost! -export set_capital_cost_energy! -export set_capital_cost_gen! -export set_capital_cost_inv! -export set_capital_cost_power! export set_capital_costs! export set_capital_costs_energy! export set_capital_costs_power! @@ -165,10 +126,6 @@ export set_demand_mw! export set_down_time! export set_eff_down! export set_eff_up! -export set_efficiency_down_ac! -export set_efficiency_down_dc! -export set_efficiency_up_ac! -export set_efficiency_up_dc! export set_eligible_resources! export set_eligible_zones! export set_end_region! @@ -182,16 +139,8 @@ export set_gen_ID! export set_heat_rate_mmbtu_per_mwh! export set_id! export set_initial_capacity! -export set_initial_capacity_energy! -export set_initial_capacity_inverter! -export set_initial_capacity_power! -export set_initial_gen_capacity! -export set_inverter_ratio! export set_line_loss! export set_losses! -export set_maintenance_begin_cadence! -export set_maintenance_cycle_length_years! -export set_maintenance_duration! export set_max_cap_energy! export set_max_cap_power! export set_max_demand_advance! @@ -199,33 +148,20 @@ export set_max_demand_curtailment! export set_max_demand_delay! export set_max_duration! export set_maximum_capacity! -export set_maximum_capacity_energy! -export set_maximum_capacity_power! -export set_maximum_duration! -export set_maximum_flow! -export set_maximum_gen_capacity! -export set_maximum_inverter_capacity! export set_maximum_new_capacity! export set_min_cap_energy! export set_min_cap_power! export set_min_duration! +export set_min_generation_percentage! export set_min_mw! export set_min_power! -export set_minimum_duration! -export set_minimum_inverter_capacity! export set_minimum_required_capacity! -export set_minimum_required_capacity_energy! -export set_minimum_required_capacity_gen! -export set_minimum_required_capacity_power! export set_name! -export set_network_lines! +export set_network_id! export set_om_costs_energy! export set_om_costs_power! export set_operation_costs! -export set_operations_cost_energy! -export set_operations_cost_gen! -export set_operations_cost_inv! -export set_operations_cost_power! +export set_outage_factor! export set_power_systems_type! export set_price_per_unit! export set_pricecap! @@ -243,7 +179,6 @@ export set_retrofit_potential! export set_rsv_cost! export set_rsv_max! export set_segments! -export set_self_discharge! export set_start_cost_per_mw! export set_start_fuel_mmbtu_per_mw! export set_start_region! From c2fd4d69e551885bc977bb9335e565991aa2187c Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 16:12:10 -0600 Subject: [PATCH 63/69] formatter --- src/PowerSystemsInvestmentsPortfolios.jl | 4 +- src/generate_structs.jl | 213 +++++++++++++---------- src/models/regions.jl | 3 +- src/models/requirements.jl | 2 +- src/portfolio.jl | 6 +- src/utils/print.jl | 4 +- 6 files changed, 130 insertions(+), 102 deletions(-) diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index 315191f..f718841 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -23,9 +23,7 @@ import InfrastructureSystems: InfrastructureSystemsComponent import PowerSystems -import PowerSystems: - StorageCost, - ThermalGenerationCost +import PowerSystems: StorageCost, ThermalGenerationCost import JSONSchema import JSON3 diff --git a/src/generate_structs.jl b/src/generate_structs.jl index a7a0767..30f2c48 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -289,7 +289,7 @@ function parse_timestamps_and_values(json_str::String) for item in data # Append the timestamp to the timestamps array push!(timestamps, item["timestamp"]) - + # Append the value to the values array push!(values, item["value"]) end @@ -303,12 +303,12 @@ function parse_json_to_arrays(json_str::String) # Initialize array to store x and y values xy_values = [] - + # Iterate over each dictionary in the parsed JSON data for item in data # Append the x values to x_values array as vector of named tuples - push!(xy_values, IS.XY_COORDS((Float64(item["from_x"]),Float64(item["from_y"])))) - push!(xy_values, IS.XY_COORDS((Float64(item["to_x"]),Float64(item["to_y"])))) + push!(xy_values, IS.XY_COORDS((Float64(item["from_x"]), Float64(item["from_y"])))) + push!(xy_values, IS.XY_COORDS((Float64(item["to_x"]), Float64(item["to_y"])))) end return unique(xy_values) @@ -329,13 +329,19 @@ function dataframe_to_structs(df_dict::Dict) supply_curve = row_pw["piecewise_linear_blob"] supply_curve_parsed = parse_json_to_arrays(supply_curve) - id = df_dict["attributes"][df_dict["attributes"][!, "entity_attribute_id"] .== eaid, "entity_id"] - + id = df_dict["attributes"][ + df_dict["attributes"][!, "entity_attribute_id"] .== eaid, + "entity_id", + ] + # Find corresponding supply technology for that supply curve - row = df_dict["supply_technologies"][df_dict["supply_technologies"][!, "technology_id"] .== id, :] - + row = df_dict["supply_technologies"][ + df_dict["supply_technologies"][!, "technology_id"] .== id, + :, + ] + #extract area - area = topologies[topologies.name .== row[!,"balancing_topology"][1], "area"][1] + area = topologies[topologies.name .== row[!, "balancing_topology"][1], "area"][1] area_int = parse(Int64, area) #extract supply curve, does every supply_technology have a supply curve? @@ -347,40 +353,45 @@ function dataframe_to_structs(df_dict::Dict) parametric = map_prime_mover_to_parametric(row[!, "prime_mover"][1]) t = SupplyTechnology{parametric}(; #Data pulled from DB - name=string(row[!,"technology_id"][1]), - id=row[!,"technology_id"][1], + name=string(row[!, "technology_id"][1]), + id=row[!, "technology_id"][1], inv_cost_per_mwyr=InputOutputCurve(PiecewiseLinearData(supply_curve_parsed)), - om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(row[!,"vom_cost"][1])), fixed=row[!,"fom_cost"][1], start_up=0.0, shut_down=0.0), - balancing_topology=string(row[!,"balancing_topology"][1]), - prime_mover_type=map_prime_mover(row[!,"prime_mover"][1]), - fuel=row[!,"fuel_type"][1], - zone = area_int, + om_costs=ThermalGenerationCost( + variable=CostCurve(LinearCurve(row[!, "vom_cost"][1])), + fixed=row[!, "fom_cost"][1], + start_up=0.0, + shut_down=0.0, + ), + balancing_topology=string(row[!, "balancing_topology"][1]), + prime_mover_type=map_prime_mover(row[!, "prime_mover"][1]), + fuel=row[!, "fuel_type"][1], + zone=area_int, #Problem ones, need to write functions to extract base_power=100.0, - existing_cap_mw = 0.0, + existing_cap_mw=0.0, cap_size=250.0, - + # Data we should have but dont currently - start_fuel_mmbtu_per_mw = 2.0, - start_cost_per_mw = 91.0, - up_time = 6.0, - down_time = 6.0, - heat_rate_mmbtu_per_mwh = 7.43, - co2 = 0.05306, - ramp_dn_percentage = 0.64, - ramp_up_percentage = 0.64, + start_fuel_mmbtu_per_mw=2.0, + start_cost_per_mw=91.0, + up_time=6.0, + down_time=6.0, + heat_rate_mmbtu_per_mwh=7.43, + co2=0.05306, + ramp_dn_percentage=0.64, + ramp_up_percentage=0.64, #Placeholder or default values (modeling assumptions) - region = "MA", #this one can probably just be removed from the structs, just descriptor for GenX + region="MA", #this one can probably just be removed from the structs, just descriptor for GenX available=true, min_cap_mw=0.0, - min_power = 0.0, - max_cap_mw = -1, + min_power=0.0, + max_cap_mw=-1, power_systems_type=string(parametric), - cluster = 1, - reg_max = 0.25, - rsv_max = 0.5, + cluster=1, + reg_max=0.25, + rsv_max=0.5, #new_build = 1 ) add_technology!(p, t) @@ -402,34 +413,39 @@ function dataframe_to_structs(df_dict::Dict) balancing_topology=string(row["balancing_topology"]), prime_mover_type=map_prime_mover(row["prime_mover"]), fuel=row["fuel_type"], - zone = area_int, + zone=area_int, base_power=row["base_power"], - existing_cap_mw = row["rating"], + existing_cap_mw=row["rating"], # Problem ones, need to write functions to extract cap_size=250.0, - + # Data we should have but dont currently - om_costs=ThermalGenerationCost(variable=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), - start_fuel_mmbtu_per_mw = 2.0, - start_cost_per_mw = 91.0, - up_time = 6.0, - down_time = 6.0, - heat_rate_mmbtu_per_mwh = 7.43, - co2 = 0.05306, - ramp_dn_percentage = 0.64, - ramp_up_percentage = 0.64, + om_costs=ThermalGenerationCost( + variable=CostCurve(LinearCurve(0.0)), + fixed=0.0, + start_up=0.0, + shut_down=0.0, + ), + start_fuel_mmbtu_per_mw=2.0, + start_cost_per_mw=91.0, + up_time=6.0, + down_time=6.0, + heat_rate_mmbtu_per_mwh=7.43, + co2=0.05306, + ramp_dn_percentage=0.64, + ramp_up_percentage=0.64, #Placeholder or default values (modeling assumptions) - region = "MA", + region="MA", available=true, min_cap_mw=0.0, - min_power = 0.0, - max_cap_mw = -1, + min_power=0.0, + max_cap_mw=-1, power_systems_type=string(parametric), - cluster = 1, - reg_max = 0.25, - rsv_max = 0.5, + cluster=1, + reg_max=0.25, + rsv_max=0.5, #new_build = 0#0 for existing builds ) add_technology!(p, t) @@ -437,7 +453,7 @@ function dataframe_to_structs(df_dict::Dict) # Get storage units for row in eachrow(df_dict["storage_units"]) - + #extract area area = topologies[topologies.name .== row["balancing_topology"], "area"][1] area_int = parse(Int64, area) @@ -447,36 +463,42 @@ function dataframe_to_structs(df_dict::Dict) name=row["name"], base_power=row["base_power"], # Natural Units id=row["storage_unit_id"], - zone = area_int, + zone=area_int, prime_mover_type=map_prime_mover(row["prime_mover"]), balancing_topology=row["balancing_topology"], - existing_cap_mw = row["rating"], - existing_cap_mwh = row["max_capacity"], - + existing_cap_mw=row["rating"], + existing_cap_mwh=row["max_capacity"], + #stuff we dont have but probably should - om_costs = StorageCost(charge_variable_cost=CostCurve(LinearCurve(0.0)), discharge_variable_cost=CostCurve(LinearCurve(0.0)), fixed=0.0, start_up=0.0, shut_down=0.0), - fixed_om_cost_per_mwhyr = LinearCurve(0.0), - eff_up = 0.92, - eff_down = 0.92, - storage_tech = StorageTech.LIB, - + om_costs=StorageCost( + charge_variable_cost=CostCurve(LinearCurve(0.0)), + discharge_variable_cost=CostCurve(LinearCurve(0.0)), + fixed=0.0, + start_up=0.0, + shut_down=0.0, + ), + fixed_om_cost_per_mwhyr=LinearCurve(0.0), + eff_up=0.92, + eff_down=0.92, + storage_tech=StorageTech.LIB, + #Default or placeholder values inv_cost_per_mwyr=LinearCurve(0.0), inv_cost_charge_per_mwyr=LinearCurve(0.0), inv_cost_per_mwhyr=LinearCurve(0.0), available=true, - region = "ME", - cluster = 0, - self_disch = 0.0, - min_duration = 1.0, - max_duration = 10.0, + region="ME", + cluster=0, + self_disch=0.0, + min_duration=1.0, + max_duration=10.0, min_cap_mwh=0.0, min_cap_mw=0.0, min_charge_cap_mw=-1, - max_cap_mw = -1, - max_charge_cap_mw = -1, - max_cap_mwh = -1, - power_systems_type = "Test", + max_cap_mw=-1, + max_charge_cap_mw=-1, + max_cap_mwh=-1, + power_systems_type="Test", ) add_technology!(p, s) end @@ -484,8 +506,11 @@ function dataframe_to_structs(df_dict::Dict) #Populate DemandRequirement structs from database for row in eachrow(df_dict["demand_requirements"]) #start in time_series - eaid = row["entity_attribute_id"] - ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[!,"time_series_blob"][1] + eaid = row["entity_attribute_id"] + ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[ + !, + "time_series_blob", + ][1] ts_parsed = parse_timestamps_and_values(ts_blob) dates = ts_parsed[1] #fix this later, dates syntax is inconsistent so hard to parse dates = DateTime("2020-01-01T00:00:00"):Hour(1):DateTime("2020-12-31T23:00:00") @@ -493,13 +518,13 @@ function dataframe_to_structs(df_dict::Dict) demand_array = TimeArray(dates, demand) ts = SingleTimeSeries(string(row["entity_attribute_id"]), demand_array) #How to parse this timestamp stuff?? - + d = DemandRequirement{ElectricLoad}( #Data pulled from DB name=string(row["entity_attribute_id"]), region=row["area"], - zone = parse(Int64, row["area"]), - + zone=parse(Int64, row["area"]), + #Placeholder/default values available=true, power_systems_type="ElectricLoad", @@ -511,38 +536,44 @@ function dataframe_to_structs(df_dict::Dict) #Transmission Lines lines = df_dict["transmission_lines"] for row in eachrow(df_dict["transmission_interchange"]) - + # get list of balancing topologies that correspond to the areas for line tx topologies_from = filter("area" => isequal(row["area_from"]), topologies)[!, "name"] topologies_to = filter("area" => isequal(row["area_to"]), topologies)[!, "name"] - + existing_capacity = 0.0 for from in topologies_from for to in topologies_to - line_cap = lines[(lines[!,"balancing_topology_from"] .== from) .& (lines[!,"balancing_topology_to"] .== to), "continuous_rating"] + line_cap = lines[ + (lines[ + !, + "balancing_topology_from", + ] .== from) .& (lines[!, "balancing_topology_to"] .== to), + "continuous_rating", + ] if length(line_cap) == 1 existing_capacity += line_cap[1] end end end - + tx = TransportTechnology{Branch}(; - name = string(rownumber(row)), - network_lines = rownumber(row), + name=string(rownumber(row)), + network_lines=rownumber(row), available=true, - start_region = parse(Int64, row["area_from"]), - end_region = parse(Int64, row["area_to"]), - maximum_new_capacity = row["max_flow_from"], - maximum_flow = row["max_flow_from"], - existing_line_capacity = existing_capacity, - + start_region=parse(Int64, row["area_from"]), + end_region=parse(Int64, row["area_to"]), + maximum_new_capacity=row["max_flow_from"], + maximum_flow=row["max_flow_from"], + existing_line_capacity=existing_capacity, + #stuff we don't have, but probably should - capital_cost = LinearCurve(19261), - line_loss = 0.019653847, - power_systems_type = "Branch" + capital_cost=LinearCurve(19261), + line_loss=0.019653847, + power_systems_type="Branch", ) add_technology!(p, tx) end return p -end \ No newline at end of file +end diff --git a/src/models/regions.jl b/src/models/regions.jl index 18e7341..8e672be 100644 --- a/src/models/regions.jl +++ b/src/models/regions.jl @@ -16,6 +16,5 @@ get_id(val::Region) = val.id get_internal(val::Region) = val.internal get_ext(val::Region) = get_ext(get_internal(val)) get_time_series_container(val::Region) = val.time_series_container -get_supplemental_attributes_container(val::Region) = - val.supplemental_attributes_container +get_supplemental_attributes_container(val::Region) = val.supplemental_attributes_container supports_time_series(::Region) = true diff --git a/src/models/requirements.jl b/src/models/requirements.jl index a55aba6..f76c28d 100644 --- a/src/models/requirements.jl +++ b/src/models/requirements.jl @@ -9,4 +9,4 @@ capacity requirements. abstract type Requirements <: IS.InfrastructureSystemsComponent end supports_time_series(::Requirements) = true -supports_supplemental_attributes(::Requirements) = true \ No newline at end of file +supports_supplemental_attributes(::Requirements) = true diff --git a/src/portfolio.jl b/src/portfolio.jl index ecc7d75..42e930c 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -605,13 +605,13 @@ end ################################ """ -Add policy requirement to portfolio +Add policy requirement to portfolio """ function add_requirement!(portfolio::Portfolio, req::Requirements) #return PSY.add_service!(portfolio.data, req) #skip_validation = false #skip_validation = _validate_or_skip!(sys, service, skip_validation) - return IS.add_component!(portfolio.data, req, skip_validation = false) + return IS.add_component!(portfolio.data, req, skip_validation=false) end function get_requirements(::Type{T}, portfolio::Portfolio;) where {T <: Requirements} @@ -675,4 +675,4 @@ end """ Return the internal of a supplemental attribute, required to add to IS for SupplementalAttributes to work """ -IS.get_internal(val::IS.SupplementalAttribute) = val.internal \ No newline at end of file +IS.get_internal(val::IS.SupplementalAttribute) = val.internal diff --git a/src/utils/print.jl b/src/utils/print.jl index 2a41b61..82f8e25 100644 --- a/src/utils/print.jl +++ b/src/utils/print.jl @@ -66,7 +66,8 @@ function Base.show(io::IO, ::MIME"text/plain", ist::PSY.Component) obj isa Vector{<:IS.InfrastructureSystemsComponent} val = summary(getproperty(ist, name)) elseif PSY.hasproperty(PowerSystemsInvestmentsPortfolios, getter_name) - getter_func = PSY.getproperty(PowerSystemsInvestmentsPortfolios, getter_name) + getter_func = + PSY.getproperty(PowerSystemsInvestmentsPortfolios, getter_name) #print(getter_func) val = getter_func(ist) else @@ -90,7 +91,6 @@ function Base.show(io::IO, ::MIME"text/plain", ist::PSY.Component) return end - function show_portfolio_table(io::IO, p::Portfolio; kwargs...) header = ["Property", "Value"] table = [ From 8826d53e9d58ff38a03899d33a878dec72973751 Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 16:51:03 -0600 Subject: [PATCH 64/69] make Zone optional for SupplyTechnology --- src/models/generated/SupplyTechnology.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 0e60ae9..01ddb3d 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -8,7 +8,7 @@ This file is auto-generated. Do not edit. mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} - zone::Zone + zone::Union{Nothing, Zone} prime_mover_type::PrimeMovers minimum_required_capacity::Float64 cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} @@ -49,7 +49,7 @@ This file is auto-generated. Do not edit. # Arguments - `base_power::Float64`: Base power - `heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh -- `zone::Zone`: (default: `nothing`) Zone where tech operates in +- `zone::Union{Nothing, Zone}`: (default: `nothing`) Zone where tech operates in - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology - `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator @@ -90,7 +90,7 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Heat rate of generator, MMBTU/MWh" heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} "Zone where tech operates in" - zone::Zone + zone::Union{Nothing, Zone} "Prime mover for generator" prime_mover_type::PrimeMovers "Minimum required capacity for a technology" From 099874cb20f77b871a39c0e2a7c936221bc5bfea Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 16:55:07 -0600 Subject: [PATCH 65/69] remove region --- src/models/generated/SupplyTechnology.jl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 01ddb3d..4330078 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -33,7 +33,6 @@ This file is auto-generated. Do not edit. internal::InfrastructureSystemsInternal ext::Dict balancing_topology::String - region::String maximum_capacity::Float64 cluster::Int64 ramp_up_percentage::Float64 @@ -74,7 +73,6 @@ This file is auto-generated. Do not edit. - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes -- `region::String`: Region/zone technology operates in - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology - `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. - `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity @@ -139,8 +137,6 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology ext::Dict "Set of balancing nodes" balancing_topology::String - "Region/zone technology operates in" - region::String "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 "Number of the cluster when representing multiple clusters of a given technology in a given region." @@ -160,8 +156,8 @@ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology end -function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), outage_factor=1.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, region, maximum_capacity=Inf, cluster=1, ramp_up_percentage=100.0, reg_cost=0.0, min_generation_percentage=0.0, start_cost_per_mw=0.0, reg_max=0.0, up_time=0.0, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, outage_factor, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, region, maximum_capacity, cluster, ramp_up_percentage, reg_cost, min_generation_percentage, start_cost_per_mw, reg_max, up_time, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), outage_factor=1.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, maximum_capacity=Inf, cluster=1, ramp_up_percentage=100.0, reg_cost=0.0, min_generation_percentage=0.0, start_cost_per_mw=0.0, reg_max=0.0, up_time=0.0, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, outage_factor, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, maximum_capacity, cluster, ramp_up_percentage, reg_cost, min_generation_percentage, start_cost_per_mw, reg_max, up_time, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" @@ -218,8 +214,6 @@ get_internal(value::SupplyTechnology) = value.internal get_ext(value::SupplyTechnology) = value.ext """Get [`SupplyTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::SupplyTechnology) = value.balancing_topology -"""Get [`SupplyTechnology`](@ref) `region`.""" -get_region(value::SupplyTechnology) = value.region """Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity """Get [`SupplyTechnology`](@ref) `cluster`.""" @@ -291,8 +285,6 @@ set_internal!(value::SupplyTechnology, val) = value.internal = val set_ext!(value::SupplyTechnology, val) = value.ext = val """Set [`SupplyTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val -"""Set [`SupplyTechnology`](@ref) `region`.""" -set_region!(value::SupplyTechnology, val) = value.region = val """Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val """Set [`SupplyTechnology`](@ref) `cluster`.""" From 8a7061b807a987b9104136e578c6cc5cea140f5a Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 17:18:53 -0600 Subject: [PATCH 66/69] add defaults for storage --- src/models/generated/StorageTechnology.jl | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 4644341..4ba669b 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -30,9 +30,8 @@ This file is auto-generated. Do not edit. om_costs_power::PSY.OperationalCost balancing_topology::String min_cap_energy::Float64 - region::String - eff_up::Float64 ext::Dict + eff_up::Float64 reg_cost::Float64 min_duration::Float64 max_cap_energy::Float64 @@ -46,10 +45,10 @@ This file is auto-generated. Do not edit. - `om_costs_energy::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology - `zone::Int64`: Zone number - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `existing_cap_energy::Float64`: Pre-existing energy capacity for a technology (MWh) +- `existing_cap_energy::Float64`: (default: `0.0`) Pre-existing energy capacity for a technology (MWh) - `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves - `available::Bool`: identifies whether the technology is available -- `existing_cap_power::Float64`: Pre-existing power capacity for a technology (MW) +- `existing_cap_power::Float64`: (default: `0.0`) Pre-existing power capacity for a technology (MW) - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type - `capital_costs_power::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. @@ -60,18 +59,17 @@ This file is auto-generated. Do not edit. - `losses::Float64`: (default: `1.0`) Power loss (pct per hour) - `eff_down::Float64`: (default: `1.0`) Efficiency of discharging storage - `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. -- `max_cap_power::Float64`: (default: `-1`) Maximum allowable installed power capacity for a storage technology +- `max_cap_power::Float64`: (default: `1e8`) Maximum allowable installed power capacity for a storage technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `om_costs_power::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology - `balancing_topology::String`: Set of balancing nodes - `min_cap_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology -- `region::String`: Region/zone technology operates in -- `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage - `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves - `min_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology -- `max_cap_energy::Float64`: (default: `-1`) Maximum allowable installed energy capacity for a storage technology +- `max_cap_energy::Float64`: (default: `1e8`) Maximum allowable installed energy capacity for a storage technology - `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology @@ -123,12 +121,10 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology balancing_topology::String "Minimum required energy capacity for a storage technology" min_cap_energy::Float64 - "Region/zone technology operates in" - region::String - "Efficiency of charging storage" - eff_up::Float64 "Option for providing additional data" ext::Dict + "Efficiency of charging storage" + eff_up::Float64 "Cost of providing regulation reserves " reg_cost::Float64 "Minimum required durection for a storage technology" @@ -140,8 +136,8 @@ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology end -function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy, rsv_cost=0.0, available, existing_cap_power, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=-1, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, region, eff_up=1.0, ext=Dict(), reg_cost=0.0, min_duration=0.0, max_cap_energy=-1, reg_max=0.0, ) where T <: PSY.Storage - StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, region, eff_up, ext, reg_cost, min_duration, max_cap_energy, reg_max, ) +function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy=0.0, rsv_cost=0.0, available, existing_cap_power=0.0, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=1e8, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, ext=Dict(), eff_up=1.0, reg_cost=0.0, min_duration=0.0, max_cap_energy=1e8, reg_max=0.0, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, ext, eff_up, reg_cost, min_duration, max_cap_energy, reg_max, ) end """Get [`StorageTechnology`](@ref) `base_power`.""" @@ -192,12 +188,10 @@ get_om_costs_power(value::StorageTechnology) = value.om_costs_power get_balancing_topology(value::StorageTechnology) = value.balancing_topology """Get [`StorageTechnology`](@ref) `min_cap_energy`.""" get_min_cap_energy(value::StorageTechnology) = value.min_cap_energy -"""Get [`StorageTechnology`](@ref) `region`.""" -get_region(value::StorageTechnology) = value.region -"""Get [`StorageTechnology`](@ref) `eff_up`.""" -get_eff_up(value::StorageTechnology) = value.eff_up """Get [`StorageTechnology`](@ref) `ext`.""" get_ext(value::StorageTechnology) = value.ext +"""Get [`StorageTechnology`](@ref) `eff_up`.""" +get_eff_up(value::StorageTechnology) = value.eff_up """Get [`StorageTechnology`](@ref) `reg_cost`.""" get_reg_cost(value::StorageTechnology) = value.reg_cost """Get [`StorageTechnology`](@ref) `min_duration`.""" @@ -255,12 +249,10 @@ set_om_costs_power!(value::StorageTechnology, val) = value.om_costs_power = val set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val """Set [`StorageTechnology`](@ref) `min_cap_energy`.""" set_min_cap_energy!(value::StorageTechnology, val) = value.min_cap_energy = val -"""Set [`StorageTechnology`](@ref) `region`.""" -set_region!(value::StorageTechnology, val) = value.region = val -"""Set [`StorageTechnology`](@ref) `eff_up`.""" -set_eff_up!(value::StorageTechnology, val) = value.eff_up = val """Set [`StorageTechnology`](@ref) `ext`.""" set_ext!(value::StorageTechnology, val) = value.ext = val +"""Set [`StorageTechnology`](@ref) `eff_up`.""" +set_eff_up!(value::StorageTechnology, val) = value.eff_up = val """Set [`StorageTechnology`](@ref) `reg_cost`.""" set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val """Set [`StorageTechnology`](@ref) `min_duration`.""" From 776b1e2f25097f1b0e264ed7252801e98e267e9f Mon Sep 17 00:00:00 2001 From: Jerry Potts Date: Tue, 17 Sep 2024 17:23:14 -0600 Subject: [PATCH 67/69] remove region from DemandRequirement --- src/models/generated/DemandRequirement.jl | 12 ++---------- src/models/generated/includes.jl | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index d9485ba..7b52fcf 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -12,7 +12,6 @@ This file is auto-generated. Do not edit. internal::InfrastructureSystemsInternal ext::Dict demand_mw::Float64 - region::String available::Bool end @@ -25,7 +24,6 @@ This file is auto-generated. Do not edit. - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `demand_mw::Float64`: (default: `0.0`) Demand profile in MW -- `region::String`: Corresponding region for peak demand - `available::Bool`: (default: `true`) identifies whether the technology is available """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology @@ -41,15 +39,13 @@ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology ext::Dict "Demand profile in MW" demand_mw::Float64 - "Corresponding region for peak demand" - region::String "identifies whether the technology is available" available::Bool end -function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), demand_mw=0.0, region, available=true, ) where T <: PSY.StaticInjection - DemandRequirement{T}(name, zone, power_systems_type, internal, ext, demand_mw, region, available, ) +function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), demand_mw=0.0, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, zone, power_systems_type, internal, ext, demand_mw, available, ) end """Get [`DemandRequirement`](@ref) `name`.""" @@ -64,8 +60,6 @@ get_internal(value::DemandRequirement) = value.internal get_ext(value::DemandRequirement) = value.ext """Get [`DemandRequirement`](@ref) `demand_mw`.""" get_demand_mw(value::DemandRequirement) = value.demand_mw -"""Get [`DemandRequirement`](@ref) `region`.""" -get_region(value::DemandRequirement) = value.region """Get [`DemandRequirement`](@ref) `available`.""" get_available(value::DemandRequirement) = value.available @@ -81,7 +75,5 @@ set_internal!(value::DemandRequirement, val) = value.internal = val set_ext!(value::DemandRequirement, val) = value.ext = val """Set [`DemandRequirement`](@ref) `demand_mw`.""" set_demand_mw!(value::DemandRequirement, val) = value.demand_mw = val -"""Set [`DemandRequirement`](@ref) `region`.""" -set_region!(value::DemandRequirement, val) = value.region = val """Set [`DemandRequirement`](@ref) `available`.""" set_available!(value::DemandRequirement, val) = value.available = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 448f6e7..820bec6 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -82,7 +82,6 @@ export get_ramp_dn_percentage export get_ramp_up_percentage export get_reg_cost export get_reg_max -export get_region export get_resistance export get_retirement_potential export get_retrofit_fraction @@ -170,7 +169,6 @@ export set_ramp_dn_percentage! export set_ramp_up_percentage! export set_reg_cost! export set_reg_max! -export set_region! export set_resistance! export set_retirement_potential! export set_retrofit_fraction! From 92ded9de3b51a74706e19206771f641c6afa810e Mon Sep 17 00:00:00 2001 From: Sourabh Dalvi Date: Fri, 13 Sep 2024 12:18:24 -0500 Subject: [PATCH 68/69] renaming file name to fix typo (#14) --- .../{DemandsideTechnology.jl => DemandSideTechnology.jl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/models/generated/{DemandsideTechnology.jl => DemandSideTechnology.jl} (100%) diff --git a/src/models/generated/DemandsideTechnology.jl b/src/models/generated/DemandSideTechnology.jl similarity index 100% rename from src/models/generated/DemandsideTechnology.jl rename to src/models/generated/DemandSideTechnology.jl From cf1b3437dc26263aa138553c04485c21a8e20cae Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Wed, 18 Sep 2024 09:46:13 -0700 Subject: [PATCH 69/69] remove extra show --- src/utils/print.jl | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/src/utils/print.jl b/src/utils/print.jl index 82f8e25..523e795 100644 --- a/src/utils/print.jl +++ b/src/utils/print.jl @@ -40,57 +40,6 @@ function Base.show(io::IO, ::MIME"text/html", p::Portfolio) return end -function Base.show(io::IO, ::MIME"text/plain", ist::PSY.Component) - default_units = false - if !PSY.has_units_setting(ist) - print(io, "\n") - @warn( - "SystemUnitSetting not defined, using NATURAL_UNITS for displaying device specification." - ) - PSY.set_units_setting!( - ist, - PSY.SystemUnitsSettings(100.0, PSY.UNIT_SYSTEM_MAPPING["NATURAL_UNITS"]), - ) - default_units = true - end - try - print(io, summary(ist), ":") - for name in fieldnames(typeof(ist)) - obj = getproperty(ist, name) - getter_name = Symbol("get_$name") - if (obj isa InfrastructureSystemsInternal) && !default_units - print(io, "\n ") - show(io, MIME"text/plain"(), obj.units_info) - continue - elseif obj isa IS.InfrastructureSystemsType || - obj isa Vector{<:IS.InfrastructureSystemsComponent} - val = summary(getproperty(ist, name)) - elseif PSY.hasproperty(PowerSystemsInvestmentsPortfolios, getter_name) - getter_func = - PSY.getproperty(PowerSystemsInvestmentsPortfolios, getter_name) - #print(getter_func) - val = getter_func(ist) - else - val = getproperty(ist, name) - end - print(io, "\n ", name, ": ", val) - end - print( - io, - "\n ", - "has_supplemental_attributes", - ": ", - string(PSY.has_supplemental_attributes(ist)), - ) - print(io, "\n ", "has_time_series", ": ", string(PSY.has_time_series(ist))) - finally - if default_units - PSY.set_units_setting!(ist, nothing) - end - end - return -end - function show_portfolio_table(io::IO, p::Portfolio; kwargs...) header = ["Property", "Value"] table = [