# GroovyBC. Distance from patch face center to wall terrain.

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

 October 22, 2014, 13:35 GroovyBC. Distance from patch face center to wall terrain. #1 Senior Member   M. Montero Join Date: Mar 2009 Location: Madrid Posts: 112 Rep Power: 8 Hi all, The point is that atmBoundaryLayerInletVelocity uses a zGround variable to impose the logaritmic profile. If the surface is not planar, we could have a problem because Zground is clearly variable. To solve this point I want to use groovyBC. The same mathematical formulation is implemented but I want to use dist() function to calculate the distance the final distance between face center and the terrain. I have used: Code: ```boundaryField { inlet { type groovyBC; variables "wd=dist();"; valueExpression "vector(wd,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(phi > 0) ? 0 : 1"; value uniform (10 0 0);``` But I obtain wd=0 for the inlet patch. Maybe dist() does not see the terrain? The appoach that I would like to follow is to impose the wallDistance of the neighbour cell to the face center. Code: `zDistance=dist();wd=internalField(zDistance)` This also fails. How can I obtain an internalField, zDistance, that I can operate with to obtain wd at the patch? Thank you very much

October 22, 2014, 15:17
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
Quote:
 Originally Posted by be_inspired Hi all, The point is that atmBoundaryLayerInletVelocity uses a zGround variable to impose the logaritmic profile. If the surface is not planar, we could have a problem because Zground is clearly variable. To solve this point I want to use groovyBC. The same mathematical formulation is implemented but I want to use dist() function to calculate the distance the final distance between face center and the terrain. I have used: Code: ```boundaryField { inlet { type groovyBC; variables "wd=dist();"; valueExpression "vector(wd,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(phi > 0) ? 0 : 1"; value uniform (10 0 0);``` But I obtain wd=0 for the inlet patch. Maybe dist() does not see the terrain? The appoach that I would like to follow is to impose the wallDistance of the neighbour cell to the face center. Code: `zDistance=dist();wd=internalField(zDistance)` This also fails. How can I obtain an internalField, zDistance, that I can operate with to obtain wd at the patch? Thank you very much
Not sure but distToPatch (http://sourceforge.net/p/openfoam-ex...amReference.md) might do what you need. For performance reasons I would not use this directly in the BC (unless your terrain changes) but create it in a functionObject at the beginning of the run
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post florian_krause OpenFOAM 108 June 9, 2015 08:13 RandomUser OpenFOAM Meshing & Mesh Conversion 5 March 2, 2015 18:19 nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42 hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

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