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
Property Value
Name
Description
System Units Base SYSTEM_BASE
Base Power 100.0
Base Frequency 60.0
Num Components 27
Static Components
Type Count
ACBus 5
Arc 6
Line 6
PowerLoad 3
RenewableDispatch 2
ThermalStandard 5
StaticTimeSeries Summary
owner_type owner_category name time_series_type initial_timestamp resolution count time_step_count
String String String String String Dates.CompoundPeriod Int64 Int64
PowerLoad Component max_active_power SingleTimeSeries 2024-01-01T00:00:00 1 hour 3 168
RenewableDispatch Component max_active_power SingleTimeSeries 2024-01-01T00:00:00 1 hour 2 168

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 CA PrimeMovers 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