membrane-economics-edi
RO/EDI economics (SEC, LCOW, lifecycle decision matrix), Electrodeionization deep-dive (cell pair geometry, FCE feed metric, KPIs, 8 failure modes), EDI vs Mixed-Bed DI sizing economics, pharmaceutical UPW/WFI regulatory context (USP/Ph. Eur./21 CFR Part 11/EU Annex 11), produced-water regulatory context (WHO/ISO 16075/EN 12952-12/SEMI F63). Use for energy benchmarks, cost modelling, EDI design/diagnostics, and regulatory citation.
What this skill does
# Membrane Economics, Energy & EDI Deep Dive
Two-part reference. Part 1 covers SEC/LCOW/lifecycle. Part 2 covers EDI process, KPIs, failure modes, and regulatory context for produced water and pharmaceutical UPW.
Convention markers:
- `⚠️` — likely bug or incorrect assumption in calling code
- `💡` — enhancement opportunity (new alert, new field, new module)
---
# PART 1 — Energy & Economics
## §1 — Specific Energy Consumption (SEC)
**Operator-facing formula:**
```
SEC = (P_HPP − P_ERD_recovered) / Q_permeate [kWh/m³]
```
where `P_HPP` = high-pressure-pump draw (kW), `P_ERD_recovered` = power recovered by ERD (kW), `Q_permeate` in m³/h. For brackish/tertiary systems without ERD the second term is zero.
**Engineering-grade form:**
```
SEC = ΔP_feed / (3600 · η_pump · R) − (1 − R) · ΔP_brine · η_ERD / (3600 · R)
```
with R = recovery, ΔP in bar.
### 1.1 Benchmarks by source water (verified 2025–2026)
| Feed type | TDS | Typical SEC | Best-in-class | Source |
|---|---|---|---|---|
| SWRO (open ocean) | ~35 000 mg/L | 2.5–4.0 kWh/m³ | **1.794 kWh/m³** Danfoss DESALRO 2.0 record, Pozo Izquierdo, Gran Canaria, Feb 2025 | Danfoss press release / Guinness |
| Modern large SWRO | 35 000 mg/L | 2.0–2.8 kWh/m³ | Previous record 2.27 kWh/m³ (SWCC, KSA) | Danfoss |
| BWRO industrial | 1 000–10 000 mg/L | 0.5–1.5 kWh/m³ | 0.5–0.8 with ERD + optimal recovery | ScienceDirect S004896972402919X |
| Tertiary reuse RO | < 2 000 mg/L | 0.5–1.5 kWh/m³ | — | EPA WaterReuse |
### 1.2 Thermodynamic minimum
- **≈ 1.06 kWh/m³** for SWRO at R = 0.5, T = 25 °C, 35 g/L TDS
- Derived from Gibbs free energy of separation with Spiegler-Kedem reversible-process framework
- Theoretical minimum at infinite dilution: ≈ 0.78 kWh/m³
Sources: *Journal of Chemical Education* 2021 (doi:10.1021/acs.jchemed.0c01194); Wang et al., *Desalination* 2016 (S001191641630087X "Thermodynamic perspective for SEC of seawater desalination"); US-DOE *Seawater Desalination Bandwidth Study* 2017.
⚠️ The "Stenzel" attribution sometimes seen on the open web for the 1.06 figure is **not confirmed**; cite the Spiegler-Kedem / Gibbs derivation instead.
### 1.3 ERD comparison
| ERD type | Peak η | Field η | Notes |
|---|---|---|---|
| Pelton wheel | 80–87 % | 78–85 % | Older centrifugal recovery; hydraulic → mechanical → hydraulic |
| Calder DWEER (isobaric dual-work) | **98 %** | 93–96 % | Licensed by Calder AG |
| Energy Recovery PX (rotary pressure exchanger) | **95–98 %** | 93–96.4 % | Industry standard for large SWRO |
ERD payback rule of thumb: < 2 years for plants > 1 000 m³/d at industrial electricity tariffs.
---
## §2 — LCOW (Levelized Cost of Water)
```
LCOW = (CAPEX_annualized + OPEX_annual) / Q_produced_annual
CRF = i·(1+i)^n / ((1+i)^n − 1) # capital recovery factor
```
### 2.1 Component breakdown — SWRO
| Component | Share |
|---|---|
| CAPEX amortized | 40–50 % |
| Energy | 30–40 % (grid-cost dependent) |
| Chemicals + cleaning | 5–10 % |
| Membrane replacement | 5–10 % |
| Labor + O&M | 10–15 % |
### 2.2 LCOW ranges (verified 2024–2026)
| Plant class | LCOW (USD/m³) | Source |
|---|---|---|
| Large SWRO (> 50 000 m³/d, excl. intake/outfall) | $0.53–$1.58 | Advisian |
| Utility-scale SWRO with high-solar 2026 forecast | $0.45–$0.70 | Energy-solutions.co |
| Small-island SWRO | $1.50–$3.00 | IDA Yearbook / Advisian |
| BWRO industrial | $0.20–$0.50 | Foreverpureplace |
### 2.3 Sensitivity ranking
1. Electricity unit price
2. Membrane lifespan & replacement rate
3. Recovery rate (R)
4. Plant capacity factor (uptime)
5. Discount rate / WACC for CAPEX amortization
Sources: Advisian *Cost of Desalination*; ScienceDirect S2213138823000577.
---
## §3 — Operational KPIs (beyond instantaneous calculations)
| KPI | Healthy | Stressed | Action |
|---|---|---|---|
| Membrane life SWRO | 5–7 yr (8–10 best) | 3–5 yr | Review pretreatment |
| Membrane life BWRO | 7–10 yr | 2–3 yr | Antiscalant + CIP review |
| CIP frequency | 1–2/yr | 4–6/yr | Diagnose foulant |
| CIP frequency critical | > 6/yr | — | Replace lead vessel / re-engineer |
| Availability | ≥ 95 % | 90–95 % | Train rotation / redundancy |
| NPF baseline drift (lifetime) | 5–10 %/yr | 15 %+/yr | Investigate compaction vs fouling |
| NSP baseline drift (lifetime) | 10–20 % | > 25 % | Approach replacement |
Sources: Aqualitek SWRO maintenance guide; FilmTec/DuPont Form 45-D01911 *Exceptional Membrane Life*; Pumps & Systems *Life of an RO Membrane*.
---
## §4 — Lifecycle Decision Matrix
Signature → action mapping that turns trends into operational decisions:
| Observation | Likely cause | Reversibility | Action | Rationale |
|---|---|---|---|---|
| NPF −15 % in 30 d, ΔPn +20 % | Particulate / biofouling | Reversible | CIP (alkaline + biocide) | Standard recovery |
| NPF −20 % over 3 yr, ΔPn stable | Compaction | Irreversible | Tolerate or schedule replacement | No CIP benefit |
| NSP +50 % sudden | Mechanical integrity loss | Localised | Probe sweep; replace lead element | Acute defect |
| NSP +30 % over 2 yr | Cumulative oxidation | Irreversible | Replace lead vessel set; audit RedOx | Wear pattern |
| ΔPn rapid stage 2 only | Stage-2 scaling | Treatable | Antiscalant review + acid CIP | Concentration-polarization location |
| NPF + NSP both down | Severe organic fouling | Often reversible | Hot CIP, then biocide | Combined permeability + selectivity hit |
💡 A `lifecycle_advisor` module consuming this table + cumulative-exposure counters + CIP history → enum recommendation `{TOLERATE, SCHEDULE_CIP, IMMEDIATE_CIP, REPLACE_LEAD, REPLACE_VESSEL_SET}` is more valuable than a single-snapshot alarm.
---
# PART 2 — EDI Deep Dive
## §5 — EDI Process Fundamentals
### 5.1 Cell geometry
Repeating "cell pair" = one **dilute (D)** compartment + one **concentrate (C)** compartment, bounded by alternating cation- and anion-exchange membranes. Electrode compartments at stack ends apply DC field.
Ions in D migrate through membranes into C; dilute stream is product.
### 5.2 In-situ regeneration
At elevated DC voltage, water splits at the bipolar interface of the resin bed in D:
```
H₂O → H⁺ + OH⁻
```
- H⁺ regenerates the cation resin
- OH⁻ regenerates the anion resin
No NaOH/HCl is needed → no hazardous regenerant waste. This is the central advantage over Mixed-Bed DI.
### 5.3 Why EDI lives downstream of RO
- Feed must be ≤ ~40 µS/cm FCE
- Weak acids (CO₂, SiO₂) load the stack when ionized internally
- Hardness > 1 ppm CaCO₃ causes concentrate scaling
- Free chlorine > 0.02 ppm destroys resin permanently
### 5.4 Verified feed envelope (Ionpure LX series)
| Parameter | Limit | Notes |
|---|---|---|
| Feed conductivity (FCE basis) | **< 40 µS/cm** | Stack-dependent 25–43 µS/cm |
| Total hardness (as CaCO₃) | **< 1.0 ppm** | Hard limit; risk = concentrate scaling |
| TOC | < 0.5 ppm | Anion-resin fouling above |
| Fe / Mn | < 0.01 ppm each | Irreversible colloidal fouling |
| Total CO₂ | < 5 ppm typical | Loads via FCE; degas if higher |
| SiO₂ | < 1.0 ppm Ionpure LX; < 0.5 ppm preferred | Polymerization risk |
| Total chlorine | **< 0.02 ppm** (target 0) | Destroys resin |
| Temperature | 5–45 °C standard; 60 °C HWS modules | HWS = hot-water-sanitizable |
| pH | 4–11 | Outside → membrane integrity loss |
| Inlet pressure | ≤ 7 bar (100 psi) | Mechanical limit |
### 5.5 Recommended `EDIDataPoint` fields
Required for computing FCE + full diagnostics:
- `feed_conductivity_uS_cm: float`
- `feed_co2_ppm: float`
- `feed_sio2_ppm: float`
- `feed_temperature_C: float`
- `product_conductivity_uS_cm: float` (or `product_resistivity_MOhm_cm`)
- `concentrate_conductivity_uS_cm: float`
- `feed_flow_m3h: float`
- `product_flow_m3h: float`
- `concentrate_flow_m3h: float`
- `stack_voltage_V: float`
- `stack_current_A: float`
- `cell_pair_count: int` (stack-config metadata)
- Optional: `feed_hardness_ppm`, `feed_chlorine_ppm`
Sources: SnowPure *Electropure OEM Manual v3.5.0*; DuPont EDI-310 Module Manual (45-D01915Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.