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/)
-   -   Low-Re Boundary Conditions for K-omega SST (aerodynamics) (https://www.cfd-online.com/Forums/openfoam-solving/226508-low-re-boundary-conditions-k-omega-sst-aerodynamics.html)

steddy April 29, 2020 10:30

Low-Re Boundary Conditions for K-omega SST (aerodynamics)
 
Hi all,
Noob here, having a simple question.
Let's take the Motorbike tutorial, that is included in OpenFOAM:
Code:

/opt/openfoam7/tutorials/incompressible/simpleFoam/motorBike
How would you modify the files in the '0' folder in order to fully resolve the boundary layer of (both) the motorbike and the floor (Low Reynolds, y+ <= 1)?
I have already seen this post, but it is quite old and I am not sure if it is still valid: https://www.cfd-online.com/Forums/op...m-1-5-dev.html
I will include for your convenience the code of the k, nut, omega, p, U.orig files.

k
Code:

#include        "include/initialConditions"

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform $turbulentKE;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    //- Define inlet conditions
    #include "include/fixedInlet"

    outlet
    {
        type            inletOutlet;
        inletValue      $internalField;
        value          $internalField;
    }

    lowerWall
    {
        type            kqRWallFunction;
        value          $internalField;
    }

    motorBikeGroup
    {
        type            kqRWallFunction;
        value          $internalField;
    }

    #include "include/frontBackUpperPatches"
}

nut
Code:

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    frontAndBack
    {
        type            calculated;
        value          uniform 0;
    }

    inlet
    {
        type            calculated;
        value          uniform 0;
    }

    outlet
    {
        type            calculated;
        value          uniform 0;
    }

    lowerWall
    {
        type            nutkWallFunction;
        value          uniform 0;
    }

    upperWall
    {
        type            calculated;
        value          uniform 0;
    }

    motorBikeGroup
    {
        type            nutkWallFunction;
        value          uniform 0;
    }
}

omega
Code:

#include        "include/initialConditions"

dimensions      [0 0 -1 0 0 0 0];

internalField  uniform $turbulentOmega;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    #include "include/fixedInlet"

    outlet
    {
        type            inletOutlet;
        inletValue      $internalField;
        value          $internalField;
    }

    lowerWall
    {
        type            omegaWallFunction;
        value          $internalField;
    }

    motorBikeGroup
    {
        type            omegaWallFunction;
        value          $internalField;
    }

    #include "include/frontBackUpperPatches"
}

p
Code:

#include        "include/initialConditions"

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform $pressure;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value          $internalField;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    motorBikeGroup
    {
        type            zeroGradient;
    }

    #include "include/frontBackUpperPatches"
}

U.orig
Code:

#include        "include/initialConditions"

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform $flowVelocity;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    #include "include/fixedInlet"

    outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value          $internalField;
    }

    lowerWall
    {
        type            fixedValue;
        value          $internalField;
    }

    motorBikeGroup
    {
        type            noSlip;
    }

    #include "include/frontBackUpperPatches"
}


openfoamer93 April 29, 2020 20:22

I assume that the boundary layer is already refined so that y+<1. If not then try to refine the boundary layer using the command:
refineWallLayer 'patchNmae' 0.5

Then

type omegaWallFunction;
value $internalField;

automatically switches to a low Re in case y+<1 and it resolve the boundary layer without using any wall function and switches to wall function when y+ is large.

No need to modify anything

steddy April 30, 2020 06:04

Bassam, thanks for your answer.

Quote:

I assume that the boundary layer is already refined so that y+<1.
Yes, the average yplus is ~0.04 on the whole surface thanks to tiny layers.

Quote:

No need to modify anything
Do you have any source to back this up; perhaps an OpenFOAM page I didn't read?

openfoamer93 April 30, 2020 23:05

For omega wall function I am sure! You can revise the theory behind this wall function which switch automatically.

However, the k and nut should be:
kLowReWallFunction
nutLowReWallFunction

I just realised that they were not a LowRe

Please revise page 27 from this report that support my claims:
A Thorough Description Of How Wall Functions Are Implemented In OpenFOAM - Chalmers

steddy May 1, 2020 08:39

Thank you very much for your help and time, I will modify accordingly!

openfoamer93 May 2, 2020 17:02

So did it work with you? I tried the approach in another case and compared the results to experiment which was satisfactory

steddy May 3, 2020 06:16

Hi, right now I am trying to replicate in OpenFOAM a Simscale case that investigates the Ahmed body, using the boundary conditions that you suggested. I will get back to you as soon as possible and send you the outcomes when the solver will be done; it will take ~ 1 day because the mesh is pretty fine (18M cells and I am using a server with 8 cores only). Thank you again for your dedication ;)
https://www.simscale.com/projects/gs...ni/ahmed_body/

openfoamer93 May 3, 2020 09:50

Wow 18M :eek: that definitely needs a cluster computer to handle the case. All the best in your simulations!


All times are GMT -4. The time now is 02:30.