From fdfdf1da3f4cb363d8d2b263e3ecd8acea106d14 Mon Sep 17 00:00:00 2001 From: Matt Bossart Date: Mon, 6 Nov 2023 16:34:09 -0500 Subject: [PATCH 1/5] add degov --- src/descriptors/power_system_structs.json | 131 ++++++++++++++++++ src/models/generated/DEGOV.jl | 157 ++++++++++++++++++++++ src/models/generated/includes.jl | 3 + 3 files changed, 291 insertions(+) create mode 100644 src/models/generated/DEGOV.jl diff --git a/src/descriptors/power_system_structs.json b/src/descriptors/power_system_structs.json index 85f9afdb25..cc2099c6ce 100644 --- a/src/descriptors/power_system_structs.json +++ b/src/descriptors/power_system_structs.json @@ -11490,6 +11490,137 @@ ], "supertype": "TurbineGov" }, + { + "struct_name": "DEGOV", + "docstring": "Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld.", + "fields": [ + { + "name": "T1", + "comment": "Governor mechanism time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T2", + "comment": "Turbine power time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T3", + "comment": "Turbine exhaust temperature time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "K", + "comment": "Governor gain (reciprocal of droop)", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T4", + "comment": "Governor lead time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T5", + "comment": "Governor lag time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T6", + "comment": "Actuator time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "Td", + "comment": "Engine time delay", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "P_ref", + "comment": "Reference Load Set-point", + "null_value": 0, + "default": "1.0", + "data_type": "Float64", + "valid_range": { + "min": 0, + "max": null + } + }, + { + "name": "ext", + "data_type": "Dict{String, Any}", + "null_value": "Dict{String, Any}()", + "default": "Dict{String, Any}()" + }, + { + "name": "states", + "exclude_setter": true, + "comment": "The states of the DEGOV model are:\n\tx_ecb1: Electric control box 1,\n\tx_ecb2: Electric control box 2,\n\tx_a1: Actuator 1,\n\tx_a2: Actuator 2,\n\tx_a3: Actuator 3,", + "internal_default": "[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3]", + "data_type": "Vector{Symbol}" + }, + { + "name": "n_states", + "exclude_setter": true, + "comment": "DEGOV has 5 states", + "internal_default": 5, + "data_type": "Int" + }, + { + "name": "states_types", + "comment": "DEGOV has 5 differential states", + "internal_default": "[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential]", + "data_type": "Vector{StateTypes}" + }, + { + "name": "internal", + "comment": "power system internal reference, do not modify", + "data_type": "InfrastructureSystemsInternal", + "internal_default": "InfrastructureSystemsInternal()", + "exclude_setter": true + } + ], + "supertype": "TurbineGov" + }, { "struct_name": "GeneralGovModel", "docstring": "GE General Governor/Turbine Model. The GeneralGovModel (GGOV1) model is a general purpose governor model used for a variety of prime movers controlled by proportional-integral-derivative (PID) governors including gas turbines.", diff --git a/src/models/generated/DEGOV.jl b/src/models/generated/DEGOV.jl new file mode 100644 index 0000000000..1aee133111 --- /dev/null +++ b/src/models/generated/DEGOV.jl @@ -0,0 +1,157 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct DEGOV <: TurbineGov + T1::Float64 + T2::Float64 + T3::Float64 + K::Float64 + T4::Float64 + T5::Float64 + T6::Float64 + Td::Float64 + P_ref::Float64 + ext::Dict{String, Any} + states::Vector{Symbol} + n_states::Int + states_types::Vector{StateTypes} + internal::InfrastructureSystemsInternal + end + +Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld. + +# Arguments +- `T1::Float64`: Governor mechanism time constant, validation range: `(eps(), 100)` +- `T2::Float64`: Turbine power time constant, validation range: `(eps(), 100)` +- `T3::Float64`: Turbine exhaust temperature time constant, validation range: `(eps(), 100)` +- `K::Float64`: Governor gain (reciprocal of droop), validation range: `(eps(), 100)` +- `T4::Float64`: Governor lead time constant, validation range: `(eps(), 100)` +- `T5::Float64`: Governor lag time constant, validation range: `(eps(), 100)` +- `T6::Float64`: Actuator time constant, validation range: `(eps(), 100)` +- `Td::Float64`: Engine time delay, validation range: `(eps(), 100)` +- `P_ref::Float64`: Reference Load Set-point, validation range: `(0, nothing)` +- `ext::Dict{String, Any}` +- `states::Vector{Symbol}`: The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3, +- `n_states::Int`: DEGOV has 5 states +- `states_types::Vector{StateTypes}`: DEGOV has 5 differential states +- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify +""" +mutable struct DEGOV <: TurbineGov + "Governor mechanism time constant" + T1::Float64 + "Turbine power time constant" + T2::Float64 + "Turbine exhaust temperature time constant" + T3::Float64 + "Governor gain (reciprocal of droop)" + K::Float64 + "Governor lead time constant" + T4::Float64 + "Governor lag time constant" + T5::Float64 + "Actuator time constant" + T6::Float64 + "Engine time delay" + Td::Float64 + "Reference Load Set-point" + P_ref::Float64 + ext::Dict{String, Any} + "The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3," + states::Vector{Symbol} + "DEGOV has 5 states" + n_states::Int + "DEGOV has 5 differential states" + states_types::Vector{StateTypes} + "power system internal reference, do not modify" + internal::InfrastructureSystemsInternal +end + +function DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, [:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], 5, [StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], InfrastructureSystemsInternal(), ) +end + +function DEGOV(; T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), states=[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], n_states=5, states_types=[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], internal=InfrastructureSystemsInternal(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, states, n_states, states_types, internal, ) +end + +# Constructor for demo purposes; non-functional. +function DEGOV(::Nothing) + DEGOV(; + T1=0, + T2=0, + T3=0, + K=0, + T4=0, + T5=0, + T6=0, + Td=0, + P_ref=0, + ext=Dict{String, Any}(), + ) +end + +"""Get [`DEGOV`](@ref) `T1`.""" +get_T1(value::DEGOV) = value.T1 +"""Get [`DEGOV`](@ref) `T2`.""" +get_T2(value::DEGOV) = value.T2 +"""Get [`DEGOV`](@ref) `T3`.""" +get_T3(value::DEGOV) = value.T3 +"""Get [`DEGOV`](@ref) `K`.""" +get_K(value::DEGOV) = value.K +"""Get [`DEGOV`](@ref) `T4`.""" +get_T4(value::DEGOV) = value.T4 +"""Get [`DEGOV`](@ref) `T5`.""" +get_T5(value::DEGOV) = value.T5 +"""Get [`DEGOV`](@ref) `T6`.""" +get_T6(value::DEGOV) = value.T6 +"""Get [`DEGOV`](@ref) `Td`.""" +get_Td(value::DEGOV) = value.Td +"""Get [`DEGOV`](@ref) `P_ref`.""" +get_P_ref(value::DEGOV) = value.P_ref +"""Get [`DEGOV`](@ref) `ext`.""" +get_ext(value::DEGOV) = value.ext +"""Get [`DEGOV`](@ref) `states`.""" +get_states(value::DEGOV) = value.states +"""Get [`DEGOV`](@ref) `n_states`.""" +get_n_states(value::DEGOV) = value.n_states +"""Get [`DEGOV`](@ref) `states_types`.""" +get_states_types(value::DEGOV) = value.states_types +"""Get [`DEGOV`](@ref) `internal`.""" +get_internal(value::DEGOV) = value.internal + +"""Set [`DEGOV`](@ref) `T1`.""" +set_T1!(value::DEGOV, val) = value.T1 = val +"""Set [`DEGOV`](@ref) `T2`.""" +set_T2!(value::DEGOV, val) = value.T2 = val +"""Set [`DEGOV`](@ref) `T3`.""" +set_T3!(value::DEGOV, val) = value.T3 = val +"""Set [`DEGOV`](@ref) `K`.""" +set_K!(value::DEGOV, val) = value.K = val +"""Set [`DEGOV`](@ref) `T4`.""" +set_T4!(value::DEGOV, val) = value.T4 = val +"""Set [`DEGOV`](@ref) `T5`.""" +set_T5!(value::DEGOV, val) = value.T5 = val +"""Set [`DEGOV`](@ref) `T6`.""" +set_T6!(value::DEGOV, val) = value.T6 = val +"""Set [`DEGOV`](@ref) `Td`.""" +set_Td!(value::DEGOV, val) = value.Td = val +"""Set [`DEGOV`](@ref) `P_ref`.""" +set_P_ref!(value::DEGOV, val) = value.P_ref = val +"""Set [`DEGOV`](@ref) `ext`.""" +set_ext!(value::DEGOV, val) = value.ext = val +"""Set [`DEGOV`](@ref) `states_types`.""" +set_states_types!(value::DEGOV, val) = value.states_types = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index 27c50bcc30..6806c6cbe9 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -84,6 +84,7 @@ include("SingleMass.jl") include("FiveMassShaft.jl") include("TGFixed.jl") include("GasTG.jl") +include("DEGOV.jl") include("GeneralGovModel.jl") include("SteamTurbineGov1.jl") include("HydroTurbineGov.jl") @@ -336,6 +337,7 @@ export get_Tb1 export get_Tc export get_Tc1 export get_Tcomp +export get_Td export get_Td0_p export get_Td0_pp export get_Td_gov @@ -864,6 +866,7 @@ export set_Tb1! export set_Tc! export set_Tc1! export set_Tcomp! +export set_Td! export set_Td0_p! export set_Td0_pp! export set_Td_gov! From 01f60f0d3d1f37a18e31faed5f326164896db6ed Mon Sep 17 00:00:00 2001 From: Matt Bossart Date: Mon, 6 Nov 2023 16:34:09 -0500 Subject: [PATCH 2/5] add degov --- src/descriptors/power_system_structs.json | 131 ++++++++++++++++++ src/models/generated/DEGOV.jl | 157 ++++++++++++++++++++++ src/models/generated/includes.jl | 3 + 3 files changed, 291 insertions(+) create mode 100644 src/models/generated/DEGOV.jl diff --git a/src/descriptors/power_system_structs.json b/src/descriptors/power_system_structs.json index 12dddd2664..c9bd1765fd 100644 --- a/src/descriptors/power_system_structs.json +++ b/src/descriptors/power_system_structs.json @@ -11816,6 +11816,137 @@ ], "supertype": "TurbineGov" }, + { + "struct_name": "DEGOV", + "docstring": "Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld.", + "fields": [ + { + "name": "T1", + "comment": "Governor mechanism time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T2", + "comment": "Turbine power time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T3", + "comment": "Turbine exhaust temperature time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "K", + "comment": "Governor gain (reciprocal of droop)", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T4", + "comment": "Governor lead time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T5", + "comment": "Governor lag time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T6", + "comment": "Actuator time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "Td", + "comment": "Engine time delay", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "P_ref", + "comment": "Reference Load Set-point", + "null_value": 0, + "default": "1.0", + "data_type": "Float64", + "valid_range": { + "min": 0, + "max": null + } + }, + { + "name": "ext", + "data_type": "Dict{String, Any}", + "null_value": "Dict{String, Any}()", + "default": "Dict{String, Any}()" + }, + { + "name": "states", + "exclude_setter": true, + "comment": "The states of the DEGOV model are:\n\tx_ecb1: Electric control box 1,\n\tx_ecb2: Electric control box 2,\n\tx_a1: Actuator 1,\n\tx_a2: Actuator 2,\n\tx_a3: Actuator 3,", + "internal_default": "[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3]", + "data_type": "Vector{Symbol}" + }, + { + "name": "n_states", + "exclude_setter": true, + "comment": "DEGOV has 5 states", + "internal_default": 5, + "data_type": "Int" + }, + { + "name": "states_types", + "comment": "DEGOV has 5 differential states", + "internal_default": "[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential]", + "data_type": "Vector{StateTypes}" + }, + { + "name": "internal", + "comment": "power system internal reference, do not modify", + "data_type": "InfrastructureSystemsInternal", + "internal_default": "InfrastructureSystemsInternal()", + "exclude_setter": true + } + ], + "supertype": "TurbineGov" + }, { "struct_name": "GeneralGovModel", "docstring": "GE General Governor/Turbine Model. The GeneralGovModel (GGOV1) model is a general purpose governor model used for a variety of prime movers controlled by proportional-integral-derivative (PID) governors including gas turbines.", diff --git a/src/models/generated/DEGOV.jl b/src/models/generated/DEGOV.jl new file mode 100644 index 0000000000..1aee133111 --- /dev/null +++ b/src/models/generated/DEGOV.jl @@ -0,0 +1,157 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct DEGOV <: TurbineGov + T1::Float64 + T2::Float64 + T3::Float64 + K::Float64 + T4::Float64 + T5::Float64 + T6::Float64 + Td::Float64 + P_ref::Float64 + ext::Dict{String, Any} + states::Vector{Symbol} + n_states::Int + states_types::Vector{StateTypes} + internal::InfrastructureSystemsInternal + end + +Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld. + +# Arguments +- `T1::Float64`: Governor mechanism time constant, validation range: `(eps(), 100)` +- `T2::Float64`: Turbine power time constant, validation range: `(eps(), 100)` +- `T3::Float64`: Turbine exhaust temperature time constant, validation range: `(eps(), 100)` +- `K::Float64`: Governor gain (reciprocal of droop), validation range: `(eps(), 100)` +- `T4::Float64`: Governor lead time constant, validation range: `(eps(), 100)` +- `T5::Float64`: Governor lag time constant, validation range: `(eps(), 100)` +- `T6::Float64`: Actuator time constant, validation range: `(eps(), 100)` +- `Td::Float64`: Engine time delay, validation range: `(eps(), 100)` +- `P_ref::Float64`: Reference Load Set-point, validation range: `(0, nothing)` +- `ext::Dict{String, Any}` +- `states::Vector{Symbol}`: The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3, +- `n_states::Int`: DEGOV has 5 states +- `states_types::Vector{StateTypes}`: DEGOV has 5 differential states +- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify +""" +mutable struct DEGOV <: TurbineGov + "Governor mechanism time constant" + T1::Float64 + "Turbine power time constant" + T2::Float64 + "Turbine exhaust temperature time constant" + T3::Float64 + "Governor gain (reciprocal of droop)" + K::Float64 + "Governor lead time constant" + T4::Float64 + "Governor lag time constant" + T5::Float64 + "Actuator time constant" + T6::Float64 + "Engine time delay" + Td::Float64 + "Reference Load Set-point" + P_ref::Float64 + ext::Dict{String, Any} + "The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3," + states::Vector{Symbol} + "DEGOV has 5 states" + n_states::Int + "DEGOV has 5 differential states" + states_types::Vector{StateTypes} + "power system internal reference, do not modify" + internal::InfrastructureSystemsInternal +end + +function DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, [:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], 5, [StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], InfrastructureSystemsInternal(), ) +end + +function DEGOV(; T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), states=[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], n_states=5, states_types=[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], internal=InfrastructureSystemsInternal(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, states, n_states, states_types, internal, ) +end + +# Constructor for demo purposes; non-functional. +function DEGOV(::Nothing) + DEGOV(; + T1=0, + T2=0, + T3=0, + K=0, + T4=0, + T5=0, + T6=0, + Td=0, + P_ref=0, + ext=Dict{String, Any}(), + ) +end + +"""Get [`DEGOV`](@ref) `T1`.""" +get_T1(value::DEGOV) = value.T1 +"""Get [`DEGOV`](@ref) `T2`.""" +get_T2(value::DEGOV) = value.T2 +"""Get [`DEGOV`](@ref) `T3`.""" +get_T3(value::DEGOV) = value.T3 +"""Get [`DEGOV`](@ref) `K`.""" +get_K(value::DEGOV) = value.K +"""Get [`DEGOV`](@ref) `T4`.""" +get_T4(value::DEGOV) = value.T4 +"""Get [`DEGOV`](@ref) `T5`.""" +get_T5(value::DEGOV) = value.T5 +"""Get [`DEGOV`](@ref) `T6`.""" +get_T6(value::DEGOV) = value.T6 +"""Get [`DEGOV`](@ref) `Td`.""" +get_Td(value::DEGOV) = value.Td +"""Get [`DEGOV`](@ref) `P_ref`.""" +get_P_ref(value::DEGOV) = value.P_ref +"""Get [`DEGOV`](@ref) `ext`.""" +get_ext(value::DEGOV) = value.ext +"""Get [`DEGOV`](@ref) `states`.""" +get_states(value::DEGOV) = value.states +"""Get [`DEGOV`](@ref) `n_states`.""" +get_n_states(value::DEGOV) = value.n_states +"""Get [`DEGOV`](@ref) `states_types`.""" +get_states_types(value::DEGOV) = value.states_types +"""Get [`DEGOV`](@ref) `internal`.""" +get_internal(value::DEGOV) = value.internal + +"""Set [`DEGOV`](@ref) `T1`.""" +set_T1!(value::DEGOV, val) = value.T1 = val +"""Set [`DEGOV`](@ref) `T2`.""" +set_T2!(value::DEGOV, val) = value.T2 = val +"""Set [`DEGOV`](@ref) `T3`.""" +set_T3!(value::DEGOV, val) = value.T3 = val +"""Set [`DEGOV`](@ref) `K`.""" +set_K!(value::DEGOV, val) = value.K = val +"""Set [`DEGOV`](@ref) `T4`.""" +set_T4!(value::DEGOV, val) = value.T4 = val +"""Set [`DEGOV`](@ref) `T5`.""" +set_T5!(value::DEGOV, val) = value.T5 = val +"""Set [`DEGOV`](@ref) `T6`.""" +set_T6!(value::DEGOV, val) = value.T6 = val +"""Set [`DEGOV`](@ref) `Td`.""" +set_Td!(value::DEGOV, val) = value.Td = val +"""Set [`DEGOV`](@ref) `P_ref`.""" +set_P_ref!(value::DEGOV, val) = value.P_ref = val +"""Set [`DEGOV`](@ref) `ext`.""" +set_ext!(value::DEGOV, val) = value.ext = val +"""Set [`DEGOV`](@ref) `states_types`.""" +set_states_types!(value::DEGOV, val) = value.states_types = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index ab7c9d4ec5..6e9a600074 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -87,6 +87,7 @@ include("SingleMass.jl") include("FiveMassShaft.jl") include("TGFixed.jl") include("GasTG.jl") +include("DEGOV.jl") include("GeneralGovModel.jl") include("SteamTurbineGov1.jl") include("HydroTurbineGov.jl") @@ -344,6 +345,7 @@ export get_Tb1 export get_Tc export get_Tc1 export get_Tcomp +export get_Td export get_Td0_p export get_Td0_pp export get_Td_gov @@ -879,6 +881,7 @@ export set_Tb1! export set_Tc! export set_Tc1! export set_Tcomp! +export set_Td! export set_Td0_p! export set_Td0_pp! export set_Td_gov! From 3e44280b8bb63408fc9d016089b378b1c88d73b3 Mon Sep 17 00:00:00 2001 From: Matt Bossart Date: Mon, 6 Nov 2023 16:34:09 -0500 Subject: [PATCH 3/5] add degov --- src/descriptors/power_system_structs.json | 131 ++++++++++++++++++ src/models/generated/DEGOV.jl | 157 ++++++++++++++++++++++ src/models/generated/includes.jl | 3 + 3 files changed, 291 insertions(+) create mode 100644 src/models/generated/DEGOV.jl diff --git a/src/descriptors/power_system_structs.json b/src/descriptors/power_system_structs.json index 12dddd2664..c9bd1765fd 100644 --- a/src/descriptors/power_system_structs.json +++ b/src/descriptors/power_system_structs.json @@ -11816,6 +11816,137 @@ ], "supertype": "TurbineGov" }, + { + "struct_name": "DEGOV", + "docstring": "Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld.", + "fields": [ + { + "name": "T1", + "comment": "Governor mechanism time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T2", + "comment": "Turbine power time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T3", + "comment": "Turbine exhaust temperature time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "K", + "comment": "Governor gain (reciprocal of droop)", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T4", + "comment": "Governor lead time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T5", + "comment": "Governor lag time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "T6", + "comment": "Actuator time constant", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "Td", + "comment": "Engine time delay", + "null_value": 0, + "data_type": "Float64", + "valid_range": { + "min": "eps()", + "max": 100.0 + } + }, + { + "name": "P_ref", + "comment": "Reference Load Set-point", + "null_value": 0, + "default": "1.0", + "data_type": "Float64", + "valid_range": { + "min": 0, + "max": null + } + }, + { + "name": "ext", + "data_type": "Dict{String, Any}", + "null_value": "Dict{String, Any}()", + "default": "Dict{String, Any}()" + }, + { + "name": "states", + "exclude_setter": true, + "comment": "The states of the DEGOV model are:\n\tx_ecb1: Electric control box 1,\n\tx_ecb2: Electric control box 2,\n\tx_a1: Actuator 1,\n\tx_a2: Actuator 2,\n\tx_a3: Actuator 3,", + "internal_default": "[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3]", + "data_type": "Vector{Symbol}" + }, + { + "name": "n_states", + "exclude_setter": true, + "comment": "DEGOV has 5 states", + "internal_default": 5, + "data_type": "Int" + }, + { + "name": "states_types", + "comment": "DEGOV has 5 differential states", + "internal_default": "[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential]", + "data_type": "Vector{StateTypes}" + }, + { + "name": "internal", + "comment": "power system internal reference, do not modify", + "data_type": "InfrastructureSystemsInternal", + "internal_default": "InfrastructureSystemsInternal()", + "exclude_setter": true + } + ], + "supertype": "TurbineGov" + }, { "struct_name": "GeneralGovModel", "docstring": "GE General Governor/Turbine Model. The GeneralGovModel (GGOV1) model is a general purpose governor model used for a variety of prime movers controlled by proportional-integral-derivative (PID) governors including gas turbines.", diff --git a/src/models/generated/DEGOV.jl b/src/models/generated/DEGOV.jl new file mode 100644 index 0000000000..1aee133111 --- /dev/null +++ b/src/models/generated/DEGOV.jl @@ -0,0 +1,157 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct DEGOV <: TurbineGov + T1::Float64 + T2::Float64 + T3::Float64 + K::Float64 + T4::Float64 + T5::Float64 + T6::Float64 + Td::Float64 + P_ref::Float64 + ext::Dict{String, Any} + states::Vector{Symbol} + n_states::Int + states_types::Vector{StateTypes} + internal::InfrastructureSystemsInternal + end + +Parameters Woodward Diesel Governor Model. DEGOV in PowerWorld. + +# Arguments +- `T1::Float64`: Governor mechanism time constant, validation range: `(eps(), 100)` +- `T2::Float64`: Turbine power time constant, validation range: `(eps(), 100)` +- `T3::Float64`: Turbine exhaust temperature time constant, validation range: `(eps(), 100)` +- `K::Float64`: Governor gain (reciprocal of droop), validation range: `(eps(), 100)` +- `T4::Float64`: Governor lead time constant, validation range: `(eps(), 100)` +- `T5::Float64`: Governor lag time constant, validation range: `(eps(), 100)` +- `T6::Float64`: Actuator time constant, validation range: `(eps(), 100)` +- `Td::Float64`: Engine time delay, validation range: `(eps(), 100)` +- `P_ref::Float64`: Reference Load Set-point, validation range: `(0, nothing)` +- `ext::Dict{String, Any}` +- `states::Vector{Symbol}`: The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3, +- `n_states::Int`: DEGOV has 5 states +- `states_types::Vector{StateTypes}`: DEGOV has 5 differential states +- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify +""" +mutable struct DEGOV <: TurbineGov + "Governor mechanism time constant" + T1::Float64 + "Turbine power time constant" + T2::Float64 + "Turbine exhaust temperature time constant" + T3::Float64 + "Governor gain (reciprocal of droop)" + K::Float64 + "Governor lead time constant" + T4::Float64 + "Governor lag time constant" + T5::Float64 + "Actuator time constant" + T6::Float64 + "Engine time delay" + Td::Float64 + "Reference Load Set-point" + P_ref::Float64 + ext::Dict{String, Any} + "The states of the DEGOV model are: + x_ecb1: Electric control box 1, + x_ecb2: Electric control box 2, + x_a1: Actuator 1, + x_a2: Actuator 2, + x_a3: Actuator 3," + states::Vector{Symbol} + "DEGOV has 5 states" + n_states::Int + "DEGOV has 5 differential states" + states_types::Vector{StateTypes} + "power system internal reference, do not modify" + internal::InfrastructureSystemsInternal +end + +function DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, [:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], 5, [StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], InfrastructureSystemsInternal(), ) +end + +function DEGOV(; T1, T2, T3, K, T4, T5, T6, Td, P_ref=1.0, ext=Dict{String, Any}(), states=[:x_ecb1, :x_ecb2, :x_a1, :x_a2, :x_a3], n_states=5, states_types=[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], internal=InfrastructureSystemsInternal(), ) + DEGOV(T1, T2, T3, K, T4, T5, T6, Td, P_ref, ext, states, n_states, states_types, internal, ) +end + +# Constructor for demo purposes; non-functional. +function DEGOV(::Nothing) + DEGOV(; + T1=0, + T2=0, + T3=0, + K=0, + T4=0, + T5=0, + T6=0, + Td=0, + P_ref=0, + ext=Dict{String, Any}(), + ) +end + +"""Get [`DEGOV`](@ref) `T1`.""" +get_T1(value::DEGOV) = value.T1 +"""Get [`DEGOV`](@ref) `T2`.""" +get_T2(value::DEGOV) = value.T2 +"""Get [`DEGOV`](@ref) `T3`.""" +get_T3(value::DEGOV) = value.T3 +"""Get [`DEGOV`](@ref) `K`.""" +get_K(value::DEGOV) = value.K +"""Get [`DEGOV`](@ref) `T4`.""" +get_T4(value::DEGOV) = value.T4 +"""Get [`DEGOV`](@ref) `T5`.""" +get_T5(value::DEGOV) = value.T5 +"""Get [`DEGOV`](@ref) `T6`.""" +get_T6(value::DEGOV) = value.T6 +"""Get [`DEGOV`](@ref) `Td`.""" +get_Td(value::DEGOV) = value.Td +"""Get [`DEGOV`](@ref) `P_ref`.""" +get_P_ref(value::DEGOV) = value.P_ref +"""Get [`DEGOV`](@ref) `ext`.""" +get_ext(value::DEGOV) = value.ext +"""Get [`DEGOV`](@ref) `states`.""" +get_states(value::DEGOV) = value.states +"""Get [`DEGOV`](@ref) `n_states`.""" +get_n_states(value::DEGOV) = value.n_states +"""Get [`DEGOV`](@ref) `states_types`.""" +get_states_types(value::DEGOV) = value.states_types +"""Get [`DEGOV`](@ref) `internal`.""" +get_internal(value::DEGOV) = value.internal + +"""Set [`DEGOV`](@ref) `T1`.""" +set_T1!(value::DEGOV, val) = value.T1 = val +"""Set [`DEGOV`](@ref) `T2`.""" +set_T2!(value::DEGOV, val) = value.T2 = val +"""Set [`DEGOV`](@ref) `T3`.""" +set_T3!(value::DEGOV, val) = value.T3 = val +"""Set [`DEGOV`](@ref) `K`.""" +set_K!(value::DEGOV, val) = value.K = val +"""Set [`DEGOV`](@ref) `T4`.""" +set_T4!(value::DEGOV, val) = value.T4 = val +"""Set [`DEGOV`](@ref) `T5`.""" +set_T5!(value::DEGOV, val) = value.T5 = val +"""Set [`DEGOV`](@ref) `T6`.""" +set_T6!(value::DEGOV, val) = value.T6 = val +"""Set [`DEGOV`](@ref) `Td`.""" +set_Td!(value::DEGOV, val) = value.Td = val +"""Set [`DEGOV`](@ref) `P_ref`.""" +set_P_ref!(value::DEGOV, val) = value.P_ref = val +"""Set [`DEGOV`](@ref) `ext`.""" +set_ext!(value::DEGOV, val) = value.ext = val +"""Set [`DEGOV`](@ref) `states_types`.""" +set_states_types!(value::DEGOV, val) = value.states_types = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index ab7c9d4ec5..6e9a600074 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -87,6 +87,7 @@ include("SingleMass.jl") include("FiveMassShaft.jl") include("TGFixed.jl") include("GasTG.jl") +include("DEGOV.jl") include("GeneralGovModel.jl") include("SteamTurbineGov1.jl") include("HydroTurbineGov.jl") @@ -344,6 +345,7 @@ export get_Tb1 export get_Tc export get_Tc1 export get_Tcomp +export get_Td export get_Td0_p export get_Td0_pp export get_Td_gov @@ -879,6 +881,7 @@ export set_Tb1! export set_Tc! export set_Tc1! export set_Tcomp! +export set_Td! export set_Td0_p! export set_Td0_pp! export set_Td_gov! From c44a9508b2ff75e6ba5f990253e112e216ae1431 Mon Sep 17 00:00:00 2001 From: Matt Bossart Date: Fri, 15 Dec 2023 18:13:58 -0500 Subject: [PATCH 4/5] export DEGOV --- src/PowerSystems.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerSystems.jl b/src/PowerSystems.jl index dd0922e00a..32f8a6d23e 100644 --- a/src/PowerSystems.jl +++ b/src/PowerSystems.jl @@ -153,6 +153,7 @@ export GeneralGovModel export HydroTurbineGov export IEEETurbineGov1 export SteamTurbineGov1 +export DEGOV # Converter Exports export Converter From 1b2ce9ee19a4cc56758472266bfebf6974144512 Mon Sep 17 00:00:00 2001 From: Matt Bossart Date: Fri, 15 Dec 2023 18:14:05 -0500 Subject: [PATCH 5/5] add test --- test/test_dynamic_generator.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test_dynamic_generator.jl b/test/test_dynamic_generator.jl index 53994bce2d..a65405828f 100644 --- a/test/test_dynamic_generator.jl +++ b/test/test_dynamic_generator.jl @@ -259,6 +259,19 @@ end D_turb = 0.0, ) @test gast_tg isa PowerSystems.DynamicComponent + + degov_tg = PSY.DEGOV(; + T1 = 0.0, + T2 = 0.0, + T3 = 0.0, + K = 18.0, + T4 = 12.0, + T5 = 5.0, + T6 = 0.2, + Td = 0.0, + P_ref = 0.0, + ) + @test degov_tg isa PowerSystems.DynamicComponent end ################ AVR Data #####################