CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   interFoam boundary condition with defined phase fraction (https://www.cfd-online.com/Forums/openfoam-pre-processing/203319-interfoam-boundary-condition-defined-phase-fraction.html)

JakobAB June 24, 2018 23:00

interFoam boundary condition with defined phase fraction
 
Hello everybody,

I am trying to simulate the free surface flow from a channel into a lake, but I ran into problems with the correct definition of the boundary condition at the outlet. The inlet is definied at the bottom, so the water then flows over the weir into the lake.




https://image.ibb.co/kww4c8/overview.png

Since the amount of water flowing into the lake is rather small, compared to the size of the lake, the waterlevel of the lake should not increase. For that I set up a codedFixedValue BC for the outlet patch in alpha.water:

scalar h_u = 1.0;

forAll(Cf, faceI)
{
if (Cf[faceI].y() <= h_u)
{
field[faceI] = 1;
}
else
{
field[faceI] = 0;
}
}

With setFields I initialized to the same waterheight. Throughout the simulation, the phasefraction (and thus the level of the water) at the outlet patch is at the same height. So far so good. But within the flow field, the waterlevel slowly but steadily rises. As a consequence, the simulation is becoming instable at the outlet region.


https://image.ibb.co/ec5ajo/closeup1.png

https://image.ibb.co/cfZqH8/closeup2.png


For the pressure at the outlet I use a fixedFluxPressure condition. The velocity inlet is a uniformFixedValue, which is slowly increasing. I feel like I am missing something to archieve the lake-like behaviour of the outlet. Since this is my first case, I might be missing something real basic?

JakobAB July 21, 2018 12:38

Openfoam seems to have problems with setting a specific height to the outlet. This can be bypassed by adding an obstacle close to the outlet, and iteratively testing its height untill the waterheight at the outflow is correct. "Numerical analysis of hydraulic jumps using OpenFOAM" describes the problem really well and explains an alternative way to set the waterheight.


All times are GMT -4. The time now is 00:33.