Skip to content

Commit

Permalink
Merge pull request #900 from NREL-SIIP/jd/add_standard_load
Browse files Browse the repository at this point in the history
add standard load
  • Loading branch information
jd-lara authored Jun 23, 2022
2 parents 3914aaa + f9d6757 commit 54fabf6
Show file tree
Hide file tree
Showing 4 changed files with 367 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/PowerSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export ElectricLoad
export StaticLoad
export PowerLoad
export PowerLoadPF
export StandardLoad
export FixedAdmittance
export ControllableLoad
export InterruptibleLoad
Expand Down
145 changes: 143 additions & 2 deletions src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,147 @@
],
"supertype": "StaticLoad"
},
{
"struct_name": "StandardLoad",
"docstring": "Data structure for a standard load.",
"fields": [
{
"null_value": "init",
"name": "name",
"exclude_setter": true,
"data_type": "String"
},
{
"null_value": "false",
"name": "available",
"data_type": "Bool"
},
{
"name": "bus",
"null_value": "Bus(nothing)",
"data_type": "Bus"
},
{
"name": "constant_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "constant_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "impedance_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "impedance_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "current_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "current_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_constant_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_constant_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_impedance_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_impedance_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_current_active_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "max_current_reactive_power",
"null_value": "0.0",
"data_type": "Float64",
"needs_conversion": true
},
{
"name": "base_power",
"comment": "Base power of the unit in MVA",
"null_value": "0.0",
"data_type": "Float64",
"valid_range": {
"min": 0,
"max": null
},
"validation_action": "warn"
},
{
"name": "services",
"data_type": "Vector{Service}",
"comment": "Services that this device contributes to",
"null_value": "Device[]",
"default": "Device[]"
},
{
"name": "dynamic_injector",
"data_type": "Union{Nothing, DynamicInjection}",
"comment": "corresponding dynamic injection device",
"null_value": "nothing",
"exclude_setter": true,
"default": "nothing"
},
{
"name": "ext",
"data_type": "Dict{String, Any}",
"null_value": "Dict{String, Any}()",
"default": "Dict{String, Any}()"
},
{
"name": "time_series_container",
"comment": "internal time_series storage",
"null_value": "InfrastructureSystems.TimeSeriesContainer()",
"data_type": "InfrastructureSystems.TimeSeriesContainer",
"default": "InfrastructureSystems.TimeSeriesContainer()"
},
{
"name": "internal",
"comment": "power system internal reference, do not modify",
"data_type": "InfrastructureSystemsInternal",
"internal_default": "InfrastructureSystemsInternal()",
"exclude_setter": true
}
],
"supertype": "StaticLoad"
},
{
"struct_name": "ExponentialLoad",
"docstring": "Data structure for a static exponential load.",
Expand Down Expand Up @@ -13489,7 +13630,7 @@
"min": 0.0,
"max": null
}
},
},
{
"name": "VES_lim",
"comment": "Min and max voltage for entering service (VES_min,VES_max)",
Expand Down Expand Up @@ -13517,7 +13658,7 @@
"min": 0.0,
"max": null
}
},
},
{
"name": "FES_lim",
"comment": "Min and max frequency for entering service (FES_min,FES_max)",
Expand Down
198 changes: 198 additions & 0 deletions src/models/generated/StandardLoad.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
#=
This file is auto-generated. Do not edit.
=#

#! format: off

"""
mutable struct StandardLoad <: StaticLoad
name::String
available::Bool
bus::Bus
constant_active_power::Float64
constant_reactive_power::Float64
impedance_active_power::Float64
impedance_reactive_power::Float64
current_active_power::Float64
current_reactive_power::Float64
max_constant_active_power::Float64
max_constant_reactive_power::Float64
max_impedance_active_power::Float64
max_impedance_reactive_power::Float64
max_current_active_power::Float64
max_current_reactive_power::Float64
base_power::Float64
services::Vector{Service}
dynamic_injector::Union{Nothing, DynamicInjection}
ext::Dict{String, Any}
time_series_container::InfrastructureSystems.TimeSeriesContainer
internal::InfrastructureSystemsInternal
end
Data structure for a standard load.
# Arguments
- `name::String`
- `available::Bool`
- `bus::Bus`
- `constant_active_power::Float64`
- `constant_reactive_power::Float64`
- `impedance_active_power::Float64`
- `impedance_reactive_power::Float64`
- `current_active_power::Float64`
- `current_reactive_power::Float64`
- `max_constant_active_power::Float64`
- `max_constant_reactive_power::Float64`
- `max_impedance_active_power::Float64`
- `max_impedance_reactive_power::Float64`
- `max_current_active_power::Float64`
- `max_current_reactive_power::Float64`
- `base_power::Float64`: Base power of the unit in MVA, validation range: `(0, nothing)`, action if invalid: `warn`
- `services::Vector{Service}`: Services that this device contributes to
- `dynamic_injector::Union{Nothing, DynamicInjection}`: corresponding dynamic injection device
- `ext::Dict{String, Any}`
- `time_series_container::InfrastructureSystems.TimeSeriesContainer`: internal time_series storage
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct StandardLoad <: StaticLoad
name::String
available::Bool
bus::Bus
constant_active_power::Float64
constant_reactive_power::Float64
impedance_active_power::Float64
impedance_reactive_power::Float64
current_active_power::Float64
current_reactive_power::Float64
max_constant_active_power::Float64
max_constant_reactive_power::Float64
max_impedance_active_power::Float64
max_impedance_reactive_power::Float64
max_current_active_power::Float64
max_current_reactive_power::Float64
"Base power of the unit in MVA"
base_power::Float64
"Services that this device contributes to"
services::Vector{Service}
"corresponding dynamic injection device"
dynamic_injector::Union{Nothing, DynamicInjection}
ext::Dict{String, Any}
"internal time_series storage"
time_series_container::InfrastructureSystems.TimeSeriesContainer
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end

function StandardLoad(name, available, bus, constant_active_power, constant_reactive_power, impedance_active_power, impedance_reactive_power, current_active_power, current_reactive_power, max_constant_active_power, max_constant_reactive_power, max_impedance_active_power, max_impedance_reactive_power, max_current_active_power, max_current_reactive_power, base_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), )
StandardLoad(name, available, bus, constant_active_power, constant_reactive_power, impedance_active_power, impedance_reactive_power, current_active_power, current_reactive_power, max_constant_active_power, max_constant_reactive_power, max_impedance_active_power, max_impedance_reactive_power, max_current_active_power, max_current_reactive_power, base_power, services, dynamic_injector, ext, time_series_container, InfrastructureSystemsInternal(), )
end

function StandardLoad(; name, available, bus, constant_active_power, constant_reactive_power, impedance_active_power, impedance_reactive_power, current_active_power, current_reactive_power, max_constant_active_power, max_constant_reactive_power, max_impedance_active_power, max_impedance_reactive_power, max_current_active_power, max_current_reactive_power, base_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), internal=InfrastructureSystemsInternal(), )
StandardLoad(name, available, bus, constant_active_power, constant_reactive_power, impedance_active_power, impedance_reactive_power, current_active_power, current_reactive_power, max_constant_active_power, max_constant_reactive_power, max_impedance_active_power, max_impedance_reactive_power, max_current_active_power, max_current_reactive_power, base_power, services, dynamic_injector, ext, time_series_container, internal, )
end

# Constructor for demo purposes; non-functional.
function StandardLoad(::Nothing)
StandardLoad(;
name="init",
available=false,
bus=Bus(nothing),
constant_active_power=0.0,
constant_reactive_power=0.0,
impedance_active_power=0.0,
impedance_reactive_power=0.0,
current_active_power=0.0,
current_reactive_power=0.0,
max_constant_active_power=0.0,
max_constant_reactive_power=0.0,
max_impedance_active_power=0.0,
max_impedance_reactive_power=0.0,
max_current_active_power=0.0,
max_current_reactive_power=0.0,
base_power=0.0,
services=Device[],
dynamic_injector=nothing,
ext=Dict{String, Any}(),
time_series_container=InfrastructureSystems.TimeSeriesContainer(),
)
end

"""Get [`StandardLoad`](@ref) `name`."""
get_name(value::StandardLoad) = value.name
"""Get [`StandardLoad`](@ref) `available`."""
get_available(value::StandardLoad) = value.available
"""Get [`StandardLoad`](@ref) `bus`."""
get_bus(value::StandardLoad) = value.bus
"""Get [`StandardLoad`](@ref) `constant_active_power`."""
get_constant_active_power(value::StandardLoad) = get_value(value, value.constant_active_power)
"""Get [`StandardLoad`](@ref) `constant_reactive_power`."""
get_constant_reactive_power(value::StandardLoad) = get_value(value, value.constant_reactive_power)
"""Get [`StandardLoad`](@ref) `impedance_active_power`."""
get_impedance_active_power(value::StandardLoad) = get_value(value, value.impedance_active_power)
"""Get [`StandardLoad`](@ref) `impedance_reactive_power`."""
get_impedance_reactive_power(value::StandardLoad) = get_value(value, value.impedance_reactive_power)
"""Get [`StandardLoad`](@ref) `current_active_power`."""
get_current_active_power(value::StandardLoad) = get_value(value, value.current_active_power)
"""Get [`StandardLoad`](@ref) `current_reactive_power`."""
get_current_reactive_power(value::StandardLoad) = get_value(value, value.current_reactive_power)
"""Get [`StandardLoad`](@ref) `max_constant_active_power`."""
get_max_constant_active_power(value::StandardLoad) = get_value(value, value.max_constant_active_power)
"""Get [`StandardLoad`](@ref) `max_constant_reactive_power`."""
get_max_constant_reactive_power(value::StandardLoad) = get_value(value, value.max_constant_reactive_power)
"""Get [`StandardLoad`](@ref) `max_impedance_active_power`."""
get_max_impedance_active_power(value::StandardLoad) = get_value(value, value.max_impedance_active_power)
"""Get [`StandardLoad`](@ref) `max_impedance_reactive_power`."""
get_max_impedance_reactive_power(value::StandardLoad) = get_value(value, value.max_impedance_reactive_power)
"""Get [`StandardLoad`](@ref) `max_current_active_power`."""
get_max_current_active_power(value::StandardLoad) = get_value(value, value.max_current_active_power)
"""Get [`StandardLoad`](@ref) `max_current_reactive_power`."""
get_max_current_reactive_power(value::StandardLoad) = get_value(value, value.max_current_reactive_power)
"""Get [`StandardLoad`](@ref) `base_power`."""
get_base_power(value::StandardLoad) = value.base_power
"""Get [`StandardLoad`](@ref) `services`."""
get_services(value::StandardLoad) = value.services
"""Get [`StandardLoad`](@ref) `dynamic_injector`."""
get_dynamic_injector(value::StandardLoad) = value.dynamic_injector
"""Get [`StandardLoad`](@ref) `ext`."""
get_ext(value::StandardLoad) = value.ext
"""Get [`StandardLoad`](@ref) `time_series_container`."""
get_time_series_container(value::StandardLoad) = value.time_series_container
"""Get [`StandardLoad`](@ref) `internal`."""
get_internal(value::StandardLoad) = value.internal

"""Set [`StandardLoad`](@ref) `available`."""
set_available!(value::StandardLoad, val) = value.available = val
"""Set [`StandardLoad`](@ref) `bus`."""
set_bus!(value::StandardLoad, val) = value.bus = val
"""Set [`StandardLoad`](@ref) `constant_active_power`."""
set_constant_active_power!(value::StandardLoad, val) = value.constant_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `constant_reactive_power`."""
set_constant_reactive_power!(value::StandardLoad, val) = value.constant_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `impedance_active_power`."""
set_impedance_active_power!(value::StandardLoad, val) = value.impedance_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `impedance_reactive_power`."""
set_impedance_reactive_power!(value::StandardLoad, val) = value.impedance_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `current_active_power`."""
set_current_active_power!(value::StandardLoad, val) = value.current_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `current_reactive_power`."""
set_current_reactive_power!(value::StandardLoad, val) = value.current_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_constant_active_power`."""
set_max_constant_active_power!(value::StandardLoad, val) = value.max_constant_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_constant_reactive_power`."""
set_max_constant_reactive_power!(value::StandardLoad, val) = value.max_constant_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_impedance_active_power`."""
set_max_impedance_active_power!(value::StandardLoad, val) = value.max_impedance_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_impedance_reactive_power`."""
set_max_impedance_reactive_power!(value::StandardLoad, val) = value.max_impedance_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_current_active_power`."""
set_max_current_active_power!(value::StandardLoad, val) = value.max_current_active_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `max_current_reactive_power`."""
set_max_current_reactive_power!(value::StandardLoad, val) = value.max_current_reactive_power = set_value(value, val)
"""Set [`StandardLoad`](@ref) `base_power`."""
set_base_power!(value::StandardLoad, val) = value.base_power = val
"""Set [`StandardLoad`](@ref) `services`."""
set_services!(value::StandardLoad, val) = value.services = val
"""Set [`StandardLoad`](@ref) `ext`."""
set_ext!(value::StandardLoad, val) = value.ext = val
"""Set [`StandardLoad`](@ref) `time_series_container`."""
set_time_series_container!(value::StandardLoad, val) = value.time_series_container = val
Loading

0 comments on commit 54fabf6

Please sign in to comment.