ENGY-AGGR
Energy Aggregation
1. Identity
Depends on module:
Purpose
Aggregates energy consumption across carriers into canonical totals, enforcing ESRS-aligned energy carrier semantics and unit normalization.
This engine is the anchor for all Energy KPIs (intensity, renewable share, deltas).
Typical usage
- Total energy consumption reporting (ESRS E1 / E5)
- Electricity vs fuel separation
- Upstream input to intensity and renewable share engines
2. Contract References (ZAR)
2.1. Input Schema
ZAR Address: schema.compute.energy.abs.inputs.v1_0_0
Required conceptual fields:
energy_items: list of energy consumption recordsalignment:BY_YEAR|BY_INDEX(defaultBY_YEAR)
Each energy item conceptually includes:
carrier: canonical energy carrier identifiervalueunit(e.g.MWh,GJ,kWh)period(typically year)
Canonical carriers (v1):
electricitynatural_gasdieselgasolinefuel_oilcoalsteamheatrenewable_electricity(if pre-tagged)
2.2. Options Schema
ZAR Address: schema.compute.energy.abs.options.v1_0_0
Common options:
unit_output: defaultMWhcarrier_normalization:STRICT|LENIENT(defaultSTRICT)unknown_carrier_policy:ERROR|DROPnegative_values_policy:ERROR|ALLOW_WITH_FLAGrounding: optional digits
2.3. Output Schema
ZAR Address: schema.compute.energy.abs.output.v1_0_0
Outputs include:
energy_totalenergy_by_carrierenergy_electricityenergy_fuelsmetadata(unit conversions, unknown carriers, flags)
3. Accepted Input Shapes
A. Flat item list (preferred)
{
"energy_items": [
{ "carrier": "electricity", "period": 2025, "value": 12000, "unit": "MWh" },
{ "carrier": "natural_gas", "period": 2025, "value": 8000, "unit": "MWh" }
],
"alignment": "BY_YEAR"
}
B. Mixed units
{
"energy_items": [
{ "carrier": "electricity", "period": 2025, "value": 12000, "unit": "MWh" },
{ "carrier": "diesel", "period": 2025, "value": 30000, "unit": "GJ" }
]
}
C. Time-series per carrier (legacy-friendly)
{
"energy_items": [
{ "carrier": "electricity", "values": [[2025, 12000], [2026, 11800]], "unit": "MWh" },
{ "carrier": "natural_gas", "values": [[2025, 8000], [2026, 7600]], "unit": "MWh" }
],
"alignment": "BY_YEAR"
}
All supported shapes MUST be normalized internally to:
Map<period, Map<carrier, energy_value_MWh>>
4. Carrier Normalization Rules (Normative)
4.1. Canonical carrier identifiers
Input carriers MUST normalize to canonical keys:
electricityfuels(derived group)- individual fuels:
natural_gas,diesel,gasoline,fuel_oil,coal - thermal:
steam,heat
If carrier_normalization = STRICT:
- unknown carriers → error
If LENIENT:
- unknown carriers may be dropped with metadata annotation
5. Compute Semantics (Normative)
Let:
- = energy consumption of carrier in period (after unit normalization)
5.1. Unit normalization
All inputs MUST be converted to unit_output (default MWh) before aggregation.
5.2. Energy by carrier
5.3. Electricity total
5.4. Fuels total
Let be the set of fuel carriers:
5.5. Total energy
Where includes electricity, fuels, and thermal carriers.
6. Validation & Error Model
Invariants
- Energy values must be finite
- Units must be convertible
- Negative values rejected unless explicitly allowed
Error codes (suggested)
ENERGY_AGGR_INVALID_CARRIERENERGY_AGGR_UNIT_CONVERSION_FAILEDENERGY_AGGR_NEGATIVE_VALUEENERGY_AGGR_NON_FINITE_VALUEENERGY_AGGR_ALIGNMENT_MISMATCH
Errors MUST include:
- engine
cmi_short_code - carrier and period context
7. Dependencies
MEID_CALC_ENERGY_AGGR depends on:
- schema resolver (ZAR)
- unit conversion utilities
- canonical energy carrier reference list
Declared via ZAR dependencies.
8. Federation & Audit Requirements
To reproduce energy aggregation externally, the export MUST include:
- engine identity (
cmiorzar_code) - engine build proof (
execution_ref+build_hash) - input/options/output schemas
- raw energy item list
- unit conversion table/version used
Provenance chain MUST show:
… → MEID_CALC_ENERGY_AGGR → …
with cmi_short_code recorded in USO tail arrays.
9. Performance Notes
- Complexity: for normalization + aggregation
- Memory:
- Suitable for batch ESG reporting
10. Methods Served (v1)
Energy.absEnergy.electricity.absEnergy.fuels.absEnergy.total.abs