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/)
-   -   Incomp. LES in pisoFOAM, how to set up Smagorinsky model with van Driest dampin (https://www.cfd-online.com/Forums/openfoam-solving/97860-incomp-les-pisofoam-how-set-up-smagorinsky-model-van-driest-dampin.html)

Jan.Östh February 27, 2012 11:27

Incomp. LES in pisoFOAM, how to set up Smagorinsky model with van Driest dampin
 
Hi all

Im new to OpenFOAM and I'm using v2.1.0 release. My question is regarding the Smagorinsky model implemented in this release. I used the motorBike tutorial to set up an incompressible LES simulation, and to use the Smagorinsky model I specify this in the LESProperties file. So far so good, I get the simulation to run as I anticipated. However, I'm not sure if van Driest damping is incorporated in the standard implementation of the standard Smagorinsky model? From what I have managed to figure out from the file Smagorinsky.H which is located in :

$OpenFOAM_Installation_dir/OpenFOAM-2.1.x/src/turbulenceModels/incompressible/LES/Smagorinsky

it seems to me van Driest damping is not included. My question is, how do I specify that I would like to use the van Driest damping? Right now, for the boundary conditions for nuSgs I have the Spalding wall function specified on my no-slip boundaries.

Cheers

alberto February 28, 2012 04:08

Set

delta vanDriest;

into LESProperties.

Jan.Östh February 29, 2012 08:30

Quote:

Originally Posted by alberto (Post 346596)
Set

delta vanDriest;

into LESProperties.

Thanks! I also saw your recommendation to use pimpleFoam instead of pisoFoam in another thread. I will try that out...

/Jan

Jan.Östh March 2, 2012 08:41

Hmm, I get an error when I try to activate the van Driest damping. The only thing I change is to set

Code:

delta              vanDriest;
instead of

Code:

delta              vanDriest;
in LESProperties. When running the case, the first time step runs:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.x-82293690fe3e
Exec  : pisoFoam
Date  : Mar 02 2012
Time  : 14:34:06
Host  : "ojan-Precision-WorkStation-T7500"
PID    : 55088
Case  : /home/ojan/OpenFOAM/ojan-2.1.x/LES_2D_cube/LES_2D_cube
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LESModel
Selecting LES turbulence model Smagorinsky
SmagorinskyCoeffs
{
    ce              1.05;
    ck              0.0472;
}


Starting time loop

Time = 0.001

Courant Number mean: 0.080654 max: 3.37697
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 6.11753e-08, No Iterations 3
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 1.97382e-07, No Iterations 3
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 8.11524e-06, No Iterations 2
DICPCG:  Solving for p, Initial residual = 1, Final residual = 0.0485667, No Iterations 321
time step continuity errors : sum local = 1.22778e-05, global = -1.62292e-18, cumulative = -1.62292e-18
DICPCG:  Solving for p, Initial residual = 0.121577, Final residual = 9.51256e-07, No Iterations 404
time step continuity errors : sum local = 1.81875e-09, global = -7.33994e-19, cumulative = -2.35691e-18

But then the solver crashes with the following error message:

Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  in "/lib/x86_64-linux-gnu/libm.so.6"
#4  exp in "/lib/x86_64-linux-gnu/libm.so.6"
#5  Foam::exp(Foam::Field<double>&, Foam::UList<double> const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::exp<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#7  Foam::incompressible::LESModels::vanDriestDelta::calcDelta() in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#8  Foam::incompressible::LESModels::Smagorinsky::correct(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#9  Foam::incompressible::LESModel::correct() in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#10 
 in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/pisoFoam"
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12 
 in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/pisoFoam"
Floating point exception

Anybody knows what might be causing this? I'm using Ubuntu 11.04...

calim_cfd March 2, 2012 08:59

hi!

i'm not that familiar with les, specially in of, yet, but have you check out the tutorials:
/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/LESProperties
/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/LESProperties
/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/LESProperties
/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/LESProperties
/tutorials/combustion/XiFoam/les/pitzDaily3D/constant/LESProperties
/tutorials/combustion/XiFoam/les/pitzDaily/constant/LESProperties
/tutorials/incompressible/channelFoam/channel395/constant/LESProperties

also you're running a transient solver.. try checking your settings with a steady-state one.. then switch over. i normally find it harder to get a transient solver to work at first

hope it helps!

regards

Jan.Östh March 2, 2012 09:09

Thanks for the reply, I will go through the tutorials. However, the above error was created by activating the van Driest damping. Before that, the simulation was running as it should...

calim_cfd March 2, 2012 09:17

then i guess the problem is the annoying one.. solver/schemes/timestep settings..

can't help you much there.. too many parameters at this point

sry :(

alberto March 2, 2012 11:54

It is actually a bug, since it happens even in tutorials, if you use vanDriest. I reported it: http://www.openfoam.org/mantisbt/view.php?id=445

alberto March 4, 2012 02:59

Short update: I investigated more using the pisoFoam/pitzDaily tutorial. The problem originates from the exp at line 93:

(kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y

I inspected the values of the argument at the first iteration and I obtained:

min(y) -1e+15
max(y) 0.000566292
min(ystar) 8.46024e-06
max(ystar) 1

It seems the minimum wall distance is computed incorrectly and leads to an overflow of the exponential function.

calim_cfd March 4, 2012 08:59

Quote:

Originally Posted by alberto (Post 347514)
Short update: I investigated more using the pisoFoam/pitzDaily tutorial. The problem originates from the exp at line 93:

(kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y

I inspected the values of the argument at the first iteration and I obtained:

min(y) -1e+15
max(y) 0.000566292
min(ystar) 8.46024e-06
max(ystar) 1

It seems the minimum wall distance is computed incorrectly and leads to an overflow of the exponential function.

interesting... i wish i had more time to check it out since i should be working with les soon enough.

one last thought..

you said the error appears even in the tutorials right? but does the error occurs with the "stock settings"?

cuz.. i mean.. say you have a tutorial and change the turbulence settings as you need..
have you checked the possibility of a mesh error?? check that for your mesh and the tutorial one... YplusLES should help you with the checking...

if mesh is not the issue, my hands are now tight..

sry and good luck! :o

alberto March 4, 2012 22:05

Some work with git bisect showed that the problem is related to commit c06792759a720eb9d1494b4b4b0c3a86d21c20b0

http://www.openfoam.org/mantisbt/view.php?id=448

Jan.Östh March 5, 2012 07:30

Ok great work, thanks alberto. I tried the OpenFoam v2.0 release and that was ok.

alberto March 5, 2012 08:15

OpenCFD fixed the bug in git for 2.1.x (See bug-report).

Jan.Östh March 5, 2012 10:46

Quote:

Originally Posted by alberto (Post 347695)
OpenCFD fixed the bug in git for 2.1.x (See bug-report).


Great. I updated the release and now it works using van Driest (at least it doesn't crash).

/Jan

palmerlee March 17, 2014 21:53

Quote:

Originally Posted by alberto (Post 347695)
OpenCFD fixed the bug in git for 2.1.x (See bug-report).

Hi, alberto!
I wonder if there is a way to fix the bug in OpenFoam 2.0.1. For some reason, I kind of have to use this version of OpenFoam. Could you please give me some hits? My OS system is Ubuntu 11.04.

Best regards
Peter

ehsankf April 30, 2014 23:14

van Driest damping fuction
 
Hi all,

Any body can point me to a paper for the van Driest damping function implemented in the Openfoam.
Thanks.

massive_turbulence May 1, 2014 01:51

Quote:

Originally Posted by ehsankf (Post 489221)
Hi all,

Any body can point me to a paper for the van Driest damping function implemented in the Openfoam.
Thanks.

There are references here

http://www.cfd-online.com/Wiki/Near-...for_LES_models
http://www.fluidosol.se/thesismod/paper5.pdf

Hope it works for you.

ehsankf May 1, 2014 02:09

The van Driest damping function in OpenFoam is applied in different way. In OpenFoam, the damping is derived by changing the filter width, depending on the distance from the wall. You may want to look at equation 2.7 in this document


http://www.tfd.chalmers.se/~hani/kur...jectReport.pdf

Any reference for that?

Quote:

Originally Posted by massive_turbulence (Post 489233)


HanSolo123 September 17, 2014 06:18

Hi ehk,

in my opinion the statement for Delta in the report you posted is wrong.

When I check eq. 2.7 with https://github.com/OpenFOAM/OpenFOAM...nDriestDelta.C
I can see a difference.

It should be:

Delta = min[Delta , kappa/C_d * (1 - exp(yPlus/APlus))*y]

and not

Delta = min[Delta , kappa/C_d] * (1 - exp(yPlus/APlus))*y

So the damping function only effects the right term of the min expression. Can someone confirm this?

Esther Jin August 4, 2016 11:22

Hello, I am doing LES turbulence simulation using OpenFOAM3.0.1, and have some questions about the turbulenceProperties in the constant folder of pitzDaily in tutorials, I don't understand what LESdelta means, is it related to filter width?

Code:

simulationType  LES;

LES
{
    LESModel        dynamicKEqn;

    turbulence      on;

    printCoeffs    on;

    delta          cubeRootVol;

    dynamicKEqnCoeffs
    {
        filter simple;
    }

    cubeRootVolCoeffs
    {
        deltaCoeff      1;
    }

    PrandtlCoeffs
    {
        delta          cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }

        smoothCoeffs
        {
            delta          cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }

            maxDeltaRatio  1.1;
        }

        Cdelta          0.158;
    }

    vanDriestCoeffs
    {
        delta          cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }

        smoothCoeffs
        {
            delta          cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }

            maxDeltaRatio  1.1;
        }

        Aplus          26;
        Cdelta          0.158;
    }

    smoothCoeffs
    {
        delta          cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }

        maxDeltaRatio  1.1;
    }
}

If I choose VanDriest as Delta, in log file it shows the LES delta type selected twice,

PHP Code:

PIMPLEOperating solver in PISO mode

Reading field p

Reading field U

Reading
/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LES
Selecting LES turbulence model Smagorinsky
Selecting LES delta type vanDriest
Selecting LES delta type cubeRootVol
SmagorinskyCoeffs
{
    
Ck              0.094;
    
Ce              1.048;


I also want to use Van Driest damping function, but I am so confused with these LES deltas and coefficients. Could anyone please explain me about these parameters if you have experience with LES turbulent flow simulation?

Thank you in advance!

Best regards,
Esther


All times are GMT -4. The time now is 11:21.