β’ What is OpenWQ?
β’ Core Capabilities
β’ Available Modules
β’ Coupled Host Models
Section 01: Theoretical Framework
β’ Governing Equation
β’ Compartment Structure
β’ Module Architecture
Supported Processes
β’ Biogeochemical Processes
β’ Pre-Built Templates
Section 03: Applications
β’ Application Areas
β’ Technical Stack
β’ AI-Powered Assistance
β’ Summary
OpenWQ is an open-source water quality modeling framework designed to simulate the transport and transformation of chemical species in aquatic environments.
βββββββββββββββββββββββββββββββββββ
β HOST MODEL β
β (SUMMA, mizuRoute, CRHM, ...) β
β β
β Provides: β
β β’ Water fluxes β
β β’ Storage volumes β
β β’ Temperature β
βββββββββββββββββ¬ββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββ
β OpenWQ β
β β
β Computes: β
β β’ Chemical transport β
β β’ Biogeochemical reactions β
β β’ Source/sink dynamics β
β β’ Concentrations & loads β
βββββββββββββββββββββββββββββββββββ
Two engines: NATIVE_BGC_FLEX for user-defined kinetic reactions (JSON-based) and PHREEQC for thermodynamic equilibrium geochemistry.
Flexible loading from CSV, JSON, HDF5, land-use coefficients, or ML predictions.
DDS optimizer with Morris screening and Sobol sensitivity analysis.
| Transport | Advection & dispersion |
| Lateral Exchange | Inter-compartment fluxes |
| Isotherms | Freundlich, Langmuir sorption |
| Erosion | Sediment-bound transport |
| Consumptive Use | Irrigation, withdrawals |
| External Fluxes | Precipitation, inflows |
OpenWQ provides a comprehensive set of modules for water quality modeling:
| NATIVE_BGC_FLEX | User-defined kinetics |
| BGC_FLEX_THERMO | With FT factor |
| PHREEQC | Equilibrium geochemistry |
| ADVDISP | Advection + Dispersion |
| ADV | Advection only |
| BOUNDMIX | Lateral exchange |
| LANGMUIR | Sorption isotherm |
| FREUNDLICH | Sorption isotherm |
| HYPE_HBVSED | Sediment transport |
| HYPE_MMF | Sediment transport |
OpenWQ integrates with established hydrological models via C++/Fortran wrappers:
| Model | Domain | Description |
|---|---|---|
| SUMMA | Land Surface | Structure for Unifying Multiple Modeling Alternatives β multi-physics land model |
| mizuRoute | River Routing | Continental-scale river routing with lakes and reservoirs |
| mizuRoute-CSLM | River + Lakes | mizuRoute with Community Surface and Lake Model integration |
| FLUXOS | Overland Flow | 2D overland flow and sediment transport model |
| CRHM | Cold Regions | Cold Regions Hydrological Model β snow, frozen soils, prairie hydrology |
| Custom | Any | Straightforward API for coupling with any model |
| Term | Description |
|---|---|
| Mij | Mass of species i in compartment j [g] |
| Qin, Qout | Water fluxes from host model [L/s] |
| Cin, Cij | Concentrations [mg/L] |
| Sij | External sources/sinks [g/s] |
| Rij | Biogeochemical reactions [g/s] |
OpenWQ organizes the domain into compartments β hydrological units that store and transport water.
PRECIPITATION
β (External Flux)
βββββββββββββββ
β CANOPY β
ββββββββ¬βββββββ
β
βββββββββββββββ
β RUNOFF ββββββ RIVER
ββββββββ¬βββββββ β
β LAKE
βββββββββββββββ
β SOIL_L1 β
ββββββββ¬βββββββ
β (Exchange)
βββββββββββββββ
β SOIL_L2 β
ββββββββ¬βββββββ
β
βββββββββββββββ
β GROUNDWATER β
βββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenWQ MODULES β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββ β
β β BIOGEOCHEMISTRY β β TRANSPORT β β SOURCES/SINKS β β
β β β β β β β β
β β β’ NATIVE_BGC_FLEX β β β’ Advection β β β’ JSON/CSV/HDF5 β β
β β (user kinetics) β β β’ Dispersion β β β’ Land-use based β β
β β β β β’ Lateral exchange β β β’ ML predictions β β
β β β’ PHREEQC β β β β β β
β β (equilibrium) β β β β β β
β βββββββββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββ β
β β SORPTION β β SEDIMENT TRANSPORT β β OUTPUT β β
β β β β β β β β
β β β’ Freundlich β β β’ HYPE_HBVSED β β β’ HDF5 β β
β β β’ Langmuir β β β’ HYPE_MMF β β β’ CSV β β
β β β β β β β β
β βββββββββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Nitrification, denitrification, mineralization, immobilization, volatilization
Sorption, desorption, mineralization, sediment binding
DOC production, BOD decay, organic matter decomposition
Reaeration, respiration, photosynthesis, SOD
Sorption isotherms, complexation, precipitation
Die-off, settling, resuspension, UV inactivation
Degradation, volatilization, sorption, hydrolysis
pH, speciation, mineral equilibria (PHREEQC)
| SWAT | N & P cycling with erosion |
| QUAL2E/QUAL2K | Stream water quality |
| HYPE | Large-scale nutrient modeling |
| WASP8 | Lakes and estuaries |
| INCA | Integrated catchment N & C |
| SPARROW | Regional nutrient export |
| C++ | Core simulation engine |
| Fortran | Host model coupling (SUMMA, mizuRoute) |
| Python | Configuration, calibration, post-processing |
| Armadillo | Linear algebra |
| exprtk | Mathematical expression parsing |
| PhreeqcRM | Geochemical reactions |
| NetCDF/HDF5 | Input/output data |
| JSON | Configuration files |
| CMake | Build system |
| Docker | Container deployment |
| Apptainer | HPC deployment |
OpenWQ includes built-in support for AI-powered assistance using Claude and other LLMs.
# macOS/Linux: Install + add to PATH curl -fsSL https://claude.ai/install.sh | sh echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc # Windows: Install using winget, then restart terminal winget install Anthropic.ClaudeCode # Navigate to OpenWQ & start Claude cd /path/to/openwq/ && claude # CLAUDE.md auto-loaded - ask anything: > How do I set up nitrification?
Can read, write & edit files directly
Copy prompt from docs/OPENWQ_ASSISTANT_PROMPT.md
Paste into claude.ai or any AI assistant
User-defined reactions without recompiling. JSON-based configuration.
Works with SUMMA, mizuRoute, CRHM, and custom hydrological models.
Open-source, community-driven, actively developed.
GitHub: github.com/ue-hydro/openwq
Documentation: openwq.readthedocs.io
Contact: diogo.costa@uevora.pt