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

endless loop

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2017, 08:43
Default endless loop
  #1
New Member
 
Alice
Join Date: Jun 2017
Posts: 26
Rep Power: 9
yangzhuan is on a distinguished road
Hi,
I reluctantmeet a problem. When i calculate using interFoam at the terminal, it always calculate one time(time=0.19539). The result is that,

Time = 0.19539
PIMPLE: iteration 1
smoothSolver: Solving for alpha.water, Initial residual = 8.34708e-07, Final residual = 5.17168e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -9.95229e-30 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.34204e-07, Final residual = 5.1608e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -3.98091e-29 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.33499e-07, Final residual = 5.14817e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -3.98091e-29 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.32854e-07, Final residual = 5.12874e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -7.96183e-29 Max(alpha.water) = 1
DICPCG: Solving for p_rgh, Initial residual = 0.028875, Final residual = 0.00122469, No Iterations 2
time step continuity errors : sum local = 1.39085e-08, global = 2.26065e-13, cumulative = -3.06313e-08
DICPCG: Solving for p_rgh, Initial residual = 0.00947855, Final residual = 9.45228e-08, No Iterations 217
time step continuity errors : sum local = 1.07545e-12, global = 2.53134e-13, cumulative = -3.0631e-08
DILUPBiCG: Solving for epsilon, Initial residual = 0.00612527, Final residual = 1.66113e-11, No Iterations 3
DILUPBiCG: Solving for k, Initial residual = 5.04826e-12, Final residual = 5.04826e-12, No Iterations 0
ExecutionTime = 9204.45 s ClockTime = 9217 s
Courant Number mean: 4.94712e-05 max: 0.496272
Interface Courant Number mean: 1.44084e-05 max: 0.171817
deltaT = 2.22645e-45
Time = 0.19539
PIMPLE: iteration 1
smoothSolver: Solving for alpha.water, Initial residual = 8.511e-07, Final residual = 5.40447e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -6.2669e-31 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.50594e-07, Final residual = 5.39369e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -8.02164e-29 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.49823e-07, Final residual = 5.38165e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -2.44801e-33 Max(alpha.water) = 1
smoothSolver: Solving for alpha.water, Initial residual = 8.49126e-07, Final residual = 5.36118e-11, No Iterations 1
Phase-1 volume fraction = 0.887425 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425 Min(alpha.water) = -2.00541e-29 Max(alpha.water) = 1
DICPCG: Solving for p_rgh, Initial residual = 0.0309779, Final residual = 0.0012495, No Iterations 2
time step continuity errors : sum local = 1.46089e-08, global = 3.53085e-13, cumulative = -3.06307e-08
DICPCG: Solving for p_rgh, Initial residual = 0.00900407, Final residual = 7.30247e-08, No Iterations 265
time step continuity errors : sum local = 8.53157e-13, global = 8.01513e-16, cumulative = -3.06307e-08
DILUPBiCG: Solving for epsilon, Initial residual = 0.0064206, Final residual = 2.15077e-11, No Iterations 3
DILUPBiCG: Solving for k, Initial residual = 5.19511e-12, Final residual = 5.19511e-12, No Iterations 0
ExecutionTime = 9206.18 s ClockTime = 9218 s
Courant Number mean: 5.07062e-05 max: 0.49549
Interface Courant Number mean: 1.47119e-05 max: 0.185369
deltaT = 2.24672e-45
Time = 0.19539

It must get into endless loop. I don't kwon how to modify. And I don't know what should post for you easy to understand. If you need something to know, just reply. Thank you!
yangzhuan is offline   Reply With Quote

Old   July 13, 2017, 09:42
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
Quote:
Originally Posted by yangzhuan View Post
Hi,
I reluctantmeet a problem. When i calculate using interFoam at the terminal, it always calculate one time(time=0.19539). The result is that,

Code:
Time = 0.19539
PIMPLE: iteration 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.34708e-07, Final residual = 5.17168e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -9.95229e-30  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.34204e-07, Final residual = 5.1608e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -3.98091e-29  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.33499e-07, Final residual = 5.14817e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -3.98091e-29  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.32854e-07, Final residual = 5.12874e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -7.96183e-29  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 0.028875, Final residual = 0.00122469, No Iterations 2
time step continuity errors : sum local = 1.39085e-08, global = 2.26065e-13, cumulative = -3.06313e-08
DICPCG:  Solving for p_rgh, Initial residual = 0.00947855, Final residual = 9.45228e-08, No Iterations 217
time step continuity errors : sum local = 1.07545e-12, global = 2.53134e-13, cumulative = -3.0631e-08
DILUPBiCG:  Solving for epsilon, Initial residual = 0.00612527, Final residual = 1.66113e-11, No Iterations 3
DILUPBiCG:  Solving for k, Initial residual = 5.04826e-12, Final residual = 5.04826e-12, No Iterations 0
ExecutionTime = 9204.45 s  ClockTime = 9217 s
Courant Number mean: 4.94712e-05 max: 0.496272
Interface Courant Number mean: 1.44084e-05 max: 0.171817
deltaT = 2.22645e-45
Time = 0.19539
PIMPLE: iteration 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.511e-07, Final residual = 5.40447e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -6.2669e-31  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.50594e-07, Final residual = 5.39369e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -8.02164e-29  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.49823e-07, Final residual = 5.38165e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -2.44801e-33  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 8.49126e-07, Final residual = 5.36118e-11, No Iterations 1
Phase-1 volume fraction = 0.887425  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.887425  Min(alpha.water) = -2.00541e-29  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 0.0309779, Final residual = 0.0012495, No Iterations 2
time step continuity errors : sum local = 1.46089e-08, global = 3.53085e-13, cumulative = -3.06307e-08
DICPCG:  Solving for p_rgh, Initial residual = 0.00900407, Final residual = 7.30247e-08, No Iterations 265
time step continuity errors : sum local = 8.53157e-13, global = 8.01513e-16, cumulative = -3.06307e-08
DILUPBiCG:  Solving for epsilon, Initial residual = 0.0064206, Final residual = 2.15077e-11, No Iterations 3
DILUPBiCG:  Solving for k, Initial residual = 5.19511e-12, Final residual = 5.19511e-12, No Iterations 0
ExecutionTime = 9206.18 s  ClockTime = 9218 s
Courant Number mean: 5.07062e-05 max: 0.49549
Interface Courant Number mean: 1.47119e-05 max: 0.185369
deltaT = 2.24672e-45
Time = 0.19539
It must get into endless loop. I don't kwon how to modify. And I don't know what should post for you easy to understand. If you need something to know, just reply. Thank you!
It's not an endless loop if you look closely at your output:
Code:
deltaT = 2.24672e-45
Time = 0.19539
0.19539+2.24672e-45=0.19539

Your timestep is way too small, yet your Courant number is 0.5.
In other words, your velocity is very large (for example U\sim10^{40}). Your simulation has diverged, yet adaptive timestepping hides this by simply making deltaT very small.

Without further information about your case, no one can help you.

However, it seems like an awfully bad idea to use only two pressure loops, with relTol=0.1. No way your simulation will converge then. In your case, this probably causes your divergence.

Try relTol=0.01 and nCorrectors=10.
floquation is offline   Reply With Quote

Old   July 13, 2017, 22:21
Default
  #3
New Member
 
Alice
Join Date: Jun 2017
Posts: 26
Rep Power: 9
yangzhuan is on a distinguished road
Quote:
Originally Posted by floquation View Post
It's not an endless loop if you look closely at your output:
Code:
deltaT = 2.24672e-45
Time = 0.19539
0.19539+2.24672e-45=0.19539

Your timestep is way too small, yet your Courant number is 0.5.
In other words, your velocity is very large (for example U\sim10^{40}). Your simulation has diverged, yet adaptive timestepping hides this by simply making deltaT very small.

Without further information about your case, no one can help you.

However, it seems like an awfully bad idea to use only two pressure loops, with relTol=0.1. No way your simulation will converge then. In your case, this probably causes your divergence.

Try relTol=0.01 and nCorrectors=10.

Thanks for your reply. I have tried relTol=0.01 and nCorrectors=10. But it has no change, and it calculates very very slowly. In my case, there are two phase flow(gas and water) in the circular tube(1m for length, 0.025m for radius), and grid size is 2.5 millimeters. This case has sucessfully calculated 15 meters long circular tube. I just changed the geometry model. I don't know where is going wrong.
Now I post the fvsolution here.

[CODE]
solvers
{
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 4;
cAlpha 2;
MULESCorr yes;
nLimiterIter 3;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0.01;
}
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0.01;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.01;
}
p_rghFinal
{
$p_rgh;
relTol 0.01;
}
"(U|k|epsilon).*"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-06;
relTol 0.01;

}
"(U|k|epsilon)Final.*"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0.01;
}
}
PIMPLE
{
momentumPredictor no;
nOuterCorrectors 1;
nCorrectors 10;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
nAlphaCorr 1;
nAlphaSubCycles 4;
cAlpha 2;
}
relaxationFactors
{
equations
{
".*" 1;
}
}

The controlDict is that,

[CODE]
application interFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 5;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.05;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression compressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.5;
maxAlphaCo 0.5;
maxDeltaT 1;
}
yangzhuan is offline   Reply With Quote

Old   July 14, 2017, 05:27
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
Please note that you should close code-tags with "[/code]".


Quote:
Originally Posted by yangzhuan View Post
But it has no change, and it calculates very very slowly.
Don't compare the speed of the simulation with your previous simulation, as your previous run was fast only because it was calculating nonsense (you didn't give it time to converge).



Quote:
Originally Posted by yangzhuan View Post
Now I post the fvsolution here.
Code:
solvers
{
    "alpha.water.*"
    {
        nAlphaCorr      1;
        nAlphaSubCycles 4;
        cAlpha          2;
        MULESCorr       yes;
        nLimiterIter    3;
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0.01;
    }
    pcorr
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-10;
        relTol          0.01;
    }
    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-07;
        relTol          0.01;
    }
    p_rghFinal
    {
        $p_rgh;
        relTol          0.01;
    }
    "(U|k|epsilon).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          0.01;
      
    }
    "(U|k|epsilon)Final.*"
    {
        solver           PBiCG;
        preconditioner   DILU;
        tolerance        1e-08;
        relTol           0.01;
    }
}
PIMPLE
{
    momentumPredictor   no;
    nOuterCorrectors    1;
    nCorrectors         10;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;
    nAlphaCorr      1;
    nAlphaSubCycles 4;
    cAlpha          2;
}
relaxationFactors
{
    equations
    {
        ".*"                1;
    }
}
Now to speed-up your simulation, you can use GAMG instead of PCG for pressure, although this technically depends on the number of cells you have:
Code:
    p_rgh
    {
        solver          GAMG; //PCG; //GAMG;
        //preconditioner  DIC; // PCG needs preconditioner, GAMG does not
        tolerance       1e-07;
        relTol          0.01;
        smoother        symGaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        nFinestSweeps   2;
        cacheAgglomeration yes;
        nCellsInCoarsestLevel 1000; // should be ~sqrt(Ncells)
        agglomerator    faceAreaPair;
        //mergeLevels     1;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }
Then, the lines I marked red in your fvSolutions dict don't do anything, so you can safely remove those.

The lines I marked blue are wrong. You should never have a relTol for the Final iteration, otherwise the case will (again) not converge properly. That's why I set relTol=0 in my snippet above.


Quote:
Originally Posted by yangzhuan View Post
This case has sucessfully calculated 15 meters long circular tube. I just changed the geometry model. I don't know where is going wrong.
When you downsized the geometry, did you change other parameters accordingly? For instance, do you still need to simulate the same time period?
Also, is the mesh identical in shape / number of cells / etc.?
Perhaps your turbulence model requires adaptation as well (I know too little about turbulence modelling to say anything sensible on that matter)?
floquation is offline   Reply With Quote

Old   July 14, 2017, 23:25
Default
  #5
New Member
 
Alice
Join Date: Jun 2017
Posts: 26
Rep Power: 9
yangzhuan is on a distinguished road
Quote:
Originally Posted by floquation View Post
When you downsized the geometry, did you change other parameters accordingly? For instance, do you still need to simulate the same time period?
Also, is the mesh identical in shape / number of cells / etc.?
Perhaps your turbulence model requires adaptation as well (I know too little about turbulence modelling to say anything sensible on that matter)?

Yesterday I tried for a long time. I change a turbulence model, and it works. Thank you for your help!
Best
yangzhuan 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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
[CAD formats] my stl surface is seen as just a line rcastilla OpenFOAM Meshing & Mesh Conversion 2 January 6, 2010 02:30
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 16:57


All times are GMT -4. The time now is 22:18.