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/)
-   -   pressure driven flow in interFoam (https://www.cfd-online.com/Forums/openfoam-solving/88141-pressure-driven-flow-interfoam.html)

deniggo May 9, 2011 13:24

pressure driven flow in interFoam
 
Hi,
I'm working on open channel flow using interFoam. A case with fixedValue-BC for U at the inlet and p_rgh fixedValue-BC at outlet is working properly (zeroGradient BC at outlet for U and inlet for p_rgh).

But is it possible to implement a pressure drop by specifying inlet AND outlet pressure fixedValue-BC (channel slope), without a fixedValue-BC for U? Thus, U should be developed corresponding to the pressure gradient.

I tried zeroGradient and pressureInletOutletVelocity for U-inlet and outlet, but the runs failed. Which BC for U would be appropriate for thise case?

Thanks for your help,

Nico

santiagomarquezd May 9, 2011 15:25

What about totalPressure for p_rgh and zeroGradient for U and alpha1 at inlet?

Regards.

deniggo May 11, 2011 08:40

Hi, thanks for your answer,
I tried also totalPressure for inlet and outlet of p_rgh with no success. totalPressure is also set for the top of the channel = atmosphere.
For alpha1, I forgot to mention, I use groovyBC at inlet for time varying waterlevel.
Maybe that's the problem?

Regards.

bmandt June 24, 2011 11:11

Hi,

I have the same problem trying to calc a flooding inside a ship, only with pressure given at the inlet side.

In a personal discussion at another forum, I received this answer (the discussion was in german, I try to translate it):

"
Hydrostatic pressure boundary condition calculated as
pRefValue + rho*g.(x - pRefPoint)
where rho is provided and assumed uniform.
"
for the inlet pressure: "uniformDensityHydrostaticPressure"
the velocity at the inlet: "pressureInletUniformVelocity"
water at the inlet: alpha/gamma = fixedValue; value uniform 1;
at the outlet "zeroGradient"for using Piso


unfortunately the author mentioned piso, not interfoam, but it may be, and I hope this, this information helps you. I was not able to set up an interfoam case with this information, the reason may be, that I am a very beginner at openfoam and cfd...


I hope you will give feedback.


Best regards


Benjamin



bongbongxanh June 25, 2011 08:13

i suggest convert the pressure drop at the boundary condition into a pressure source, i.e. a constant gradient of pressure in the desired flow direction and add it to momentum equation in the solver. the velocity at the boundary can be set at zeroGradient or inletOutlet, the velocity itselft will then be driven by the pressure source and develop over the length of the channel. :)
Hope this idea can help.

nimasam June 25, 2011 15:42

look into channelFoam, you can download channelInterFoam here, but i cant promise its totally true ;)

http://www.4shared.com/file/75DpcP1g...InterFoam.html

Andrea_85 October 11, 2011 06:45

Hi Nico,
Have you found a solution? Have you tried channelFoam? I need to specify a pressure gradient between the inlet and the outlet of my domain and i would like that the flow was driven by this gradient.

Best

andrea

nimasam October 11, 2011 16:59

use a fan boundary condition between outlet and inlet so the pressure gradient* channel length will be the value of pressure jump

Andrea_85 October 12, 2011 03:52

Hi nima and thanks for reply.
I never used fan BC, can you be a bit more specific about how to use them for my case? or can you direct me to some reference or tutorial?

thanks again

andrea

deniggo October 13, 2011 04:51

Hi nimasam,
thanks for your help.
I tried to use fan BC. But I use groovyBC for defining the water level at the inlet. Therefore, cyclic fan BC does not work, because "inout" (cyclic patch of inlet & outlet) can not be defined by groovyBC?!

Nico

nimasam October 13, 2011 05:01

use the funkySetFields to initiate the level of the water at time zero!

deniggo October 13, 2011 06:00

ok! defining water level at time 0 by using setFields works. water level stays constant through the simulation.
thank you very much!

Andrea_85 October 18, 2011 07:28

Hi again,
I understand how to define a "inout" cyclic patch between inlet and outlet. Now my question is which is the correct boundary condition for alpha1 in "inout"?
i have

0/U
inout
{
type cyclic;
value uniform (0 0 0);
}

0/p_rgh
inout
{
type fan;
patchType cyclic;
f List<scalar> 1(1000);
value uniform 0;
}

0/alpha1
inout ??

Can i use the inletOutlet patch? I would like to have fixedValue at the inlet (uniform 1) and something like zeroGradient or inletOutlet at the outlet.

best

andrea

nimasam October 18, 2011 08:07

no you can't , when you use the class cyclic, you can only use cyclic boundary condition or its sub derived class like fan
but the main question is that how ur alpha treats? is it cyclic or not? if it is not cyclic why you are going to use cyclic BC for ur simulation?

Andrea_85 October 18, 2011 08:37

Hi nima,
honestly i'm trying different types of boundary condition to see what is the best choice to reproduce an experiment. In the experiment the flow is driven by a pressure difference between inlet and outlet and I'm loking for something similar in my simulation (at least i would like to not specify the pressure at outlet, because i'm interesting in what happens at the breakthrough and i think fixed pressure BC affects the results). Probably you are right and my alpha1 is not cyclic because i want only phase1 which enters at the inlet and not a mix of the two (which is what flows out at the outlet). the problem remains!
if you have other ideas, of course are welcome.

best

andrea

Mojtaba.a September 13, 2013 04:57

This maybe an old thread, but did you found any solution for this?

nimasam September 13, 2013 08:51

Quote:

Originally Posted by Mojtaba.a (Post 451481)
This maybe an old thread, but did you found any solution for this?

solution for what?

Mojtaba.a September 13, 2013 12:36

Quote:

Originally Posted by nimasam (Post 451529)
solution for what?

To solve for pressure driven flow using interFoam.
I mean the boundary conditions.

I don't know why not typical boundaries converge for this case.

P value must be greater that a specific value (i.e 20000 Pa) to be able to drive the flow. But the one I want it to be is about 1000 Pa. With this lower value I can not converge the solution.

nimasam September 13, 2013 13:21

i have no idea, you may want to setup a simple test case and show this, which may help other OpenFOAM user help you to find out how to solve this problem

Saideep November 13, 2015 07:16

Channel flow bc's at inlet
 
Hi guys;

I would like to revoke this old thread.
For a 1 phase flow, pressure gradient between inlet and outlet works perfectly whereas this is not the case for a 2phase flow in interFoam. Can anyone shed some light over that.

My case:
it is simple channel flow with one phase being invaded by an other phase. My ideal bc's would be is to specify inlet and outlet bcs for pressure and let the velocity develop over the channels flow physically.

I tried this but it doesn't work whereas when i try to invade it by specifying injection velocity at inlet and 0 pressure at outlet i have a flow.

Could anyone who already solved your problem for a similar case help me out with suitable bcs,

Saideep

Andrea_85 November 13, 2015 08:38

The tutorial "capillary rise" of interfoam uses two pressure bc at inlet and outlet, flow is driven by hydrostatic pressure (and capillary forces) and it works fine. If you have only 1 phase at the boundaries i think there is no problem. If you have 2 phases in contact with inlet or outlet then it becomes more tricky.

Best,
Andrea

Saideep November 13, 2015 12:22

2 Attachment(s)
I tried to replicate as close as to capillaryRise case.
It looks to get some shape but still there seems to be some problem.

I used the following bcs: {2D case and no influence of 'g'.}
P_rgh {inlet: 500Pa, outlet:0Pa, fixedWalls: fixedFluxPressure}
U {inlet/ outlet: pressureInletOutletVelocity, fixedWalls: (0 0 0)}
Alpha {inlet: inletOutlet {based on phase number for value}, outlet: zeroGradient, fixedWalls: equilibrium ca of 30}.

Everything looks fine until the drop/ bubble flows out of the channel. Soon there is a change in the phase representation. That is if i have a water drop passing out of the channel the channel is being filled by water and air starts to displacing from the inlet again. See pictures 1 and 2 (successive time steps data with the provided bcs). This looks quite nonphysical. How can water enter the system? Any ideas over this.

Thanks;
Saideep

Andrea_85 November 16, 2015 03:39

Not sure i have understood well your problem. I don't think the 2 pictures are successive time-step since in the first one the water bubble is still far from the boundary. Try to put fixedvalue 0 at inlet for alpha. Which version of OF are you using?

Btw, as i said before, at the breakthorugh you have multiple phases on the outlet boundary and the constant pressure bc might be no longer correct.

best,
andrea

Saideep November 16, 2015 07:35

2 Attachment(s)
Thanks Andrea,

Sorry I was not clear in my previous post. I am using OF2.3.1. In my bcs for alpha i mention alpha(0-> air) injection at inlet and zeroGradient at outlet.

As you mentioned earlier, specifying fixedPressure at outlet {along with the inlet face pressure} seems not a good option. Attached are two time steps with glyphs just to be clear what is happening within the system.
Attachment 43499

Attachment 43500

To adjust pressures at inlet and outlet to fixed values, a pressure gradient developed is causing backward flow possibly.

So, is fixing the inflow at inlet and fixing pressure at outlet only solution?

Saideep

Andrea_85 November 16, 2015 08:34

Can you show also the pressure field of those 2 pictures.
or alternatively, if you provide the test case i can give it a try.

andrea

Saideep November 16, 2015 08:45

1 Attachment(s)
Attached is the test case.

Best;
Saideep

Attachment 43507

Andrea_85 November 16, 2015 09:44

Ok, now i see what is going on.
Your channel is very small (R=2.5 micormeter) and capillary pressure is very large. If you don't provide a pressure force (between inlet and outlet) larger than the capillary force (which points to the negative x-axis after the first meniscus has left the domain) you will have flow from right to left (negative x-axis). Note that when the bubble is full inside the domain, the total capillary force is approximatively zero (if you assume that the 2 menisci are perfect circles) and the bubble moves correctly from left to right.

Just check the forces (after the first meniscus has left the domain).

-capillary force
Fc = gamma*cos(theta)*L = 6e-7 N (L is lenght of the contat line)

-pressure force
Fp = deltaP*A = 1.25e-8 N (A cross-sectional area of the channel)


There's nothing wrong with your simulation:)

Best,
Andrea

Saideep November 18, 2015 08:14

3 Attachment(s)
Thanks for that explanation Andrea.

I just made the case more complex, {plus channel}: instead of fixing pressures at inlet and outlet, I now try to inject at constant rate(water displacing air) and have fixed Pressure at outlets.

In figa, you can see injecting water (left face inlet and all remaining faces are outlets) into the system. In figb, i guess the capillary force that spread out into the top and bottom channels is balanced but there could be capillary force acting normal at the junction point which is acting along the direction of the pressure force.

I am confused of what is causing air to flow into the system from the outlet face on the right side? {figb}

Attachment 43568 Attachment 43569

In figc, as you mentioned there is a two phase outflow and is defining fixed pressure bc a good option? I am just wondering how can water flow inwards from the outlets{top and bottom faces} for this case. I am using pressureInletOutletVelocity which is like a zeroGradient for outlet for U as bc for outlets.
Attachment 43570

Best,
Saideep

Andrea_85 November 18, 2015 08:54

Try using inletOutlet for alpha with inletValue 0 (which is air in your case if i am not wrong) instead of zeroGradient to prevent water coming in from the top and bottom boundary and yes, in my opinion, it is not a good idea fix the pressure on those boundaries. I would fix it on the right boundary where you have only 1 fluid.

Best,
andrea


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