Group generators into plants

This how-to shows how to group generator units into plant structures. For background on when plant-level aggregation matters, see Grouping generators into plants.

Prerequisites

using PowerSystems
using PowerSystemCaseBuilder

sys = build_system(PSISystems, "c_sys5_pjm")
System
PropertyValue
Name
Description
System Units BaseSYSTEM_BASE
Base Power100.0
Base Frequency60.0
Num Components27
Static Components
TypeCount
ACBus5
Arc6
Line6
PowerLoad3
RenewableDispatch2
ThermalStandard5
StaticTimeSeries Summary
owner_typeowner_categorynametime_series_typeinitial_timestampresolutioncounttime_step_count
StringStringStringStringStringDates.CompoundPeriodInt64Int64
PowerLoadComponentmax_active_powerSingleTimeSeries2024-01-01T00:00:001 hour3168
RenewableDispatchComponentmax_active_powerSingleTimeSeries2024-01-01T00:00:001 hour2168

Group thermal units by shaft

Create a ThermalPowerPlant, then attach generators with a shaft_number keyword. Units on the same shaft share mechanical coupling:

gens = collect(get_components(ThermalStandard, sys))
gen1, gen2, gen3 = gens[1], gens[2], gens[3]

plant = ThermalPowerPlant(; name = "Coal Plant Alpha")

add_supplemental_attribute!(sys, gen1, plant; shaft_number = 1)
add_supplemental_attribute!(sys, gen2, plant; shaft_number = 1)
add_supplemental_attribute!(sys, gen3, plant; shaft_number = 2)

Query units on a specific shaft with get_components_in_shaft:

shaft_1_gens = get_components_in_shaft(sys, plant, 1)
length(shaft_1_gens)
2

Group hydro units by penstock

HydroPowerPlant uses a positional penstock_number argument (not a keyword). Only HydroTurbine and HydroPumpTurbine components are supported. Create the plant with HydroPowerPlant, attach turbines with add_supplemental_attribute!(sys, turbine, hydro_plant, penstock_number), and query with get_components_in_penstock.

Penstock grouping is separate from linking HydroReservoir components to turbines; see Link hydro reservoirs to turbines.

Group renewable units by PCC

RenewablePowerPlant uses a positional pcc_number argument. Supported components are RenewableGen and EnergyReservoirStorage. Attach with add_supplemental_attribute!(sys, component, renewable_plant, pcc_number) and query with get_components_in_pcc.

Group combined cycle units

For block-level combined cycle modeling, use CombinedCycleBlock with the hrsg_number keyword. Only generators with CT or CAPrimeMovers are allowed:

cc_block = CombinedCycleBlock(;
    name = "CC Unit 1",
    configuration = CombinedCycleConfiguration.DoubleCombustionOneSteam,
)
get_name(cc_block)
"CC Unit 1"

For mutually exclusive operating modes, use CombinedCycleFractional with the exclusion_group keyword. Only generators with the CC prime mover type are allowed. Attach CT/CA or CC units to the block or fractional plant once those generators are in your System; see the Public API Reference for constructor and accessor details.

Query and remove associations

Retrieve all units in a plant with get_associated_components:

all_gens = collect(get_associated_components(sys, plant; component_type = ThermalGen))
total_capacity = sum(get_active_power_limits(g).max for g in all_gens)
total_capacity
7.300000000000001

Remove a unit from a plant without deleting either object:

remove_supplemental_attribute!(sys, gen1, plant)

See also