CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Stratified Two-Phase Flow

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 19, 2010, 06:29
Post Stratified Two-Phase Flow
  #1
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Hi,

I am currently attempting to model stratified flow in horizontal pipeline (water/steam) and is new to openFOAM. I would like to implement non-uniform boundary conditions for each phase but is finding it difficult to do so. The main boundary conditions which I am interested in is the phase velocities and void fraction. The solvers which I have been playing with have been interFoam and twoPhaseEuler.

The main questions which I have is:

Is the solvers which I am attempting to use capable of handling separate boundary conditions per phase? and of so how can I do it?

Any help will be greatly appreciated
metro is offline   Reply With Quote

Old   May 20, 2010, 03:28
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Both the solvers can deal with non-uniform conditions on the variables they solve for.

The approach the solvers use are however very different. InterFoam is a VOF code, where the velocity is defined for the mixture. TwoPhaseEulerFoam uses the two-fluid approach, solving one momentum equation for each phase.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 20, 2010, 16:58
Default
  #3
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thank you for your input.

It seems the twoPhaseEuler solver will be the best option. A question I do have is that we are mainly concerned with setting up the phase velocities depending on the mass flow rate of each fluid and the cross sectional area they occupy (Void Fraction). How can this be achieved or is this already set up in the solver?

Due to me being a novice to openFOAM, how do I set the pressure boundary condition so that the pressure drop across the system is dependent on the fluids behaviour and not vice-versa.
metro is offline   Reply With Quote

Old   May 20, 2010, 18:46
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
I'm not sure I understand what you want to do :-)

If you want to specify a non-uniform, constant in time, boundary condition you can simply set it by patching the values on the face (there are a few tools on the wiki that make your life easier like funkySetField, or you can use the macros to keep the initial condition as BC ($internalField, as done in some of the tutorial of single phase codes)).

About the pressure, if you want to let the pressure change according to the velocity field (which is what you normally do, when you fix the velocity at inlets in incompressible flows), you simply set the pressure to zeroGradient at the inlet, and to fixedValue (athmospheric or the value you want) at the outlet.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 20, 2010, 19:50
Default
  #5
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thank you again for your input

Sorry about that, let me reword my problem. I am studying stratified horizontal two-phase flow (steam and water) where I would like to determine the pressure drop across a section of pipe using CFD.

I want to set up a model where I specify the mass flow rate of the two phases and openFOAM will simulate the problem with the end result being the pressure drop between the pipe inlet and outlet. I would like to used the twoPhaseEuler solver for this problem.The problem I'm having is that due to my limited experience with openFOAM I'm having difficulty setup the B.C.

The problem is that the phase velocities is dependent on the mass flow rates and the cross sectional area each phase is occupying in the pipe (Conservation of mass). I don't know how to set this up in openFOAM and any help will be greatly appreciated.

I hope this clarifies things.
metro is offline   Reply With Quote

Old   May 20, 2010, 20:08
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Well, in the two-fluid approach, you assume the phases are incompressible, so you specify only the phase velocities and volume fractions at the inlet and the pressure at the outlet. The rest comes out from the simulation.

Do you know how the mass flow rate and what portion of the inlet cross-section each phase occupies? Do these quantities change in time?

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 20, 2010, 21:02
Default
  #7
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thats great. Do we need to specify the internal field values for Ua, Ub and alpha or do I need to leave them at 0? We are assuming that the phase mass flow rates state constant but in reality there is flashing and condensation of the steam and water. This will be added to the solver code at a later date when I am more familiar with the software.

The phase velocities also change as the liquid gas interface tends to be wavy and therefore the cross sectional area occupied by each changes with time at a particular instant. Im just wondering if I need to set this up or is it automatically.
metro is offline   Reply With Quote

Old   May 20, 2010, 21:13
Default
  #8
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by metro View Post
Thats great. Do we need to specify the internal field values for Ua, Ub and alpha or do I need to leave them at 0? We are assuming that the phase mass flow rates state constant but in reality there is flashing and condensation of the steam and water. This will be added to the solver code at a later date when I am more familiar with the software.

The phase velocities also change as the liquid gas interface tends to be wavy and therefore the cross sectional area occupied by each changes with time at a particular instant. Im just wondering if I need to set this up or is it automatically.
You can either start from an empty domain or from an already filled domain. Probably starting with a basic non-uniform initial condition will help convergence and also shorten the computational time.

If the pipe is horizontal, for example you can do something like

=================================
Steam here (Ua, alpha)
-------------------------------------------------------------
Liquid here (Ub, beta)
=================================

You can do this with setField, very easily. If you specify the initial condition so that it is equal to the inlet condition initially, you can use $internalField in the definition of BC's.

About the interface, two-fluid methods are not very good to capture sharp interfaces. So you'll see the interface, but do not expect to obtain something comparable to what you would observe with a VOF approach.

I hope this helps.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 20, 2010, 22:58
Default
  #9
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thats what I was going to attempt first. When it comes to the twoPhaseEuler solver is there a beta phase file similiar to the alpha phase? Or is this automatically derived from the alpha file.

When it comes to B.C can I use the setFields function to set the B.C for Ua and Ub? The mean velocity of the phases are different (due to different mass flow rates) but the same at the interface and zero at the wall (assuming no slip). How can this be captured with the standard 7th order turbulent velocity distribution?

You have been so help full Alberto. Very much appreciated.

Metro
metro is offline   Reply With Quote

Old   May 21, 2010, 02:29
Default
  #10
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi,

beta = 1 - alpha is computed automatically, so if you fix alpha, beta will be initialised consistently.

Do you have an analytical expression for the BC's? If so check the wiki for groovy BC.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 21, 2010, 04:17
Default
  #11
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
I do have a couple but depends how easy it will be to implement as I am new to openFOAM. I was considering implementing a piece-wise function which will apply a uniform mean velocity for each phase just as a starting point.

For non-uniform B.C I would have to specify the velocity profile separately for each phase when using groovyBC? How stable is groovyBC as the openFOAM wiki states that it is a beta version? I am using openFOAM 1.6x.

Thank you

Metro
metro is offline   Reply With Quote

Old   May 21, 2010, 14:35
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by metro View Post
I do have a couple but depends how easy it will be to implement as I am new to openFOAM. I was considering implementing a piece-wise function which will apply a uniform mean velocity for each phase just as a starting point.

For non-uniform B.C I would have to specify the velocity profile separately for each phase when using groovyBC?
GroovyBC makes it very easy to specify complex profiles at boundaries. Yes you have to specify different profiles for each phase.

Quote:
How stable is groovyBC as the openFOAM wiki states that it is a beta version? I am using openFOAM 1.6x.
It's stable enough to be used regularly.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 22, 2010, 23:24
Default
  #13
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
I have been attempting to run a uniform BC scenario as detailed in one of your previous threads but I keep getting this error message when I try and run the solver

"DILUPBiCG: Solving for alpha, Initial residual = 0.895457, Final residual = 7.09895e-11, No Iterations 80
Dispersed phase volume fraction = 0.0137154 Min(alpha) = -390.447 Max(alpha) = 419.758
DILUPBiCG: Solving for alpha, Initial residual = 0.999992, Final residual = 3.17554e-11, No Iterations 8
Dispersed phase volume fraction = -6.99526e+09 Min(alpha) = -8.91999e+12 Max(alpha) = 1
#0 Foam::error:rintStack(Foam::Ostream&) in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::GAMGSolver::scalingFactor(Foam::Field<double >&, Foam::Field<double> const&, Foam::Field<double> const&, Foam::Field<double> const&) const in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::GAMGSolver::scalingFactor(Foam::Field<double >&, Foam::lduMatrix const&, Foam::Field<double>&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/home/david/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libfiniteVolume.so"
#8
in "/home/david/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#9 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#10
in "/home/david/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
Floating point exception"

Due to my limited experience with the software I am finding it very difficult to decipher . I was attempting to simulate a theoretical stratified flow scenario where the void fraction was 0.5 and the velocities for Ua and Ub was 10 and 1 m/s respectively. The inlet pressure was set at 50kPa. I have also attached files which contains my BC and pipe segment mesh.

Any help will be greatly appreciated. Thank you in advance

Metro
Attached Files
File Type: zip example strat.zip (86.2 KB, 59 views)
metro is offline   Reply With Quote

Old   May 23, 2010, 01:50
Default
  #14
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi, well jumping on OpenFOAM without the time of learning it a bit surely makes things hard. I would recommend you to go through the user's guide and programmer's guide tutorials, and then do the tutorials for twoPhaseEulerFoam. Of course we can help here if you face problems.

About your case:
  • You are specifying the pressure at a boundary where you imposed the velocity. You should not do that. Fix the pressure at the outlet.
  • Use a much smaller time step (10^-5 s).
I would also replace the inletOutlet for Ua and Ub at the outlet with zeroGradient.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 23, 2010, 02:52
Default
  #15
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thank you for your advice, I have done some of those tutorials but due to the tight time schedules I am on I kinda have to dive into the deep end (its kinda a do or die situation). By saying it though I am learning so much going through this problem and most of that I owe to you Alberto.

I implemented your findings and I am still getting the same error message? Do you still have any other suggestions?

Thank you in advance

Metro
metro is offline   Reply With Quote

Old   May 23, 2010, 03:42
Default
  #16
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by metro View Post
Thank you for your advice, I have done some of those tutorials but due to the tight time schedules I am on I kinda have to dive into the deep end (its kinda a do or die situation). By saying it though I am learning so much going through this problem and most of that I owe to you Alberto.
It is surely something I don't like to encourage. Doing things in such a hurry and with this approach = bad idea. But probably your boss wants it...

Quote:
I implemented your findings and I am still getting the same error message? Do you still have any other suggestions?
See the attachment.

Some comments:

  • The time step is very small (10^-6) to let the simulation start, but after a few iterations you can simply activate the adaptive time stepping, set the maximum Co to 0.4 and the max time step to 10^-4s. Probably this is due to some other problem in the initial condition / simulation setup, but I didn't have the time to check.
  • You should set the no-slip condition at the pipe wall (check how I changed Ua and Ub for "pipe").
  • The inlet condition won't keep the flow stratified, since alpha is set to be uniform.
Good luck!
Attached Files
File Type: gz pipesim2Euler.tar.gz (74.1 KB, 114 views)
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 23, 2010, 04:31
Default
  #17
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Yea its not really ideal and I do agree as there is so many different aspect of the software which I need to learn. When it comes to my problem the tips you provided finally allowed me to get some form of results which I can use as a starting point. Thank you for your help

Regards

Metro
metro is offline   Reply With Quote

Old   May 25, 2010, 17:06
Default
  #18
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Hey Alberto

From your experience modelling two phase systems which solver would you have chosen to model two phase flow in pipes. The reason why I ask is that I have used both the interFoam (VOF) and twoPhaseEuler (Euler-Euler) as described in previous threads. I have also now done some of the tutorials . I also now got stratified flow by modifying my BC with groovyBC.

I am now evaluating which model/solver is best suited for my problem. From my understanding the twoPhaseEuler would allow me to model the effects of transportation between the steam and water and allow me to have BC control over both fluids. It doesnt though allow me to model the fluid interface to well. The interFoam will model the interface accurately but limits the control I have of the fluids and no transportation/entrainment.

Is there an solver that harnesses both theories? Or do you know of other ways which I can achieve all the desired results such as interfacial accuracy and transportation/entrainment?
metro is offline   Reply With Quote

Old   May 26, 2010, 00:58
Default
  #19
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by metro View Post
Hey Alberto

From your experience modelling two phase systems which solver would you have chosen to model two phase flow in pipes. The reason why I ask is that I have used both the interFoam (VOF) and twoPhaseEuler (Euler-Euler) as described in previous threads. I have also now done some of the tutorials . I also now got stratified flow by modifying my BC with groovyBC.

I am now evaluating which model/solver is best suited for my problem. From my understanding the twoPhaseEuler would allow me to model the effects of transportation between the steam and water and allow me to have BC control over both fluids. It doesnt though allow me to model the fluid interface to well. The interFoam will model the interface accurately but limits the control I have of the fluids and no transportation/entrainment.

Is there an solver that harnesses both theories? Or do you know of other ways which I can achieve all the desired results such as interfacial accuracy and transportation/entrainment?
The question is what are you interested in modelling? :-)

If you need to track the interface accurately, twoPhaseEulerFoam is not the right choice, while if you can give up on a good resolution of the interface, you'll have the advantage of being able to implement the other submodels in a well known and straightforward manner.

There is some solver in OpenFOAM that deals with mass transfer. Take a look at cavitatingFoam. You might want to take a look at it.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 26, 2010, 01:41
Default
  #20
New Member
 
Join Date: May 2010
Posts: 27
Rep Power: 15
metro is on a distinguished road
Thanks for the reply,

Well I actually need to simulate what is occuring at the interface as at high differential phase velocities the shear forces is high resulting in large pressure drop which I need to determine. This is done with the interFoam solver.

But then I also need to model the diffusion of the liquid phase into the gaseous phase (Flashing of the liquid into steam) and vice versa. This effects the momentum and mass equations and the pressure drop results. This I know can be done with the Euler-Euler solver. So I am at a dilemma as I require a "hybrid" solver .

Any input will be greatly appreciated.....
metro is offline   Reply With Quote

Reply

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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
Two phase flow with condensation Sunnie FLUENT 0 May 31, 2009 11:02
Stratified Two Phase Flow ravi1650 FLUENT 1 May 29, 2009 06:13
Error in Lax-wendroff with two phase flow k.baker Main CFD Forum 1 November 24, 2007 05:22
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 22:31


All times are GMT -4. The time now is 22:00.