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 - inlet profile at complex terrain (https://www.cfd-online.com/Forums/openfoam-community-contributions/175333-groovybc-inlet-profile-complex-terrain.html)

potac July 28, 2016 02:58

groovyBC - inlet profile at complex terrain
 
1 Attachment(s)
I have defined a logarithmic velocity profile at domain over a complex terrain using groovyBC as
Code:

    inlet
    {
        type            groovyBC;
        variables "Uref=$Uref;Zref=$Zref;z0=$z0;kappa=$kappa;Ufr=Uref*kappa/log(Zref/z0);minz=min(pts().z);WD=$WD;";
        valueExpression "vector(Ufr/kappa*log(((pos().z)+z0)/z0)*cos(WD), Ufr/kappa*log(((pos().z)+z0)/z0)*sin(WD), 0)";
        value          uniform (0 0 0);
    }

However in my results, the profile is not relative to the elevation of the bottom edge. In other words my profile does not start from the bottom edge. When I apply this on pitzDaily case with inlet not starting at 0 coordinate, it works fine. What am I missing here? Thanks.

Mitchell Baum December 20, 2016 19:21

1 Attachment(s)
Hi Potac,

I'm experiencing a similar issue where I'm trying to impose a velocity profile at the model inlet in accordance with fitted field data. Ideally, I would like to implement the profile uniformly over the patch, however with the slope of the lower boundary I encounter issues.

Have you made any further progress since your last post?

Kind regards,
Mitchell

Mitchell Baum January 3, 2017 19:18

1 Attachment(s)
Hi Potac,

I am still unsure about how your implementation works in pitzDaily, however I have since achieved my desired inlet BC. My issue was simply resolved by subtracting the slope from my desired velocity profile (7th order Gaussian fit).

Before:
Code:

    Inlet
    {
                type            groovyBC;
                variables        (
                                "a1= 0.1828;"
                                "b1= -21.15;"
                                "c1= 4.2;"
                                "a2= 0.1829;"
                                "b2= -31.27;"
                                "c2= 3.851;"
                                "a3= 0.001014;"
                                "b3= -28;"
                                "c3= 0.02724;"
                                "a4= -0.1166;"
                                "b4= -15.38;"
                                "c4= 2.68;"
                                "a5= 0.04652;"
                                "b5= -10.67;"
                                "c5= 2.141;"
                                "a6= 0.1419;"
                                "b6= -26.29;"
                                "c6= 3.65;"
                                "a7= 0.2606;"
                                "b7= -15.25;"
                                "c7= 3.469;"
                                "zp= pos().z;"
                                "velProfile= (a1*exp(-1*pow(((zp-b1)/c1),2)) +
                                a2*exp(-1*pow(((zp-b2)/c2),2)) +
                                a3*exp(-1*pow(((zp-b3)/c3),2)) +
                                a4*exp(-1*pow(((zp-b4)/c4),2)) +
                                a5*exp(-1*pow(((zp-b5)/c5),2)) +
                                a6*exp(-1*pow(((zp-b6)/c6),2)) +
                                a7*exp(-1*pow(((zp-b7)/c7),2)));"
                                        );
                valueExpression "-1*velProfile*normal()";
                value          uniform (0 0.151 0);
    }

After:
Code:

    Inlet
    {
                type            groovyBC;
                variables        (
                                "a1= 12.5;"
                                "b1= -31.83;"
                                "c1= 9.766;"
                                "a2= -12.26;"
                                "b2= -31.87;"
                                "c2= 9.601;"
                                "a3= 0.004232;"
                                "b3= -26.65;"
                                "c3= 0.3996;"
                                "a4= -1.862;"
                                "b4= -14.29;"
                                "c4= 3.392;"
                                "a5= 1.95;"
                                "b5= -14.27;"
                                "c5= 3.458;"
                                "a6= -0.1094;"
                                "b6= -25.46;"
                                "c6= 5.007;"
                                "a7= 0;"
                                "b7= -17.9;"
                                "c7= 0.01037;"
                                "zp= pos().z;"
                                "xp= pos().x;"
                                "slopeEq= 0.01543*xp -1.04256;"
                                "velProfile= (a1*exp(-1*pow(((zp-slopeEq-                    b1)/c1),2)) +
                                a2*exp(-1*pow(((zp-slopeEq-b2)/c2),2)) +
                                a3*exp(-1*pow(((zp-slopeEq-b3)/c3),2)) +
                                a4*exp(-1*pow(((zp-slopeEq-b4)/c4),2)) +
                                a5*exp(-1*pow(((zp-slopeEq-b5)/c5),2)) +
                                a6*exp(-1*pow(((zp-slopeEq-b6)/c6),2)) +
                                a7*exp(-1*pow(((zp-slopeEq-b7)/c7),2)));"
                                        );
                valueExpression "-1*velProfile*normal()";
                value          uniform (0 0.151 0);
    }

If you have not yet reached a solution, perhaps you could apply a similar method and fit a curve to match your terrain and execute a similar process?

Kind regards,
Mitchell


All times are GMT -4. The time now is 00:16.