CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Tank emptying (https://www.cfd-online.com/Forums/openfoam/107485-tank-emptying.html)

 Andrea1984 September 28, 2012 07:52

Tank emptying

Hi,

I'm trying to simulate the emptying of a tank with OF.
As I'm a newbie in OF, i have some doubt about the BCs.

The tank is 25x25 cm and has an height of 7 cm; the water height is equal to 5 cm and is drained through an hole at its bottom (d=1.3 cm).

The top of the tank is opened to atmosphere.

My doubt are about the boundary conditions for pressure and alpha1.

For the pressure I'm thinking to use a TotalPressure bc at the top (the same used in the DamBreak tutorial), zeroGradient at the outlet and zeroGradient at the wall (or should I use buoyantPressure for the walls?)

For alpha1 I want to use 0 for the top (only air), 1 for the outlet (only water) and zeroGradient at the walls.

Are this settings right?

Andrea

 SirWombat September 29, 2012 04:35

i suggest totalPressure for pressure at the outlet. make the water flow out to the atmospheric pressure (probably 0 if you haven't defined it) or use fixedValue = 0. you can use pressureInletOutletVelocity for the velocity at the outlet

 nsf September 30, 2012 04:38

Hi,

I would set inletOutlet on alpha1 on the outlet. If you on some point get a vortex which transports air out through the outlet you'll get into trouble if you prescribe a fixedValue.

Good luck!

 Sam-CFD October 1, 2012 07:16

problem with total pressure = 0

On a sample problem, I've tried the same boundary condition on the bottom outlet as top atmosphere; which effectively means,

p_rgh (p - rho*g*h) being totalPressure

U being pressureInletOutletVelocity

alpha1 being inletOutlet

When I compare it to the analytical expression for the outlet flow rate and velocity {i.e., sqrt(2*g*h)}, the OpenFOAM results are around 1/3rd this value.

I performed the simulation in ANSYS FLUENT with Pressure Inlet (total gauge pressure = 0) and Pressure Outlet (static pressure outlet = 0) and the results seem to be acceptable to the analytical expression with some slight reduction due to viscous and other losses.

So, I am not quite sure if the boundary conditions suggested above are really correct?!

Any comments from others who have experience?

Thanks and regards,

Sam

 nsf October 1, 2012 13:15

Hi,

Have a look in
Code:

` ...tutorials/multiphase/interFoam/ras/waterChannel`
In the tutorial, they set buoyantPressure for p_rgh on all patches except the atmospheric patch. Where the set totalPressure.

For U on the outlet it's inletOutlet.

They do set zeroGradient on alpha at the outlet. Which I think is fine unless there is any risk of reversed flow. In that case I would use inletOutlet.

Let us know how it goes!

/Nicolas

 SirWombat October 2, 2012 04:18

Quote:
 Originally Posted by Sam-CFD (Post 384331) When I compare it to the analytical expression for the outlet flow rate and velocity {i.e., sqrt(2*g*h)}, the OpenFOAM results are around 1/3rd this value. Sam
When, how and where did you measure the velocity of the outflow? If no water is flowing into the tank then the velocity is a function of the height of the remaining waterlevel ... did you take this into account?

 Andrea1984 October 2, 2012 08:09

1 Attachment(s)
I have a fixed value for the flow rate at the outlet so I'm using a fixedValue for the velocity and zeroGradient for the pressure.

I think my problem is with the BCs at the wall, as I obtain a strange velocity field at the wall proximity using buoyantPressure (see attached picture, U contour at free surface).

 Sam-CFD October 3, 2012 02:11

I want to obtain the velocity at the outlet from the simulation and compare it with the analytical solution.
v = sqrt(2*g*h)
where, h = height of the liquid presently in the column.
Unlike Andrea's case, my problem involves a tank draining under gravity; therefore, I have to have a boundary condition on the outlet similar to static pressure = 0 (in ANSYS FLUENT).

I am expecting backflow at the outlet and gas to ingest into the domain. Primarily the aim is to verify whether, vortex from the top free-surface enters into the outlet.

Regards,
Sam

Quote:
 Originally Posted by SirWombat (Post 384468) When, how and where did you measure the velocity of the outflow? If no water is flowing into the tank then the velocity is a function of the height of the remaining waterlevel ... did you take this into account?

 giack April 5, 2013 09:29

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

 nsf April 5, 2013 12:43

Hi giack,

I once hade a problem with interFoam where alpha was unphysically diffused through the walls. This was resolved (for Of 2.1) by setting
Code:

```    walls     {         type            buoyantPressure;         gradient        uniform 0;         value          uniform 0;     }```
on the wall patches. I think you should have zeroGradient on alpha on the left wall as well.

So for the patches that are walls (left and pipe) you should have the same bc's and they should be
velocity: fixedValue (0 0 0)
p_rgh: buoyantPressure (as above)