In my COMSOL - PHREEQC Coupling using Matlab Interface, how to update solution for next time step??

I'm currently trying to use COMSOL - PHREEQC Coupling using Matlab Interface for reactive transport modeling. I'm trying Wissmeier & Barry (2011) approach for this. Currently, I'm facing the issue of solution from phreeqc is not being updated in comsol and the transport is not evolving in my simulation. I'm trying to simulate example 11 of phreeqc manual (Cation exchange). Can anyone help me with this?

Answers (1)

Hello,
The Wissmeier & Barry coupling requires you to manually pass PHREEQC results back into COMSOL each time step.
If the LiveLink script does not write updated concentrations back into COMSOL variables, the transport field will stay frozen. The interface is strictly sequential noniterative (SNIA) and depends on this manual update. https://infoscience.epfl.ch/server/api/core/bitstreams/fc290fdf-3638-4cd3-a010-6c0e55a0e59c/content
For Example 11, exchange reactions must be updated consistently. Example11 relies on EXCHANGE blocks; ignoring exchange states or only applying SOLUTION_MODIFY can cause no evolution or oscillations. Some users must also use EXCHANGE_MODIFY depending on how they rebuild each cells state.
Ensure your loop does this every time step:
  • COMSOL; PHREEQC ; read SelectedOutput ; overwrite COMSOL species fields; next step.
  • Explicitly update both SOLUTION and EXCHANGE states for Example11.
  • Reduce time step if results oscillate (known for Example11).
  • Consider using an existing stable interface such as iCP.
Hope this helps.

1 Comment

So, to update the results back to COMSOL, is it better to use solution vector (U) or create a text file and update using interpolation function.

Sign in to comment.

Categories

Products

Release

R2024b

Asked:

on 16 Mar 2026 at 9:00

Commented:

on 20 Mar 2026 at 12:14

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!