Skip to content

Commit

Permalink
add degov
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bossart committed Nov 6, 2023
1 parent 4f19d56 commit fdfdf1d
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 0 deletions.
131 changes: 131 additions & 0 deletions src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
157 changes: 157 additions & 0 deletions src/models/generated/DEGOV.jl
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions src/models/generated/includes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!
Expand Down

0 comments on commit fdfdf1d

Please sign in to comment.