CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Help with coupling two flow equations

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2019, 18:29
Exclamation Help with coupling two flow equations
  #1
Member
 
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 40
Rep Power: 7
ELwardi is on a distinguished road
Hi all,

I'm trying to solve the basic incompressible, immiscible two-phase flow that can be modeled with the following equations in a coupled manner:


SwEqn: (water equation)
\phi \frac{\partial S_w}{\partial t}+ \nabla (-T_w \nabla P)+ \nabla(T_w P_{cap})+ \nabla(\gamma_w \nabla z)+ Q_w = 0


pEqn: (oil equation)
- \phi \frac{\partial S_w}{\partial t} + \nabla (-T_o \nabla P)+ \nabla(\gamma_o \nabla z)+ Q_o = 0


For now, what works for me is to solve:
1- SwEqn explicitly for Sw: All coeffs T_w, \gamma_w and \nabla (-T_w \nabla P) are calculated from previous time.
2- The equation (SwEqn+pEqn) implicitly for p (ddt(Sw) eliminated from pressure equation only if the flow is incompressible ).


\nabla(T_w\nabla P_{cap}) is a function of Sw and is calculated explicitly.


Of course, the explicit calculation of Sw sets some constraints on deltaT and introduces instabilities when attempting to model Q source terms in a semi-implicit manner.



My first attempts to couple these two equations (using foam-extend-4.0) through the terms:
1- pInSw: \nabla(-Tw \nabla P)
2- SwInp: - \phi \frac{\partial Sw}{\partial t}
did not prove to be successful .


The general layout of the coupled solver looks like this:


1- Create the block matrix for the working variable pSw.
2- Assemble pEqn and SwEqn without the coupling terms
3- Calculate coupling terms separately.
4- Add equations and coupling terms to the block matrix

5- Solve it and retrieve solution.


Till now, the testing case works fine with the segregated solver but
gives weird results with the coupled version.


I'm currently investigating the boundary conditions but i don't think there is a problem there.



Any help/orientation to reference material is greatly appreciated
ELwardi is offline   Reply With Quote

Old   March 28, 2019, 05:07
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
Hi ELwardi,

You can have a look at the porousMultiphaseFoam package https://github.com/phorgue/porousMultiphaseFoam that solves the multiphase Darcy equations with the IMPES algorithm.

The corresponding paper is there : https://www.sciencedirect.com/scienc...10465514003403

Cheers,
Cyprien
Cyp is offline   Reply With Quote

Old   March 28, 2019, 16:11
Default
  #3
Member
 
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 40
Rep Power: 7
ELwardi is on a distinguished road
Quote:
Originally Posted by Cyp View Post
Hi ELwardi,

You can have a look at the porousMultiphaseFoam package https://github.com/phorgue/porousMultiphaseFoam that solves the multiphase Darcy equations with the IMPES algorithm.

The corresponding paper is there : https://www.sciencedirect.com/scienc...10465514003403

Cheers,
Cyprien

Thanks for your reply,



I have already seen the awesome toolkit , what I'm looking for is to create a fully coupled solver though.


A very simple case where IMPES methods fall short is when applying a semi-implicit well rate (BHP-controled well, you may improve deltaT calculation for this if you want).
ELwardi is offline   Reply With Quote

Reply

Tags
block matrix, block-coupling, coupled, foam ext 4.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
Solving non-linear coupled equations using blockmatrix solver (OpenFOAM-3.1ext) Rolanzo OpenFOAM Running, Solving & CFD 0 April 12, 2018 21:49
Advice regarding algorithm for solution of discretised equations in compressible flow lorbekl Main CFD Forum 10 January 22, 2018 02:59
DPM coupling with multiphaseInterFoam for gas-oil-water-particle 4phase flow particlecfd OpenFOAM Programming & Development 0 September 9, 2016 14:09
Flow meter Design CD adapco Group Marketing Siemens 3 June 21, 2011 09:33


All times are GMT -4. The time now is 12:45.