Include binary diffusion in compositional module

99 views
Skip to first unread message

Alejandro Fernández

unread,
Jan 25, 2024, 2:34:36 PM1/25/24
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi everyone,

I am trying to include diffusion between two gas species in the Compositional module when using the GenericNaturalVariableModel. 

For this, following the implementation of diffusion in the example "diffusion.m" described in Chapter 10 of the book "Advanced MRST...", I have included these lines:
  
Sg_rhoG_poro = s.faceUpstr(upcg,sG.*model.G.rock.poro);
eqs{i} = eqs{i} - s.Div(Di_aux(i)./tau_aux.*Sg_rhoG_poro.*s.Grad(yM{i}.*rhoG));

after line 352 of the file "equationsNaturalVariables.m", with Di_aux = [1e-5, 1e-5]. However, I cannot see any effect due to diffusion. Any idea of where I am going wrong? 
Thanks in advance for any hint.

Best,
Alejandro





aken the example from the geothermal module "diffusion.m", explained in Chapter 10 of the book "Advanced MRST...". 

Olav Møyner

unread,
Jan 26, 2024, 4:26:41 AM1/26/24
to Alejandro Fernández, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Alejandro,

The "generic" models use the equations set up in the FluxDiscretization class. If you want to see the effects of changes to equatiosNaturalVariables you will have to instead use the regular "NaturalVariablesCompositionalModel".

Best regards,
Olav

From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Alejandro Fernández <aleferna...@gmail.com>
Sent: Thursday, January 25, 2024 19:13
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] Include binary diffusion in compositional module
 
--
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/6c5b9adc-9cae-4a4c-960b-7c7875de71ccn%40googlegroups.com.

Alejandro Fernández

unread,
Jan 26, 2024, 9:01:55 AM1/26/24
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Olav,

Thanks a lot for your reply. I am now trying to locate the FluxDiscretization class and include diffusion/dispersion there, since I want to use the Generic model, as it allows me to impose adaptive time discretization, as well as the WENO scheme for the spatial discretization. Any hint is much appreciated!

Cheers,
Alejandro

Dexuan Li

unread,
Feb 18, 2025, 5:03:21 PM2/18/25
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello all,

I am quite new to mrst, and I have a follow-up question. I am trying to incorporate diffusion into a gas-water two-phase system, the initial model that I used is GenericOverallCompositionModel, but after I switched to NaturalVariablesCompositionalModel following Olav's advice above, the error originated from the function validateModel in ThreePhaseCompositionalModel.m, which shows the diffusion can only be considered within oil-gas systems. I would highly appreciate it if you could provide any hint on how to consider gas-water diffusion!

Sincerely,
Dexuan
ValidateModel.png

Reply all
Reply to author
Forward
0 new messages