Error When Adding Rock Compressibility in dfm_and_dual_porosity.m

19 views
Skip to first unread message

smith bob

unread,
Jun 13, 2025, 7:23:51 AMJun 13
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hello everyone,

I'm a new user of MRST and have just started learning how to use it. I'm particularly interested in dual-porosity models. Recently, I tried modifying the dfm_and_dual_porosity.m example script to include rock compressibility, hoping to simulate a compressible reservoir:

base_fluid = initSimpleADIFluid('phases', 'WO',...
'c', [1e-12,1e-12]/psia,...
'n', [1,1],...
'mu',[1,1.5]*centi*poise,...
'cR',1e-5/barsa);

However, after adding the compressibility, the code throws an error when I try to run it. The specific error message is:

Error  *  (Line 188)
              h.val = u*h.val;

Error  .*  (Line 221)
                 h = mtimes(u,v);

Error FracturedDomainPoreVolume/evaluateOnDomain (Line 21)
                pv = pv.*pvMult;

Error StateFunctionGrouping/evaluateStateFunction (Line 212)
            props_struct.(name) = prop.evaluateOnDomain(model, state);

Error StateFunctionGrouping/evaluateStateFunctionWithDependencies (Line 237)
            state = props.evaluateStateFunction(model, state, name);

Error StateFunctionGrouping/get (Line 189)
                state = props.evaluateStateFunctionWithDependencies(model, state, name);

Error PhysicalModel/getProp (Line 1022)
                    [p, state] = c.get(model, state, nms{sub});

Error PhysicalModel>@(x)model.getProp(state,x) (Line 1189)
        varargout = cellfun(@(x) model.getProp(state, x), ...

Error PhysicalModel/getProps (Line 1189)
        varargout = cellfun(@(x) model.getProp(state, x), ...

Error equationsOilWater (Line 114)
[b, pv] = model.getProps(state, 'ShrinkageFactors', 'PoreVolume');

Error TwoPhaseOilWaterModel/getEquations (Line 21)
            [problem, state] = equationsOilWater(state0, state, model, dt, drivingForces, varargin{:});

Error PhysicalModel/stepFunction (Line 717)
        [problem, state] = model.getEquations(state0, state, dt, drivingForces, ...

Error ReservoirModel/stepFunction (Line 307)
        [state, report] = stepFunction@PhysicalModel(model, state, state0, dt, drivingForces, linsolver, nonlinsolver, iteration, varargin{:});

Error NonLinearSolver/solveMinistep (Line 374)
                    model.stepFunction(state, state0, dt, drivingForces, ...

Error NonLinearSolver/solveTimestep (Line 210)
                    solveMinistep(solver, model, state, state0_inner, dt, drivingForces);

Error dfm_and_dual_porosity (Line 117)
    state = solver.solveTimestep(state, dt, model, 'W', W);

Any guidance or suggestions on what might be causing this error would be greatly appreciated.

Thank you for your help!

 Sincerely,
 Bob


Reply all
Reply to author
Forward
0 new messages