# Boundary conditions for Two-phase Flow with Different Inlet Pressures

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

September 24, 2014, 15:43
Boundary conditions for Two-phase Flow with Different Inlet Pressures
#1
New Member

Join Date: May 2013
Posts: 1
Rep Power: 0
Hi,
I am working on a 2D channel flow of air and water flow using interFoam as the solver.
Some part of the inlet is the inlet for water, whereas the remaining part is inlet for air.
The case requires air to be coming in from a higher pressure than water (10 times more).
Velocity of the water is fixed. flow is laminar always.
I have tried fixedValue, totalPressure for the boundary conditions at air and water inlet of the file p_rgh; but both of them yield non-physical results.
I wish to know what would be suitable boundary conditions for such a flow.
I am attaching the image of the domain for better clarity.
Thanks a lot!
Attached Images
 rsz_screenshot_from_2014-09-25_011018.jpg (40.5 KB, 119 views)

April 14, 2016, 13:40
Air-water two phase flow
#2
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Hello,

I'm trying to simulate 2-D Air and Water two-phase flow inside a pipe. I just divided the inlet into two same parts. one for water inlet and one for air inlet as well as the outlets. I used "patch" as boundary conditions for inlets and outlets. However, looks like the outlet behaves like a wall. Can anybody help me? is that really a wall at outlet?
Attached Images
 Screen Shot 2016-04-14 at 12.24.49 PM.png (102.7 KB, 78 views)

 April 15, 2016, 12:48 inlets #3 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 Mizzou, First of all, please provide enough info about your case to answer your question. solver, OF version, constant/polyMesh/boundary, 0/alphas From the sounds of your description, you tried to create two inlets on the same geometry, but that isn't possible. You need to specify the amount of water and air at the single inlet. Is that what you mean? mizzou likes this.

April 16, 2016, 12:16
#4
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee Mizzou, First of all, please provide enough info about your case to answer your question. solver, OF version, constant/polyMesh/boundary, 0/alphas From the sounds of your description, you tried to create two inlets on the same geometry, but that isn't possible. You need to specify the amount of water and air at the single inlet. Is that what you mean?
Many thanks for your response. I am using OF version 2.4.0 and interFoam as the solver. My main goal is to capture different two-phase flow regimes (like bubbly flow, stratified flow, annular flow, ...) based on the different velocities of the phases (Air and Water). Since I am new to OF, I guess I have some basic problems. Since I'd like to solve in 2-D, the geometry in a plane is a simple rectangular. In order to have both phases in the pipe, I just devoted the half part of the inlet for water (alpha=1) and the rest half part to the air (alpha=0). Actually I will have a couple of questions for my simulaton. But here, in this case I wonder if defining patch as boundary conditions is correct or not? and also do I need to execute any setfields or not?
this is my blockmesh:

convertToMeters 1;

vertices
(
(0 0 -0.1)
(20 0 -0.1)
(20 0.5 -0.1)
(0 0.5 -0.1)
(0 0 0.1)
(20 0 0.1)
(20 0.5 0.1)
(0 0.5 0.1)
(0 1 -0.1)
(20 1 -0.1)
(20 1 0.1)
(0 1 0.1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (50 10 1) simpleGrading (1 1 1)
hex (3 2 9 8 7 6 10 11) (50 10 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet_water
{
type patch;
faces
(
(3 7 11 8)
);
}
inlet_air
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet_air
{
type patch;
faces
(
(1 2 6 5)
);
}
outlet_water
{
type patch;
faces
(
(2 9 10 6)
);
}
lowerWall
{
type wall;
faces
(
(0 1 5 4)
);
}
topWall
{
type wall;
faces
(
(9 8 11 10)
);
}
);

mergePatchPairs
(
);

This is my alpha.water

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet_water
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}

inlet_air
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
outlet_water
{
}

outlet_air
{
}

lowerWall
{
}

topWall
{

}

defaultFaces
{
type empty;
}
}
And thats gonna be for U

dimensions [0 1 -1 0 0 0 0];

internalField uniform (1 0 0);

boundaryField
{
inlet_water
{
type fixedValue;
value uniform (1 0 0);
}

inlet_air
{
type fixedValue;
value uniform (1 0 0);
}

outlet_water
{
}

outlet_air
{
}

lowerWall
{
type fixedValue;
value uniform (0 0 0);
}

topWall
{

type fixedValue;
value uniform (0 0 0);
}
defaultFaces
{
type empty;
}
}

 April 16, 2016, 13:31 #5 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 The first thing to do is to combine your inlets into one and specify the volume water fraction in the alpha.inlet. right now, you couldn't vary the relative flow rates sine having different velocities in adjacent boundary patches is not physical (there would always have to be a gradient and therefor some space between them). The water and air will separate according to the surface tension you specified, and the mesh must be fine enough to cut across the interfaces formed. I'm using interFoam currently in a 6M cell 3D model pipe with vapor and water. For your case, interFoam might produce useful results at ~50k cells. Your current mesh is much too coarse for a VOF solver. For looking at dispersed v annular flow, you might want to go to much higher mesh densities. mizzou likes this.

April 16, 2016, 14:16
#6
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee The first thing to do is to combine your inlets into one and specify the volume water fraction in the alpha.inlet. right now, you couldn't vary the relative flow rates sine having different velocities in adjacent boundary patches is not physical (there would always have to be a gradient and therefor some space between them). The water and air will separate according to the surface tension you specified, and the mesh must be fine enough to cut across the interfaces formed. I'm using interFoam currently in a 6M cell 3D model pipe with vapor and water. For your case, interFoam might produce useful results at ~50k cells. Your current mesh is much too coarse for a VOF solver. For looking at dispersed v annular flow, you might want to go to much higher mesh densities.
Your great response is highly appreciated. As I understand, I should avoid to have two separate fluid inlet with different velocities since this is not physical at adjacent boundary patches. Instead, you are suggesting to have one inlet with the alpha between one and zero. is that right? if so, a question which comes to my mind right away is that since it's gonna be an adiabatic two-phase flow and there is no phase change, having volume fraction between zero and one is still not physical I guess. And second question is how can I capture the interacting between two different phases (air and water) when having one fluid inlet?
I'm sorry if my questions would be so fundamental.

 April 16, 2016, 14:42 #7 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 The phase fraction is physical only in the sense that a given cell can contain both water and air. The location of the interface between the water and air is what the solver is trying to solve. You'll see the first layer of cells at the inlet being homogenous, and then separation will occur as you move away from the inlet. It will take some time/distance before the flow is realistic. In my case, it takes about 5m into a 30 m pipe before the fliw hits an elbow. After the elbow, the annular flow is resolved but the dispersed flow is only represented by blobs of water that are large enough to cover a few cells. A VOF solver needs a mesh that is fine enough to resolve the interfaces of interest. Have you tried adapting a tutorial? mizzou likes this.

April 16, 2016, 15:52
#8
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee The phase fraction is physical only in the sense that a given cell can contain both water and air. The location of the interface between the water and air is what the solver is trying to solve. You'll see the first layer of cells at the inlet being homogenous, and then separation will occur as you move away from the inlet. It will take some time/distance before the flow is realistic. In my case, it takes about 5m into a 30 m pipe before the fliw hits an elbow. After the elbow, the annular flow is resolved but the dispersed flow is only represented by blobs of water that are large enough to cover a few cells. A VOF solver needs a mesh that is fine enough to resolve the interfaces of interest. Have you tried adapting a tutorial?
As you definitely know, the flow regime map for adiabatic two-phase flow depends upon the superficial velocities of the phases. If you mean I should have one inlet in blockMeshDict and a certain value for alpha.water at 0 folder, I guess I will have one certain value for my inlet velocity as well. So, I could not fully understand how can I change the flow regime in my simulation if I want to contribute the result (fluid distribution) to the phases velocities?

Thanks

 April 16, 2016, 16:56 #9 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 The flow will take time to develop. If it is annular flow with a small liquid fraction, the surface film will be slower than the vapor, with each iccupying separate cells. To be clear, with sufficiently small mesh size, the phases will not overlap in space. Each phase will occupy separate cells, except where a cell staddles the interface. The phases will each have their own velocities, but unless it it stratified flow, it will be difficult to have enough cells. For example, with my current 2-phase pipe interfoam simulation, large droplets of water that separate from the bulk phase are slowly accelerated by the vapor until the droplet merges with the bulk phase again. This is only possible because the mesh is fine enough to resolve the droplet. mizzou likes this.

 April 16, 2016, 17:10 #10 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 The single inlet velocity only applies to the homogenous first layer of cells. Once the phases separate, they will interact but each cell will have its own velocity vector, but each cell will also have a separate phase. There are also ither solvers available that might be better suited to your task, depending on velocities, contact angle effects on the pipe surface, etc. I like the VOF model for its ability to track surface evolution, but if you have a lot of small-scale surface such as droplets, it becomes very expensive to run because mesh needs to be very fine. You may be better off with a solver like twoPhaseEulerFoam, in which each phase with a cell has its own velocity. That way, cells can be large enough that they actually contain both phases. For bubbly flow, I suggest the IATE dispersion model. Unfortunately, the IATE model can currently only handle a light dispersed phase.

April 16, 2016, 18:11
#11
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee The single inlet velocity only applies to the homogenous first layer of cells. Once the phases separate, they will interact but each cell will have its own velocity vector, but each cell will also have a separate phase. There are also ither solvers available that might be better suited to your task, depending on velocities, contact angle effects on the pipe surface, etc. I like the VOF model for its ability to track surface evolution, but if you have a lot of small-scale surface such as droplets, it becomes very expensive to run because mesh needs to be very fine. You may be better off with a solver like twoPhaseEulerFoam, in which each phase with a cell has its own velocity. That way, cells can be large enough that they actually contain both phases. For bubbly flow, I suggest the IATE dispersion model. Unfortunately, the IATE model can currently only handle a light dispersed phase.
Thanks for your valuable information. For interFoam, what is the best type of inlet boundary condition for alpha? inletOutlet? if so, is that a correct format if I would like to have alpha=0.5 at inlet?
inlet_water
{
type inletOutlet;
inletValue uniform 0.5;
value uniform 1;
}

 April 16, 2016, 21:13 #12 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 I usually specify velocity at the inlet (fixedValue or surfaceNormalFixedValue) and pressure at the outlet (fixed value). Others are zeroGradient. It varies, though, depending on the case. The one thing to be certain of is that you don't overspecify (e.g., don't specify pressures or velocites in two place that might contradict) or underspecify boundary conditions. The safest bet is to use one of the tutorials, run it, and then modify it in steps. Run it between each step to ensure you haven't introduced an inconsistency or contradiction. mizzou likes this.

April 20, 2016, 14:53
#13
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee I usually specify velocity at the inlet (fixedValue or surfaceNormalFixedValue) and pressure at the outlet (fixed value). Others are zeroGradient. It varies, though, depending on the case. The one thing to be certain of is that you don't overspecify (e.g., don't specify pressures or velocites in two place that might contradict) or underspecify boundary conditions. The safest bet is to use one of the tutorials, run it, and then modify it in steps. Run it between each step to ensure you haven't introduced an inconsistency or contradiction.
I just run my case with a one inlet with the alpha=0.5 and velocity=0.3 m/s in the 2-D 1m*0.02m geometry. As you truly mentioned I could capture the interaction between phases and you can see in the attached image, looks like the flow is slug flow. Your comment was really effective. Actually because of some limitations I could not go for very fine mesh so far. I will try to use very fine mesh later as you said. At this time, my question is how can I capture annular flow using interFoam and applying this combined inlet boundary condition? Actually my problem is since in this kind of inlet, the gas and liquid velocity is the same as we already define just one velocity, is that possible to observe the annular flow? Becasue the gas velocity is supposed to be much higher than liquid velocity in annular flow regime.
So sorry to ask frequently. Please accept my apologize as I am new to OpenFoam.
Attached Images
 Screen.png (137.2 KB, 76 views)

 April 20, 2016, 15:07 #14 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 Well, the phases will separate as the flow develops and the water will slow down while the gas speeds up to maintain the steady state flux. Remember, boundary conditions are just that - conditions at the boundary. They do not dictate the velocities in the individual cells. The average velocity may be determined by the inlet in your case, which determines the flow regime. Generally speaking, the flow regime isn't so much *determined* by the relative phase velocities, as the relative phase velocities are also determined by the flow regime. Both are emergent properties determined by the inlet flux of each phase, which you specify. Be sure to take a look at the twoPhaseEulerFoam bubble column tutorials. Best of luck. mizzou likes this.

May 27, 2016, 15:39
#15
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee Well, the phases will separate as the flow develops and the water will slow down while the gas speeds up to maintain the steady state flux. Remember, boundary conditions are just that - conditions at the boundary. They do not dictate the velocities in the individual cells. The average velocity may be determined by the inlet in your case, which determines the flow regime. Generally speaking, the flow regime isn't so much *determined* by the relative phase velocities, as the relative phase velocities are also determined by the flow regime. Both are emergent properties determined by the inlet flux of each phase, which you specify. Be sure to take a look at the twoPhaseEulerFoam bubble column tutorials. Best of luck.
Thank you so much for your kindly help. Your great comments were always help me a lot. Here, I would like to ask you another question which might be not relevant to my previous ones.
I just downgrade my OpenFOAM version to older one for a reason. I already have OpenFOAM version 2.3.0. When I try to visualize my case in Paraview, I got this error:

Could you please give me any comment how to fix that?
Thanks again,

Here is the content of my epsilon directory:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -3 0 0 0 0];

internalField uniform 0.00016934;

boundaryField
{
inlet_water
{
type fixedValue;
value uniform 0.0000655594;
}
inlet_air
{
type fixedValue;
value uniform 0.00017045;
}
outlet_water
{
}
outlet_air
{
}

lowerWall
{
type epsilonWallFunction;
value uniform 0.00001498;
}

topWall
{
type epsilonWallFunction;
value uniform 0.00001498;
}

defaultFaces
{
type empty;
}
}

// ************************************************** *********************** //

 May 27, 2016, 16:17 #16 Member   Andrew Eisenhawer Join Date: Nov 2012 Location: Alberta, Canada Posts: 30 Rep Power: 6 I am confused. It looks like you went back to using separate inlets and outlets for air and water. Is this the same case? For your case, there should only be one inlet and one outlet. Also, be careful about assuming the flow depicted is a realistic simulation of dispersed v slug flow. Remember, in CFD, we have discretization errors. The resolution of the cells limits the physics that can be modeled. You won't be able to model a dispersed flow with a VOF (e.g., interFoam) solution, but will be able to model wavy or slug flow. What would actually be dispersed flow in real life may end up looking like slug flow in the model because the smallest resolved droplet size is limited by the cell size (actually a few adjacent cells). You started the thread talking about inlets with different pressures. For all practical purposes, that isn't going to happen if the inlets are adjacent. In reality, an air supply tubing might be at 300 psi and a water hose might be at 30, but if you combine the two into a pipe at 25 psi, the pressure of the air in the tubing will drop from 300 to 25 psi along is length, and the water will drop from 30 to 25 psi. In other words, the pressures will be the same at the inlet of the pipe. The flow rate of air will be determined by the pressure drop available versus the flow resistance (which increases with flow rate). Apologies for using archaic units. mizzou likes this.

May 27, 2016, 17:42
#17
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by aee I am confused. It looks like you went back to using separate inlets and outlets for air and water. Is this the same case? For your case, there should only be one inlet and one outlet. Also, be careful about assuming the flow depicted is a realistic simulation of dispersed v slug flow. Remember, in CFD, we have discretization errors. The resolution of the cells limits the physics that can be modeled. You won't be able to model a dispersed flow with a VOF (e.g., interFoam) solution, but will be able to model wavy or slug flow. What would actually be dispersed flow in real life may end up looking like slug flow in the model because the smallest resolved droplet size is limited by the cell size (actually a few adjacent cells). You started the thread talking about inlets with different pressures. For all practical purposes, that isn't going to happen if the inlets are adjacent. In reality, an air supply tubing might be at 300 psi and a water hose might be at 30, but if you combine the two into a pipe at 25 psi, the pressure of the air in the tubing will drop from 300 to 25 psi along is length, and the water will drop from 30 to 25 psi. In other words, the pressures will be the same at the inlet of the pipe. The flow rate of air will be determined by the pressure drop available versus the flow resistance (which increases with flow rate). Apologies for using archaic units.
Yes, all your comments are highly appreciated. I got very helpful points from your response. Never mind about my inlet at this time, since for a reason, I'm working on both inlet conditions (separate and one combined inlet). I just came up to that error in Paraview with this old version. Actually I did not get that error while running the similar case in the later version. That's why I am confused about that error. I've just attached a scrrenshot here.

Thanks
Attached Images
 Screenshot from 2016-05-27 16:41:31.jpg (130.2 KB, 48 views)

November 8, 2016, 09:44
#18
Member

Join Date: Jan 2016
Location: FRANCE
Posts: 32
Rep Power: 3
Quote:
 Originally Posted by mizzou I just run my case with a one inlet with the alpha=0.5 and velocity=0.3 m/s in the 2-D 1m*0.02m geometry. As you truly mentioned I could capture the interaction between phases and you can see in the attached image, looks like the flow is slug flow. Your comment was really effective. Actually because of some limitations I could not go for very fine mesh so far. I will try to use very fine mesh later as you said. At this time, my question is how can I capture annular flow using interFoam and applying this combined inlet boundary condition? Actually my problem is since in this kind of inlet, the gas and liquid velocity is the same as we already define just one velocity, is that possible to observe the annular flow? Becasue the gas velocity is supposed to be much higher than liquid velocity in annular flow regime. So sorry to ask frequently. Please accept my apologize as I am new to OpenFoam. Thank you so much for your kind reply in advance.
Hi Mizzou,

I am trying to simulate a similar case. I am pretty sure you forgot the gravity...

EDIT : My apologize, it's ok. Your pipe is just vertical..Anyway with your settings on a horizontal pipe the flow is stratified

When I run the multiphase flow (air water, SST turbulence model) on a horizontal 2D pipe (length 1 m, diameter : 0.02 m) whit the following BC :
• Inlet Alpha = 0.5, v = 0.3 m/s
• Outlet = 0 bar
The flow pattern is stratified..

My mesh is enough fine I guess (1000x40 meshs).

Last edited by Fauster; November 8, 2016 at 12:27.

November 8, 2016, 13:43
#19
Member

Join Date: Jul 2015
Location: USA
Posts: 38
Rep Power: 3
Quote:
 Originally Posted by Fauster Hi Mizzou, I am trying to simulate a similar case. I am pretty sure you forgot the gravity... EDIT : My apologize, it's ok. Your pipe is just vertical..Anyway with your settings on a horizontal pipe the flow is stratified When I run the multiphase flow (air water, SST turbulence model) on a horizontal 2D pipe (length 1 m, diameter : 0.02 m) whit the following BC : Inlet Alpha = 0.5, v = 0.3 m/s Outlet = 0 bar The flow pattern is stratified.. My mesh is enough fine I guess (1000x40 meshs).
Dear Paul,

Thanks for your response here. I am glad you are interested in my problem. I have couple of things to discuss with you. Could you please give me a screen-shoot of your result? And what is the superficial velocities of gas and water in this case? (U=0.3 and alpha=0.5)

Thank you,

November 9, 2016, 05:08
#20
Member

Join Date: Jan 2016
Location: FRANCE
Posts: 32
Rep Power: 3
Hi Mizzou,

Here are different results :

The first one is for alpha = 0.3 and u = 0.3 m/s, and the second is for alpha = 0.6 and u = 0.2 m/s. With alpha = 0.3 and u = 0.3 m/s the regime seems to be churn.

As you can see with alpha=0.6 and u = 0.2 m/s the flow tends to be slug regime but I am not satisfied. More settings are needed to get a proper slug flow.

Quote:
 And what is the superficial velocities of gas and water in this case? (U=0.3 and alpha=0.5)
I am wondering the same thing.

Maybe by using conservation of mass :

the total superficial velocity is given by :

So you can know superficial velocities of liquid and gas at inlet at least.

Did you take a look at Taitel and Duckler map ? Maybe it's also possible to evaluate Martinelli-Nelson parameter and others non dimensional parameters to get information about flow structures.

EDIT : I am running this case on 9 cores.
Attached Images
 Flow_pattern1.jpg (33.6 KB, 42 views) Flow_pattern2.jpg (33.6 KB, 28 views)

Last edited by Fauster; November 9, 2016 at 07:20.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Saima CFX 45 September 22, 2015 10:53 legendyxg FLUENT 2 May 11, 2010 07:32 Joseph CFX 14 April 20, 2010 15:45 cc1000 CFX 6 April 27, 2009 08:10 Adel Ataki FLUENT 2 November 9, 2000 05:24

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