Question about Compatibility of pside Function in MRST 2025

8 views
Skip to first unread message

敬洪彬

unread,
Jan 7, 2026, 12:25:55 AMJan 7
to sinte...@googlegroups.com
Dear MRST Support Team,

I am a postdoctoral researcher at Zhongyuan Oilfield, Sinopec. Currently, I am learning reservoir simulation with MRST and following the examples in the book An Introduction to Reservoir Simulation Using MATLAB/GNU Octave (the "Introduction" chapter).

When running the example that uses the pside function to set pressure boundary conditions (specifically for the TOP boundary of a Cartesian grid), I encountered a runtime error: "Index exceeds array bounds" (triggered at line 93 of the pside function, where the code checks ischar(varargin{1})).

Upon debugging, I found that the parameter requirements of the pside function in the latest MRST 2025 version seem inconsistent with the usage in the book's examples:


  1. 1. The book’s example calls pside with 4 core arguments (bc, G, side, pressure), but the 2025 version of pside appears to require additional mandatory parameters (e.g., state, fluid), leading to an empty varargin array and thus the index out-of-bounds error.
  2. 2. The internal logic of pside (e.g., accessing state.mu, fluid.relperm) also relies on uninitialized structures in the book’s original example code.

I would greatly appreciate your clarification on the following questions:

1. Has the pside function been deprecated, modified, or replaced in MRST 2025?

2. If pside is still usable, what is the correct parameter format and initialization requirement for it in the 2025 version?

3. Is there an official/recommended alternative function to set pressure boundary conditions for Cartesian grids in the latest MRST?

Thank you very much for your time and assistance. I look forward to your reply.

Best regards,

Hongbin Jing

Postdoctoral ResearcherZhongyuan Oilfield, Sinopec

Olav Møyner

unread,
Jan 7, 2026, 3:40:01 AMJan 7
to 敬洪彬, sinte...@googlegroups.com
Dear Hongbin Jing,

Thank you for your email. I do not think the interface of the pside function has changed since the book was published. If you look at the current version, it follows the format that you are expecting (4 arguments + optional keyword arguments): https://github.com/SINTEF-AppliedCompSci/MRST/blob/fd5cea5d2f9180331150131aabdfb8b34c045cc1/core/params/wells_and_bc/pside.m#L1

Could you write the following command in your MRST session and see what it says?

which pside

That way, we can determine if the default pside implementation is shadowed by another file or function.

Best regards,
Olav

--
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/a022df3a-51ed-0e6a-de56-a0dd1ef2a977%40sinopec.com.
Reply all
Reply to author
Forward
0 new messages