CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Laminar simpleFoam does not converge

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Alczem
  • 1 Post By geth03

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2024, 09:26
Default Laminar simpleFoam does not converge
  #1
New Member
 
Alberto
Join Date: Jun 2024
Posts: 5
Rep Power: 2
Gyros is on a distinguished road
Hello everyone!

I'm new to OpenFOAM and finite volume simulations, and I'm trying to run a simulation using simpleFoam in a laminar regime. The fluid is incompressible and Newtonian, with the value of the dynamic viscosity of 3.3e-6. The most relevant velocity component is Uz. The Reynolds number for my problem is around 6000-7000, so it's likely in a transient regime. However, based on experimental results, I do not expect turbulence.

My issue is that the solution converges when I set the residual control to 1.e-3, but it does not converge at 1.e-4. I've tried changing the URF, using different schemes and solvers, and testing various types of meshes. I even tried to ramp up the viscosity and the boundary velocity as well. While the residuals vary somewhat, I still can't achieve the desired convergence.

I can't share specifics about the mesh, but running the code:
Code:
checkMesh -allGeometry -allTopology
yields "Mesh OK" with a non-orthogonality around 55.

Does anyone have any ideas on what might be wrong with my case? I have copied the relevant files below:

fvSchemes (but I tried a lot of different schemes and well):
Code:
ddtSchemes
{
    default         steadyState;
}

gradSchemes
{

    default           cellMDLimited Gauss linear 0.5;
    grad(p)           cellMDLimited leastSquares 0.5;
}


divSchemes
{
    //Working Schemes
    default         none;
    div(phi,U)      bounded Gauss linearUpwindV grad(U);
   div((nuEff*dev2(T(grad(U))))) Gauss linear;

}


laplacianSchemes
{
    default          Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}
fvSolutions (I tried the PCG and PBiCGstab combination as well)
Code:
solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-8;
        relTol          0.;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration      on;
        agglomerator          faceAreaPair;
        nCellsInCoarsestLevel 1000;
        mergeLevels 1;
        minIter 3;

    }

U
    {
        solver          GAMG;
        smoother         GaussSeidel;
        tolerance        1e-12;
        relTol           0.;
        minIter 3;
    }
}


PIMPLE
{
        nOuterCorrectors 4;
        nCorrectors     1;
        nNonOrthogonalCorrectors 1;
        pRefCell        0;
        pRefValue       0;
}

SIMPLE
{
    nOuterCorrectors 1;
    nNonOrthogonalCorrectors 3;
    nCorrectors 1;
    consistent      yes;

    residualControl
    {
        p               1e-4;
        U               1e-4;
    }
}


relaxationFactors
{
    fields
    {
      default           0;
        p               0.7;
    }
    equations
    {
        default           0;
        U               0.1;
    }
}

potentialFlow
{
    nNonOrthogonalCorrectors 15;
}


// ************************************************************************* //
0/p
Code:
dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    Inlet
    {
        type            zeroGradient;

    }

    Outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    Wall
    {
        type            zeroGradient;
    }
}
0/U
Code:
dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0. 0. 0.);

boundaryField
{
    Inlet
    {
        type            fixedValue;
        value           uniform (0 0 0.604201);
    }

    Outlet
    {
      type            zeroGradient;
    }


    Wall
    {
        type            noSlip;
    }

}
Last iterations (I stopped at 2000 in this case, but You can see that the residuals of Ux and Uy are increasing):
Code:
Time = 1997

GAMG:  Solving for Ux, Initial residual = 0.00102127988842, Final residual = 3.78843410895e-14, No Iterations 4
GAMG:  Solving for Uy, Initial residual = 0.00102127873465, Final residual = 3.66920583825e-14, No Iterations 4
GAMG:  Solving for Uz, Initial residual = 6.84716366464e-05, Final residual = 1.93793345052e-13, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.000264545972474, Final residual = 7.91106068333e-09, No Iterations 20
GAMG:  Solving for p, Initial residual = 2.15211854916e-05, Final residual = 6.44141210732e-09, No Iterations 12
GAMG:  Solving for p, Initial residual = 3.90868944978e-06, Final residual = 9.50674813054e-09, No Iterations 8
GAMG:  Solving for p, Initial residual = 7.78381617016e-07, Final residual = 6.01070548673e-09, No Iterations 6
time step continuity errors : sum local = 4.26235491328e-07, global = 2.80680362419e-09, cumulative = -0.000273761795971
ExecutionTime = 2396.85 s  ClockTime = 2398 s

Time = 1998

GAMG:  Solving for Ux, Initial residual = 0.00102210900128, Final residual = 3.78439650521e-14, No Iterations 4
GAMG:  Solving for Uy, Initial residual = 0.0010221077803, Final residual = 3.66159293664e-14, No Iterations 4
GAMG:  Solving for Uz, Initial residual = 6.85176412086e-05, Final residual = 1.9473011416e-13, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.000266006998858, Final residual = 5.91567974654e-09, No Iterations 22
GAMG:  Solving for p, Initial residual = 2.1515117835e-05, Final residual = 7.53548884828e-09, No Iterations 10
GAMG:  Solving for p, Initial residual = 3.92752594773e-06, Final residual = 5.16086621663e-09, No Iterations 8
GAMG:  Solving for p, Initial residual = 7.74893068203e-07, Final residual = 5.43745707001e-09, No Iterations 6
time step continuity errors : sum local = 3.85463673237e-07, global = 5.3841699939e-09, cumulative = -0.000273756411801
ExecutionTime = 2398.26 s  ClockTime = 2400 s

Time = 1999

GAMG:  Solving for Ux, Initial residual = 0.00102287550141, Final residual = 3.78609861112e-14, No Iterations 4
GAMG:  Solving for Uy, Initial residual = 0.00102287422025, Final residual = 3.66569823254e-14, No Iterations 4
GAMG:  Solving for Uz, Initial residual = 6.85632941851e-05, Final residual = 1.956562032e-13, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.000260697977053, Final residual = 6.70872317025e-09, No Iterations 22
GAMG:  Solving for p, Initial residual = 2.18089265959e-05, Final residual = 5.60718051847e-09, No Iterations 10
GAMG:  Solving for p, Initial residual = 3.93294974769e-06, Final residual = 5.50368960367e-09, No Iterations 8
GAMG:  Solving for p, Initial residual = 7.68216082053e-07, Final residual = 4.81018719123e-09, No Iterations 6
time step continuity errors : sum local = 3.40865014092e-07, global = 4.70000373712e-09, cumulative = -0.000273751711797
ExecutionTime = 2399.61 s  ClockTime = 2401 s

Time = 2000

GAMG:  Solving for Ux, Initial residual = 0.0010238956283, Final residual = 3.78588038726e-14, No Iterations 4
GAMG:  Solving for Uy, Initial residual = 0.0010238944556, Final residual = 3.66586957047e-14, No Iterations 4
GAMG:  Solving for Uz, Initial residual = 6.86066516146e-05, Final residual = 1.95873799441e-13, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.000260974085062, Final residual = 6.49579910429e-09, No Iterations 22
GAMG:  Solving for p, Initial residual = 2.18087255747e-05, Final residual = 6.20127413556e-09, No Iterations 10
GAMG:  Solving for p, Initial residual = 3.93472473082e-06, Final residual = 6.10523977338e-09, No Iterations 8
GAMG:  Solving for p, Initial residual = 7.62268058637e-07, Final residual = 4.27575427211e-09, No Iterations 6
time step continuity errors : sum local = 3.02870846598e-07, global = 5.26248358204e-09, cumulative = -0.000273746449314
ExecutionTime = 2401.57 s  ClockTime = 2403 s
Residuals: https://drive.google.com/file/d/1oGP...ew?usp=sharing

Thank you to anyone who can offer me some suggestions to solve this problem.

Regards.
Gyros is offline   Reply With Quote

Old   August 6, 2024, 07:21
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 251
Rep Power: 6
Alczem is on a distinguished road
Hey!


Other than residuals, do you monitor any physical values in your domain, such as velocity probes? Your residuals look ok to me, not the lowest ever achieved, but not bad either. If your velocity field is stable, I would say you have a decent solution.


Your relaxation factor for U is really low considering you are using the consistent option. It was not stable with a high value?


Last thing, I would avoir any kind of gradient limiter for grad(p), there are several threads recommending the same thing.
Gyros likes this.
Alczem is offline   Reply With Quote

Old   August 6, 2024, 08:27
Default
  #3
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8
geth03 is on a distinguished road
1. based on your Reynolds-Number nobody can tell what you are simulating. for pipes you are in turbulent regime, for flat plate you are in laminar regime.

2. you should not limit the pressure gradient.

3. why do you use urf for pressure field in the simple-c algo? when your mesh is that good, why do you use nonOrtho-Correctors?
Code:
SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;

    residualControl
    {
        //adjust to whatever you want
    }
}

relaxationFactors
{
    equations
    {
        U               0.9; // 0.9 is more stable but 0.95 more convergent
        ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
    }
}
first fix your fvschemes and fvsolution dicts.

using simplefoam does not guarantee a steady state solution if a steady state solution does not exist. a laminar flow is no promise for steady state case if you have periodic flow for example. what you can do is drop the reynolds number to low values (increase viscosity, decrease velocity ...) and reach a creeping flow condition, it is likely that you will find a steady state solution, from there you can increse reynolds number again.

one more tip: you can use first order upwind also that will add numerical diffusion and drop residual levels. but keep in mind to switch back to second order upwind afterwards. your residuals will increase again, but the solution will be better.
Gyros likes this.
geth03 is offline   Reply With Quote

Old   August 6, 2024, 12:11
Default
  #4
New Member
 
Alberto
Join Date: Jun 2024
Posts: 5
Rep Power: 2
Gyros is on a distinguished road
Thank you both for your kind responses. I will avoid the limiters for grad(p).

Dear Alczem,

Yes, I checked the velocity solution but it doesn't seem to me that it reaches a stable solution. And, yes, with higher URF the residuals are higher and oscillate a lot.


Dear geth03,

I used the URF for the pressure because, by trial and error, I thought I was getting a better solution, but removing the limiter for the grad(p) it seems to work better without URF. I used nonOrtho-Correctors to try to stabilize the solution and not have problems with the mesh, but it's probably useless in my case. Thank you for your tips, it seems that by using upwind and then changing scheme I get a better solution, and I will try to reach convergence using this method.
Gyros is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ncrit for a glider Xfoil. How to use it. GPT4 answer AlanMattanó Main CFD Forum 0 April 10, 2023 13:16
simpleFoam turbulent flow laminar results NicolasB OpenFOAM Running, Solving & CFD 22 March 25, 2016 13:31
Laminar doesn't converge; Turbulent models do? Amit FLUENT 11 April 23, 2015 23:55
simpleFoam pipe flow case doesn't converge me3840 OpenFOAM Running, Solving & CFD 5 February 8, 2014 14:54
SimpleFoam: Laminar vs. Turbulent Convergence JasonG OpenFOAM 0 June 2, 2011 09:29


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