CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   mixed boundary condition with GroovyBC (https://www.cfd-online.com/Forums/openfoam-solving/221302-mixed-boundary-condition-groovybc.html)

Pavithra October 11, 2019 09:19

mixed boundary condition with GroovyBC
 
Hello Everyone,

I want to implement the following boundary condition on a horizontal wall.

Normal component of velocity

u_y = 0


Tangential component of velocity

\frac{du_x}{dy} = 3u_x

I have tried to use groovyBC as follows:

Code:

    floor
    {
        type                        groovyBC;
        valueExpression        0;
        gradientExpression    3.0*U.component(0);
        value                        uniform (0 1 0);   
    }

But, I am unsuccessful.

1) How can we differentiate tangential and normal components of velocity as we do in directionMixed boundary condition.

2) I want to use value '0' for normal component of velocity and 'gradientExpression' for tangential component of velocity.

Kindly please give me some directions to implement this boundary condition.

Thank You.

With Thanks
Pavithra.

gschaider October 15, 2019 16:39

Quote:

Originally Posted by Pavithra (Post 746827)
Hello Everyone,

I want to implement the following boundary condition on a horizontal wall.

Normal component of velocity

u_y = 0


Tangential component of velocity

\frac{du_x}{dy} = 3u_x

I have tried to use groovyBC as follows:

Code:

    floor
    {
        type                        groovyBC;
        valueExpression        0;
        gradientExpression    3.0*U.component(0);
        value                        uniform (0 1 0);   
    }

But, I am unsuccessful.

1) How can we differentiate tangential and normal components of velocity as we do in directionMixed boundary condition.

2) I want to use value '0' for normal component of velocity and 'gradientExpression' for tangential component of velocity.

Kindly please give me some directions to implement this boundary condition.

Thank You.

With Thanks
Pavithra.


In the same library as groovyBC there is a boundary condition groovyBCDirection that is based on directionMixed

Pavithra October 19, 2019 08:13

Quote:

Originally Posted by gschaider (Post 747127)
In the same library as groovyBC there is a boundary condition groovyBCDirection that is based on directionMixed


Respected Sir,

Thank you so much for your guidance. I was able to achieve my requirement using groovyBCDirection.

Following is what I have done. (May be useful for someone else in future)

Code:

floor
    {
        type                            groovyBCDirection;
        valueFraction              uniform (0 0 0 1 0 0);
        gradientExpression        "vector((3.0*Ux),0,0)";
        valueExpression            "vector(0,0,0)";
    }

The normal vector to my wall is n = (0 ~1 ~0). Hence, n*n = (0~ 0~ 0 ~1 ~0 ~0). To set the normal component to fixed value and two tangential components to fixed gradients valueFraction = n*n = (0 ~0 ~0 ~1 ~0 ~0).

I have defined Ux=U.component(vector::X); somewhere inside my solver code.

I was not able to directly use U.component(vector::X) inside the gradient expression. Hence, I defined it as a scalarField and then used it in the boundary condition.

@gschaider Sir, Kindly please let me know if I have made any mistake.

Thank you once again for your kind help.

With Thanks,
Pavithra.


All times are GMT -4. The time now is 07:50.