CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Boundary Condtions for Open Channel Flow with interFoam (https://www.cfd-online.com/Forums/openfoam/191881-boundary-condtions-open-channel-flow-interfoam.html)

liviaadi August 23, 2017 05:25

Boundary Condtions for Open Channel Flow with interFoam
 
Dear Foamers,

I am a begginer of CFD and OF. I am trying to simulate very simple cases.
Now I am struggling with an open flow channel, using interFoam.
I would like to specify a BC at the inlet for p_rgh in order to have an hydrostatic distribution. I found the option phaseHydrostaticPressure but I was not able to make it works and I didn't find examples of this.
I was wondering if someone used it or if someone knows a different approach.
Many thanks for your help.

vatavuk August 29, 2017 10:20

Hi Livia,

You don't need to specify a hydrostatic distribution. The variable p_rgh is pressure minus the hydrostatic pressure. So p_rgh is the non hydrostatic part of the pressure.
If you study the tutorials you will notice that the boundary condition fixedFluxPressure is used for all surfaces except for the atmosphere that uses totalPressure boundary condition.

Best Regards,
Paulo

liviaadi August 31, 2017 07:37

Dear Paulo,

many thanks for your answer. I really appreciate.

I was a bit confused about p_rgh.
I understand that it is the pressure related to the velocity.

My problem is that I would like to start the flow with a water level at the inlet which means a static pressure as boundary condition.
For what I am understanding this is not possible, or it is uncommon. According to the definition of p_rgh the condition that I had in mind to define should be:

inlet
{

type fixedValue;
value uniform 0;

}

Is this correct ?

Even though it seems that the best way to define BC at the inlet is to fix the velocity field rather then the pressure. This is the reason why I was trying the BC variableHeightFlowRateInletVelocity. It seems to work quite well.

Many thanks for your help.

vatavuk August 31, 2017 10:50

Hi Livia,

I'm not sure when the fixedValue condition should be used. If you look at the tutorials for interFoam you will notice that, at inlet surfaces, three conditions are used for p_rgh: zeroGradient, fixedFluxPressure and fixedValue. The zeroGradient condition can result in convergence problems so it's better not to use it.

To obtain a constant water level at the inlet you could prepare your simulation like it's done in the spillway tutorial that you can find at: https://www.hpc.ntnu.no/display/hpc/...llway+Tutorial

This tutorial is a bit old. You will need to make some adaptations to run it with newer versions of openFOAM.

Best Regards,
Paulo

liviaadi September 1, 2017 07:11

Dear Paulo,

thanks again.
I was actually studying this tutorial, because this is exactly what I have to simulate for my dissertation.
The problem is that I am trying to understand the different types of BC, to set the correct ones. To this purpose I am exploring a number of cases and I want to compare them with analytical solutions.

Thanks a lot for your help, it is precious.

vatavuk September 1, 2017 07:56

Hi Livia,

In the 11th Openfoam Workshop there was a tutorial about interFoam and boundary conditions. You may find this tutorial at: https://drive.google.com/drive/folde...eg&usp=sharing

I'm an assistant professor at the University of Campinas, Brasil, and I'm supervising a group of graduate students that are working in the application of CFD in hydraulic structures. We are interested studying possible limitations in the use of CFD in free surface flows, applied to hydraulic applications. I would be interested in knowing more about your work.

Best Regards,
Paulo


Quick Moderator note: Link has been updated. For future reference, please refer to the archive website and look for "Learning how to use free surface flows in OpenFOAM 3.0" here: http://openfoam-extend.sourceforge.n...s/courses.html

liviaadi September 1, 2017 09:25

Dear Paulo,

thanks a lot.
I am an italian PhD student at Strathclyde University (Glasgow). My hydraulic background I have to say it's not great, since I come from a Structural and Geotechnical Engineering Department. Now I am studying the erosion processes on earth-made embankments (fine grain geomaterials) during overflowing and overtopping. I want to perform a CFD analysis to obtain the shear stresses distributions along the downward slope.

This is the reason why |I have to understan how to set the problem, mainly the boundary conditions. Now I have to start introducing the turbulence properties. Actually I am quite desperate, because I am doing these only for few months and I am not able to understand this BC.

Thanks a lot for your help and I hope that we can share our findings !

Teosim September 18, 2017 03:45

When I simulate over-weir flow I often use a variableHeightFlowRateInletVelocity for U and a zeroGradient for p_rgh at the inlet. I know some may argue with zeroGradient inlet BC but so far it worked well for me.

You could refer to the interFoam weirOverflow tutorial for a quick view.

Please let us know if you find a better setup.

mkjmalik March 11, 2020 15:13

hi

i want to know when to use variableHeightFlowRateInletVelocity?

GrivalszkiP January 22, 2021 07:20

river simulation
 
Quote:

Originally Posted by vatavuk (Post 662736)
Hi Livia,

In the 11th Openfoam Workshop there was a tutorial about interFoam and boundary conditions. You may find this tutorial at: https://drive.google.com/drive/folde...eg&usp=sharing

I'm an assistant professor at the University of Campinas, Brasil, and I'm supervising a group of graduate students that are working in the application of CFD in hydraulic structures. We are interested studying possible limitations in the use of CFD in free surface flows, applied to hydraulic applications. I would be interested in knowing more about your work.

Best Regards,
Paulo


Quick Moderator note: Link has been updated. For future reference, please refer to the archive website and look for "Learning how to use free surface flows in OpenFOAM 3.0" here: http://openfoam-extend.sourceforge.n...s/courses.html

Hi Paulo!

This tutorial is really usefull, thank you very much!

However, I have problems with my setup: I want to simulate a fictitious river (2 km long, 300m wide with 1cm/km slope). I have a rectangular mesh with dx=dy=5m, dz=1m. The discharge is 2000 m3/s, for this, I have 5 m downstream water level (so the average velocity is 1,3334 m/s). If I use the suggested BCs from this workshop, water flows out the domain faster than it arrives. Somehow I have to fix the outlet water level. I have already tried everything I found information about, none of them worked correctly.

I need this dummy river model in order to make sure that the estimated velocity profiles and the free surface slope is calculated correctly. I tried plenty of setups without success. In the future I want to place structures in this river to analyze their effects on free surface and velocities.

Do you have any suggestions?

Thank you, in advance!

Peter

vatavuk January 22, 2021 09:10

Hi Peter,

The tutorial recommends the zeroGradient boundary condition for U. It seems to me that this boundary condition will make the flow critical (Froude = 1) at the outlet.

To have a fixed depth at the outlet, you can try the fixedValue boundary condition for U. The idea is that, since you have a constant inlet flow rate Q, using a constant velocity at the outlet will result in a constant area of liquid at the outlet, because Q=V.A. So you have to choose the value of the velocity V, to have an area A=Q/V, that corresponds to the depth that you want.

Using this boundary condition for U, you must be careful with the outlet boundary condition for p_rgh. The tutorial recommends the use of the fixedFluxPressure, but I’ve seen a case in which this condition crashes the simulation after a few seconds. The problem was resolved using the zeroGradient condition for p_rgh at the outlet.

I hope this helps. Please tell me if this solution works, I'm curious about it.

Best regards,
Paulo


All times are GMT -4. The time now is 13:26.