Method
MDC — Donnan-exclusion salt flux
What it predicts
Salt removal rate, desalination efficiency and energy per kg salt for a three-chamber CEM/AEM stack.
Governing relations
Each relation is transcribed from the implementation. Where the code cites no source, the source line says so.
Salt flux from current Source: Faraday's law; Cao et al. 2009, Environ. Sci. Technol. 43:7148 (about 90 % desalination in the first MDC).
Symbol Meaning Unit salt removal flux mol/m²/s coulombic-to-salt efficiency (default 1.0, clamped 0–1.5) 1 anode current density from predict.ts A/m² Faraday constant, 96 485 C/mol membrane permselectivities (default 0.95 each) 1 Worked example
These inputs, passed to the predictor, return the output below. A test re-runs the example on every change, so this number is the one the code produces.
input value unit temperatureC 25 °C ph 7 pH electrodeSpacingCm 2 cm hrtHours 24 h codMgL 1,000 mg/L Output · mdc.saltRemovalRate = 1.403e-6 mol Na⁺/m²/s, within ±0.1 %
By hand · j = 0.15 A/m² from predict.ts at 25 °C, pH 7, 1000 mg/L COD, no anode named (see the MFC worked example). N = 1.0 × 0.15 / 96 485 × 0.95 × 0.95 = 1.403×10⁻⁶ mol/m²/s.
Reproduce · Pinned by libs/shared/electrochemistry/src/predictors/worked-examples.test.ts. Run it from the repository root:
pnpm exec jest -c libs/shared/electrochemistry/jest.config.js worked-examples.test.ts -t "mdc.saltRemovalRate"
Depletion toward a floor Source: First-order approach to a 10 % floor; Cao et al. 2009 reached about 10 % residual after 24 h (as stated in mdc.ts).
k is chosen so the initial rate equals the Faradaic salt flux; the floor is a fixed fraction, not a conductivity model.
Symbol Meaning Unit initial middle-chamber salt concentration (default 35) g/L residual floor where conductivity collapses g/L smaller of the CEM and AEM areas (default 0.001) m² middle-chamber volume (default 50 mL) m³ run duration (default 24 h) s Net energy per kg salt Source: Energy balance as stated in mdc.ts; Cao et al. 2009 observed power output during desalination.
Symbol Meaning Unit net energy per kg salt removed; negative when the anode out-produces the bias kWh/kg external bias (default 0) V anode power density from predict.ts W/m² salt mass removed kg
Assumptions and constants
- Anode current from the shared Butler-Volmer biofilm kinetics in predict.ts (Geobacter on acetate), with the same Arrhenius, substrate, pH and ohmic corrections as the MFC predictor.
- CE_desal defaults to 1.0 (literature 0.85–1.2; Cao et al. 2009 report ~90 % desalination efficiency).
- Membrane permselectivity ≈ 95 % for both CEM and AEM; co-ion leakage is a multiplicative loss.
- Anode area is taken equal to the smaller membrane area.
Corrections applied
- Co-ion leakage factors on CEM and AEM.
- Conductivity collapse as the middle chamber depletes.
Not modelled
- Osmotic water flux (significant only above ~35 g/L feeds).
- Biofouling kinetics over weeks of operation.
Literature anchors in the source
- Cao et al. 2009, Environ. Sci. Technol. 43:7148 (first MDC, ~90 % desalination efficiency)
- Kim & Logan 2013, Desalination 308:122
Implementation
libs/shared/electrochemistry/src/predictors/mdc.ts
Interval the predictor ships
heuristic_fixed_fraction — A fixed ±25 % placeholder band. It is NOT a calibrated interval; when served through /api/ml/predict it is replaced by the benchmark band below, or withheld. How served intervals are built
Calibration artifacts used when served
- Benchmark out-of-fold residual quantiles: bes-benchmark-v1 · gkf5 · generated 2026-09-09
- Split-conformal calibration: split-conformal · generated 2026-05-21
- Hierarchical-priors v2 trust snapshot: populated · generated 2026-05-16
Benchmark cells for this predictor’s systems
Each row is a stratum with n ≥ 30 residuals at nominal level 90%. Coverage is the cross-validated share of held-out points inside the band.
| target | stratum | n | papers | coverageCV |
|---|---|---|---|---|
| cod_removal | MDC | 51 | 13 | 76.5% |
| cod_removal | MDC|desalination | 33 | 6 | 61.5% |
Prior trust by served parameter
The state the lab badge shows for each served parameter and system, from the v2 priors fit.
| parameter | system | state | papers | prior |
|---|---|---|---|---|
| cod_removal | MDC | modeled | 12 | weakly_informative |
Scientific-rigor gates
pnpm verify:science runs these rules over the committed priors and validation artifacts in pre-commit. Known violations are baselined per rule and slug; a new one blocks the commit. Baseline from hierarchical-priors-v2.json@2026-10-26T00:10:47.721880+00:00.
| rule | baselined |
|---|---|
| gate-honestyNo parameter may pass a rounded-threshold gate read while converged=false | 1 |
| support-containmentBounded quantities must have ci95 inside physical support, width <= range | 3 |
| magnitude-sanityNo ci95 bound may exceed the plausibility ceiling (1.0e+6) | 0 |
| slug-uniquenessNo two slugs may share a spelling-independent identity; scale must agree | 2 |
| secondary-source-purityNo fitted prior may carry a REVIEW (secondary-source) stratum | 0 |
| artifact-pairingEach fit must have its own coverage evidence; the served fit must have some | 0 |
| coverage-sharpnessAny coverage figure must ship its interval width alongside | 0 |
| interval-calibrationHeld-out interval coverage per parameter may not newly degrade | 128 |
| effects-gap-completenesseffects.json is schema 2.0; every non-high effect has a gap per archetype; no gap is "high" | 0 |