Initialization Region With Black Oil Model

49 views
Skip to first unread message

Mukhammad Sholikhuddin

unread,
Apr 11, 2025, 7:38:32 AMApr 11
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hello everyone,

I am trying to build a black oil reservoir model with a gas oil system. currently I am in the initialization stage, where I have an error (I put the error in the picture). In fluid modeling I use initSimpleADIFluid with the values of bO, bG, muO, and muG data I input manually. what solutions can be applied?

then the thing that I am confused about is also for the initialization result of saturation, is the value only 1 0 or I have missed a step, how to define saturation so that it is distributed based on fluid rho, pressure and reservoir depth.

Screenshot 2025-04-11 at 18.34.33.png

SimpleWaterfloodBlackOil.m

Bård Skaflestad

unread,
Apr 11, 2025, 11:24:37 AMApr 11
to Mukhammad Sholikhuddin, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

I've reviewed your script, and there appears to be a misunderstanding there.  The 'bG', 'bO', &c fields of the fluid structure are supposed to be functions (typically function handles) that can be evaluated at a vector of pressure values—or saturations in the case of krO/krG.  Your script uses tables for these and that does not meet the requirements of the ad-blackoil simulation tools.

If you want to use tabulated property and saturaiton functions, then I recommend having a look at the 'interpTable' helper function. By the way, MRST uses strict SI unit conventions, so you need to convert your viscosity values from cP to Pascal seconds before you use them in any simulation.  Finally, the 'bG' &c functions are supposed to compute reciprocal formation factors, and these typically increase as a function of increasing pressure whereas your tables appear to have decreasing function values as a function of pressure.


Best Regards,

Bård Skaflestad
SINTEF Digital, Mathematics & Cybernetics
Applied Computational Science group


From: sinte...@googlegroups.com on behalf of Mukhammad Sholikhuddin
Sent: Friday, April 11, 2025 13:38
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Subject: [MRST Users] Initialization Region With Black Oil Model
--
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 visit https://groups.google.com/d/msgid/sintef-mrst/9e164b1e-7631-4aea-bef3-9bb182a2c937n%40googlegroups.com.

Mukhammad Sholikhuddin

unread,
Apr 12, 2025, 12:51:16 AMApr 12
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi Bård,

Thank you for the clarification. I have followed your suggestions, especially by using the interpTable function, and it worked — the previous errors are no longer appearing. However, I would like to ask further regarding the initialization of saturations. Currently, the saturation values are strictly either 1 or 0 for oil and gas. Is this expected behavior, or have I possibly missed a step?

How should I properly define the initial saturation so that it is distributed more realistically based on fluid density (rho), pressure, and reservoir depth? I would like to understand how to set up an initial saturation distribution that is more physical, rather than just binary values.

Thank you in advance for your help and guidance.

SimpleWaterfloodBlackOil.m

Olav Møyner

unread,
Apr 12, 2025, 5:54:57 AMApr 12
to Mukhammad Sholikhuddin, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

Unless you have capillary pressure or connate water, the saturation distribution will be constant in each region. The variation due to hydrostatic equilibrium will be in the pressure distribution, which will account for density changes as a function of pressure.

Olav


From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Mukhammad Sholikhuddin <muhammadsh...@gmail.com>
Sent: Saturday, April 12, 2025 6:51:25 AM
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: Re: [MRST Users] Initialization Region With Black Oil Model

Mukhammad Sholikhuddin

unread,
Apr 12, 2025, 6:51:00 AMApr 12
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Olav,

Thank you for the explanation.

Regarding connate water saturation, I would like to ask how we can define or input this value in the simulation. Is it done in the same way as when we define fluid properties using initSimpleADIFluid, or is it handled during a different initialization stage?

In my current script, I have already included the interpTable function to define relative permeability (Kr) based on saturation. Does this function automatically account for connate water saturation, or should it be specified explicitly elsewhere?

I would appreciate it if you could show the steps or guide me through the process.

Thank you

Mukhammad Sholikhuddin

unread,
Apr 14, 2025, 4:35:05 AMApr 14
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Olav,

When I build GenericBlackOilModel with water oil gas and disgas everything is "true". How do I define the Rs value while I use initSimpleADIFluid which already has Rs value with “interptable” function. I also attach my code file.

Thank you
Screenshot 2025-04-14 at 15.33.54.png

On Saturday, April 12, 2025 at 4:54:57 PM UTC+7 Olav Møyner wrote:
SimpleWaterfloodBlackOil.m

Mukhammad Sholikhuddin

unread,
Apr 14, 2025, 5:13:21 AMApr 14
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi Olav,

Thank you for answering, I have tried to input a constant rs value in my region using getInitializationRegionsBlackOil but it returns an error like this.Iis there something wrong with the way I define properties in initSimpleADIFluid using interpTable, can you help me with this?

Thank you

Screenshot 2025-04-14 at 16.12.47.png

SimpleWaterfloodBlackOil.m

Olav Møyner

unread,
Apr 14, 2025, 5:22:51 AMApr 14
to Mukhammad Sholikhuddin, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

It looks like the fluid functions are not set up properly. I would have a look at the fluid model in blackOilTutorialSPE9 to get an idea of how it should be set up. The relevant function is assignPVTO for PVTI tables, but it is maybe not so user friendly as it is primarily used to set up input files.

Best regards
Olav 

Olav

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Mukhammad Sholikhuddin <muhammadsh...@gmail.com>
Sent: Monday, April 14, 2025 11:13:20 AM

Mukhammad Sholikhuddin

unread,
Apr 14, 2025, 11:16:55 AMApr 14
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi Olav,

I have tried following your suggestion regarding the setup of the fluid functions and refer to assignPVTO as in blackOilTutorialSPE9. However, I am still encountering some errors during initialization, as attached below.

The main error seems to happen during pressure initialization and interpolation in the fluid table (interpPVT -> interpolate), specifically related to indexing out of bounds.

Would you be able to help me troubleshoot this issue further?

Thank you very much for your help!

Screenshot 2025-04-14 at 22.16.06.png

SimpleWaterfloodBlackOil.m

Mukhammad Sholikhuddin

unread,
Apr 14, 2025, 11:08:49 PMApr 14
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Olav,

After I tried using assignPVTO there was still an error and I was not good at using it, finally I tried using the general method, but until the step of running the simulation the error occurred again. is this wrong in the way of defining the fluid and the model or the way I have a schedule because if you look at this warning "Matrix is close to singular or badly scaled" ?

Is there any input related to how to solve the error? thank you very much in advance

Screenshot 2025-04-15 at 10.06.04.png

SimpleWaterfloodBlackOil.m
Reply all
Reply to author
Forward
0 new messages