Friday, July 17, 2015

Power law velocity profile given average velocity with groovyBC or swak4FOAM

Power law velocity profile given average velocity with groovyBC or swak4FOAM for use in OpenFOAM


circular pipe aligned in the x-dir

   inlet
    {

    type    groovyBC;
      value   uniform (1 0 0);
      variables (
        "Uavg=1;"

        "r=sqrt(pos().y*pos().y+pos().z*pos().z);"
        "R=(max(pts().y)-min(pts().y))/2;"
        "Re=Uavg*R*2/nu;"
        "n=-1.7+1.8*log10(Re);"
        "Uc=Uavg*(n+1)*(2*n+1)/(2*pow(n,2));"
        );
      valueExpression "-Uc*pow((1-r/R),1/n)*normal()";
}

in controlDict

libs (
    "libsimpleFunctionObjects.so"
    "libsimpleSwakFunctionObjects.so"      
    "libswakFunctionObjects.so"
    "libgroovyBC.so"
);


see https://openfoamwiki.net/index.php/Contrib/groovyBC#Download

No comments:

Post a Comment