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/)
-   -   How to use DESModelRegions function object (https://www.cfd-online.com/Forums/openfoam-solving/117083-how-use-desmodelregions-function-object.html)

ch_jaehnel September 26, 2018 03:24

Quote:

Originally Posted by potentialFoam (Post 627911)
Sure, inside
system/controlDict.functions
you need to add
Code:

functions
{
 //  Determine LES-content
    desField
    {
      type            DESModelRegions;
      functionObjectLibs ("libutilityFunctionObjects.so");
      log            true;
      enabled on;
      storeFilter on;
      outputControl  outputTime;
    }
}

And afterwards, you can just execute
Code:

execFlowFunctionObjects -time 0.4 | tee log.desField
for the time you want.

Good luck!


Thank you for that hint. I did a simulation with interfoam and now get the following error after executing "execFlowFunctionObjects -time 1.5 | tee log.desField":



Code:

Create time

Create mesh for time = 1.5

Time = 1.5
    Reading phi
    Reading U
    Reading p
No finite volume options present

--> FOAM Warning :
--> FOAM FATAL IO ERROR:
keyword transportModel is undefined in dictionary "/lustre/scratch2/s2665038/FFW2.5_n24_350l/constant/transportProperties"

file: /lustre/scratch2/s2665038/FFW2.5_n24_350l/constant/transportProperties from line 18 to line 66.

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

End

Here are my transportProperties:


Code:

phases (water air);

water
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ]  1e-06;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1000;
   
    CrossPowerLawCoeffs   
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf        nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m            m [ 0 0 1 0 0 0 0 ] 1;
        n            n [ 0 0 0 0 0 0 0 ] 0;
    }
   
    BirdCarreauCoeffs 
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf        nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k            k [ 0 0 1 0 0 0 0 ] 99.6;
        n            n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

air
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ]  1.48e-05;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1;
   
    CrossPowerLawCoeffs   
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf        nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m            m [ 0 0 1 0 0 0 0 ] 1;
        n            n [ 0 0 0 0 0 0 0 ] 0;
    }
   
    BirdCarreauCoeffs   
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf        nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k            k [ 0 0 1 0 0 0 0 ] 99.6;
        n            n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

sigma          sigma [ 1 0 -2 0 0 0 0 ] 0.07;

so the transportModel is obviously defined, but for every phase. How can I get around this error?
Thanks a lot!

wyldckat September 26, 2018 16:51

Quick question @ch_jaehnel: Which OpenFOAM version are you using?

ch_jaehnel September 28, 2018 06:35

Quote:

Originally Posted by wyldckat (Post 707729)
Quick question @ch_jaehnel: Which OpenFOAM version are you using?


Sorry forgot to mention: I use OF 2.3.1


I have also acces to OF5.0, the result is the same.

saiguruprasad December 4, 2018 02:58

Quote:

Originally Posted by wyldckat (Post 703323)
Greetings hanis_rda,

I was curious about this and was inspired to work on this. I've managed to create the function object for OpenFOAM 5 and 6, but I have not fully tested it.

The repository is provided here: https://github.com/wyldckat/DESModelRegions
And you can find download and build instructions on that page as well.

Please report back here if this works or not and with which OpenFOAM version it worked and with which DES-type turbulence model!

Best regards,
Bruno

I am trying to use the DESModelRegions for the k-Omega SST DES model, but I don't think it is supported with this code.

Is there any way to make this code work for the k-Omega SST DES model?

I got this error when I used it for k-Omega SST DES : "No DES turbulence model found in database"

wyldckat December 4, 2018 16:41

Quick answers:

@ch_jaehnel: Sorry for the very late reply:
Quote:

Originally Posted by ch_jaehnel (Post 708099)
Sorry forgot to mention: I use OF 2.3.1

I have also acces to OF5.0, the result is the same.

The problem is that execFlowFunctionObjects does not load the necessary dependencies for transport properties, turbulence and so on.
With OpenFOAM 5, use the "-postProcess" option with the solver, which will load in the necessary properties and fields. See the User Guide for more details.

----------

@saiguruprasad:
Quote:

Originally Posted by saiguruprasad (Post 717845)
I am trying to use the DESModelRegions for the k-Omega SST DES model, but I don't think it is supported with this code.

Is there any way to make this code work for the k-Omega SST DES model?

I got this error when I used it for k-Omega SST DES : "No DES turbulence model found in database"

I... I don't even know what to tell you exactly... please read this thread: https://www.cfd-online.com/Forums/op...-get-help.html - hopefully you will understand why I don't even know what answer to give you :(

saiguruprasad December 4, 2018 22:19

I am sorry for not being verbose about the problem before.

I am trying to simulate Couette flow at Re_w=8600 using k-\omega SST DES model in OF-5.x. I used perturbUChannel to set up the initial conditions for the flow to sustain turbulence. Running a LES simulation, the instantaneous and mean velocity should be different. But I was not able to achieve this using k-\omega SST DES.

I wanted to use DESModelRegions to check how much of the area was being solved using LES and RANS. I downloaded the code and compiled it without errors. I added the folowing line to my controlDict:
Code:

functions
{
desField
    {
        type            DESModelRegions;
        functionObjectLibs ("libDESModelRegions.so");
        writeControl writeTime;
    }
}

In the log file, I got the following output:
Quote:

DESModelRegions desField write:
No DES turbulence model found in database
I would like to know if I can use DESModelRegions with k-\omega SST DES model in OF-5.x.

wyldckat December 5, 2018 05:46

Quick question: What is the exact line you used to define the turbulence model in the file "turbulenceProperties"?

saiguruprasad December 5, 2018 22:39

Code:


simulationType  LES;

LES
{
    LESModel        kOmegaSSTDES;

    turbulence      on;

    printCoeffs    on;

    delta              cubeRootVol;

    printCoeffs        on;

    turbulence          on;

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

This is my turbulenceProperties file

wyldckat December 6, 2018 12:38

Quick answer @saiguruprasad: Many thanks for all of the details, because I'm not very familiar with DES and how it's implemented.


After taking a better look, I roughly remembered things and then noticed what I wrote back when I created the repository and I quote: https://github.com/wyldckat/DESModel...#how-to-use-it

Quote:

You must use the turbulence model SpalartAllmarasDES or one of its derivatives, as shown in the diagram here: https://cpp.openfoam.org/v5/classFoa...lmarasDES.html
In other words, "kOmegaSSTDES" is not supported because it does not provide the necessary calculations for differentiate between RAS and LES :(


In more detail, with the SpalartAllmarasDES models, the calculation of the model regions field is calculated as indicated here: https://cpp.openfoam.org/v5/SpalartA...ce.html#l00379
But the problem is that it's not clear how it should be calculated for "kOmegaSSTDES", not even back in OpenFOAM 2.3.


If you do some research on the topic and figure out how it should be calculated, we can then work on implementing that calculation.

sibo February 21, 2019 10:44

DESModelRegions Usage
 
1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 703323)
Greetings hanis_rda,

I was curious about this and was inspired to work on this. I've managed to create the function object for OpenFOAM 5 and 6, but I have not fully tested it.

The repository is provided here: https://github.com/wyldckat/DESModelRegions
And you can find download and build instructions on that page as well.

Please report back here if this works or not and with which OpenFOAM version it worked and with which DES-type turbulence model!

Best regards,
Bruno

Hi Bruno,

Firstly thanks a lot for providing this utility for OF 5.
I want to test this function in a tutorial case pitzDaily using SpalartAllmarasDES model. But the results show that

Code:

DESModelRegions desField write:
    No DES turbulence model found in database

I was following the instruction https://github.com/wyldckat/DESModelRegions to build it.

I attached my case here. Could you help me to test it?
Thanks!

wyldckat February 24, 2019 18:10

Quick answer:
Quote:

Originally Posted by sibo (Post 725554)
I attached my case here. Could you help me to test it?

Many thanks for the feedback and test case! I had made a mistake in how the model is constructed for compressible flow.

If you downloaded the ZIP file, then please do another download and build again, because I have committed the bug fix just now.

If you downloaded using Git, then go into the folder where you've placed the "DESModelRegions" source code and run:
Code:

git pull
wmake

Then try running the case once again! It should now work as intended.

sibo February 24, 2019 18:31

Thanks a lot!

It works fine now.

CarlosGRR April 19, 2019 19:12

Implementation for kwSST-DES
 
Quote:

Originally Posted by wyldckat (Post 703323)
Greetings hanis_rda,

I was curious about this and was inspired to work on this. I've managed to create the function object for OpenFOAM 5 and 6, but I have not fully tested it.

The repository is provided here: https://github.com/wyldckat/DESModelRegions
And you can find download and build instructions on that page as well.

Please report back here if this works or not and with which OpenFOAM version it worked and with which DES-type turbulence model!

Best regards,
Bruno

Thank you for this function for the latest OpenFOAM versions. As you mentioned in your GitHub documentation, this function only supports Spalart-Allmaras-DES models. It would be great that this were uptated to work with kwSST-DES hybrid models, available in OpenFOAM too.

Thanks again for this contribution,

Carlos

wyldckat April 21, 2019 06:17

Quick answer:
  1. Even though I have been informed and given permission to bring in adapted code to the repo I'm maintaining, I haven't had time to work on it: https://github.com/wyldckat/DESModelRegions/issues/1
  2. On that report I was informed that the versions at OpenFOAM.com do have that capability, namely they do have the DESModelRegions for the k-omega variant with DES.


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