diff --git a/src/descriptors/power_system_structs.json b/src/descriptors/power_system_structs.json index a63d4e8b83..ec2e777dad 100644 --- a/src/descriptors/power_system_structs.json +++ b/src/descriptors/power_system_structs.json @@ -16615,6 +16615,13 @@ "data_type": "Float64", "default": "0.0" }, + { + "name": "base_power", + "comment": "Base Power in MVA", + "null_value": 0, + "data_type": "Float64", + "default": "100.0" + }, { "name": "dynamic_injector", "data_type": "Union{Nothing, DynamicInjection}", diff --git a/src/models/generated/Source.jl b/src/models/generated/Source.jl index 1a5014cf22..a6152896e4 100644 --- a/src/models/generated/Source.jl +++ b/src/models/generated/Source.jl @@ -15,6 +15,7 @@ This file is auto-generated. Do not edit. X_th::Float64 internal_voltage::Float64 internal_angle::Float64 + base_power::Float64 dynamic_injector::Union{Nothing, DynamicInjection} services::Vector{Service} ext::Dict{String, Any} @@ -35,6 +36,7 @@ Commonly used in dynamics simulations to represent a very large machine on a sin - `X_th::Float64`: Source Thevenin reactance, validation range: `(0, nothing)` - `internal_voltage::Float64`: (default: `1.0`) Internal Voltage (pu), validation range: `(0, nothing)` - `internal_angle::Float64`: (default: `0.0`) Internal Angle +- `base_power::Float64`: (default: `100.0`) Base Power in MVA - `dynamic_injector::Union{Nothing, DynamicInjection}`: (default: `nothing`) corresponding dynamic injection device - `services::Vector{Service}`: (default: `Device[]`) Services that this device contributes to - `ext::Dict{String, Any}`: (default: `Dict{String, Any}()`) An [*ext*ra dictionary](@ref additional_fields) for users to add metadata that are not used in simulation, such as latitude and longitude. @@ -59,6 +61,8 @@ mutable struct Source <: StaticInjection internal_voltage::Float64 "Internal Angle" internal_angle::Float64 + "Base Power in MVA" + base_power::Float64 "corresponding dynamic injection device" dynamic_injector::Union{Nothing, DynamicInjection} "Services that this device contributes to" @@ -69,12 +73,12 @@ mutable struct Source <: StaticInjection internal::InfrastructureSystemsInternal end -function Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage=1.0, internal_angle=0.0, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), ) - Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage, internal_angle, dynamic_injector, services, ext, InfrastructureSystemsInternal(), ) +function Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage=1.0, internal_angle=0.0, base_power=100.0, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), ) + Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage, internal_angle, base_power, dynamic_injector, services, ext, InfrastructureSystemsInternal(), ) end -function Source(; name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage=1.0, internal_angle=0.0, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), ) - Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage, internal_angle, dynamic_injector, services, ext, internal, ) +function Source(; name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage=1.0, internal_angle=0.0, base_power=100.0, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), ) + Source(name, available, bus, active_power, reactive_power, R_th, X_th, internal_voltage, internal_angle, base_power, dynamic_injector, services, ext, internal, ) end # Constructor for demo purposes; non-functional. @@ -89,6 +93,7 @@ function Source(::Nothing) X_th=0, internal_voltage=0, internal_angle=0, + base_power=0, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), @@ -113,6 +118,8 @@ get_X_th(value::Source) = value.X_th get_internal_voltage(value::Source) = value.internal_voltage """Get [`Source`](@ref) `internal_angle`.""" get_internal_angle(value::Source) = value.internal_angle +"""Get [`Source`](@ref) `base_power`.""" +get_base_power(value::Source) = value.base_power """Get [`Source`](@ref) `dynamic_injector`.""" get_dynamic_injector(value::Source) = value.dynamic_injector """Get [`Source`](@ref) `services`.""" @@ -138,6 +145,8 @@ set_X_th!(value::Source, val) = value.X_th = val set_internal_voltage!(value::Source, val) = value.internal_voltage = val """Set [`Source`](@ref) `internal_angle`.""" set_internal_angle!(value::Source, val) = value.internal_angle = val +"""Set [`Source`](@ref) `base_power`.""" +set_base_power!(value::Source, val) = value.base_power = val """Set [`Source`](@ref) `services`.""" set_services!(value::Source, val) = value.services = val """Set [`Source`](@ref) `ext`."""