Back to All ProjectsTechnical Specification & Results Sheet
Wet Lab & Systems£40k Grant & 35,232 Sensor Records

Parallel PHREEQC Speciation Engine

Multi-Core Python & C++ IPhreeqc Geochemical Modelling Package

Co-developed an installable multi-core Python package wrapping the USGS IPhreeqc C++ shared library across 13 thermodynamic databases, running parallel chemical speciation across 35,232 environmental sensor records and supporting a £40,000 commercial grant at Nanolyse Technologies.

Commercial Impact

£40,000 R&D Grant

STFC / Harwell Campus grant + 3 corporate R&D partnerships secured

Dataset Throughput

35,232 Sensor Rows

Parallel multi-catchment hydrochemical speciation (NH3 mol/kgw)

Thermodynamic Models

13 Bundled Databases

phreeqc.dat, minteq.v4.dat, wateq4f.dat, llnl.dat, pitzer.dat, sit.dat

Execution Architecture

ProcessPool C++ DLL

Persistent per-worker libiphreeqc.dll/.so initialisation (_init_worker)

Skills & Stack:
Python
PHREEQC
MATLAB
Pandas / NumPy / SciPy
Git

System Architecture & Quantitative Results

Installable Python package (phreeqc_project v0.1.0) co-developed over Git at Nanolyse Technologies Ltd. (Harwell Science and Innovation Campus), coupling the USGS IPhreeqc C++ engine with multi-core Python batch execution and MATLAB/Excel decision models.
  • Persistent Multi-Core C++ Wrapper (PhreeqcBatchRunner): Uses ProcessPoolExecutor with a persistent worker initialiser (_init_worker) that loads libiphreeqc.dll/.so and one of 13 thermodynamic databases once per CPU core.
  • Telemetry Sanitization (clean_water_quality_file): Automated ingestion of .xls/.xlsx/.csv water sensor logs, stripping faulty sensor flags and repairing Excel serial timestamps across pH, temperature, nitrite, nitrate, ammonium, DO, and conductivity.
  • Commercial Grant Validation: Ran parallel speciation across 35,232 dual-catchment records to model toxic un-ionised ammonia (NH3), supporting executive pitches that won a £40,000 commercial grant and 3 corporate R&D partnerships.

Speciation Output & Multi-Core C++ Worker Scaling

[Fig. 1]Aqueous Ammonia/Carbonate Equilibrium Speciation & Multi-Core Throughput Scaling

Left: Non-linear thermodynamic distribution of un-ionised NH3(aq) vs NH4+ across pH. Right: Multi-core throughput scaling using persistent per-worker IPhreeqc C++ instances.

Aqueous Ammonia/Carbonate Equilibrium Speciation & Multi-Core Throughput Scaling

[Fig. 2]Empirical River Catchment Un-Ionised Ammonia (NH3) Speciation Output

Direct speciation trajectory generated by phreeqc-python-tool across multi-parameter river telemetry.

Empirical River Catchment Un-Ionised Ammonia (NH3) Speciation Output