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

Simple doesn't stop after convergence criteria is achieved

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2015, 09:37
Default Simple doesn't stop after convergence criteria is achieved
  #1
Member
 
Thiago Parente Lima
Join Date: Sep 2011
Location: Diamantina, Brazil.
Posts: 62
Rep Power: 14
thiagopl is on a distinguished road
Hi,

I'm using the chtMultiRegionSimpleFoam to simulate the problem of a enclosure vertically heated and cooled with an internal solid.
As I show bellow, even after all the convergence criteria is achieved (10^-6) the Simple algorithm doesn't stop.
I can't see the rho residuals, but I've changed it to 10^-3 and the results are the same. Why doesn't it stop?

Log showing all the residuals bellow the criteria convergence:
Code:
Time = 2216

Solving for fluid region air
DILUPBiCG:  Solving for Ux, Initial residual = 4.163122729918927e-09, Final residual = 4.163122729918927e-09, No Iterations 0
DILUPBiCG:  Solving for Uy, Initial residual = 4.59032787455036e-09, Final residual = 4.59032787455036e-09, No Iterations 0
DILUPBiCG:  Solving for h, Initial residual = 9.416101596905256e-07, Final residual = 9.416101596905256e-07, No Iterations 0
Min/max T:300 310
DICPCG:  Solving for p_rgh, Initial residual = 9.343214257414049e-07, Final residual = 9.343214257414049e-07, No Iterations 0
time step continuity errors : sum local = 2.758594777251156e-07, global = -1.499279134027018e-17, cumulative = 1.340309069704447e-15
Min/max rho:1.123451097280091 1.160905661033402

Solving for solid region body
DICPCG:  Solving for h, Initial residual = 8.686132203851212e-07, Final residual = 8.686132203851212e-07, No Iterations 0
Min/max T:min(T) [0 0 0 1 0 0 0] 303.7710276494997 max(T) [0 0 0 1 0 0 0] 306.1953321209988
ExecutionTime = 75.23 s  ClockTime = 75 s
Here is the fvSoltuion for the air region:
Code:
solvers
{
    rho
    {
       solver          PCG
       preconditioner  DIC;
       tolerance       1e-4;
       relTol          0.1;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-6;
        relTol          0.1; //0.01
    }

    "(U|h|k|epsilon)"
    {
        solver           PBiCG;
        preconditioner   DILU;
        tolerance        1e-6;
        relTol           0; //0.1
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       1e5;
    rhoMin          rhoMin [1 -3 0 0 0] 0.2;
    rhoMax          rhoMax [1 -3 0 0 0] 2;

    residualControl
    {
    	p_rgh           1e-6;
    	U               1e-6;
    	h               1e-6;
	rho		1e-4;
    }
}
Here is the fvSoltuion for the solid region:
Code:
solvers
{
    h
    {
        solver           PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;	//0.1
    }
}
SIMPLE
{
    nNonOrthogonalCorrectors 0;

    residualControl
    {
       h               1e-6;
   }
}
relaxationFactors
{
    fields
    {
    }
    equations
    {
        h               1;
    }
}
__________________
Fields of interest: buoyantFoam, chtMultRegionFoam.
thiagopl is offline   Reply With Quote

Old   April 2, 2015, 09:47
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If you check source code of the solver, it does not check for convergence. runTime.loop() (loop method of Time class) just checks if time reached endTime.

Code:
    while (runTime.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        forAll(fluidRegions, i)
        {
            Info<< "\nSolving for fluid region "
                << fluidRegions[i].name() << endl;
            #include "setRegionFluidFields.H"
            #include "readFluidMultiRegionSIMPLEControls.H"
            #include "solveFluid.H"
        }

        forAll(solidRegions, i)
        {
            Info<< "\nSolving for solid region "
                << solidRegions[i].name() << endl;
            #include "setRegionSolidFields.H"
            #include "readSolidMultiRegionSIMPLEControls.H"
            #include "solveSolid.H"
        }

        runTime.write();

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }
lav likes this.
alexeym is offline   Reply With Quote

Old   April 2, 2015, 10:01
Default
  #3
Member
 
Thiago Parente Lima
Join Date: Sep 2011
Location: Diamantina, Brazil.
Posts: 62
Rep Power: 14
thiagopl is on a distinguished road
Hmm... so it was a dumb question.
I believe that there is a way to modify it, but I still can't read the codes of the solvers.

Thank you.

PS: Why not check for convergence?
__________________
Fields of interest: buoyantFoam, chtMultRegionFoam.
thiagopl is offline   Reply With Quote

Old   April 2, 2015, 10:29
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, it was correct question though it was not a question about OpenFOAM but a question of OpenFOAM's consistency. It is quite obvious that user expects similar behavior from SIMPLE family of solvers.

And, in fact, modification of the solver would be rather simple.

Unfortunately simpleControl has only loop public method that does a little bit more than just checking convergence. And there is criteriaSatisfied method which is protected but does just what is necessary to check convergence. So you can create myOwnSimpleControl class, which is simpleControl child. In this class you create public converged method. It just returns result criteriaSatisfied method.

Then in addition to creation of the meshes for all regions you create myOwnSimpleControl objects for every mesh. Finally you create boolean allRegionsConverged and check convergence of the regions in forAll loops.
alexeym 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
SIMPLE: no convergence criteria found Gennaro OpenFOAM Programming & Development 3 October 21, 2018 00:08
Setting up additional convergence criteria: output parameters are ‘constant’ Pierre1 FLUENT 3 March 23, 2015 09:47
Convergence criteria PrandtlGlawert FLUENT 1 August 13, 2009 18:06
How stop simulation if convergence is not reached? Andreas FLUENT 0 October 16, 2007 12:35
Physical convergence criteria yogui FLUENT 0 April 27, 2005 08:34


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