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/)
-   -   How to give following BC using GroovyBC (https://www.cfd-online.com/Forums/openfoam-solving/221425-how-give-following-bc-using-groovybc.html)

AshwaniAssam October 16, 2019 07:06

How to give following BC using GroovyBC
 
Hi,


I have to give the following boundary condition for pressure
\frac{dp}{dx} = -\rho\frac{d \phi_g}{dx}


where

\phi_g=x and it is a variable defined in the code.


I coded it like this

Code:

    side0
    {
    type groovyBC;
    gradientExpression "rho0";
        variables "rho0=-rho*snGrad(phig);";
    value uniform -1.0;
    fractionExpression "0";
    }

But it is giving a wrong value. For phi_g = x, gradient value at the boundary should be equal to -\rho but it is giving something different.


All times are GMT -4. The time now is 20:26.