CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Outlet boundary condition in interFoam (https://www.cfd-online.com/Forums/openfoam-solving/95524-outlet-boundary-condition-interfoam.html)

Andrea_85 December 21, 2011 08: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 13:03

fluxCorrectedVelocity ?

doubtsincfd December 30, 2011 02:21

pressureInletOutletVelocity?

Andrea_85 January 1, 2012 09: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 09: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

giack April 11, 2013 10:38

I don't understand what is you problem...you have a deltap between inlet and outlet?in this case try to set a fixedvalue for the pressure and a pressureInletOutletvelocity for U in both boundary

nadine April 11, 2013 10:53

Hello giack,

Thanks for the quick reply,

I want to simulate a filling process, so initially my tube is filled with phase 2 fluid (air), and then it is being filled with phase 1 fluid (liquid aluminium). So there is a hude difference in the density and viscosity values.

When I fix a velocity profile at the inlet and a fixed pressure at the outlet, everythings works fine and I get my poiseuille profile. But now I have to simulate the real problem by fixing a delta p, so I tried to fix a pressure at the inlet and outlet with a inletoutlet condition for the velocity but it's not working.

P.S: when the tube is just filled with one liquid, the simulation runs fine withe the deltap condition, but tracking an interface of the 2 fluids somehow blocks interfoam with a pressure difference condition.

I tried your suggestion and didn't work as well.

Need Help,
Best regards,
Nadine

giack April 11, 2013 11:01

Can you post the geometry of your problem?What are the BC that you set for alpha1?

I suggest to view the tutorials of Hassan Hemida: Free surface tutorial using interFoam and rasInterFoam. It treat about the filling of a bottle

nadine April 11, 2013 11:17

3 Attachment(s)
ok,
I have a cylinder with three boundary (inflow surround and outflow).
For alpha1
inlflow fixedValue uniform 1;
surround zeroGradient;
outflow zeroGradient;

in my old case with a velocity profile at the inlet:
for U
inflow fixedValue uniform (0.5 0 0);
surround fixedValue uniform (0 0 0);
outflow zeroGradient;

for p_rgh
inflow zeroGradient;
surround zeroGradient;
outflow fixedValue uniform 0;

now I want a pressure driven flow, so I tried two dirrichlet condition for p, one dirrichlet one Neuman and vice-versa! nothing worked!!!

thank you for being intrested with my problem.
Sincerly,
Nadine

giack April 11, 2013 11:24

Try to set total pressure instead of fixedValue for inlet and outlet and pressureInletOutletvelocity to U. Also set buoyantPressure for surround.
Your mesh is enough refined?

Andrea_85 April 11, 2013 16:36

Hi,
which is exactly the problem you have with 2 pressure bc? I already succesfully simulated a pressure driven flow with interFoam, i think it should work.

best
andrea

giack April 12, 2013 04:24

Hi,
I have an uncertain about the boundary condition used for U in the outlet patch (pressureInletOutletVelocity). Why this BC is used for atmosphere patch?How work this BC? I read some different position about this BC. For outflow means zeroGradient but for inflow I read different opinion:
-fixedValue
-calculate from pressure
calculate from flux

I'm really confused about this BC...

Thank to all

Andrea_85 April 12, 2013 04:35

HI,
take a look at pressureInletOutletVelocityFvPatchVectorField.H, there is a brief description of the bc. For inflow the velocity is calculated from the flux normal to the patch.

best
andrea

nadine April 16, 2013 10:58

Thank you for all the help,

for info,
I was mistaken, my problem was not related to fixing the boundary conditions but because my initial time step was large, plus I had to lower the max Co to 0.1.
The thing is when changing the boundary condition from a velocity profile to a pressure difference, you should change the controlDict as well so the simulation can run.

thanks again, and I hope that my innocent mistake could help others.
Regards,

sandy13 May 3, 2014 15:31

liquid rebounds at the outlet
 
Quote:

Originally Posted by vonboett (Post 362635)
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.

Dear vonboett,
I am simulating a liquid jet with an inlet and out let BC, using OF 2.1.1. My problem is similar to the other and I I have liquid rebounds and dose not go out of the domain as it should be. when I visualized the results it seems like there is a flow coming in the opposite direction and preventing liquid from going out. Is switching from pimple to piso could be the solution? and which OF version should I use to do so?. Please If you have any solution or suggestion help me... Thanks in advance..
Best wishes,
Sandy

vonboett May 5, 2014 03:43

Hi Sandy,

I by now use pressureInletOutletVelocity together with totalPressure or buoyantPressure. But the OF 2.3 interFoam tutorial "waterChannel" uses inletOutlet togther with fixedFluxPressure for p_rgh, a boundary condition I would like to try.

sandy13 May 5, 2014 06:37

Quote:

Originally Posted by vonboett (Post 489818)
Hi Sandy,

I by now use pressureInletOutletVelocity together with totalPressure or buoyantPressure. But the OF 2.3 interFoam tutorial "waterChannel" uses inletOutlet togther with fixedFluxPressure for p_rgh, a boundary condition I would like to try.

Dear vonboett,
Thanks for your quick replay, I realy appreciate it very much. As I told you I am using OF2.1.1. I will try to use the BC you recommended for U and P_rgh, but what about alpha1 at the out let, Is using zeroGradient good enogh? or you suggest some thing else?. regarding to OF 2.3 interFoam, does it use PIMOLE or PISO? or does not make any difference?.... Thanks in advance
Best Wishes,
Sandy,

vonboett May 5, 2014 07:15

For alpha1 at the outlet I use inletOutlet; inletValue uniform 0; and at the inlet inletOutlet inletValue uniform 1; value uniform 1;

PIMPLE becomes PISO if you set in the fvSolution nOuterCorrectors accordingly such that no iteration takes place. Outer corrections make sense if your fluid viscosity does change like for non-newtonian viscosities or when running turbulence simulations.
"Originally Posted by alberto http://www.cfd-online.com/Forums/ima...s/viewpost.gif PISO simply does not iterate over the equations: it solves alpha, Theta, U, p, k, epsilon and proceeds in time.

PIMPLE is a combination of PISO and SIMPLE. In other words you can have outer correctors, if you set the appropriate keyword in the fvSolution PIMPLE sub-dictionary."



sandy13 May 5, 2014 07:20

Quote:

Originally Posted by sandy13 (Post 489847)
Dear vonboett,
Thanks for your quick replay, I realy appreciate it very much. As I told you I am using OF2.1.1. I will try to use the BC you recommended for U and P_rgh, but what about alpha1 at the out let, Is using zeroGradient good enogh? or you suggest some thing else?. regarding to OF 2.3 interFoam, does it use PIMOLE or PISO? or does not make any difference?.... Thanks in advance
Best Wishes,
Sandy,

Dear vonboett,
I had a go with you suggestion, but it did not run when I used OUTLET P_rgh= type buoyantPressure;
value uniform 0;
I got the error message:
--> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 1e-300
Specified mass inflow : 5.29932e-07
Specified mass outflow : 0
Adjustable mass outflow : 0


From function adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p
in file cfdTools/general/adjustPhi/adjustPhi.C at line 118.

FOAM exiting
Does it mean I wont work? do I have to use another solver?
Best Wishes,
Sandy,

vonboett May 5, 2014 08:30

use type buoyantPressure;
gradient uniform 0;
value uniform 'yourAtmospherePressure';

where 'yourAtmospherePressure' is the pressure above your free surface, and it should match with your pRefValue in case you specified such in fvSolution. Do you have a "atmosphere" boundary condition besides your outlet, or is your outlet the only patch that allows outflow? How did you specify pressureInletOutletVelocity?
Best,

Albrecht

sandy13 May 5, 2014 08:47

1 Attachment(s)
Quote:

Originally Posted by vonboett (Post 489893)
use type buoyantPressure;
gradient uniform 0;
value uniform 'yourAtmospherePressure';

where 'yourAtmospherePressure' is the pressure above your free surface, and it should match with your pRefValue in case you specified such in fvSolution. Do you have a "atmosphere" boundary condition besides your outlet, or is your outlet the only patch that allows outflow? How did you specify pressureInletOutletVelocity?
Best,

Albrecht

Dear vonboett,
Please find bellow attached the geometry of my case, I have a liquid comes from a circular patch(in red color at the top), the lower patch all is outlet and shoud be open to atmosphere(the hole lower floor), and the rest is walls. so my outlet is the only patch allows outflow which is it opened to atmosphere.

vonboett May 6, 2014 06:53

Ok I see, I think you have three possibilities: If your atmospheric pressure is 1000 Pa, try at your lower floor:
p_rgh:
type totalPressure;
rho rho;
psi none;
gamma 1;
p0 uniform 1000;
value uniform 1000;
gradient uniform 0;
value uniform 1000;

alpha1:
inletOutlet; inletValue uniform 0; value uniform 0;

U:
type pressureInletOutletVelocity; value uniform (0 0 0);

or alternativeley try:


p_rgh:
type buoyantPressure;
gradient uniform 0;
value uniform 1000;

alpha1:
type zeroGradient (but inletOutlet with inletValue uniform 0 should work, too);

U:
type inletOutlet ( in case of alpha1 inletOutlet, use pressureInletOutletVelocity);
inletValue uniform (0 0 0)
value uniform (0 0 0)

Since I work with short time frames, the outflow has little influence on my channel flow surface, so I guess in your case any version should work, too. Please let me know if not.

sandy13 May 6, 2014 11:06

Quote:

Originally Posted by vonboett (Post 490089)
Ok I see, I think you have three possibilities: If your atmospheric pressure is 1000 Pa, try at your lower floor:
p_rgh:
type totalPressure;
rho rho;
psi none;
gamma 1;
p0 uniform 1000;
value uniform 1000;
gradient uniform 0;
value uniform 1000;

alpha1:
inletOutlet; inletValue uniform 0; value uniform 0;

U:
type pressureInletOutletVelocity; value uniform (0 0 0);

or alternativeley try:


p_rgh:
type buoyantPressure;
gradient uniform 0;
value uniform 1000;

alpha1:
type zeroGradient (but inletOutlet with inletValue uniform 0 should work, too);

U:
type inletOutlet ( in case of alpha1 inletOutlet, use pressureInletOutletVelocity);
inletValue uniform (0 0 0)
value uniform (0 0 0)

Since I work with short time frames, the outflow has little influence on my channel flow surface, so I guess in your case any version should work, too. Please let me know if not.

Dear vonboett,
Thanks for you help, I will try to test them, but what is the third possibility?
best wishes,
Sandy,

sandy13 May 7, 2014 04:49

Dear vonboett,

Thanks for your help. I tried the options you gave me, the first one worked but I still have the same issue downstream, I got liquid blocked and did not come out of the domain. The other to options did not run at all. Any how I started to think it some thing regarded to the pressure. I am using ambient pressure 1bar(100000 Ps). In OF we use the gauge pressure P_rgh, which is the Ptotal- hydrostatic pressure, and Ptotal is calculated through the solution... is that correct? please correct me If I am wrong. So It seems that the hydrostatic pressure becomes higher the total some how and prevent the liquid from coming out for long domain(long height) because it works perfectly for the shorter one with the same BC.
Best wishes,
Sandy,

vonboett May 15, 2014 10:24

1 Attachment(s)
Hi Sandy,

I made a quick test case with a cind of a "shower" domain like you have, only the inlet is a square box instead of a round plate. I used the settings of version 1 and as you can see (vectors are colored by alpha1) the stuff flows in at the top, through the coarse grid and leaves niceley at the bottom through the outlet. I guess there must be something else a problem. Again, this is done using at the outlet:
for the fluid (alpha1):

outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
pressure p_rgh:
outlet
{
type totalPressure;
rho rho;
psi none;
gamma 1;
p0 uniform 1000.0;
value uniform 1000.0;
}
and U
outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}

for an explanation of p_rgh see http://www.cfd-online.com/Forums/ope...tml#post484311


All times are GMT -4. The time now is 11:06.