Skip to main content

Summary

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.

Inputs

NameSymbolUnitsDescription
Battery AC DischargePAC,dP_{AC,d}WAC discharge power from inverter (Battery Model)
Battery AC ChargePAC,cP_{AC,c}WAC charge power to inverter (Battery Model)
Battery DC PowerPDCP_{DC}WDC power at battery terminals (Battery Model)
PV MV Transformer OutputPPV,MVP_{PV,MV}WPV power before HV losses (from PV-only pass)
PV Power After AvailabilityPPV,availP_{PV,avail}WPV output after availability losses (from PV-only pass)
Interconnect CapacityPPOIP_{POI}WMaximum plant output ( limit)
MV Transformer RatingPrated,MVP_{rated,MV}kVAStorage MV transformer nameplate capacity
MV No-Load LossLNL,MVL_{NL,MV}%Storage MV transformer no-load loss percentage
MV Full-Load LossLFL,MVL_{FL,MV}%Storage MV transformer full-load loss percentage
Nameplate Energy CapacityEnomE_{nom}kWhBattery nameplate capacity

Outputs

NameSymbolUnitsDescription
Discharge at MVPMV,dP_{MV,d}WDischarge power after storage MV transformer
Charge at MVPMV,cP_{MV,c}WCharge power including storage MV transformer loss
MV Transformer LossLMVL_{MV}WStorage MV transformer loss (charge, discharge, or idle)
Adjusted PV OutputPPV,adjP_{PV,adj}WPV output after charging diversion
LGIA-Limited Adjusted PVPPV,adj,limitedP_{PV,adj,limited}WAdjusted PV capped at interconnect limit (reporting only)
Combined PV+ESS OutputPcombinedP_{combined}WTotal power at MV level (input to plant-level power flow re-run)

Detailed Description

Storage MV Transformer

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,dLMV(PAC,d)P_{MV,d} = P_{AC,d} - L_{MV}(P_{AC,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)P_{MV,c} = P_{AC,c} + L_{MV}(P_{AC,c})

MV Transformer Idle Loss

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,MVL_{MV,idle} = L_{NL,MV} \times P_{rated,MV} This no-load loss is reported as a negative discharge value: PMV,d=LMV,idleP_{MV,d} = -L_{MV,idle} The negative sign indicates power consumed from the grid rather than delivered to it.

PV Output Adjustment

When the battery is charging, power is diverted from the PV output at the MV level. The adjusted PV output is: PPV,adj=PPV,MVPMV,cP_{PV,adj} = P_{PV,MV} - P_{MV,c} This adjusted value represents the PV power remaining after subtracting the power diverted to storage (including the MV transformer loss overhead).

LGIA-Limited Adjusted PV (Reporting Only)

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:\text{If } P_{PV,adj} > P_{POI} \text{ and } P_{PV,avail} > P_{POI}: PPV,adj,limited=PPOI×PPV,MVPPV,availP_{PV,adj,limited} = P_{POI} \times \frac{P_{PV,MV}}{P_{PV,avail}} Otherwise: PPV,adj,limited=PPV,adjP_{PV,adj,limited} = P_{PV,adj} The ratio PPV,MV/PPV,availP_{PV,MV} / P_{PV,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.

Combined PV+ESS Output

The combined output at the MV level adds the (possibly LGIA-limited) adjusted PV and the battery discharge: Pcombined=PPV,adj+PMV,dP_{combined} = P_{PV,adj} + P_{MV,d} Two edge cases handle unusual power flow conditions:
  • PV negative, battery discharging (PPV,adj<0P_{PV,adj} < 0 and PMV,d>0P_{MV,d} > 0): only the battery discharge is delivered — Pcombined=PMV,dP_{combined} = P_{MV,d}
  • PV positive, battery idle with no-load loss (PPV,adj>0P_{PV,adj} > 0 and PMV,d<0P_{MV,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.

Plant-Level Power Flow Re-Run

The combined output (PcombinedP_{combined}) 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:
  1. HV transformers and transmission lines (same equipment and loss model as PV-only)
  2. Availability loss
  3. Grid limit enforcement
This produces the final plant output at the POI.