diff --git a/src/initialization/inverter_components/init_DCside.jl b/src/initialization/inverter_components/init_DCside.jl index bffdf0eae..95fe06f56 100644 --- a/src/initialization/inverter_components/init_DCside.jl +++ b/src/initialization/inverter_components/init_DCside.jl @@ -1,7 +1,9 @@ function initialize_DCside!( device_states, static::PSY.StaticInjection, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, PSY.FixedDCSource, P, F}}, + dynamic_device::DynamicWrapper{ + PSY.DynamicInverter{C, O, IC, PSY.FixedDCSource, P, F, L}, + }, inner_vars::AbstractVector, ) where { C <: PSY.Converter, @@ -9,6 +11,7 @@ function initialize_DCside!( IC <: PSY.InnerControl, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Update inner_vars diff --git a/src/initialization/inverter_components/init_converter.jl b/src/initialization/inverter_components/init_converter.jl index b61b1a76f..e4538b3a6 100644 --- a/src/initialization/inverter_components/init_converter.jl +++ b/src/initialization/inverter_components/init_converter.jl @@ -2,7 +2,7 @@ function initialize_converter!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.AverageConverter, O, IC, DC, P, F}, + PSY.DynamicInverter{PSY.AverageConverter, O, IC, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -11,13 +11,14 @@ function initialize_converter!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } end function initialize_converter!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.RenewableEnergyConverterTypeA, O, IC, DC, P, F}, + PSY.DynamicInverter{PSY.RenewableEnergyConverterTypeA, O, IC, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -26,6 +27,7 @@ function initialize_converter!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Get inner vars V_R = inner_vars[Vr_cnv_var] @@ -71,7 +73,7 @@ function initialize_converter!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.RenewableEnergyVoltageConverterTypeA, O, IC, DC, P, F}, + PSY.DynamicInverter{PSY.RenewableEnergyVoltageConverterTypeA, O, IC, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -80,6 +82,7 @@ function initialize_converter!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Get inner vars Vr_filter = inner_vars[Vr_filter_var] diff --git a/src/initialization/inverter_components/init_filter.jl b/src/initialization/inverter_components/init_filter.jl index 6df249c9d..c59e391c7 100644 --- a/src/initialization/inverter_components/init_filter.jl +++ b/src/initialization/inverter_components/init_filter.jl @@ -1,7 +1,7 @@ function initialize_filter!( device_states, static::PSY.StaticInjection, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.LCLFilter}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.LCLFilter, L}}, inner_vars::AbstractVector, ) where { C <: PSY.Converter, @@ -9,6 +9,7 @@ function initialize_filter!( IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #PowerFlow Data P0 = PSY.get_active_power(static) @@ -92,7 +93,7 @@ end function initialize_filter!( device_states, static::PSY.StaticInjection, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.RLFilter}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.RLFilter, L}}, inner_vars::AbstractVector, ) where { C <: PSY.Converter, @@ -100,6 +101,7 @@ function initialize_filter!( IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #PowerFlow Data P0 = PSY.get_active_power(static) diff --git a/src/initialization/inverter_components/init_frequency_estimator.jl b/src/initialization/inverter_components/init_frequency_estimator.jl index 249df89df..3901e7905 100644 --- a/src/initialization/inverter_components/init_frequency_estimator.jl +++ b/src/initialization/inverter_components/init_frequency_estimator.jl @@ -1,7 +1,7 @@ function initialize_frequency_estimator!( device_states, static::PSY.StaticInjection, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, PSY.KauraPLL, F}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, PSY.KauraPLL, F, L}}, inner_vars::AbstractVector, ) where { C <: PSY.Converter, @@ -9,6 +9,7 @@ function initialize_frequency_estimator!( IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } Vr_filter = inner_vars[Vr_filter_var] Vi_filter = inner_vars[Vi_filter_var] @@ -66,7 +67,7 @@ function initialize_frequency_estimator!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, IC, DC, PSY.ReducedOrderPLL, F}, + PSY.DynamicInverter{C, O, IC, DC, PSY.ReducedOrderPLL, F, L}, }, inner_vars::AbstractVector, ) where { @@ -75,6 +76,7 @@ function initialize_frequency_estimator!( IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } Vr_filter = inner_vars[Vr_filter_var] Vi_filter = inner_vars[Vi_filter_var] @@ -128,7 +130,7 @@ function initialize_frequency_estimator!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, IC, DC, PSY.FixedFrequency, F}, + PSY.DynamicInverter{C, O, IC, DC, PSY.FixedFrequency, F, L}, }, inner_vars::AbstractVector, ) where { @@ -137,6 +139,7 @@ function initialize_frequency_estimator!( IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Get parameters pll_control = PSY.get_freq_estimator(dynamic_device) diff --git a/src/initialization/inverter_components/init_inner.jl b/src/initialization/inverter_components/init_inner.jl index 39f89662f..5a4184a6e 100644 --- a/src/initialization/inverter_components/init_inner.jl +++ b/src/initialization/inverter_components/init_inner.jl @@ -2,7 +2,7 @@ function initialize_inner!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.VoltageModeControl, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.VoltageModeControl, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -11,6 +11,7 @@ function initialize_inner!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -146,7 +147,7 @@ function initialize_inner!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.CurrentModeControl, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.CurrentModeControl, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -155,6 +156,7 @@ function initialize_inner!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -231,7 +233,7 @@ function initialize_inner!( device_states, static::PSY.StaticInjection, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -240,6 +242,7 @@ function initialize_inner!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } # Obtain inner variables for component Vr_filter = inner_vars[Vr_filter_var] diff --git a/src/initialization/inverter_components/init_outer.jl b/src/initialization/inverter_components/init_outer.jl index ddf205fd0..33f2163e3 100644 --- a/src/initialization/inverter_components/init_outer.jl +++ b/src/initialization/inverter_components/init_outer.jl @@ -9,6 +9,7 @@ function initialize_outer!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -18,6 +19,7 @@ function initialize_outer!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -74,6 +76,7 @@ function initialize_outer!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -83,6 +86,7 @@ function initialize_outer!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -138,6 +142,7 @@ function initialize_outer!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -147,6 +152,7 @@ function initialize_outer!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -201,6 +207,7 @@ function initialize_outer!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -210,6 +217,7 @@ function initialize_outer!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -283,6 +291,7 @@ function initialize_outer!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -292,6 +301,7 @@ function initialize_outer!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } # Read inner vars Vr_filter = inner_vars[Vr_filter_var] diff --git a/src/models/device.jl b/src/models/device.jl index df339f843..e6972ed7b 100644 --- a/src/models/device.jl +++ b/src/models/device.jl @@ -441,7 +441,7 @@ function _update_inner_vars!( ::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, ::AbstractArray{<:ACCEPTED_REAL_TYPES}, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, F}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, F, L}}, ) where { C <: PSY.Converter, O <: PSY.OuterControl, @@ -449,6 +449,7 @@ function _update_inner_vars!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } return end @@ -459,13 +460,22 @@ function _update_inner_vars!( ω_sys::ACCEPTED_REAL_TYPES, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.RenewableEnergyConverterTypeA, O, IC, DC, P, PSY.RLFilter}, + PSY.DynamicInverter{ + PSY.RenewableEnergyConverterTypeA, + O, + IC, + DC, + P, + PSY.RLFilter, + L, + }, }, ) where { O <: PSY.OuterControl, IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } V_R = inner_vars[Vr_inv_var] V_I = inner_vars[Vi_inv_var] @@ -578,6 +588,7 @@ function _update_inner_vars!( DC, P, PSY.LCLFilter, + L, }, }, ) where { @@ -585,6 +596,7 @@ function _update_inner_vars!( IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } filter_ix = get_local_state_ix(dynamic_device, PSY.LCLFilter) filter_states = @view device_states[filter_ix] diff --git a/src/models/inverter_models/DCside_models.jl b/src/models/inverter_models/DCside_models.jl index 5f586b162..9a1269cc0 100644 --- a/src/models/inverter_models/DCside_models.jl +++ b/src/models/inverter_models/DCside_models.jl @@ -11,13 +11,16 @@ function mdl_DCside_ode!( ::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, PSY.FixedDCSource, P, F}}, + dynamic_device::DynamicWrapper{ + PSY.DynamicInverter{C, O, IC, PSY.FixedDCSource, P, F, L}, + }, ) where { C <: PSY.Converter, O <: PSY.OuterControl, IC <: PSY.InnerControl, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Update inner_vars diff --git a/src/models/inverter_models/converter_models.jl b/src/models/inverter_models/converter_models.jl index 55bec94ea..bfecc4668 100644 --- a/src/models/inverter_models/converter_models.jl +++ b/src/models/inverter_models/converter_models.jl @@ -11,7 +11,7 @@ function mdl_converter_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.AverageConverter, O, IC, DC, P, F}, + PSY.DynamicInverter{PSY.AverageConverter, O, IC, DC, P, F, L}, }, ) where { O <: PSY.OuterControl, @@ -19,6 +19,7 @@ function mdl_converter_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component @@ -41,13 +42,22 @@ function mdl_converter_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{PSY.RenewableEnergyConverterTypeA, O, IC, DC, P, PSY.RLFilter}, + PSY.DynamicInverter{ + PSY.RenewableEnergyConverterTypeA, + O, + IC, + DC, + P, + PSY.RLFilter, + L, + }, }, ) where { O <: PSY.OuterControl, IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component V_R = inner_vars[Vr_filter_var] @@ -172,6 +182,7 @@ function mdl_converter_ode!( DC, P, PSY.LCLFilter, + L, }, }, ) where { @@ -179,6 +190,7 @@ function mdl_converter_ode!( IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component V_R = inner_vars[Vr_filter_var] diff --git a/src/models/inverter_models/filter_models.jl b/src/models/inverter_models/filter_models.jl index a738c6bc0..aac31ac46 100644 --- a/src/models/inverter_models/filter_models.jl +++ b/src/models/inverter_models/filter_models.jl @@ -39,13 +39,14 @@ function mdl_filter_ode!( current_i::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.LCLFilter}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.LCLFilter, L}}, ) where { C <: PSY.Converter, O <: PSY.OuterControl, IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #external_ix = get_input_port_ix(dynamic_device, PSY.LCLFilter) @@ -120,13 +121,14 @@ function mdl_filter_ode!( current_i::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.RLFilter}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, P, PSY.RLFilter, L}}, ) where { C <: PSY.Converter, O <: PSY.OuterControl, IC <: PSY.InnerControl, DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component basepower = PSY.get_base_power(dynamic_device) diff --git a/src/models/inverter_models/frequency_estimator_models.jl b/src/models/inverter_models/frequency_estimator_models.jl index a34751fd1..9f68a392e 100644 --- a/src/models/inverter_models/frequency_estimator_models.jl +++ b/src/models/inverter_models/frequency_estimator_models.jl @@ -11,13 +11,14 @@ function mdl_freq_estimator_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, - dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, PSY.KauraPLL, F}}, + dynamic_device::DynamicWrapper{PSY.DynamicInverter{C, O, IC, DC, PSY.KauraPLL, F, L}}, ) where { C <: PSY.Converter, O <: PSY.OuterControl, IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -75,7 +76,7 @@ function mdl_freq_estimator_ode!( inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, IC, DC, PSY.ReducedOrderPLL, F}, + PSY.DynamicInverter{C, O, IC, DC, PSY.ReducedOrderPLL, F, L}, }, ) where { C <: PSY.Converter, @@ -83,6 +84,7 @@ function mdl_freq_estimator_ode!( IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -135,7 +137,7 @@ function mdl_freq_estimator_ode!( inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, ω_sys::ACCEPTED_REAL_TYPES, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, IC, DC, PSY.FixedFrequency, F}, + PSY.DynamicInverter{C, O, IC, DC, PSY.FixedFrequency, F, L}, }, ) where { C <: PSY.Converter, @@ -143,6 +145,7 @@ function mdl_freq_estimator_ode!( IC <: PSY.InnerControl, DC <: PSY.DCSource, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Get parameters diff --git a/src/models/inverter_models/inner_control_models.jl b/src/models/inverter_models/inner_control_models.jl index f5a78cc48..a538939f0 100644 --- a/src/models/inverter_models/inner_control_models.jl +++ b/src/models/inverter_models/inner_control_models.jl @@ -34,7 +34,7 @@ function _mdl_ode_RE_inner_controller_B!( ::Val{0}, inner_control::PSY.RECurrentControlB, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -43,6 +43,7 @@ function _mdl_ode_RE_inner_controller_B!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component V_t = sqrt(inner_vars[Vr_filter_var]^2 + inner_vars[Vi_filter_var]^2) @@ -88,7 +89,7 @@ function _mdl_ode_RE_inner_controller_B!( ::Val{1}, inner_control::PSY.RECurrentControlB, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F, L}, }, inner_vars::AbstractVector, ) where { @@ -97,6 +98,7 @@ function _mdl_ode_RE_inner_controller_B!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain inner variables for component V_t = sqrt(inner_vars[Vr_filter_var]^2 + inner_vars[Vi_filter_var]^2) @@ -149,7 +151,7 @@ function mdl_inner_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.VoltageModeControl, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.VoltageModeControl, DC, P, F, L}, }, ) where { C <: PSY.Converter, @@ -157,6 +159,7 @@ function mdl_inner_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -258,7 +261,7 @@ function mdl_inner_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.CurrentModeControl, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.CurrentModeControl, DC, P, F, L}, }, ) where { C <: PSY.Converter, @@ -266,6 +269,7 @@ function mdl_inner_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -329,7 +333,7 @@ function mdl_inner_ode!( output_ode::AbstractArray{<:ACCEPTED_REAL_TYPES}, inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES}, dynamic_device::DynamicWrapper{ - PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F}, + PSY.DynamicInverter{C, O, PSY.RECurrentControlB, DC, P, F, L}, }, ) where { C <: PSY.Converter, @@ -337,6 +341,7 @@ function mdl_inner_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Get Current Controller parameters inner_control = PSY.get_inner_control(dynamic_device) diff --git a/src/models/inverter_models/outer_control_models.jl b/src/models/inverter_models/outer_control_models.jl index 55a54ea22..14e2c5891 100644 --- a/src/models/inverter_models/outer_control_models.jl +++ b/src/models/inverter_models/outer_control_models.jl @@ -32,6 +32,7 @@ function _mdl_ode_RE_active_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -41,6 +42,7 @@ function _mdl_ode_RE_active_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters @@ -122,6 +124,7 @@ function _mdl_ode_RE_active_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -131,6 +134,7 @@ function _mdl_ode_RE_active_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters @@ -180,6 +184,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -189,6 +194,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters @@ -262,6 +268,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -271,6 +278,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters q_ref = get_Q_ref(dynamic_device) @@ -337,6 +345,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -346,6 +355,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters V_ref = get_V_ref(dynamic_device) @@ -443,6 +453,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC, P, F, + L, }, }, inner_vars::AbstractVector, @@ -452,6 +463,7 @@ function _mdl_ode_RE_reactive_controller_AB!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external parameters V_ref = get_V_ref(dynamic_device) @@ -533,6 +545,7 @@ function mdl_outer_ode!( DC, P, F, + L, }, }, ) where { @@ -541,6 +554,7 @@ function mdl_outer_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -621,6 +635,7 @@ function mdl_outer_ode!( DC, P, F, + L, }, }, ) where { @@ -629,6 +644,7 @@ function mdl_outer_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -711,6 +727,7 @@ function mdl_outer_ode!( DC, P, F, + L, }, }, ) where { @@ -719,6 +736,7 @@ function mdl_outer_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -803,6 +821,7 @@ function mdl_outer_ode!( DC, P, F, + L, }, }, ) where { @@ -811,6 +830,7 @@ function mdl_outer_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component @@ -897,6 +917,7 @@ function mdl_outer_ode!( DC, P, F, + L, }, }, ) where { @@ -905,6 +926,7 @@ function mdl_outer_ode!( DC <: PSY.DCSource, P <: PSY.FrequencyEstimator, F <: PSY.Filter, + L <: Union{Nothing, PSY.InverterLimiter}, } #Obtain external states inputs for component