coupled flow-geomechanical simulation

95 views
Skip to first unread message

Timur Sabirov

unread,
Jun 13, 2025, 12:27:15 AMJun 13
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear MRST Developers,
I'm working with the code, initially constructed for a two-phase (oil-water) simulation, we are numerically simulating hydraulic fracturing (with one water injecting well) - coupled flow-geomechanical simulation. I am trying to rebuild it to work on a three-phase (blackoil model); Some parts of the code are attached, I added third phase (gas) into the simulation, previous version of code was done for two phase. However, I am encountering some errors, after added gas to the simulation:
Error using cellfun
Non-scalar in Uniform output, at index 1, output 1.
Set 'UniformOutput' to false.

Error in PhysicalModel/stepFunction (line 489)
            if any(cellfun(@(d) ~all(isfinite(d)), dx))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in NonLinearSolver/solveMinistep (line 356)
                    model.stepFunction(state, state0, dt, drivingForces, ...
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in NonLinearSolver/solveTimestep (line 220)
                    solveMinistep(solver, model, state, state0_inner, dt, drivingForces);
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in MechFluidFixedStressSplitModel/stepFunction (line 107)
            [mstate, mreport] = mechsolver.solveTimestep(mstate0, dt, mechModel, ...
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in NonLinearSolver/solveMinistep (line 356)
                    model.stepFunction(state, state0, dt, drivingForces, ...
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in NonLinearSolver/solveTimestep (line 220)
                    solveMinistep(solver, model, state, state0_inner, dt, drivingForces);
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in simulateScheduleAD (line 250)
            [state, report] = solver.solveTimestep(state0, dt(i), model,...
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in THREE_phase_Base (line 755)
    [w, s, report] = simulateScheduleAD(initState, model, schedule, ...
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^photo_2025-06-12_16-43-30.jpgphoto_2025-06-12_16-45-38.jpgimage_2025-06-12_16-55-05.png

Thank you in advance!
Timur Sabirov

Odd Andersen

unread,
Jun 20, 2025, 3:18:46 AMJun 20
to Timur Sabirov, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Timur,

Did you figure this problem out?  I can have a look, but it is hard to tell just from the error message and code screenshot. 
If you have a breaking code example you can send, it would be easier to check what is going on.

Best regards,
Odd 

Odd Andersen
Senior Research Scientist
SINTEF Digital, Mathematics and Cybernetics
Oslo, Norway

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Timur Sabirov <sab...@ualberta.ca>
Sent: Friday, June 13, 2025 1:01 AM
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] coupled flow-geomechanical simulation
 
--
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/87df04c4-c190-4462-bc59-374b49f29997n%40googlegroups.com.

Odd Andersen

unread,
Jun 20, 2025, 3:18:55 AMJun 20
to Timur Sabirov, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Timur,

Did you figure this problem out?  I can have a look, but it is hard to tell just from the error message and code screenshot. 
If you have a breaking code example you can send, it would be easier to check what is going on.

Best regards,
Odd 



Odd Andersen
Senior Research Scientist
SINTEF Digital, Mathematics and Cybernetics
Oslo, Norway

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Timur Sabirov <sab...@ualberta.ca>
Sent: Friday, June 13, 2025 1:01 AM
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] coupled flow-geomechanical simulation
 
--

Timur Sabirov

unread,
Jun 24, 2025, 7:52:47 AMJun 24
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Odd,
I have figured out the problem. Thank you for you response!

пятница, 20 июня 2025 г. в 01:18:55 UTC-6, Odd Andersen:
Reply all
Reply to author
Forward
0 new messages