# Channel flow using InterFOAM

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

 April 11, 2013, 09:28 #21 Senior Member   Albrecht vBoetticher Join Date: Aug 2010 Location: Zürich, Swizerland Posts: 234 Rep Power: 15 If you know the downstream water level and want to use it as a boundary constraint, a good approach is the setup of kflora in Setting BCs for Riverine Flows using Interfoam. If you want the outflow flow depth be dependent on your simulation, you can use U: pressureInletOutletVelocity and p_rgh: totalPressure at the outlet because that even allows to have inflow at the outlet if the local pressure field demands it. So this BC is self stabilizing and rise or fall of surface do not occur even in long time runs.

 April 12, 2013, 08:01 #22 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Hi! I did what you told me: "U: pressureInletOutletVelocity and p_rgh: totalPressure at the outlet" and this happens: https://dl.dropboxusercontent.com/u/...ier9abril3.avi The problem in the outlet is the same. Do you have any suggestion? Perphaps the problem isn't in the BC of outlet?

 April 16, 2013, 16:10 #23 Senior Member   Albrecht vBoetticher Join Date: Aug 2010 Location: Zürich, Swizerland Posts: 234 Rep Power: 15 could you tell what values you used for U and p_rgh at the outlet? Upper left in the video shows the free surface with colours representing velocity? Please give aswell your viscosity value and courant number. Is the flow height getting zero at the outlet? U performs with zero gradient at the outlet which makes sense, but the (too high?) acceleration towards the outlet might be due to too high g or due to too small viscosity. Do jou have a no-slip boundary condition for U at the slope?

 April 19, 2013, 13:32 #24 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Hi again! I already solved the problem... it was a bad definition in the mesh (outlet). but now there is another problem. it seems to be in the inlet. see the video please: http://www.youtube.com/watch?v=G_dtw...yer_detailpage how i should define the inlet? i dont want that wave... see this: http://d.pr/i/yhog Best regards.

 April 22, 2013, 05:35 #25 Senior Member   Albrecht vBoetticher Join Date: Aug 2010 Location: Zürich, Swizerland Posts: 234 Rep Power: 15 ...I guess you have a noSlip boundary condition at the sidewalls which conflicts a bit with your fixed value inlet. I suggest a short block with full slip boundary conditions between your inlet and the channel simulation, that allows a velocity profile to develop over a certain distance. And for turbulence modelling it might make sense to grade the mesh such that you get finer mesh resolutions close to the walls, especially if you want to switch to LES or hybrid URANS/LES (I recommend LeMoS openFOAM extensions for this) sail and pedroxramos like this.

 April 23, 2013, 06:57 #26 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Hello Albrecht!Thanks for your help. I'm doing a simulation of the flow on a sand bed with glass sidewalls. Does it make sense impose slip condition on sidewalls? Or should I only put that condition on the smaller block? Can I use swak4foam like an alternative? Best regards.

 April 24, 2013, 05:35 #27 Senior Member   Albrecht vBoetticher Join Date: Aug 2010 Location: Zürich, Swizerland Posts: 234 Rep Power: 15 Hi Pedro, I would apply the slip only at your 'artificial' inlet block. Your setup works because with water the shear gradient can be high enough to allow you to feed a constant inlet velocity at the inlet patch of an inlet cell while demanding a zero velocity on the side or ground patch of the same cell, since finite Volumes solves for the values in the cell centers. I used to model debris flows and that made me use theese inlet blocks that have the inlet patch on one side and full slip patches on all other boundaries. If you want to include the erosion and deposition of the sand behind your pile, I recommend CFDEM-LIGGGHTS like it was used here: http://web678.public1.linz.at/media/...flow_small.pdf pedroxramos likes this.

 April 24, 2013, 07:59 #28 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Can the mesh in the artigivial inlet block be with less quality (bigger cells) than the other zones?

 April 26, 2013, 06:21 #29 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Hi again! Thanks for your help! I did what you told but the problem is still there: http://www.youtube.com/watch?feature...&v=-LEeX9pFk3Y What you think? Regards.

 April 26, 2013, 23:29 #30 Senior Member     Jose Rey Join Date: Oct 2012 Posts: 134 Rep Power: 16 I've seen examples (old Comsol model laminar flow as I remember) in which the flow at the inlet is set as a fully developed parabolic flow with the purpose of not getting it to develop on your computational domain. I don't know if in your case that would solve the problem. Are others (tutorials) using a function and not just a fixed value at inlets? Last edited by JR22; April 29, 2013 at 23:13.

May 7, 2013, 10:46
#31
Senior Member

Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 234
Rep Power: 15
Quote:
 Originally Posted by JR22 I've seen examples (old Comsol model laminar flow as I remember) in which the flow at the inlet is set as a fully developed parabolic flow with the purpose of not getting it to develop on your computational domain. I don't know if in your case that would solve the problem. Are others (tutorials) using a function and not just a fixed value at inlets?
LeMoS at the University Rostock provides an inflow generator for OpenFOAM:
"an inflow generator for synthesis of turbulent fields with prescribed second order statistics using turbulent spot method"

Parabolic profiles can be done with groovyBC

May 24, 2013, 06:59
#32
Senior Member

Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 234
Rep Power: 15
Quote:
 Originally Posted by vonboett If you know the downstream water level and want to use it as a boundary constraint, a good approach is the setup of kflora in Setting BCs for Riverine Flows using Interfoam. If you want the outflow flow depth be dependent on your simulation, you can use U: pressureInletOutletVelocity and p_rgh: totalPressure at the outlet because that even allows to have inflow at the outlet if the local pressure field demands it. So this BC is self stabilizing and rise or fall of surface do not occur even in long time runs.
Actually, I was imprecise, pressureInletOutletVelocity together with totalPressure is flux controlled, it is the flux not the local pressure allowing to turn from outflow to inflow.

 June 1, 2013, 12:41 considering roughness in channel #33 New Member   ali naqi mohammadi Join Date: Dec 2012 Posts: 6 Rep Power: 11 hi i want to model same case, critical depth in outlet and flow rate for inflow it doesn't work! on other hand, i should consider problem of roughness obtaining Ks by n'manning. may you help me a bit? thanks Last edited by ali naqi; June 6, 2013 at 10:27.

November 6, 2013, 06:29
Critical inlet & subcritical outlet to force a hydraulic jump
#34
New Member

Arnau
Join Date: Jan 2012
Posts: 17
Rep Power: 12
Hi everyone,

Thank you very much for your helpful contributions. I am trying to simulate a similar case, the only difference is that I want to force a hydraulic jump, so the water level imposed at the outlet is significantly higher than that at the inlet (the problem is better explained in the attached scheme). I have tried a lot of combinations of boundary conditions but none of them worked so far.

As it is not exactly the same case your are dealing with I started a new thread: http://www.cfd-online.com/Forums/ope...tml#post460707

Any ideas?

Thanks,

Arnau.
Attached Files
 Hydraulic Jump Scheme.pdf (27.9 KB, 126 views)

March 17, 2014, 22:44
#35
New Member

Youngkook Kim
Join Date: Jul 2013
Location: Singapore and South Korea
Posts: 20
Rep Power: 11
Quote:
 Originally Posted by mgdenno Kevin, I experienced the problem you describe regarding the water level going up or down at the inlet if the internal velocity was not just right. I have had reasonable success dealing with this by breaking the "inlet" face into two separate patches that I name "inlet" and "aboveInlet" with the top edge of "inlet" patch near the expected water surface elevation. I then set alpha1 = 1 for the "inlet" patch and alpha1 = 0 for "aboveInlet" patch. This is not perfect but is the best I have found so far. I understand that with swak4Foam you can set the height of alpha1 = 1 to be at a specific elevation. I am planning to try this soon, but haven't had a chance to yet. MD
Hi Matthew,

I have some problem that the free surface level is decreasing. And I'm trying what you suggested but the calculation clashes. When I use one patch at the inlet, everything was okay except the free surface level. But after split the inlet patch for water and air, calculation clashes within 30min. I didn't change anything except the inlet patch and inlet boundary conditions. Do you have this experience or know why it happens?

And another question is what you mean by 'setting alpha1=1 for the inlet and 0 for aboveInlet' is setting the fixedValue at the boundary condition of alpha?

March 19, 2014, 10:14
#36
Senior Member

Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 14
Quote:
 Originally Posted by totalart Hi Matthew, I have some problem that the free surface level is decreasing. And I'm trying what you suggested but the calculation clashes. When I use one patch at the inlet, everything was okay except the free surface level. But after split the inlet patch for water and air, calculation clashes within 30min. I didn't change anything except the inlet patch and inlet boundary conditions. Do you have this experience or know why it happens? And another question is what you mean by setting alpha1=1 for the inlet and 0 for aboveInlet' is setting the fixedValue at the boundary condition of alpha?
Hi,

To answer your second question first, yes I was referring to setting the alpha1 value using a fixedValue boundary condition.

Regarding the free surface level decreasing, without knowing anything about your case, I would guess that it may have more to do with your outlet boundary condition than your inlet boundary. If you have a zeroGradient outlet boundary, there is nothing to "hold" the water level up at the initial level, and it may drop. Did you initialize the velocity field using setFields? Depending on your case this may help the free surface stay at the initial level. If you post more information about your case, I (or someone else) may be able to provide more specific thoughts.

What version of OF are you using? Recent versions have some channel flow (waterChannel and weirFlow) examples in the tutorials that may be helpful, and there are also some new inlet boundaries for two phase flow, that I think are used in the tutorials too.

Matt

 April 23, 2014, 08:51 #37 New Member   Youngkook Kim Join Date: Jul 2013 Location: Singapore and South Korea Posts: 20 Rep Power: 11 Hi Matt, I am late for your reply. I didn't notice. Yes you're right. I realised the problem is related to the outlet condition which affects continuity. When I set the same velocity at the outlet, the problem was resolved. But this is not applicable for all the cases. I was using OF2.1 and I've recently installed OF2.3. I found some useful tutorials and I'm improving my case based on them. Thank you! Youngkook

June 13, 2015, 15:50
#38
Senior Member

Ehsan Asgari
Join Date: Apr 2010
Posts: 471
Rep Power: 16
Quote:
 Originally Posted by vonboett LeMoS at the University Rostock provides an inflow generator for OpenFOAM: "an inflow generator for synthesis of turbulent fields with prescribed second order statistics using turbulent spot method" Parabolic profiles can be done with groovyBC
Dear Albrecht,

How is it possible to implement both LeMOS inflow generator and groovy BC simultaneously? I need too apply a boundary layer velocity profile at inlet, on the other hand, I need to implement LeMOS to generate fluctuations at the inlet.
But I do not have any idea how to implement them both at the same time. Could you provide me a brief example??

Regards.

 May 24, 2016, 09:59 Salome #39 New Member   Yash Lakhani Join Date: May 2016 Posts: 2 Rep Power: 0 Can anyone tell me how to create the mesh for open channel flow with air above it. The channel is 0.4 m wide 0.6 m depth and 9 m length. The water is flowing into the channel upto the depth of 0.089m. I want my mesh to be cubic i.e. the channel should be composed of cubic boxes i.e. more no. of elements along the depth and the length as compared to the width. Any help will be great. Thanks in advance.

 June 11, 2016, 05:53 #40 Member   Pedro Ramos Join Date: Mar 2012 Location: Belgium Posts: 81 Rep Power: 12 Try swak4Foam