Supple water as ADI or as compositional or as both?

62 views
Skip to first unread message

alex meson

unread,
May 24, 2024, 12:43:40 AMMay 24
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear all,

I hope you are doing well.I am using MRST to model the process of storing hydrogen in underground porous media. I am running into some problems when considering the role of water.Should I supple water as ADI or as compositional or as both? Should I enter the properties of the water into the main code or should I put them inside the getBenchMixture2 function?
Regards
Alyx Lu

alex meson

unread,
May 29, 2024, 4:32:17 PMMay 29
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
X0511.pngX4.png
Dear All:
I sincerely request your help. As shown in the image, if water is not represented in the function, the code works fine, if water is added to the BIC, this appears with a large number of errors. The error lifting is as follows:

Error using strcmpi
Too many input arguments.

Error in ReservoirModel/addBoundaryConditionsAndSources (line 1337)
                assert(strcmpi(types{sub}, 'cell'), 'Unable to add source terms to equation that is not per cell.');

Error in equationsNaturalVariables (line 327)
[eqs, state, bsrc] = model.addBoundaryConditionsAndSources(eqs, names, types, state, ...

Error in NaturalVariablesCompositionalModel/getEquations (line 45)
            [problem, state] = equationsNaturalVariables(state0, state, model, dt, ...

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

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

Error in ThreePhaseCompositionalModel/stepFunction (line 198)
            [state, report] = stepFunction@ReservoirModel(model, state, state0, dt, drivingForces, linsolver,
            nonlinsolver, iteration, varargin{:});

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

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

Error in simulateScheduleAD (line 295)
            [state, report] = solver.solveTimestep(state0, dt, model,...

Error in initialCO2injectH2_J_27_05 (line 250)
[ws, state, rep] = simulateScheduleAD(state0, model, schedule);
 

getBenchmarkMixture2.m
MainCode.m

Olav Møyner

unread,
Jun 3, 2024, 7:08:42 AMJun 3
to alex meson, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

I think you cannot use the name "water" if you have a water-like component. This name may be reserved in parts of the code for the water phase. Try using H2O instead.

As for the question if you want to model water as a component (by including it in your mixture) or an immiscible phase (by setting model.water = true) this depends on what you are trying to do with your simulation. If you want to have miscibility between components and water, you need to include it in the mixture, but be aware that just using Peng Robinson as the EoS will not give good predictions for solubility or density of the water phase.

Best regards,
Olav

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of alex meson <alex1...@gmail.com>
Sent: Wednesday, May 29, 2024 21:11
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] Re: Supple water as ADI or as compositional or as both?
 
--
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/6b034268-8aff-4e06-a5a8-88d0937b5a68n%40googlegroups.com.

alex meson

unread,
Jun 7, 2024, 12:48:55 PMJun 7
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi, Olav
Thank you very much. Following your instructions, I managed to add the water properties. Now I need to simulate the CO2 dissolution process even further. I would like to ask if I need to build the VEfluid (using the initVEFuildHForm function) or just add the CO2 in the getBenchmarkMixture function or both.
Best Regards
Alyx Lu

Williams Jang

unread,
Jun 18, 2024, 4:09:32 PM (12 days ago) Jun 18
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Olav,

Following up on this question which is very important for my problem. When "H2O" is used instead of "Water" as shown in the code snippet below, the well solutions show different flow rates for water (as shown in the attached picture). Which is the true value of water flowrate from the well?

%% Set up compositional fluid model (Remember to avoid the name "Water" here; it causes problems)

names = {'Hydrogen', 'Methane', 'Carbondioxide', 'Nitrogen', 'n-Undecane', 'n-Dodecane', 'H2O'};

T_c =   [33.145,      190.564,   304.1282,       126.192,    639,          658,           647.096];

P_c =   [12.9583,     45.3886,   72.8645,        33.5554,    19.245,       17.962,        217.666]*atm;

M_w =   [2.01588,     16.0428,   44.0098,        28.0135,    156.312,      170.338,       18.0153]/1000;

Acc =   [-0.215993,   0.0115478, 0.223621,       0.0377215,  0.530316,     0.576385,      0.344861];

Z_c =   [0.305,       0.286,     0.27588,        0.289,      0.242,        0.238,         0.229];

V_c =   Z_c.*8.314.*T_c./P_c;

compfluid = CompositionalMixture(names, T_c, P_c, V_c, Acc, M_w);

zcomp = [0.00, 0.00, 0.85, 0.00, 0.05, 0.05, 0.05]; % Composition of gas mixture in the reservoir


Kind regards,
Williams

WatervsH2O.PNG

Williams Jang

unread,
Jun 18, 2024, 4:37:05 PM (12 days ago) Jun 18
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
PS: MRST seems to attribute/map:
the Gas phase to components 'Hydrogen''Methane''Carbondioxide''Nitrogen'
the  Oil phase to components 'n-Undecane''n-Dodecane'

However, it is failing to do this for Water (i.e., Water --> 'H2O')


You received this message because you are subscribed to a topic in the Google Groups "MRST-users: The Matlab Reservoir Simulation Toolbox User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sintef-mrst/tM5zOy3CCN0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sintef-mrst...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sintef-mrst/010831ce-c3b7-4718-9d85-c47a7c754742n%40googlegroups.com.

Olav Møyner

unread,
Jun 19, 2024, 2:50:32 AM (11 days ago) Jun 19
to Williams Jang, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

The compositional module assumes that two phases are miscible. In your current setup, the default, this is the oil and gas phase. H2O will not end up in the water phase - in your setup, it is just another component that can form either the liquid/oil phase or the gas/vapor phase. Splitting components into three phases would require a three-phase flash which is not currently implemented in MRST.

The alternative is to use water as an immiscible phase (see previous post) to get three phase behavior with miscibility between two of the phases only.

Best regards,
Olav

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Williams Jang <willj...@gmail.com>
Sent: Tuesday, June 18, 2024 22:34

To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: Re: [MRST Users] Re: Supple water as ADI or as compositional or as both?
 
Reply all
Reply to author
Forward
0 new messages