Order in Phase Injection Specification and Phase Property

211 views
Skip to first unread message

Matt Lin

unread,
Feb 2, 2018, 12:08:14 AM2/2/18
to sinte...@googlegroups.com
Hello:

I am learning how to use compositional module of MRST from the included examples. I would like to ask for some clarifications regarding the order of injected phase specification in the addWell() and order of phase property specification during initialization using initSimpleADIFluid().

In addWell(), there's a part that I have to specify 'comp_i', [1 0 0] for three-phase flow and 'comp_i', [1 0] for two-phase flow. The explanation in addWell() states that "[1 0 0] means water injection".

What about specifying gas injection and water injection in the case of three-phase (oil,gas,water) flow and two-phase (oil-gas / oil-water / gas-water) flow? I notice it doesn't follow order in the default 'phase', 'WOG' convention in the initSimpleADIFluid(). Which entry in the vector for 'comp_i' specifies the injected phase?
For example:
3-phase oil-gas-water: water injection = [1 0 0]
3-phase oil-gas water: gas injection = ?
2-phase gas-oil: gas injection = [1 0]
2-phase water-oil: water injection = ?
2-phase water-gas: water injection = ?
2-phase water-gas: gas injection = ?
Does this convention (order of specification) apply to 'sat' in fluxside() and pside() as well?

This question is similar to the previous question. Phase specified using initSimpleADIFluid() has default: 'phase', 'WOG'. For example, if I don't specify anything, the vector reads [muW, muO, muG]. If I specify 'phase', 'GOW', then my vector for 'mu' is [muG, muO, muW]. What if one doesn't specify 'phase' and the system is two phases, what would be the order?
For example:
Oil-gas: [muO, muG]?
Water-oil: [muW, muO]? 
If I'm not mistaken, this phase order specification also applies to s0 (initial saturation) in initCompositionalState(). This means, the order of s0 would be [sG sO sW] if 'phase' is specified as 'GOW'. Please let me know if I'm wrong on this. 

Any help is appreciated.

Sincerely,
Matt

Olav Møyner

unread,
Feb 2, 2018, 2:37:23 AM2/2/18
to Matt Lin, sinte...@googlegroups.com

Hello Matt,


That is a good question!


The canonical ordering in MRST is WOG, so whenever you encounter saturations or injection phase composition, it refers to this ordering. This is straightforward for the three-phase case since all phases are present, but when phases are missing from the model it becomes more complicated. By convention, phases absent from the model are skipped over. Filling out your table:


3-phase oil-gas-water: water injection = [1 0 0]
3-phase oil-gas water: gas injection = [0 1] Oil is before gas in WOG, so oil is the first and gas is the second in this two-phase
2-phase gas-oil: gas injection = You wrote [1 0], but it is actually [0 1] since WOG without the W is OG, making oil the first phase and gas the second
2-phase water-oil: water injection = [1 0] (WO: Water first, oil second)
2-phase water-gas: water injection =  [1 0] (WG: Water first, gas second)
2-phase water-gas: gas injection = [0 1] (WG: Water first, gas second)

This convention also applies to boundary conditions ('sat' in fluxside/pside/addBC and source terms from addSource).

For the initSimpleADIFluid, the 'phase' keyword is a convenience argument intended to make it easier to programmatically add properties. It does not actually change the ordering of the resulting fluid phase, just the way the input arguments are inserted. The fluid model considers named properties, so
initSimpleADIFluid('phases', 'WO', 'rho', [1000, 700]*kilogram/meter^3)
initSimpleADIFluid('phases', 'OW', 'rho', [700, 1000]*kilogram/meter^3)

will produce two fluids that are identical in behavior without any changes to the canonical phase ordering. If you do not specify phases and you only supply arguments of length two you will get an error. Omitting the phases argument only works for three-phases, where the routine can default to the WOG ordering.

This indeed also applies to the initCompositionalState, with one caveat: This routine flashes the hydrocarbons internally to ensure an consistent state, which ignores the oil/gas saturations in favor of predicting them using the composition, pressure, temperature and equation-of-state. The water saturation is used, however, for WOG cases. The convention is always WOG there as well.

I hope this clears things up.

Regards,

Olav

---

Olav Møyner, PhD

SINTEF Digital

Department of Mathematics & Cybernetics

+47 99 02 49 49


From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of Matt Lin <matt.l...@gmail.com>
Sent: Friday, February 2, 2018 6:08:13 AM
To: sinte...@googlegroups.com
Subject: [MRST Users] Order in Phase Injection Specification and Phase Property
 
--
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/CALaAufAVCyoerrJFBw_Ft0S0OgAfYdsRLVyjfumFo5tpvgR%3Dbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

matt.l...@gmail.com

unread,
Feb 3, 2018, 3:04:11 PM2/3/18
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Olav:

First of all, thank you for your immediate response to my questions. It did clear up all the doubts I had. I think there was a little typo for the 3-phase gas injection that 'comp_i' should be [0 0 1] following WOG and gas being the 3rd entry.

I have a few follow-up questions on the well term. I will refer to this "compositionalExample3DSixComponents.m" example during the discussion.

Because of this example, in my original post, I wrote "2-phase gas-oil: gas injection = [1 0]" (which was incorrect because gas is supposed to be the second entry i.e., [0 1]). The description says that it's a "pure CO2 injection", so I assumed that gaseous CO2 is injected. It seems to me that the simulation results (e.g. injection rate and reservoir pressure response) depend on the specification of the 'comp_i'. In this example, if I run with the original specification ('comp_i' = [1 0]), I can clearly see CO2 moving from injector to producer and pressure increase, highest at the well injector. On the other hand, if I specify 'comp_i' to be [0 1] for "gas injection", the result is different. I don't see CO2 being pushed toward the producer and very little pressure response compared to the case with 'com_i' = [1 0]. They are significantly different.

From what I understand, the command addWell() will create a producer/injector following Peaceman's well model which should be something like, for producer:
rate = - composition * krj / mu_j * WI * (P_cell - BHP) where WI is the well productivity index. Typically, WI = 2*pi*k*h / ln(re/rw + Skin).
In the case of injection term, if I'm not mistaken, MRST manual and your PhD thesis describe that  "total mobility" which is ( krG / muG ) + ( krO / muO ) + ( krW / muW ) is used in the injector. So, the well is like:
rate = - composition * (total_mobility) * WI * (P_cell - BHP).
The data taken from getCompositionalFluidCase() contains injection composition which is specified in W(i).components. The rest of the variables (kr, mu, equivalent well block radius, etc) is calculated internally. 

I understand 'comp_i' doesn't really matter in a producer. It just kind of has to be there (for debugging purpose according to another post). Then, what is the use of 'comp_i' in an injector for a compositional simulation because this alters the simulation results? Why are the simulation results in the example different when I swap 'comp_i' from [1 0] to [0 1]?

Again, thank you for your your.

Sincerely,
Matt

Olav Møyner

unread,
Feb 5, 2018, 5:33:20 AM2/5/18
to matt.l...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hello again Matt,


You are of course correct about my typo. Gas injection for three phase should be [0 0 1]!


For your follow up results I think it can be explained by how MRST thinks about well controls.


In this example, the injector is set to 'rate' control. This means that there is a constant injection rate measured in volume at reference conditions. What are the reference conditions in this case? The surface densities are set to 10 kg/m^3 for gas/vapor phase and 800 kg/m^3 for the oil/liquid phase. This is a conceptual example, so these values are just set to fairly arbitrary values instead of flashing at e.g. separator PVT conditions.


This means that the same injection rate with comp_i set to [0, 1, 0] will inject 80 times as much mass as [0, 0, 1] with the same components array. I think this explains the very different simulation results. If the surface densities for oil and gas are equal, you will get identical results. We maintain the two different fields because not all fluids are compositional and we might extend this behavior in the future (one possibility would be working with energy balances, where the energy of phase transitions in the near-well region come into play).


For the well equation, with fixed rates, this relation is only used to find the BHP values (which do not affect the simulation itself for rate controls with no limits).


Regards,

Olav


---

Olav Møyner, PhD

SINTEF Digital

Department of Mathematics & Cybernetics

+47 99 02 49 49


From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of matt.l...@gmail.com <matt.l...@gmail.com>
Sent: Saturday, February 3, 2018 9:04:11 PM
To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Subject: Re: [MRST Users] Order in Phase Injection Specification and Phase Property
 

matt.l...@gmail.com

unread,
Feb 6, 2018, 8:41:57 PM2/6/18
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Olav:

Thank you for your explanation. I appreciate your help. That cleared the doubt I had. I tested 'comp_i' = [1 0] and [0 1] with the same density ('rho', [1000 800 800]) and the results are identical. Basically, specified volumetric injection rate is dependent on the reference density which impacts the actual amount that is being injected.

From the same example, I switched the injector from 'rate' to 'bhp', set 'bhp' to maxP, and set 'rho' to be the same for liquid and vapor (i.e. 'rho' = [1000 800 800]). I compared the results from 'comp_i' = [1 0] with [0 1] but the results are not identical. I think the well treatment for 'bhp' specification is different from my understanding as well. I would think 'bhp' is used to calculate the rate which follows the Peaceman model (rate = - composition * (total_mobility) * WI * (P_cell - bhp)). If so, the results from 'comp_i' = [1 0] and [0 1] should be identical because I specified the same 'rho' and the other variables are calculated internally, but they are not. Could you please explain how MRST handles injector with 'bhp' specification? Thank you very much.

Sincerely,
Matt

Olav Møyner

unread,
Feb 8, 2018, 2:06:36 AM2/8/18
to matt.l...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi Matt,


There's one more part to the expression that might be relevant:

rate = - composition * (total_mobility) * WI * (P_cell - bhp - cdp)


where cdp is the pressure drop model within the well bore, that depends on the densities. But this should also be initialized equally if you have the same surface densities.


Could you supply your modified script so I can take a look?


Regards,

Olav


---

Olav Møyner, PhD

SINTEF Digital

Department of Mathematics & Cybernetics

+47 99 02 49 49

Sent: Wednesday, February 7, 2018 2:41:56 AM

Matt Lin

unread,
Feb 8, 2018, 11:25:33 AM2/8/18
to Olav Møyner, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Olav:

Please see the attached modified compositionalExample3DSixComponents. I changed the following:
  1. Number of grid to 10, and it's a 1-D reservoir now to make run faster. Dimensions remain the same.
  2. Injector to 'bhp' specification, injecting at maxP
  3. Changed 'rho' to [1000 800 800]
  4. Total simulation time to 0.1 years to make run faster
I changed 'comp_i' = [1 0] and [0 1] between the two runs and compared the results.

Thank you.

Sincerely,
Matt


Virus-free. www.avast.com

To unsubscribe from this group and stop receiving emails from it, send an email to sintef-mrst+unsubscribe@googlegroups.com.
compositionalExample3DSixComponents_mod.m

Olav Møyner

unread,
Feb 12, 2018, 7:24:14 AM2/12/18
to Matt Lin, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi Matt,


Sorry for the late follow-up. I have run your modified scripts and observe the same discrepancy. I think my previous statements were a bit off with respect to injectors on BHP.


MRST calculates the volumetric rates of the injector based on the pressure at the bhp, and the reservoir pressure itself. This leads to a volumetric rate at the reservoir conditions of each perforated cell. The amount of mass in this injection stream is calculated according to the densities in the reservoir. For compositional models, there is always both a vapor and a liquid density that differ when both phases are present. In this case, you will therefore get different results with different comp_i. 


When bhp is used for producers (which is the most typical case), this treatment should be correct. For injectors, however, it is a little bit strange since the densities used does not account for the well-bore composition. I think the safest way of specifying injection is to inject with fixed rates which should be converted to masses. I will consider how the injection density should be considered for compositional problems and try to fix this for a future release - for the time being, I think it is a bug.


Thank you for the bug report and script!


Cheers,

Olav

---

Olav Møyner, PhD

SINTEF Digital

Department of Mathematics & Cybernetics

+47 99 02 49 49

Sent: Thursday, February 8, 2018 5:25:31 PM
To: Olav Møyner
Cc: MRST-users: The Matlab Reservoir Simulation Toolbox User Group

matt.l...@gmail.com

unread,
Feb 12, 2018, 2:51:35 PM2/12/18
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Olav:

Thank you for checking the script.

In fact, when I wrote the well formula, I missed a term for density of the injected phase. It should be:
rate = - composition * rho_inj * (total_mobility) * WI * (P_cell - bhp - cdp)
Out of curiosity, I checked this density term (rho_inj), and it seems to me that the injected amount in the current release depends on the phase density of well cell specified by 'comp_i' (for example, if 'comp_i' is [1, 0], it uses cell's oil density 'rhoO' to calculate the rate) instead of density of the injected phase (in this case, density of pure CO2 at reservoir temperature and pressure).

I'll use the rate specification for now while waiting for the bug fix in the future release. Thank you again.

Sincerely,
Matt
Reply all
Reply to author
Forward
0 new messages