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/)
-   -   simpleFoam tutorial PitzDaily using Reynolds stress tensor (LRR RASModel) (https://www.cfd-online.com/Forums/openfoam-solving/227418-simplefoam-tutorial-pitzdaily-using-reynolds-stress-tensor-lrr-rasmodel.html)

crubio.abujas March 2, 2022 04:36

Hi lpz456,


Sadly, I've never succeded in making this tutorial to work. Even trying relaxation factor as low as 0.05 during 20k iteration the solution converges and maintain this "transient" behaviour. I found curious that the turbulent fields (R, epsilon, nut) seem to be converged, but velocity ad pressure keeps oscilating.



I've tried it on v7 and v2012 in case is some implementation error, but no luck. I guess there is something on the setting I'm mising, but I cannot figure out what.

crubio.abujas March 2, 2022 12:03

After some time I tried again to run this case, with some minor advances:

1. I figured out that R relaxationFactor sould be in "equations" instead of "fields"

As far as I know, the differente is on fields the new value is applied directly to the new field, where on the case of "equations" it is used to relax the solving matrix.

2. I've observed that sometimes the tolerance of the R fields drops abruptly to 1e-10 or so and is kept stuck due to solver settings. To avoid this I set a minimum of 1 iteration on each field on the solvers. I algo tried to tight the relative and absolute tolerance of the solvers.

3. I've check the results of the kEpsilon case against some literature found on internet. I've found a comparative on the results for LRR, kEpsilon and
kOmega. Here the link.

Sadly, I did not find enough information in this file to replicate the results on LRR. When comparing the results, the kEpsilon case is quite similar to the results presented here.

The results on velocity and nut are pretty similar among the three turbulence models. As on the current approach we are pre-initiallizing the fields with the results of kEpsilon I expected minor changes on these fields. However what I've seen is a drastic variation on all the profiles, which makes me doubt about the usefullness of the preinitialization.

Following this line of reasoning, as I consider that mi initial guess is pretty close to the final results, I imposed a strong relaxation factor on U and p, hoping that the turbulence fields can update fast enought to keep them close to the initial value. However I had no success.

I share the current state of mi fvSolution file in case it can be helpfull for anyone trying to replicate this tutorial.


system/fvSolution
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version        2;
    format          ascii;
    class          dictionary;
    location        "system";
    object          fvSolution;
}

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.01;
        smoother        GaussSeidel;
    }
    "(U|k|epsilon|omega|f|v2)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-08;
        relTol          0.001;
        minIter        1;
    }
    R
    {
        solver          GAMG;
        smoother        GaussSeidel;
        tolerante      1e-08;
        relTol          0.001;
        minIter        1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;
}

relaxationFactors
{
    fields
    {
        p              0.01;
    }
    equations
    {
        U              0.05;
        R              0.01;
        epsilon        0.05;
    }
}


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


lpz456 March 6, 2022 20:15

Quote:

Originally Posted by crubio.abujas (Post 823378)
After some time I tried again to run this case, with some minor advances:

1. I figured out that R relaxationFactor sould be in "equations" instead of "fields"

As far as I know, the differente is on fields the new value is applied directly to the new field, where on the case of "equations" it is used to relax the solving matrix.

2. I've observed that sometimes the tolerance of the R fields drops abruptly to 1e-10 or so and is kept stuck due to solver settings. To avoid this I set a minimum of 1 iteration on each field on the solvers. I algo tried to tight the relative and absolute tolerance of the solvers.

3. I've check the results of the kEpsilon case against some literature found on internet. I've found a comparative on the results for LRR, kEpsilon and
kOmega. Here the link.

Sadly, I did not find enough information in this file to replicate the results on LRR. When comparing the results, the kEpsilon case is quite similar to the results presented here.

The results on velocity and nut are pretty similar among the three turbulence models. As on the current approach we are pre-initiallizing the fields with the results of kEpsilon I expected minor changes on these fields. However what I've seen is a drastic variation on all the profiles, which makes me doubt about the usefullness of the preinitialization.

Following this line of reasoning, as I consider that mi initial guess is pretty close to the final results, I imposed a strong relaxation factor on U and p, hoping that the turbulence fields can update fast enought to keep them close to the initial value. However I had no success.

I share the current state of mi fvSolution file in case it can be helpfull for anyone trying to replicate this tutorial.


system/fvSolution
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version        2;
    format          ascii;
    class          dictionary;
    location        "system";
    object          fvSolution;
}

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.01;
        smoother        GaussSeidel;
    }
    "(U|k|epsilon|omega|f|v2)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-08;
        relTol          0.001;
        minIter        1;
    }
    R
    {
        solver          GAMG;
        smoother        GaussSeidel;
        tolerante      1e-08;
        relTol          0.001;
        minIter        1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;
}

relaxationFactors
{
    fields
    {
        p              0.01;
    }
    equations
    {
        U              0.05;
        R              0.01;
        epsilon        0.05;
    }
}


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


Thank you for your reply.
Recently, I also noticed the link you provided. In fact, there is information worthy of attention in the link. The openfoam version in the link is 1.7.1. By comparing with openfoamv2106, you will find that the LRR model has changed significantly. There is an item called wall reflection in the new version.
I tried to close the wall reflection term in the turbulenceproperties file and use the uniform initial field of R. The convergence has been significantly improved! Although there are still some unsteady properties.
Therefore, at present, I locate the convergence problem in the LRR model itself (especially the wall reflection term). I intend to study the equation itself first, and then solve the convergence problem.
Good luck, too!

lpz456 March 6, 2022 21:14

Unfortunately, after consulting fluent's theory manual, I found that the wall reflection term is switched on by default. In the case I studied, the simulation by fluent has good convergence, but by openfoam always diverges.

Artch August 4, 2023 14:29

Quote:

Originally Posted by dlahaye (Post 772298)
Abstract

3/ Case Set-Up

Step 2/3: Setting up the 0-folder
In the second step we edit the 0-folder. We do *not* define the boundary conditions for the components of the tensor R for inlet, outlet and wall patches directly. Instead, we resort to a two-substep procedure in which in the first substep, a simulation using a two-equation turbulence model runs for a number of iterations. In the second substep, the stress tensor R is computed in post-processing stage for the latest iteration. This computed stress tensor is used as boundary value setting for the simulation using the LRR model.

More specifically, in the first substep, we run simpleFoam on the out-of-the-box tutorial. At the last iteration (iteration 283 in our case) we compute the stress tensor R by post-processing computed results and running simpleFoam -postProcess -func R -latestTime. This command produce a file called turbulenceProperties: R in the latest time folder (folder 283). This file can be renamed to R and copied to the 0-folder. Observe that the settings for the turbulence equation used in the first run is used as input to compute R. One can thus *not* modify the constant-folder/turbulenceProperties-file prior to computing R. One can visualize components and magnitude of the tensor R in paraview.


I've had abysmal convergence problems with the running first the k-Epsilon tutorial first and using the R field for the last iteration.


I managed to get much better results runing the simpleFoam -postProcess -func R -latestTime command on a clean k-epsilon case, and then changing the turbulence model.


https://www.cfd.at/sites/default/fil...ExampleSix.pdf


All times are GMT -4. The time now is 13:05.