CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] GroovyBC. Distance from patch face center to wall terrain. (https://www.cfd-online.com/Forums/openfoam-community-contributions/143360-groovybc-distance-patch-face-center-wall-terrain.html)

be_inspired October 22, 2014 13:35

GroovyBC. Distance from patch face center to wall terrain.
 
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

gschaider October 22, 2014 15:17

Quote:

Originally Posted by be_inspired (Post 515597)
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


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