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/)
-   -   Initialize the field using another simpler turbolence model (https://www.cfd-online.com/Forums/openfoam-solving/129835-initialize-field-using-another-simpler-turbolence-model.html)

ArathoN February 13, 2014 21:58

Initialize the field using another simpler turbolence model
 
hi foamers,

My friend told me that in Fluent there is an option to initialize the flow properties then run the desired the simulation. I searched for such an option on openfoam but i found nothing.

So i was thinking if i use a 1ep.-model like spalart-allmaras to initialize the flow then i swith to my desired RAS model, Does this improve my solution? and more importantly does the solution converge faster?

ArathoN February 20, 2014 14:51

Resolved.

First before running any simulation use:
Code:

refineMesh
It will help the first steps of the simulation.

Then if you use kEpsilon, it's better to run potentialFoam to initialize the U & p fields, you need to add this in the fvsolution file
Code:

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}

then run
Code:

potentialFoam
Finally if you'll use the kOmegaSST initialize the fields with the data from the kEpsilon, the same with every other model derived from the kEpsilon. In genereal the kEpsilon is the fastest one so it's better to use it then feed the data to the others and the gain in cpu time reduction is huge.

That's all i learned. If some one has more advice i'll gladly hear him.

RodriguezFatz February 21, 2014 05:47

Quote:

Originally Posted by ArathoN (Post 475920)
Then if you use kEpsilon, it's better to run potentialFoam to initialize the U & p fields, you need to add this in the fvsolution file
Code:

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}


Hi, i think this is exactly what Fluent does when using "Hybrid Initialization".

ArathoN February 21, 2014 10:07

Quote:

Originally Posted by RodriguezFatz (Post 476004)
Hi, i think this is exactly what Fluent does when using "Hybrid Initialization".

Exactly I have a friend using fluent and old me about this initialization so after some test and research i found out how to do it in openFoam. In the case of kEpsilon running potentialFoam before the main solver has little effect (at least for the cases i studied), but in case of different models (LaunderSharmaLowRe, kOmegaSST,....) the initialization with kEpsilon helps really in reducing the time needed for the convergence.

RodriguezFatz February 24, 2014 02:41

Aditionally to the speedup, I also had a case that diverged with a simple constant initialization but not with the potentialFoam init.

ArathoN February 27, 2014 10:22

Quote:

Originally Posted by RodriguezFatz (Post 476415)
Aditionally to the speedup, I also had a case that diverged with a simple constant initialization but not with the potentialFoam init.

If you use very accurate schemes, sometimes the case will diverge. It's better to start the simulation with a diffusive scheme but robust, then after some iterations switch to the accurate one. That's what i do when i need to simulate complex cases.

shipman March 2, 2014 21:55

Dear Arathon,

I also try to initialize my flow field using potentialflow before running my multiphase calculation according to your above explanation, but i couldnt succeed. in multiphase pressure dimension is kgm/s^2 however in potetialflow it is m^2/s^2. i set my cases as follows and but giving following error (is it error or not no idea). also how can i initialize the value of k and epsilon?? could you help to me pls...thanks

==>0/U
Code:

dimensions      [0 1 -1 0 0];
internalField  uniform (0 0 0);
boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform (0 -3.104 0);
    }
    outlet
    {
        type            zeroGradient;
    }
    wall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

=>0/P
dimensions [0 2 -2 0 0 0 0];
Code:

internalField  uniform 0;
boundaryField
{
    inlet
    {
        type          zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value          $internalField;;
    }
    wall
    {
        type            zeroGradient;
    }

==> fvSchemes:
Code:

ddtSchemes
{
    default              steadyState;
}

interpolationSchemes
{
  default        linear;
    interpolate(U)  linear;
}

divSchemes
{
    default              none;
  div(phi,U)      Gauss upwind;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,nuTilda) Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}
gradSchemes
{
    default              Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian(1,p)  Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

snGradSchemes
{
 default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}

==>fvsolution:
Code:

solvers
{
  "(U|k|omega)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-06;
        relTol          0;
    }
  p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-06;
        relTol          0;
    }
}

potentialFlow
{
nNonOrthogonalCorrectors  10;
}

sorry i forgat to paste the error:

DICPCG: Solving for p, Initial residual = 1, Final residual = 8.80882e-07, No Iterations 180
DICPCG: Solving for p, Initial residual = 0.168621, Final residual = 9.37342e-07, No Iterations 131
DICPCG: Solving for p, Initial residual = 0.00789625, Final residual = 9.67837e-07, No Iterations 115
DICPCG: Solving for p, Initial residual = 0.000384399, Final residual = 8.94174e-07, No Iterations 101
DICPCG: Solving for p, Initial residual = 2.60676e-05, Final residual = 8.91063e-07, No Iterations 3
DICPCG: Solving for p, Initial residual = 1.92316e-06, Final residual = 5.88908e-07, No Iterations 1
DICPCG: Solving for p, Initial residual = 7.12976e-07, Final residual = 7.12976e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 7.12976e-07, Final residual = 7.12976e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 7.12976e-07, Final residual = 7.12976e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 7.12976e-07, Final residual = 7.12976e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 7.12976e-07, Final residual = 7.12976e-07, No Iterations 0
continuity error = 0.0244929
Interpolated U error = 0.000203337
ExecutionTime = 6.04 s ClockTime = 6 s


All times are GMT -4. The time now is 09:43.