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/)
-   -   LES-Content of a Detached Eddy Simulation for OpenFOAM (https://www.cfd-online.com/Forums/openfoam-solving/104123-les-content-detached-eddy-simulation-openfoam.html)

Anne Lincke July 3, 2012 11:36

LES-Content of a Detached Eddy Simulation for OpenFOAM
 
Hey Foamers,

I started with OpenFOAM®+DES, SpalartAllmarasIDDES.
I would like to determine the LES-Content of my computation.
Does someone know an indicator or a way to determine the content?

It would be desirable to see the averaged LES content...

Thanks
Anne

vkrastev July 4, 2012 11:07

Quote:

Originally Posted by Anne Lincke (Post 369550)
Hey Foamers,

I started with OpenFOAM®+DES, SpalartAllmarasIDDES.
I would like to determine the LES-Content of my computation.
Does someone know an indicator or a way to determine the content?

It would be desirable to see the averaged LES content...

Thanks
Anne

Hi,
you can obtain the averaged resolved Reynolds stresses by just activating the averaging function for the velocity field at the end of your controlDict:

functions
{
fieldAverage
{
type fieldAverage;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
outputControl outputTime;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}
);
}
}

The above addition will produce and write both the time-averaged velocity field as well as the six time averaged components of the resolved Reynolds stresses tensor (this is the meaning of prime2Mean: fluctuating components squared and averaged against time). Of course, to obtain reliable results, you have to start averaging when the flow has developed its transient content and then average for a sufficiently long period, in order to get the mean (and thus the fluctuating) values stabilized.

Hope this helps

V.

Anne Lincke July 5, 2012 03:11

Hey Vesselin,

thanks for your answer. I already activated fieldAverage and plottet those values.

But this was not my question, maybe I expressed in a bad way.
What I meant: I would like to plot a "sensor" which is for example "1" in regions where LES-mode is activated and "0" in regions where RANS-mode is activated.
When outputting the averaged sensor, one could see the regions where mainly LES-, and regions where mainly RANS-mode was activated.

It is desirable for a DES to switch on RANS-mode in near-wall regions and LES-mode inside the fluid volume.

Dou you or someone else have an idea how to solve this in OpenFOAM?
I heard that it is common for solvers to have such a sensor implemented....

Thanks
Anne

vkrastev July 5, 2012 04:10

1 Attachment(s)
Quote:

Originally Posted by Anne Lincke (Post 369870)
Hey Vesselin,

thanks for your answer. I already activated fieldAverage and plottet those values.

But this was not my question, maybe I expressed in a bad way.
What I meant: I would like to plot a "sensor" which is for example "1" in regions where LES-mode is activated and "0" in regions where RANS-mode is activated.
When outputting the averaged sensor, one could see the regions where mainly LES-, and regions where mainly RANS-mode was activated.

It is desirable for a DES to switch on RANS-mode in near-wall regions and LES-mode inside the fluid volume.

Dou you or someone else have an idea how to solve this in OpenFOAM?
I heard that it is common for solvers to have such a sensor implemented....

Thanks
Anne

Ok, so I haven't understood your question properly...Well, if you are interested in a post-processing of this RANS/LES parameter than the easiest way should be to write your own post-proc utility which calculates and writes the parameter using already calculated flow variables. For the DES and DDES models actually all you have to do is to calculate the ratio between the RANS and LES lenght scales which are used to discriminate where to apply the RANS or DES formulation (where the RANS scale is smaller then the LES one the model works in RANS mode, the opposite applies for the LES mode). I'm not sure if things are that easy with the IDDES model, which as far as I know has a much more complex formulation. Just as an example, I can send you an utility which calculates and writes the delaying function fd included in the DDES model.

Good luck for your work

V.

Anne Lincke July 17, 2012 04:24

Hey Vesselin,

sorry for the late reply.
Thanks a lot for this tool. I wrote a similar one for IDDES.

Kind Regards
Anne

vkrastev July 17, 2012 04:35

Hi Anne,
no problem, happy to see that you have solved your issue!

Regards

V.

luhawk August 8, 2012 05:35

Hello everybody,
hello Anne,

I am currently trying to work my way into DES in OpenFOAM. Such a tool as you said would really be neat to have. Unfortunately, when it comes to coding in OpenFOAM, I am pretty much a novice, so I have a question:
Did you implement the evaluation of the length scales as a post processing or routine did you modify the turbulence model to write a field?

Any help is appreciated.

Best regards,

Lukas

Anne Lincke August 8, 2012 05:52

Hey Lukas,

I implemented a postprocessing tool which writes \tilde{fd}*(1+fe) and 1-\tilde{fd} which are the coefficients of l_RANS and l_LES, respectively (according to the paper of Shur et. al).

It would be desirable to insert such a tool inside a simulation such that these coefficients are computed at each time step and could be averaged.

But I only succeeded in doing this inside a postprocessing routine, which computes these values for the written time steps. So one can see the LES content of each time step which was output.

Kind Regards
Anne

JulytoNovember August 9, 2012 00:15

Hi Anne,
Could you please post your LESProperties file, with SpalartAllmarasIDDES implemented?

timo_IHS August 9, 2012 02:55

Hi Anne,

have a look in the extend project.
You have to define an IOobject.

Anne Lincke August 9, 2012 03:09

Hey,

Quote:

Originally Posted by JulytoNovember (Post 376122)
Hi Anne,
Could you please post your LESProperties file, with SpalartAllmarasIDDES implemented?

here it is:

HTML Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      LESProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

LESModel      SpalartAllmarasIDDES;

printCoeffs    on;

delta IDDESDelta; // maxDeltaxyz;//


maxDeltaxyzCoeffs
{
    deltaCoeff 2;
}



SpalartAllmarasIDDESCoeffs
{
    fieldMaps
    {
        nuTilda        nuTilda;
        nuSgs          nuSgs;
    }
    alphaNut        1.5;
    Cb1            0.1355;
    Cb2            0.622;
    Cw2            0.3;
    Cw3            2;
    Cv1            7.1;
    Cv2            5;
    CDES            0.65;
    ck              0.07;
    fwStar          0.424;
    cl              3.55;
    ct              1.63;
}

IDDESDeltaCoeffs
{
    cw 0.15;
    deltaCoeff      2;//1; 2 for hexMesh

}

SpalartAllmarasCoeffs
{
    alphaNut        1.5;
    Cb1              0.1355;
    Cb2              0.622;
    Cw2              0.3;
    Cw3              2;
    Cv1              7.1;
    Cv2              5.0;
    CDES            0.65;
    ck              0.07;
}

SpalartAllmarasDDESCoeffs
{
    alphaNut        1.5;
    Cb1              0.1355;
    Cb2              0.622;
    Cw2              0.3;
    Cw3              2.0;
    Cv1              7.1;
    Cv2              5.0;
    CDES            0.65;
    ck              0.07;
}

SpalartAllmarasIDDESCoeffs
{
    alphaNut        1.5;
    kappa            0.4187;
    Cb1              0.1355;
    Cb2              0.622;
    Cw2              0.3;
    Cw3              2.0;
    Cv1              7.1;
    Cv2              5.0;
    CDES            0.65;
    ck              0.07;
}



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;
}


// ************************************************************************* //

Kind Regards,
Anne

Jane L August 14, 2012 09:21

Hi,
just in case you're still interested. You can define the IOobject Timo_IHS mentioned in your own copy of the SpalartAllmaras.C (DES) model which could look like this:
Code:

  RANSregion_
    (
        IOobject
        (
            "RANSregion",
            runTime_.timeName(),
            mesh_,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh_
    ),

"RANSregion_" has to be initialized in the *.H file and you need a RANSregion_ file in the 0 folder with the correct dimensions depending on your equation to calculate "RANSregion_". The equation itself may be placed where nuSgs is calculated. Example for SpalartAllmaras:
Code:

void mySpalartAllmaras::updateSubGridScaleFields()
{
    nuSgs_.internalField() = fv1()*nuTilda_.internalField();
    nuSgs_.correctBoundaryConditions();

    RANSregion_ = CDES_*delta() - y_;
}

This gives you a positive result in the area where RANS is used and a negative where LES is used.

kind regards

owayz August 14, 2012 12:56

Hi Jane L,
Can we do something similar for other Turbulence models as well. And what is "fv1()" in the above equation. It would be very helpful if you could explain shortly what this code snippet is actually doing.
Regards,
Awais

Jane L August 15, 2012 02:22

Hi!
Quote:

Originally Posted by owayz (Post 377081)
Can we do something similar for other Turbulence models as well.

The example above is a possible solution for the issue Anne described:

Quote:

I would like to plot a "sensor" which is for example "1" in regions where LES-mode is activated and "0" in regions where RANS-mode is activated.
While this makes only sence in a DES method, you can of course apply something similar to any turbulence model if you wish to have some more outputdata. This data will be written in the folder of each timestep and can be used by paraview.

Quote:

Originally Posted by owayz (Post 377081)
And what is "fv1()" in the above equation. It would be very helpful if you could explain shortly what this code snippet is actually doing.

This code snipped is a variation of the SpalartAllmaras turbulence model, which is located in your OpenFOAM installation folder under:
/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C
So actually the function "fv1()" comes from this model. In order to alter existing turbulence models you should make your own copy of that turbulence model. Follow the instructions of Hakan Nilsson (you find the "implementTurbulenceModel.pdf" via google)

I hope this helps!
regards

Anne Lincke August 15, 2012 10:17

Hey Jane,

thank you very much for this information. I am still interested in implementing such a sensor and will try to do it in this way.
Starting with Spalart-Allmaras and DES seems to be a good way, as the model gets more and more complex for DDES and IDDES.

Kind Regards
Anne

owayz August 15, 2012 11:11

Hi Jane,
Thanks for your reply. I will try to look into that pdf. Also I might try to do something similar for LES as well.

Regards,
Awais

Tarak August 17, 2012 00:29

Hii,

Have you tried plotting the energy spectrum to get an estimate of the LES content?

MaryBau March 1, 2013 15:22

Hi;

I have been trying to run a simulation in OFv2.1.0 with SpalartAllmarasIDDES using exactly the same LESProperties file that Anne L. posted in this forum. However, I am getting this error:

Code:

Selecting incompressible transport model Newtonian
Selecting turbulence model type LESModel
Selecting LES turbulence model SpalartAllmarasIDDES


--> FOAM FATAL IO ERROR:
keyword delta is undefined in dictionary ""

file:

    From function dictionary::lookupEntry(const word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 400.

FOAM exiting

The IDDESDelta is recognized, because if I spell it wrong it appears on the LESdelta types.

Code:


--> FOAM FATAL ERROR:
Unknown LESdelta type XXIDDESDelta

Valid LESdelta types are :

6
(
IDDESDelta
Prandtl
cubeRootVol
maxDeltaxyz
smooth
vanDriest
)


    From function LESdelta::New(const fvMesh&, const dictionary&)
    in file LESdelta/LESdelta.C at line 78.

FOAM exiting

Any ideas or suggestions?

Thanks!

Anne Lincke March 4, 2013 03:27

Hey,

I installed OpenFOAM-2.1.1. and since then I get exactly the same error message. I would be really interested in how to solve this, too.

ingcorra March 6, 2013 08:16

This should be the correct LESProperties file for 2.1.x

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      LESProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

LESModel      SpalartAllmarasIDDES;

printCoeffs    on;

delta cubeRootVol;

printCoeffs on;

cubeRootVolCoeffs
{
    deltaCoeff      1;
}

SpalartAllmarasIDDESCoeffs
{
    delta IDDESDelta;
    IDDESDeltaCoeffs
    {
        deltaCoeff 1;
        cw 0.15;
    }
}


//*************************************************************************//


Anne Lincke March 6, 2013 08:23

I have the same in my computation, meaning to use cubeRootVol for delta and IDDESDelta inside SpalartAllmaras model.
This works in any case.
Would be interesting to know if it is possible to set the general delta to "IDDESDelta".
So far, this does not work with OF-2.1.1.

MaryBau March 6, 2013 14:13

It runs perfect! Thank you ingcorra.

But I might have spoken to fast. Anne has a point.

So to check if IDDESDelta is being used and not cubeRoot I simply added a line in the IDDESDelta.C file:

Info<<delta_.internalField()<<endl;

after the calculation of delta.

It prints the value of delta before the first iteration, but not in each iteration.

Does delta is something that is calculated once? (which will mean the IDDESDelta works fine) or it is calculated every iteration? (and there is something wrong in the code)

Joanna Huang April 30, 2013 09:56

1 Attachment(s)
Quote:

Originally Posted by Anne Lincke (Post 369550)
Hey Foamers,

I started with OpenFOAM®+DES, SpalartAllmarasIDDES.
I would like to determine the LES-Content of my computation.
Does someone know an indicator or a way to determine the content?

It would be desirable to see the averaged LES content...

Thanks
Anne


Hello,
Anne, I notice that you are familar with IDDES, I am currently doing some simulation relating to this, but everytime it has errors like this:


request for RASModel RASProperties from objectRegistry region0 failed
available objects of type RASModel are
0
(
)

I attached the case file below(0,constant,system), could you please kindly help me with this, I will really appreciate that since I am suffering this now.

hakonbar May 3, 2013 09:02

Hi everyone! I was just wondering, what's the consensus on the delta for IDDES? The way I understand the issue is that in old releases of OpenFOAM (pre 2.1) it was possible to define the delta as "IDDESDelta" in the root of the "LESProperties" file (as per post #11), but that in the newer versions, the delta has to be defined as something else first (like in post #20).

Is this a bug in the new releases, or has it been done on purpose? If it's on purpose, is the first definition of delta just a "dummy definition" which isn't really used in the simulation?

I get the following output when I start an IDDES simulation, suggesting that the solver switches back and forth between different definitions of delta.

Code:

Selecting turbulence model type LESModel
Selecting LES turbulence model SpalartAllmarasIDDES
Selecting LES delta type maxDeltaxyz
Selecting LES delta type maxDeltaxyz
Selecting LES delta type IDDESDelta
Selecting LES delta type maxDeltaxyz

When I select a regular LES-model, there's no such switching back and forth:

Code:

Selecting turbulence model type LESModel
Selecting LES turbulence model oneEqEddy
Selecting LES delta type maxDeltaxyz

So is this a bug or a feature, and how do we find out?

Anne Lincke May 6, 2013 07:25

The computation of IDDES delta is based on a general delta. You can find in IDDESDelta.C the formula of IDDESDelta

HTML Code:

delta_.internalField() =
            deltaCoeff_
          *min
            (
                max
                (
                    max(cw_*wallDist(mesh()).y(), cw_*hmax),
                    faceToFacenMax()
                ),
                hmax
            );

where "hmax" needs a general delta as you can see in SpalartAllmarasIDDES.C

HTML Code:

hmax_
    (
        LESdelta::New
        (
            "hmax",
            mesh_,
            *this
        )
    ),

The hmax equals to the maximum local grid spacing. When using structured meshes the defintion of maxDeltaxyz is fine, when using unstructured meshes the cubeRootVolDelta is more appropriate.
In the paper of Shur, Spalart, Strelets and Travin, International Jorunal of Heat and Fluid Flow 29 (2008) 1638-1649 you can read more.

Hope this helped.

Kind Regards,
Anne

hakonbar May 7, 2013 11:33

Hi Anne, and thanks for the thorough explanation! So in a structured grid, like one would make in blockMesh, all the cells are aligned with the principal axes of the domain, and the "maxDeltaxyz" definition is fine, but since this might not be the case for an unstructured grid, it would be safer to use the "cubeRootVol" definition..is this correct?

Shur et al. do talk a lot about how the "max"-definition is preferable to the cube root, but the choice of delta definition is maybe not as significant for DDES and IDDES, which have the shielding term?

cheers,
Håkon

vonboett May 8, 2013 03:41

Hi Håkon,

The LeMoS extensions for OpenFOAM provide an URANS-LES Detatched Eddy approach where the regions of URANS and LES are decomposed dynamically in every timestep dependent on flow properties and local mesh resolution. They have very good validation results using ship hydrodynamic test cases. So if you want to use LES with an unstructured grid, this might be helpful.

Anne Lincke May 8, 2013 06:09

Hey Ha°kon,

Quote:

So in a structured grid, like one would make in blockMesh, all the cells are aligned with the principal axes of the domain, and the "maxDeltaxyz" definition is fine, but since this might not be the case for an unstructured grid, it would be safer to use the "cubeRootVol" definition..is this correct?
Yes, this is correct.

Kind Regards
Anne

baklanton July 21, 2015 11:41

baklanton
 
Hi Anne,

Could you please post or attach the post-processing tool that you created, the one that writes \tilde{fd}*(1+fe) and 1-\tilde{fd} .

Many Thanks

Anton

Anne Lincke October 12, 2015 08:58

Dear Anton,

sorry for this late response. I found the tool which I implemented a while ago. If you are still interested, I could send it to you via e-mail.

Kind Regards,
Anne

Chanterz January 18, 2016 21:35

(Sorry, ignore me)

Chanterz January 18, 2016 21:41

For anyone still following this thread, the correction Corrado posted in response to Anne's LESProperties post worked for me,

Thanks :)

Alhasan April 9, 2017 12:46

Is this the answer to your Question ?
 
Hi All,

My two cents on the intial question,

This should be added to the functions in the controlDict, to get the LES and DES regions during the simulations so it can be visualised after the simulation.

Code:


desField
{
  type DESModelRegions;
  functionObjectLibs ("libutilityFunctionObjects.so");
  log true;
  enabled on;
  storeFilter on;
  timeStart 0.15;
  outputControl outputTime;
}

Regards,
Hasan K.J


All times are GMT -4. The time now is 15:59.