Coupling geochemistry and black oil modulus

458 views
Skip to first unread message

Davood Zivar

unread,
Mar 19, 2021, 12:50:17 AM3/19/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear all,

Hi
I want to couple the geochemistry and black oil (two phase flow) modulus to handle the injection of low salinity water. Could you please give me advice on this matter?

Many thanks
Davood

xav.r...@gmail.com

unread,
Mar 26, 2021, 8:06:18 PM3/26/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Dear Davood,

The geochemistry module that comes as a third-party module in MRST release contains tools for solving equilibrium water-based chemical system. The water-salt system with two chemical reactions (H2O <-> H+ + OH- and NaCl <-> Na+ + Cl-) is a typical example of that and is demonstrated in several examples. The module provides also tools for coupling with transport but only in a single water phase, in this version. You can have a look at `examples/transport/injectorProducerArray.m` for an example also NaCl.

Adding black-oil capability will require to rewrite the function:

`function [eqs, names, types] = equationsTransportComponents(model, state0, state, dt, drivingForces, varargin)`

which is located in `geochemistry/utils/` and include the blackoil part, with the two oil and gas phases and components. The equations for the blackoil part

`function [problem, state] = equationsBlackOil(state0, state, model, dt, drivingForces, varargin)`

can be found in `mrst-autodiff/ad-blackoil/utils/equationsBlackOil.m`

Depending on your familiarity with MRST these modifications may more or less easy. By doing that, you can obtain a first prototype.

The solver will nonetheless not cope with the absence/disparition of species (for example absence of NaCl). This case requires support for switching equations (we miss an equilibrium equation) which is not supported in this version.

I hope it helps!

Best Regards,

Xavier.

Davood Zivar

unread,
Mar 27, 2021, 2:31:32 PM3/27/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Xavier,

Thank you for the helpful explanation and information. I am new at MRST and got confused because of this sentence that you have mentioned, "The module provides also tools for coupling with transport but only in a single water phase, in this version". I am planning to build a model with Swi=0.2 (which contains different ions such as Na+ and Cl- with know concentration) and So=0.8. Then, injecting a brine with different ions and concentrations from Swi. The goals are to determine a) in-situ and effluent ions concentrations and b) recovery factor. Is it possible to build such a scenario using MRST (coupling geochemistry and black-oil modules)?

Best Regards,
Davood

Davood Zivar

unread,
Mar 27, 2021, 3:31:47 PM3/27/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Xavier,

Thank you for your explanation and helpful information. I am new at MRST and now I got confused because of this sentence "The module provides also tools for coupling with transport but only in a single water phase, in this version". I am planning to build a model with Swi=0.2 (Swi contains different ions, such as Na+, Cl- with known concentrations) and So=0.8. The injecting water contains ions with different ions and concentrations from the Swi. The goals are to determine the concentration of the ions and the remaining oil inside the porous media. Is it possible to model such a scenario with MRST using coupling geochemistry and block oil modulus?

Many thanks
Davood
On Saturday, March 27, 2021 at 6:06:18 AM UTC+6 xav.r...@gmail.com wrote:

Alessandro Migone

unread,
Nov 25, 2021, 5:57:15 AM11/25/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Greetings,
Recently, I started working with geochemistry module; and interested in the topic "coupling geochemistry and black oil modules in MRST" to run some two-phase reactive transport simulations. Unfortunately, examples available in the geochemistry module (latest version) are all prepared for studying one-phase reactive transport problems. I am wondering if anyone made some in-house exercises on "coupling geochemistry and black-oil simulations". I would appreciate if you could share a very basic example with me. Thanks in advance.
Sincerely,
Alessandro

javad madadi mogharrab

unread,
Feb 1, 2022, 7:44:59 AM2/1/22
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi guys, 
Can I have any simplified template of low salinity flooding in core scale, using MRST? 

The goals are to determine the concentration of the ions and the remaining oil inside the porous media. Is it possible to model such a scenario with MRST using coupling geochemistry and block oil modulus?
do you have any example file to help me?

ATB, 
Javad

Knut-Andreas Lie

unread,
Feb 1, 2022, 11:47:49 AM2/1/22
to javad madadi mogharrab, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Javad,

There is no such functionality in the official release. On the other hand, several users have expressed interest in this functionality, so maybe somebody has code that they can share with you.

(Unfortunately, there are many capabilities developed by users that are never shared back with the community. My team is generally helpful if anybody comes forward with new modules of pieces of code they want to share.)

 - Knut-Andreas

--
Knut-Andreas Lie, Professor, PhD
Chief Scientist, SINTEF Digital, Mathematics & Cybernetics, Oslo
Phone: +47 930 58 721 (mobile)
http://folk.ntnu.no/andreas

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of javad madadi mogharrab <javad...@gmail.com>
Sent: Tuesday, February 1, 2022 1:35 PM
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] Re: Coupling geochemistry and black oil modulus
 
--
You received this message because you are subscribed to the Google Groups "MRST-users: The Matlab Reservoir Simulation Toolbox User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sintef-mrst...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sintef-mrst/b7754b24-6f1c-40e2-893b-57de47959020n%40googlegroups.com.

omarc...@hotmail.com

unread,
Feb 5, 2022, 6:09:04 PM2/5/22
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Javad and Everyone, 

I came across this post and I would like to share a code I used a while ago as part of my study and I hope that it can be helpful for you and anyone interested in coupling PHREEQC with any of MRST modules. 

In my work I was working on a low salinity polymer flooding problem, so I did the modifications on the polymer modules "OilWaterPolymerModel.m" and '"equationsOilWaterPolymer". MRST polymer model was extended to allow modeling the transport of geochemical species (e.g., Na, Cl, Ca, Mg, etc.). Moreover, in this example the concentration of polymer was zero and the initial water saturation was 0.999 to make it single phase (to allow comparing it to example 11 of the PHREEQC manual). Therefore I believe that anyone interested in coupling MRST with PHREEQC can benefit from this code even if the work is not polymer related. 

Attached below are all the files needed to run the codes and plot the graphs. I tried to run the example using the latest version of MRST (mrst-2021b) and it was working fine. On a side note, make sure that you download both 32-bit and 64-bit COM versions of PHREEQC. Because the coupling is made in a way such that MRST and PHREEQC communicate through the COM server. 

The provided example is part of this study: 
Paper Number: OTC-31191-MS

Having a look at the paper, specifically the coupling part, could be really helpful. 

Regards,
Omar Chaabi
ReactiveTransport_validation8.m
phreeqc.dat
ReactiveTransport_Initialization8.pqi
Fluid_Data.DATA
TwoPhasePolymerTracerModel.m
ReactiveTransportValidation8.xlsx
equationsTwoPhasePolymerTracer.m

Knut-Andreas Lie

unread,
Feb 6, 2022, 6:58:25 AM2/6/22
to omarc...@hotmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Omar,

Thank you so much for sharing your work on coupling of MRST and PHREEQC. This is exactly what we are hoping for with MRST: that people who use it to build new functionality share this back to the community so that other can leverage their work. 😀

 - Knut-Andreas
--
Knut-Andreas Lie, Professor, PhD
Chief Scientist, SINTEF Digital, Mathematics & Cybernetics, Oslo
Phone: +47 930 58 721 (mobile)
http://folk.ntnu.no/andreas

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of omarc...@hotmail.com <omarc...@hotmail.com>
Sent: Sunday, February 6, 2022 12:09 AM

To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: Re: [MRST Users] Re: Coupling geochemistry and black oil modulus
 

Mohammed Jeeshan Sheikh

unread,
Mar 28, 2022, 8:05:51 AM3/28/22
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Greetings to all,

Similar to Davood, I have been trying to couple two phase flow with chemical transport as well. There has been some progress but while debugging, I was trying to analyze the 'InjectorProducerArray' example provided in geochemistry module.
This has initial Na concentration of 1e-1 mol/L (per cell) and injected conc. of 1e-3 mol/L. When I print, the summation of conc. of Na in reservoir after the schedule runs still comes out to be 10000 mol/m3 (i.e. 10 mol/L).
This implies that there is no net change due to injection.

Same is the case when I switch the initial and injected chemistry. There, Na Conc. summation after the schedule runs comes out as 100 mol/m3 (i.e. 0.1 mol/L) which is the same as initial chemistry for that case.
Could someone please comment on this, whether this is an issue with the module or I'm missing something in my analysis.
 
Attaching both the simulations for reference :

Thankfully,
Jeeshan

ahmadreza shojaee

unread,
Jun 13, 2024, 5:28:43 AMJun 13
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

I did a same thing in terms of incompatible waterflood. A new module is built named ad-scale which considers water composition and rock dissolution/precipitation. You can find the paper and the codes here:

Ahmad
Reply all
Reply to author
Forward
0 new messages