Processes > Reactive transport modelling

Coupling MRST with PHREEQC in Matlab??Tight Coupling

(1/1)

CalvinScott:
Hello, I am a graduate student specializing in oil and gas reservoir development. My current work focuses on building models using the open-source reservoir simulation software MRST (a MATLAB-based package primarily used for simulating fluid flow in porous media).

Recently, I have been studying matrix acidizing, which involves injecting hydrochloric acid (HCl) solutions into the reservoir. The HCl reacts with carbonate rocks, dissolving them to increase the reservoir's porosity and permeability. After acidizing, the reservoir properties are updated, which in turn influences the acid solution's flow behavior.

I came across some research papers discussing the coupling of MRST with PHREEQC (MRST handling the flow process and PHREEQC handling the acid dissolution reactions. Interacting MRST with PHREEQC through Tight Coupling). However, the critical details, especially on how to integrate PHREEQC, were not provided. On GitHub, I found some similar examples where Python was used to call PHREEQC, but not MATLAB. I have been searching for a simpler and more seamless way to call PHREEQC in MATLAB, but unfortunately, I haven't been successful so far. Previously, I came across a method involving the use of MATLAB's COM interface (if available) to interact with PHREEQC, but it seems that this approach is not very effective.

I would greatly appreciate any guidance on how to implement this coupling in MATLAB so that I can call PHREEQC while running MRST. Thank you very much!

dlparkhurst:
Sorry, I am not good enough with Matlab to help you much. You want to build PhreeqcRM from https://github.com/usgs-coupled/phreeqcrm/releases/tag/v3.8.5. You probably want to use BMIPhreeqcRM instances, which have all of the capabilities of PhreeqcRM instances, with some added features. Documentation is created in the install directory.

Here is a web site related to Matlab and PhreeqcRM that might help.

And, there are multiple posts in the forum related to Matlab.

CalvinScott:
Thank you very much for your help. I will follow your advice and conduct a thorough study.
In addition, I have another question that I hope you can clarify. I understand that PHREEQC simulates one-dimensional processes, while my MRST handles three-dimensional flow. My question is, can PHREEQC simulate three-dimensional salt reactions through tight coupling with MRST? I apologize for asking such a basic question, as I only started working with PHREEQC a couple of days ago. This will determine whether I can use PHREEQC for my research. Once again, I would like to express my gratitude to you.

dlparkhurst:
PHREEQC is a standalone program for geochemical calculations. It includes a 1D transport capability.

However, PhreeqcRM is a reaction module based on the reaction capabilities of PHREEQC, which is intended to be coupled with other transport models. The basic idea is that PhreeqcRM is used to set initial chemical conditions for a set of cells, the transport model takes these concentrations and transports each component (element), and the transported concentrations are then sent to PhreeqcRM, where reactions are calculated. You repeat the cycle by taking concentrations from PhreeqcRM and transporting them, followed by reactions.

PhreeqcRM does not know anything about model geometry or transport, it simply takes concentrations for cells and runs reactions on each cell. It does not know whether the cells are a 1D, 2D, or 3D model.

CalvinScott:
Thank you very much. I have no doubts now; I can indeed perform strongly coupled simulations of dissolution reactions. Now, there is only one thing left to do, which is to tightly couple MRST with PHREEQC. Thank you again.
Thanks.

Navigation

[0] Message Index

Go to full version