WTR-CONS
Water Discharge Aggregation
1. Identity
Depends on module:
Purpose
Aggregates water discharge (water returned from the organization to the environment or third parties) into canonical totals and structured breakdowns aligned with ESRS E3-style water accounting.
This engine is the discharge counterpart to:
MEID_CALC_WATER_AGGR(withdrawal)- and is a key upstream input to
MEID_CALC_WATER_CONS(derived consumption mode).
Typical usage
- Total water discharge (m³)
- Discharge by destination (surface water, sewer, sea, third party, etc.)
- Discharge by quality category (if reported)
- Input to mass-balance consumption calculation
2. Contract References (ZAR)
2.1 Input Schema
ZAR Address: schema.compute.water.discharge.inputs.v1_0_0
Required conceptual fields:
discharge_items: list of water discharge recordsalignment:BY_YEAR|BY_INDEX(defaultBY_YEAR)
Each discharge_item conceptually includes:
period(typically year)valueunit(e.g.,m3,L,ML)destination: canonical discharge destination identifier- optional:
quality:TREATED|UNTREATED|UNKNOWNsite_idbasin_idgeo_refmeter_id/invoice_idis_estimate(boolean)
Canonical destinations (v1):
surface_watergroundwater(rare but included)seawatermunicipal_sewerthird_partyother
Note: In many orgs, discharge is best represented as “to sewer” vs “to environment”. Destinations support both.
2.2 Options Schema
ZAR Address: schema.compute.water.discharge.options.v1_0_0
Common options:
unit_output: defaultm3destination_normalization:STRICT|LENIENT(defaultSTRICT)unknown_destination_policy:ERROR|DROP|ASSIGN_OTHER(defaultERROR)negative_values_policy:ERROR|ALLOW_WITH_FLAGmissing_policy:ERROR|SKIProunding: optional digitsinclude_quality_breakdown: boolean (default false)
2.3 Output Schema
ZAR Address: schema.compute.water.discharge.output.v1_0_0
Outputs include:
- optional
metadata(unit conversions, unknown destinations, flags, completeness)
3. Accepted Input Shapes
A. Flat discharge item list (preferred)
{
"discharge_items": [
{ "destination": "municipal_sewer", "period": 2025, "value": 90000, "unit": "m3" },
{ "destination": "surface_water", "period": 2025, "value": 18000, "unit": "m3" }
],
"alignment": "BY_YEAR"
}
B. Mixed units
{
"discharge_items": [
{ "destination": "municipal_sewer", "period": 2025, "value": 90000, "unit": "m3" },
{ "destination": "third_party", "period": 2025, "value": 25000000, "unit": "L" }
]
}
C. With quality tagging
{
"discharge_items": [
{ "destination": "municipal_sewer", "quality": "TREATED", "period": 2025, "value": 85000, "unit": "m3" },
{ "destination": "surface_water", "quality": "UNTREATED", "period": 2025, "value": 5000, "unit": "m3" }
],
"include_quality_breakdown": true
}
All supported shapes MUST be normalized internally to:
Map<period, Map<destination, discharge_m3>> (+ optional quality dimension)
4. Destination Normalization Rules (Normative)
4.1. Canonical destination identifiers
Input destinations MUST normalize to canonical keys:
surface_watergroundwaterseawatermunicipal_sewerthird_partyother
If destination_normalization = STRICT:
- unknown destinations MUST error (default)
If LENIENT:
- unknown destinations handled per
unknown_destination_policy
4.2. Unknown destination handling
If a record cannot be mapped:
ERROR: fail the computationDROP: omit record and record in metadataASSIGN_OTHER: map to other and record in metadata
5. Compute Semantics (Normative)
Let be discharge volume to destination at time (after unit normalization).
5.1. Discharge by destination
5.2. Total discharge
Where is the set of included canonical destinations.
5.3. Optional quality breakdown
If include_quality_breakdown = true, let :
6. Completeness & Coverage Metadata (Normative)
This engine MUST compute a structural completeness measure:
- : destinations present in input (post-normalization)
- : expected destinations (defaults to the canonical set unless overridden)
Metadata MUST include:
destinations_presentdestinations_expectedcoverage_ratiounknown_destination_countnegative_value_count(if allowed)
7. Validation & Error Model
Invariants
- Values must be finite
- Units must be convertible to unit_output
- Negative values rejected unless explicitly allowed
- Period keys coherent under alignment rules
Error codes (suggested)
WATER_DISC_INVALID_DESTINATIONWATER_DISC_UNIT_CONVERSION_FAILEDWATER_DISC_NEGATIVE_VALUEWATER_DISC_NON_FINITE_VALUEWATER_DISC_ALIGNMENT_MISMATCH
Errors MUST include:
- engine
cmi_short_code - destination and period context
8. Dependencies
MEID_CALC_WATER_DISC depends on:
- schema resolver (ZAR)
- unit conversion capability (delegated)
- canonical discharge destination reference list
Declared via ZAR dependencies.
9. Federation & Audit Requirements
To reproduce water discharge externally, the export MUST include:
- engine identity (
cmiorzar_code) - engine build proof (
execution_ref+build_hash) - input/options/output schemas used
- raw discharge items
- destination normalization policy used
- unit conversion reference/version used (if applicable)
Provenance chain MUST show:
… → MEID_CALC_WATER_DISC → …
with cmi_short_code recorded in USO tail arrays.
10. Performance Notes
- Complexity:
- Memory:
- Suitable for batch reporting and KPI analytics
11. Methods Served (v1)
Water.discharge.absWater.discharge.by_destination.absWater.discharge.by_quality.abs(if enabled)Water.discharge.total.abs