# Boundary Condtions for Open Channel Flow with interFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 23, 2017, 05:25 Boundary Condtions for Open Channel Flow with interFoam #1 New Member   Livia Adinolfi Join Date: May 2017 Posts: 14 Rep Power: 4 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.

 August 29, 2017, 10:20 #2 Senior Member   Paulo Vatavuk Join Date: Mar 2009 Location: Campinas, Brasil Posts: 188 Rep Power: 13 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 tonnykz and liviaadi like this.

 August 31, 2017, 07:37 #3 New Member   Livia Adinolfi Join Date: May 2017 Posts: 14 Rep Power: 4 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.

 August 31, 2017, 10:50 #4 Senior Member   Paulo Vatavuk Join Date: Mar 2009 Location: Campinas, Brasil Posts: 188 Rep Power: 13 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

 September 1, 2017, 07:11 #5 New Member   Livia Adinolfi Join Date: May 2017 Posts: 14 Rep Power: 4 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.

 September 1, 2017, 07:56 #6 Senior Member   Paulo Vatavuk Join Date: Mar 2009 Location: Campinas, Brasil Posts: 188 Rep Power: 13 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...UplTWx1M3RpWVk 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

 September 1, 2017, 09:25 #7 New Member   Livia Adinolfi Join Date: May 2017 Posts: 14 Rep Power: 4 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 !

 September 18, 2017, 03:45 #8 New Member   Join Date: Aug 2017 Location: Milan Area, Italy Posts: 10 Rep Power: 4 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.

 March 11, 2020, 15:13 #9 New Member   Muhammad Kashif Jawad Join Date: Oct 2019 Location: Pakistan Posts: 14 Rep Power: 2 hi i want to know when to use variableHeightFlowRateInletVelocity?