# Rough boundary bottom at OpenFOAM

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

 August 22, 2016, 07:42 Rough boundary bottom at OpenFOAM #1 New Member   Join Date: Aug 2016 Posts: 6 Rep Power: 9 Hello everyone! I want create new boundary condition for OpenFOAM, which provides logarithmic velocity profile at atmospheric boundary layer. In this boundary condition U will depend from height. But I have a trouble with happening when inlet has rough bottom, because in this case I should be able to determine z0 at any point. Are there any tools at OpenFOAM to get z0 for any point at boundary?

 August 22, 2016, 11:07 #2 New Member   Join Date: Aug 2016 Posts: 6 Rep Power: 9 For example, for such inlet boundary. You can see that the bottom of this boundary is rough. I want to consider this fact and make dependency from local height at any point

 August 23, 2016, 05:06 #3 New Member   Patrick Kastner Join Date: Apr 2016 Posts: 10 Rep Power: 10 Hi, if I understand your question correctly, there is a BC which does what you are looking for. atmBoundaryLayerInletVelocity Example: Code: ```ground { type atmBoundaryLayerInletVelocity; n (1 0 0); z (0 0 1); Uref 10.0; Zref 20.0; z0 uniform 0.1; zGround uniform 0.0; }``` Best, Patrick burlyga likes this.

August 23, 2016, 05:55
#4
New Member

Join Date: Aug 2016
Posts: 6
Rep Power: 9
Quote:
 Originally Posted by kostnermo Hi, if I understand your question correctly, there is a BC which does what you are looking for. atmBoundaryLayerInletVelocity Example: Code: ```ground { type atmBoundaryLayerInletVelocity; n (1 0 0); z (0 0 1); Uref 10.0; Zref 20.0; z0 uniform 0.1; zGround uniform 0.0; }``` Best, Patrick
Thank you for you reply, Patrick!

If I understand correctly, atmBoundaryLayerInletVelocity doesn't provide tools to consider rough inlet boundary conditions (look at the picture attached to 2 post). I need to make log U profile incipient from a bootom by z-coordinate at my red inlet boundary everywhere.

Best,

Yury

August 23, 2016, 07:10
#5
New Member

Patrick Kastner
Join Date: Apr 2016
Posts: 10
Rep Power: 10
Hi Yury,

I think I understood what you mean. You would like to specify at your inlet according to the height of the terrain?
You could use groovyBC to specify different equations along the x-axis in negative y-direction, which could be a work-around.

Quote:
 But I have a trouble with happening when inlet has rough bottom, because in this case I should be able to determine z0 at any point.
Thinking about your problem again, do you need to specify/consider at all?
To my knowledge, is a constant to emulate the roughness imposed by a terrain one usually wouldn't consider in the model.
Why would you want to specify a to represent a rough terrain, which you use at the ground level of your domain anyway?

Best,

Patrick

 August 23, 2016, 07:45 #6 New Member   Join Date: Aug 2016 Posts: 6 Rep Power: 9 Dear Patrick, I should be able to work with such cases, as in this image. In this image, red marked inlet. As you can see, height of the terrain here varies quite strongly, so can not be taken as a constant. Therefore, I would like to be able to identify height of the terrain as at each point. Best, Yury Last edited by burlyga; August 23, 2016 at 10:30.

 August 24, 2016, 07:54 #7 Member   gereksiz Join Date: Mar 2015 Posts: 42 Rep Power: 11 I've recently worked on something like that but as burlyga says atmBoundaryLayerInletVelocity is not a proper solution for this kind of problem. Also z_0 is not that height if I'm not terribly wrong, it's something different, simulates ground effects but not huge differences like your case. If I were, I would use a flat surface at the inlet region and put the terrain in the middle of the domain, so that I would able to use atmBoundaryLayerInletVelocity without any problem. Only thing you need to do is merge a flat surface with your terrain. In ayn case if you wanna create a whole new boundary condition, which I think it's wrong, you can modify atmBoundaryLayerInletVelocity and calculate reference height not by location of z coordinates, but distance to the patch. burlyga likes this.

 August 25, 2016, 06:15 #8 New Member   Join Date: Aug 2016 Posts: 6 Rep Power: 9 Thank you for your reply, clktp! I have already written and compiled a new boundary condition. Now I want to modify it for the case, of which I am writing. Could you tell me more about how you can find the distance from the cell to the patch? I think this is what I need. Best, Yury

 August 25, 2016, 09:41 #9 Member   gereksiz Join Date: Mar 2015 Posts: 42 Rep Power: 11 I haven't done it before but I guess you can find a good example for it in the y+ calculation utility. It should be yPlusRANS and yPlusLES. On the other hand I strongly recommend you to check the theory of ABL velocity profile if you don't know very well the subject. What you are doing doesn't sound correct to me, but of course I might be wrong. I haven't studied particularly ABL profile, but used many times. Anyways, just saying. I would be grateful if you share your results. Good luck.

 September 5, 2016, 06:04 #10 New Member   Join Date: Aug 2016 Posts: 6 Rep Power: 9 Hello everyone! Unfortunately, I did not get to determine the distance to a patch to find out the current altitude. I tried using mesh.findCell() and meshSearch class for this, however, the boundary condition at me when it does not work. Maybe someone had to deal with such a task? As in OpenFOAM can be determined for the current point?

 Tags boundaries condition, openfoam 2.4.x, roughness, roughness height