Composition error: boundary condition implementation for incomp 2phase

110 views
Skip to first unread message

Yohanes Nuwara

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

I try to implement boundary conditions in an incompressible 2 phase (oil-water) program, "computeLorenzSPE10". 

I have set up the boundary conditions:

bc = fluxside([], G, 'FRONT', 0);
bc = fluxside(bc, G, 'BACK', 10);
bc = fluxside(bc, G, 'LEFT', -5);
bc = pside(bc, G, 'RIGHT', 100);

And added 'bc' to the "incompTPFA" and "implicitTransport"

x  = incompTPFA(x, G, hT, fluid, 'bc', bc, 'wells', W);
x  = implicitTransport(x, G, dT, rock, fluid, 'bc', bc, 'wells', W);

I got the following error:

error: Injection composition incompatible with existing source terms

Do I have something missing from my code? 

Meanwhile, I have searched for any script in the "in2ph" folder inside the "book" module, I haven't found an example that implements boundary cond. 

The attached link is my full source code. I'd be glad if you could help me out, thanks!

Best, 

Yohanes

Øystein S. Klemetsdal

unread,
Mar 11, 2021, 5:02:15 PM3/11/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Yohanes,

MRST uses single-point upwind discretization for the fluxes, so you need to also specify the saturation at the boundaries, e.g.,
bc = fluxside([], G, 'FRONT', 0, 'sat', [sw, so]);

Note that this is required for all boundaries, but technically only used for inflow.

Cheers,
-Øystein Klemetsdal

Yohanes Nuwara

unread,
Mar 12, 2021, 11:09:28 PM3/12/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Oystein, 

Thanks for your solution, it worked. I want to implement the following boundaries to my case:

# Boundary conditions 
bc = [];
bc = pside([], G, 'FRONT', 100, 'sat', [1 0]);
bc = fluxside(bc, G, 'BACK', -5*stb/day, 'sat', [1 0]);
bc = pside(bc, G, 'LEFT', 100, 'sat', [1 0]);
bc = fluxside(bc, G, 'RIGHT', 10*stb/day, 'sat', [1 0]);

I observed that these boundaries result in an error saying:

error: MRST does not support injection and production in same cell

However, if some boundaries are passed, for example, only left-right, front-back, or back-left, it successfully runs without the error. For some other boundaries; back-right or front-right, it also gives the same error. 

I wonder why? 

Cheers, 

Yohanes 

Olav Møyner

unread,
Mar 15, 2021, 5:18:18 AM3/15/21
to Yohanes Nuwara, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

These solvers do not support multiple boundary conditions in the same cell, which will happen on the cells on the corners of the model. It may be difficult to impose both a constant volumetric depletion/injection and a specific pressure for incompressible flow. Some of the newer solvers do not have this limitation, but I would just start with fewer boundary conditions to get it running (e.g. just the right and left conditions)

Best regards,
Olav

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Yohanes Nuwara <ign.nu...@gmail.com>
Sent: Saturday, March 13, 2021 5:09
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] Re: Composition error: boundary condition implementation for incomp 2phase
 
--
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/8320f354-f26f-4187-b0d3-b19a1ad0d51en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages