Power Flow to Grid traces battery AC power from the storage inverter output through the , combines it with PV output, and delivers the result to the grid. During charging, PV output is reduced by the power diverted to storage. During discharging, battery power is added to PV output. The combined output at MV then triggers a re-run of the plant-level power flow — only the transformers, transmission lines, availability loss, and LGIA limit are re-applied; the rest of the PV pipeline is not re-run.
The storage MV transformer uses the same quadratic loss model as PV transformers (see Transformer Loss Model). Losses are calculated separately for discharge and charge because the power levels differ.Discharge (power flows battery → grid):The transformer reduces the power delivered to the MV bus:PMV,d=PAC,d−LMV(PAC,d)Charge (power flows grid → battery):The transformer increases the power drawn from the MV bus (the grid must supply the charge power plus the transformer loss):PMV,c=PAC,c+LMV(PAC,c)
When the battery is idle (neither charging nor discharging), the transformer still draws power from the grid to maintain core magnetization:LMV,idle=LNL,MV×Prated,MVThis no-load loss is reported as a negative discharge value:PMV,d=−LMV,idleThe negative sign indicates power consumed from the grid rather than delivered to it.
When the battery is charging, power is diverted from the PV output at the MV level. The adjusted PV output is:PPV,adj=PPV,MV−PMV,cThis adjusted value represents the PV power remaining after subtracting the power diverted to storage (including the MV transformer loss overhead).
If the adjusted PV output still exceeds the interconnect capacity (possible when the battery cannot absorb all excess due to inverter capacity or SOC limits), a scaled-down value is calculated for reporting purposes. This value is not used in the combined output or subsequent power flow—the actual LGIA limit is enforced downstream when the combined output re-enters the plant-level power flow.If PPV,adj>PPOI and PPV,avail>PPOI:PPV,adj,limited=PPOI×PPV,availPPV,MVOtherwise:PPV,adj,limited=PPV,adjThe ratio PPV,MV/PPV,avail represents the relationship between PV power before HV losses and PV power after availability losses, allowing the LGIA-limited value to account for downstream losses.
The combined output at the MV level adds the (possibly LGIA-limited) adjusted PV and the battery discharge:Pcombined=PPV,adj+PMV,dTwo edge cases handle unusual power flow conditions:
PV negative, battery discharging (PPV,adj<0 and PMV,d>0): only the battery discharge is delivered — Pcombined=PMV,d
PV positive, battery idle with no-load loss (PPV,adj>0 and PMV,d<0): the no-load loss exclusion is intended but not effective in the current code—the addition case applies in practice.
The no-load loss exclusion case (PV positive, discharge negative) is not effective in the current code due to an if/else control flow issue: the first conditional assignment is overwritten by the subsequent else branch.
The combined output (Pcombined) replaces the sum of PV block outputs, and only the plant-level power flow is re-run — the same step that already ran for PV-only. The rest of the PV pipeline (irradiance, DC performance, inverter, array-level losses) is not re-run; those results are retained. The re-run applies:
HV transformers and transmission lines (same equipment and loss model as PV-only)