CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Outlet boundary condition in interFoam (http://www.cfd-online.com/Forums/openfoam/95524-outlet-boundary-condition-interfoam.html)

Andrea_85 December 21, 2011 09:23

Outlet boundary condition in interFoam
 
HI all,
Is there the possibility to assign an integrated velocity (a flux) at a certain boundary instead of a fixed velocity bc (cell by cell)? I'm simulating a two phase flow and i have an inlet and an outlet. At boundary inlet the pressure is fixed and at boundary outlet i want to fix the total volume flux and the velocity (cell by cell) should depend on the viscosity of the fluids (both fluids flow out). Use fixedValue velocity gives non physical results. Which boundary conditions could be used to simulate this case?

thanks

andrea

santiagomarquezd December 23, 2011 14:03

fluxCorrectedVelocity ?

doubtsincfd December 30, 2011 03:21

pressureInletOutletVelocity?

Andrea_85 January 1, 2012 10:38

Hi,
and sorry for late response..

Both BC should be used in conjunction with a fixed pressure or not (the pressure is specified at the inlet not at the outlet)? Can i leave zeroGradient for pressure at the outlet?


thank

andrea

Andrea_85 January 3, 2012 10:49

Hi again,
I have tried both conditions and i think they work fine only if the pressure is fixed on the same boundary, which is not my case.
Just to explain better my case: i have an inlet and an outlet. At inlet only fluid1 enters but at the outlet both fluids flow out.
I tried this set of BC:

-inlet
p_rgh->zeroGradient
U->fixedValue
alpha1->fixedValue =1

-outlet
p_rgh->fixedValue (=0 or atm)
U->zeroGradient (or inletOutlet)
alpha1->zeroGradient (or inletOutlet)

This set of conditions works fine until fluid1, injected at the inlet, reaches the outlet. At this point there is a sort of pressure relaxation and the time step falls to very low values. In my opinion this due to the fact that i am fixing the same pressure in both fluids at the outlet (not sure about this!).
This is the reason why I would like to fix the pressure at the inlet, where only fluid 1 is present. Now i'm looking for the correct condition for velocity at the outlet (in order to have flow from inlet to outlet), but FixedValue in this case is not correct and gives strange results when fluid1 reaches the outlet (a layer of alpha=1 is formed along that boundary, to match the boundary condition for velocity). The correct condition would be a fixed velocity integrated along the boundary and the local velocity should depends on the properties of the fluids.
I hope this makes my case more clear. if anyone of you has any advice would be really appreciated.

thanks a lot

andrea

vonboett May 11, 2012 06:10

There are some quite different results of alpha1 at an outlet if one uses PIMPLE or PISO. I changed the current version back to use PISO, then my channel flow simulations look fine. Maybe this could help?

mgdenno May 12, 2012 22:35

vonboett,

I am experiencing a problem with alpha1 at the outlet of my domain too. When you say change from PIMPLE to PISO, did you just change it in the fvSolutions? Or does it need to be changes else where also.

Andrea_85,

I seem to be having a similar problem as you, when the first bubble of air reaches the outlet my simulation timestep decreases and eventually fails. Looks like there are a number of posts regarding interfoam outlet boundary conditions lately...

mgdenno May 12, 2012 23:19

Quote:

Originally Posted by mgdenno (Post 360754)
When you say change from PIMPLE to PISO, did you just change it in the fvSolutions? Or does it need to be changes else where also.

Okay, I see that it is not quite that simple as it looks like PIMPLE is in the interfoam application. Could you elaborate on how you set up interfoam to use PISO?

vonboett May 14, 2012 08:08

1 Attachment(s)
...I adjusted the corresponding parts in the interFoam.C, alphaEqnSubCycle.H, UEqn.H, pEqn.H to version OF 2.0 and reintroduced readPISOContropls.H. Adjust fvSolution that it corresponds. In the attatched iso-view of a channel flow I used OF 1.7.1 with the atmosphere as the outlet (displayed as wireframe). Inflow is at the left, outflow at the right, and the simulation corresponded well to the experiment. I used:
in file U:

type pressureInletOutletVelocity;
phi phi;
value uniform (0 0 0);

in file p_rgh (maybe kind of old style but works):

type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;

in file alpha1:

type inletOutlet;
inletValue uniform 0;
value uniform 0;
However, the current simulation with the interFoam of OF 2.1.x changed to PISO does not seem to be correct either. I will go through the code this week to see if I can find more hints.

vonboett May 15, 2012 04:32

Hello Matthew,
Meanwhile I tested an Outflow with
U:
{
type inletOutlet;
inletValue uniform (0 0 0);
}
p_rgh:
{
type outletInlet;
outletValue uniform 0;
}
alpha1:
{
type zeroGradient;
}
which works fine in interFoam of OF 2.0. I test it on interFoam of OF 2.1.x set back to PISO loop today.

mgdenno May 15, 2012 08:31

Thanks for the update. I am compiling OF 1.7.1 right now and will see if it works better for my problem. OF 1.7.1 used PISO for interFoam right?

mgdenno May 16, 2012 21:59

Quote:

Originally Posted by vonboett (Post 361119)
Hello Matthew,
Meanwhile I tested an Outflow with
U:
{
type inletOutlet;
inletValue uniform (0 0 0);
}
p_rgh:
{
type outletInlet;
outletValue uniform 0;
}
alpha1:
{
type zeroGradient;
}
which works fine in interFoam of OF 2.0. I test it on interFoam of OF 2.1.x set back to PISO loop today.

vonboett,

Are you saying that the problem with the PIMPLE doesn't exist in OF 2.0.0? I am having trouble getting 1.7.1 to compile...if 2.0.0 seems to work I will try that instead.

MD

vonboett May 23, 2012 06:15

2 Attachment(s)
Ok turning old searching the cause of alpha1 being reflected at the outflow, I finally got it. Maybe this is a bug dependent on ubuntu version, but it is quite relevant. The difference between the two pictures below showing an outflow of a channel is only that I moved the grid from positive x quadrant to negative x quadrant. When the whol gid lies at a position that the x-coordinates are smaller than 0 the outflow works! Maybe this should be reported.

vonboett June 14, 2012 09:11

the strange behavior vanishes when using zeroGradient for p_rgh instead. However I cant explain the coordinate-dependent behavior when using outletValue uniform 0.

giack April 5, 2013 09:38

Hi to all,
I have a problem with the setting of the boundary condition in a similar problem.
My case is summarized as follow:
at the initial time t=0 the right wall of a closed tube completely filled with liquid is removed, allowing the liquid to exit the domain and, at the same time, allowing the gas to enter.
I set the BC in this way:
left wall: "p" zero gradient "U" fixed value (0,0,0) "alpha1" fixed value 1
pipe wall: "p" zero gradient "U" fixed value (0,0,0) "alpha1" zero gradient
right wall (outlet): "p" total pressure "U" pressureInletOutletVelocity "alpha1" inletOutlet
but I obtain unphysical result

Where is the error?Someone have an idea to set BC for this case?
thank to all

vonboett April 5, 2013 10:10

could you post a screenshot of your unphysical results? Maybe with grid resolution (For example in Paraview: surface with edges) as well as timestep and the inletOutlet settings for alpha1 (should be in a way that you get zero gradient for outflow and fixed value 0 for inflow)?

giack April 5, 2013 10:48

3 Attachment(s)
thank you for your reply.
The images that I attached represent the pipe plane of symmetry at the outlet. Figure1 represent the solution after 0,1 s. After 0,5 s the solution remain the same as in figure2.
In both figure there is a strange behavior. The solution should be as show in figure3 and the air should entered into the pipe and not remain confinated only in the first cell.
the grid resolution is very low because, in a first moment, I want only capture the physic of the problem.
the time step is 0,001

vonboett April 9, 2013 07:53

..the pictures show alpha1 right? And earth acceleration g is in -y direction? Timestep is ok. I will try out myself and tell if it looks better.

giack April 9, 2013 08:28

The answer to both question is yes. I try a more refined mesh and the behaviour is as expected but there is still a strange behaviour in the first instants of motion, in particulare till 0,3 s. After this time the solution seems right. I must try a more refined mesh to see if this behaviour disappear

nadine April 11, 2013 10:31

Hello Andrea,

I was wondering if you managed to solve this problem, because I am trying to simulate the same case and I can't find the right boundary conditions.
when fixing a velocity at the inlet and a pressure at the outlet, the code works fine, but I want to simulate a pressure driven filling flow in a tube. I tried every single combination but nothing works.
I hope you can help,
Best Regards,
Nadine


All times are GMT -4. The time now is 15:51.