Recent progress in thedevelopment of theHPx framework forreactive transport
calculations
Diederik Jacques1, Jirka Simunek2, Hans Meeussen3,
Eric Laloy1
1SCK CEN
2UCR
3NRG

Reactive coupled transport

Physical

Biological
Bio
Microbiology
Roots - vegetation
SCK CEN/55000182

Flow & Transport
Flow
Heat transport
Solute transport

GeochemicalGeochemistry
Thermodynamics
Kinetic processes
2

ISC: RestrictedSimulating water flow, transport and biogeochemical reactions in environmental
soil quality problems

A Coupled Numerical Code for
Variably Saturated Water Flow,
Solute Transport andBioGeoChemistryin Soil Systems

Flow and transport model
HYDRUS-1D 4.0
HYDRUS (2D/3D) 2.x

SCK CEN/55000182

Biogeochemical model
PHREEQC-3

3

ISC: Restricted

How it started… 1999
Rien van Genuchten

Diederik Jacques

Dirk Mallants

Jirka Simunek

Mirek Senja

Hello from C++
Hello from FortranSCK CEN/55000182

4

ISC: Restricted

Starting from HYDRUS1D & PHREEQC-2 gave
immediately an unique code

SCK CEN/55000182

5

ISC: RestrictedSome significant changes 2005-2015• Integration in GUI of HYDRUS-1D• Development HP2• Feedback from geochemistry to transport properties• Moving to PHREEQC-3• OPEN-MP – shared memory for parallel computing• Inline variables and improved scripting
SCK CEN/55000182

6

ISC: RestrictedHPx Framework

SCK CEN/55000182

7

ISC: RestrictedGeochemical solvers
Scripts

SCK CEN/55000182

8

ISC: RestrictedGeochemistry - ORCHESTRA
Hans Meeussen
NRG
The Netherlands

SCK CEN/55000182

9

ISC: Restricted

Easy activation

SCK CEN/55000182

10

ISC: RestrictedBenchmark – 1D Cement leaching model

SCK CEN/55000182

11

ISC: RestrictedBenchmark – Cement leaching 2DSCK CEN/55000182

12

ISC: RestrictedGeochemistry - Script• Script accept and adapt the aqueous concentrations• Three script languages• BASIC – standard in PHREEQC• MyBasic – HPx: “Modern” structured BASIC, OO• https://github.com/paladin-t/my_basic• All phreeqc-related functions are added• Python• “beta” version – not in “official version”• Not all phreeqc-related functions are added

SCK CEN/55000182

13

ISC: Restricted

Potential use
Repeated calculations (UA, SA) for
geochemical calculations

Alternative geochemical modelSurrogate modelling

Hello from C++
Hello from python

SCK CEN/55000182

14

ISC: Restricted

Why a statistical surrogate model forgeochemical calculations• Geochemical calculations typically consume most of the computationaltime of RT simulations, say 80% to 90%• Over large domains and/or for long simulation periods, RT simulations may
become intractable• Replace the geochemical solver of the RTM by a trained ML surrogate
model• Some recent works : Huang et al. (2018), Guérillot and Bruyelle (2019),
Leal et al. (2020), Prasianakis et al. (2020), De Lucia and Kühn (2021),Laloy and Jacques (2022), Demirer et al. (2022)

SCK CEN/55000182

15

ISC: Restricted

Surrogate geochemical modeling within the RTM• Replace PHREEQC in HPx RT model by trained
• kNN
• DNN
• Speedup > 1000 on a GPU vs single-threaded PHREEQC for 10,000
predictions at once
• After each transport step calculated by Hydrus• The C++ written HPx main module calls the Python-based kNN or DNN
emulator• For each node, emulation of aqueous concentrations from total amounts
and re-calculation of the solid amounts• For each node and time step, mass balance is honored, but potentiallywrong distribution between aqueous and solid phases
SCK CEN/55000182

16

ISC: RestrictedExample – 2D Cement leaching• 2D leaching from hardened cement paste, 61x61 (3721) and121x121 (14641) nodes, advective flow
• CaO-SiO2(-Al2O3-CO2-SO3) system• PHREEQC consumes 80% to 90% of HPx computational
budget using 4-cores parallelization (or 94% to 97% on asingle-thread)• ML• Input: Total amounts of Ca, Si, (Al, S, C)• Output: Aqueous concentrations of Ca, Si, (Al, S, C,) O, H
• Results for Ca-Si•

excellent correspondence•

DNN & kNN speedup of 7 (max = 7.7) against HP-4 cores, 24.5 (max =28.5) against HP-1 core

SCK CEN/55000182

17

ISC: Restricted

CaO-SiO2-Al2O3CO2-SO3 system•

DNN speedups 8.2 (max = 9)against HP-4c, 30.3 (max = 33.1)
against HP-1c•

Training set very crucial• LHS (400k) not sufficient• A ‘simple RTM’ was used forguidance of additional sampling(Kernel density sampling)•Outlook• Quality of training set• Accept/Reject criterion (kNN)• Physics Informed Neural
Network
SCK CEN/55000182

18

ISC: Restricted

HPInput / HPOutput
HPGeochemistry

SCK CEN/55000182

19

ISC: RestrictedGUI

SCK CEN/55000182

20

ISC: RestrictedGUI – Input

SCK CEN/55000182

21

ISC: RestrictedGUI – Output
Text files: Phreeqc.out

GraphsUser-made input forms
Data files

SCK CEN/55000182

22

ISC: Restricted

Redox zonation in groundwater systems
Ca H bOd Z + sSO24+ + ( 2a − d − 4 s ) H 2O → aCO2 + sHS− + ( 4a + b − 2d − 9 s ) H +

SCK CEN/55000182

DAMMED  K D,0  EA  K A,0  K B 
R = Qmax B IT
K D +  E D  K A +  EA   K B + B Biomass

RB = YB R − bB B
23

ISC: RestrictedModule for redox sequence calculation

SCK CEN/55000182

24

ISC: Restricted

Kinetic path calculations / Transport calculation

SCK CEN/55000182

25

ISC: RestrictedMachine Learning forSA/UA/(calibration)

SCK CEN/5500018226

ISC: RestrictedEmulator for full reactive transport model
U transport by multi-rate surface
complexation model, mobile-immobile,alternating boundary conditions• 1D model – CPU might be too large
for SA, UA, inverse modelling• PCE, GP and DNN• 13 parameters• Time series of dissolved U inoutflow

SCK CEN/55000182

27

ISC: Restricted

Predictions

SCK CEN/55000182

28

ISC: RestrictedApplication• GSA – excellent performance• No high accuracy required, only
similar sensitivity

SCK CEN/55000182

29

ISC: RestrictedApplication• GSA – excellent performance• No high accuracy required, onlysimilar sensitivity• UA – good performance• Higher requirements on training
set

SCK CEN/55000182

30

ISC: RestrictedApplication• GSA – excellent performance• No high accuracy required, only
similar sensitivity• UA – good performance• Higher requirements on trainingset• Global calibration (Bayesiannetwork) – smallest performance• Highest requirements onemulator as values should beexact.

SCK CEN/55000182

31

ISC: Restricted

Final statement

SCK CEN/55000182

32

ISC: Restricted

Recent developments in HPX• Towards a versatile tool (scripts)• Towards an environment for simulation workflow management• Towards a stand-alone graphical interface for geochemistry and thegeochemical definitions• Towards a friendly integration in HYDRUS 5

SCK CEN/55000182

33

ISC: RestrictedHPx is one of the most sophisticated, and meanwhile userfriendly reactive transport codes around. Its uniquefeatures allows for smooth implementation andinterpretation of complex environmental and engineered
chemical coupled transport problems; all embedded inamazing graphical interfaces
D. Jacques, 2022-01-31 (@23u30)

SCK CEN/55000182

34

ISC: RestrictedCopyright © SCK CEN
PLEASE NOTE!
This presentation contains data, information and formats for dedicated use only and may not be communicated, copied,reproduced, distributed or cited without the explicit written permission of SCK CEN.
If this explicit written permission has been obtained, please reference the author, followed by ‘by courtesy of SCK CEN’.
Any infringement to this rule is illegal and entitles to claim damages from the infringer, without prejudice to any other right incase of granting a patent or registration in the field of intellectual property.
SCK CEN
Belgian Nuclear Research Centre
Foundation of Public Utility
Registered Office: Avenue Herrmann-Debrouxlaan 40 – BE-1160 BRUSSELS
Operational Office: Boeretang 200 – BE-2400 MOL

SCK CEN/55000182

35
ISC: Restricted