Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome
Guest
Forum Home
Login
Register
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
EXCHANGE_MODIFY in COMSOL-PHREEQC coupling
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: EXCHANGE_MODIFY in COMSOL-PHREEQC coupling (Read 13150 times)
Jeonghwan Hwang
Top Contributor
Posts: 81
EXCHANGE_MODIFY in COMSOL-PHREEQC coupling
«
on:
19/06/24 11:33 »
Hi,
I am conducting research that links COMSOL and PHREEQC.
Currently, my PHREEQC model includes cation exchange reactions.
At each time step, the concentration changes calculated in PHREEQC are passed to COMSOL, where the chemical species flow is then calculated.
For each time step, I use SOLUTION_MODIFY for the PHREEQC calculations.
From my observations, it seems that considering SOLUTION_MODIFY alone automatically takes the EXCHANGE information into account.
Moreover, since the cation exchange sites do not flow separately, I have not considered EXCHANGE explicitly.
However, the model results exhibit abnormal oscillations during the calculations.
On the other hand, when I include EXCHANGE_MODIFY, the model works well.
Is it necessary to explicitly set EXCHANGE_MODIFY as well?
Thank you
Sincerely,
Jeonghwan Hwang
Logged
dlparkhurst
Global Moderator
Posts: 4336
Re: EXCHANGE_MODIFY in COMSOL-PHREEQC coupling
«
Reply #1 on:
19/06/24 21:25 »
SOLUTION_MODIFY only accounts for the dissolved concentrations of elements. Usually, only the dissolved concentrations are transported, and the exchanged species are assumed to be stationary; so, it is sufficient to transport the dissolved concentrations, update the solutions with SOLUTION_MODIFY, and then run reactions to equilibrate the new solution composition in a cell with the exchanger in the cell. No EXCHANGE_MODIFY definition is necessary.
Perhaps your transport solution is introducing oscillations. In 1D, to avoid oscillations using centered-in-space weighting, delta_x/alpha must be less than 2 (alpha is dispersivity), and for centered-in-time, alpha*v*delta_t/delta_x^2 must be less that 1. Try decreasing your time step and grid spacing, or use backward-in-time and upstream-in-space differencing, which will not produce oscillations, but may introduce numerical dispersion.
I think I have suggested before that you should use PhreeqcRM. It is designed to couple geochemical reactions with transport models.
Logged
Yongqiang
Top Contributor
Posts: 140
Re: EXCHANGE_MODIFY in COMSOL-PHREEQC coupling
«
Reply #2 on:
08/05/25 03:32 »
Hi David,
It seems difficult to use PHREEQCRM in MATLAB to connect with COMSOL. The data type is quite different and difficult to handle in MATLAB for PHREEQCRM as an external C library.
Thanks
Logged
dlparkhurst
Global Moderator
Posts: 4336
Re: EXCHANGE_MODIFY in COMSOL-PHREEQC coupling
«
Reply #3 on:
08/05/25 05:38 »
There is a C version documented here
https://water.usgs.gov/water-resources/software/PHREEQC/documentation/phreeqcrm-html/index.html
.
The latest version is available at
https://github.com/usgs-coupled/phreeqcrm/releases/
.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
EXCHANGE_MODIFY in COMSOL-PHREEQC coupling