Extracting mass balance terms (accumulation, flux, source/sink) in MRST for CO2 injection

8 views
Skip to first unread message

Hassan Jaberi

unread,
Oct 23, 2025, 12:10:47 AM (11 days ago) Oct 23
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi everyone,

First of all, I am very new to MRST and any guidance would be highly appreciated. 

I’m trying to get the mass balance equation terms (accumulation, flux, and source/sink) in  MRST simulations for a CO2 injection problem.

Are there specific keywords, variables, or internal fields in MRST that correspond to these terms? 


Kind regards,
Hassan

Odd Andersen

unread,
Oct 27, 2025, 3:55:11 AM (7 days ago) Oct 27
to Hassan Jaberi, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Hassan,

Thank you for getting in touch.  Before trying to answer your question, could you clarify what simulator you are using: one of the general ones (e.g. blackoil or compositional) found in the autodiff-folder, or the vertical equilibrium simulator found in the co2lab module?  

Best regards,
Odd A.

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

Fra: sinte...@googlegroups.com <sinte...@googlegroups.com> på vegne av Hassan Jaberi <hasan.j...@gmail.com>
Sendt: torsdag 23. oktober 2025 00:40
Til: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Emne: [MRST Users] Extracting mass balance terms (accumulation, flux, source/sink) in MRST for CO2 injection
 
--
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/7f0a4237-a1b1-4632-822b-b0cf6dfd04f7n%40googlegroups.com.

Hassan Jaberi

unread,
Oct 27, 2025, 1:50:22 PM (6 days ago) Oct 27
to Odd Andersen, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Odd,

Thank you so much for your email. I am interested to extract those terms for each grid cell in a CO2 example and I have been trying the examples in co2lab so far. 

Kind regards,
Hassan

Odd Andersen

unread,
Oct 28, 2025, 4:34:12 AM (6 days ago) Oct 28
to Hassan Jaberi, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Hassan,

If I understand it correctly, you are using CO2VEBlackOilModel then?
In that case, the system equations get assembled in the function getModelEquations (found in CO2VEBlackOilTypeModel.m).  

The call inside that function to model.FlowDiscretization.componentConservationEquations computes the bare accumulation terms (per cell) and fluxes (per face).  Subsequently, sources and sinks are added inside the function, as well as special treatments for dissolution and hysteresis.  

Does this answer your question, or did you have something else in mind?

Best regards,
Odd

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

Fra: Odd Andersen <Odd.An...@sintef.no>
Sendt: mandag 27. oktober 2025 08:55
Til: Hassan Jaberi <hasan.j...@gmail.com>; MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Emne: Sv: [MRST Users] Extracting mass balance terms (accumulation, flux, source/sink) in MRST for CO2 injection
 

Hassan Jaberi

unread,
Oct 31, 2025, 1:31:50 PM (2 days ago) Oct 31
to Odd Andersen, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Odd,

Thank you so much for your response. It was very helpful. I have another question. During looking at different examples, I realized that the model creation for them is different and because of that those functions that you mentioned for going straight to where mass balance terms are defined are also different. How can I find these functions in different examples? 
Also, I need to create a much simpler example to see clearly what the dimensions are and make sure the terms that I get come from the related cells with the same dimensions. How can I create the model while the model creations are different?

All the best,
Hassan 

Odd Andersen

unread,
6:58 AM (16 hours ago) 6:58 AM
to Hassan Jaberi, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Dear Hassan,

I'm glad if I could help.  As for your new question, it's not quite quite clear to me what you are asking about.  Perhaps you could point out the specific examples, and the difference you refer to regarding mass balance?

Best regards,
Odd 

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

Fra: Hassan Jaberi <hasan.j...@gmail.com>
Sendt: fredag 31. oktober 2025 17:49
Til: Odd Andersen <Odd.An...@sintef.no>
Kopi: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Emne: Re: [MRST Users] Extracting mass balance terms (accumulation, flux, source/sink) in MRST for CO2 injection
 
Reply all
Reply to author
Forward
0 new messages