ENGY-FUEL
Fuel Consolidation
1. Identity
Depends on module:
Purpose
Consolidates fuel consumption from procurement, fleet, and stationary combustion systems into canonical fuel-energy series suitable for ESRS-aligned energy reporting and downstream aggregation.
This engine exists because fuels often arrive as:
- liters/tonnes/m³ from procurement,
- mixed units and calorific assumptions,
- split across mobile vs stationary uses,
- with data quality variability requiring strict normalization + metadata.
Typical usage
- Total fuels energy consumption (MWh)
- Fuels by fuel-type (MWh)
- Stationary vs mobile fuels splits (MWh)
- Input to
MEID_CALC_ENERGY_AGGR(as the authoritative fuels stream)
2. Contract References (ZAR)
2.1 Input Schema
ZAR Address: schema.compute.energy.fuels.inputs.v1_0_0
Required conceptual fields (v1 minimal):
records: list of fuel recordsalignment:BY_YEAR|BY_INDEX(defaultBY_YEAR)
Each fuel record conceptually includes:
period(typically year)fuel_type: canonical fuel identifier (e.g.,diesel,gasoline,natural_gas,fuel_oil,coal,lpg)valueunit(e.g.,L,m3,kg,tonne,GJ,MWh)- optional:
use_context:STATIONARY|MOBILE|UNKNOWNsource_type:PROCUREMENT|FLEET|METER|ESTIMATEinvoice_id/purchase_id/tank_idsite_id/fleet_idlcv_hv_flag:LCV|HHV(if relevant)calorific_value_override(MJ/unit)density_override(kg/L) (for volume→mass conversions)
Optional structured fields (preferred when available):
fuels_total: scalar or time-series (already energy-normalized)fuels_by_type: map fuel_type → series (already energy-normalized)
If structured fields are provided,
recordsmay be omitted.
2.2 Options Schema
ZAR Address: schema.compute.energy.fuels.options.v1_0_0
Common options:
unit_output: defaultMWhfuel_normalization:STRICT|LENIENT(defaultSTRICT)unknown_fuel_policy:ERROR|DROP|FLAG(defaultERROR)conversion_policy:DEFAULT_FACTORS|REQUIRE_FACTORS(defaultDEFAULT_FACTORS)default_factor_ref: reference to default conversion factors dataset (NCV/LHV)duplicate_policy:ALLOW|DEDUPE_BY_ID|ERROR(defaultDEDUPE_BY_ID)negative_values_policy:ERROR|ALLOW_WITH_FLAGmissing_policy:ERROR|SKIProunding: optional digits
2.3 Output Schema
ZAR Address: schema.compute.energy.fuels.output.v1_0_0
Outputs include:
- : total fuels energy
- : fuels by type
metadata(factor sources, overrides used, unknown fuel handling, dedupe actions)
3. Accepted Input Shapes
A. Procurement records (volumetric units)
{
"records": [
{ "source_type": "PROCUREMENT", "purchase_id": "P-001", "period": 2025, "fuel_type": "diesel", "value": 50000, "unit": "L", "use_context": "MOBILE" },
{ "source_type": "PROCUREMENT", "purchase_id": "P-002", "period": 2025, "fuel_type": "natural_gas", "value": 20000, "unit": "m3", "use_context": "STATIONARY" }
],
"alignment": "BY_YEAR"
}
B. Direct energy units (already in GJ / MWh)
{
"records": [
{ "source_type": "METER", "period": 2025, "fuel_type": "natural_gas", "value": 30000, "unit": "GJ", "use_context": "STATIONARY" }
]
}
C. Structured series (already consolidated upstream)
{
"fuels_by_type": {
"diesel": [[2025, 5200], [2026, 5100]],
"natural_gas": [[2025, 8000], [2026, 7600]]
},
"unit_output": "MWh",
"alignment": "BY_YEAR"
}
All supported shapes MUST be normalized internally to:
Map<period, Map<fuel_type, energy_MWh>> + optional Map<period, context_splits>
4. Fuel Normalization Rules (Normative)
4.1. Canonical fuel identifiers (v1)
At minimum, v1 MUST recognize:
- diesel
- gasoline
- natural_gas
- fuel_oil
- coal
- lpg
- jet_fuel (optional but common)
If fuel_normalization = STRICT:
- unknown fuels MUST error (default)
If LENIENT:
- unknown fuels may be dropped or flagged per
unknown_fuel_policy
4.2. Conversion factors governance
If conversion_policy = DEFAULT_FACTORS:
- use conversion factors from
default_factor_ref(dataset) unless overridden per record
If REQUIRE_FACTORS:
- each record MUST provide an override factor (calorific/density) or computation fails
Metadata MUST record:
- factor dataset reference/version used
- overrides used (count + which fuel types)
5. Unit Conversion Semantics (Normative)
5.1. Convert to energy in MJ
For a fuel record with value in a physical unit:
- If unit is already energy (e.g., GJ, MWh): convert directly.
- If unit is mass or volume: convert using:
- density (if volume→mass needed)
- calorific value (MJ per unit)
Generic conversion:
Where is the calorific value in MJ per input unit.
If volume requires density:
- convert volume to mass first:
Then:
5.2. Convert MJ to output unit (MWh)
Using :
6. Aggregation Semantics (Normative)
Let be the set of fuel types and periods.
6.1. Fuels by type
For each fuel type and period :
6.2. Fuels total
6.3. Stationary vs mobile splits (if use_context provided)
Let be records where use_context=STATIONARY, and similarly for mobile.
If context is missing:
- record under UNKNOWN bucket and flag in metadata (v1)
7. Validation & Error Model
Invariants
- Values must be finite
- Units must be convertible
- Conversion factors must be resolvable under policy
- Duplicate records handled per duplicate_policy
- Negative values default to error
Error codes (suggested)
ENERGY_FUEL_MISSING_INPUTENERGY_FUEL_INVALID_FUEL_TYPEENERGY_FUEL_FACTOR_NOT_FOUNDENERGY_FUEL_UNIT_CONVERSION_FAILEDENERGY_FUEL_DUPLICATE_RECORD_ERRORENERGY_FUEL_NON_FINITE_VALUEENERGY_FUEL_ALIGNMENT_MISMATCH
Errors MUST include:
- engine
cmi_short_code - record identifier and period
- fuel_type and unit context
8. Dependencies
MEID_CALC_ENERGY_FUEL depends on:
- schema resolver (ZAR)
- unit conversion utilities
- fuel conversion factors dataset (
default_factor_ref) - optional density/calorific reference tables
Declared via ZAR dependencies.
9. Federation & Audit Requirements
To reproduce fuel consolidation externally, the export MUST include:
- engine identity (
cmiorzar_code) - engine build proof (
execution_ref+build_hash) - input/options/output schemas used
- raw fuel records or structured series used
- conversion factor dataset reference/version
- any density/calorific overrides applied
conversion_policy,unknown_fuel_policy,duplicate_policy
Provenance chain MUST show:
… → MEID_CALC_ENERGY_FUEL → …
with cmi_short_code recorded in USO tail arrays.
10. Performance Notes
- Complexity:
- Memory:
- Highly parallelizable by site/fleet
11. Methods Served (v1)
Energy.fuels.absEnergy.fuels.by_type.absEnergy.fuels.stationary.absEnergy.fuels.mobile.abs