View Issue Details

IDProjectCategoryView StatusLast Update
0003173OpenFOAMBugpublic2019-03-01 15:46
Reporterjherb Assigned Towill  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformSUSE Linux Enterprise Server 11 OSSUSE Linux Enterprise Server 11 OS Version(please specify)
Summary0003173: buoyantPimpleFoam with nOuterCorrectors crashes (regression from OpenFOAM 5)
DescriptionFor different cases buoyantPimpleFoam crashes, if nOuterCorrectors are used:
PIMPLE: Iteration 7
DILUPBiCGStab: Solving for Ux, Initial residual = 0.0026433, Final residual = 6.27222e-06, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 0.00255987, Final residual = 6.41521e-06, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.0026433, Final residual = 6.27221e-06, No Iterations 1
DILUPBiCGStab: Solving for h, Initial residual = 0.00181503, Final residual = 8.62371e-06, No Iterations 1
DICPCG: Solving for p_rgh, Initial residual = 0.00737213, Final residual = 5.90448e-05, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 5.906e-05, Final residual = 5.01722e-07, No Iterations 10
DICPCG: Solving for p_rgh, Initial residual = 5.03358e-07, Final residual = 4.33555e-09, No Iterations 16
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.42194e-07, global = 2.42194e-07, cumulative = 0.000212064
DICPCG: Solving for p_rgh, Initial residual = 0.00283376, Final residual = 2.0804e-05, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 2.0808e-05, Final residual = 1.8005e-07, No Iterations 10
DICPCG: Solving for p_rgh, Initial residual = 1.82666e-07, Final residual = 6.11662e-09, No Iterations 14
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.4238e-07, global = 2.4238e-07, cumulative = 0.000212306
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib64/libc.so.6"
#3 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, Foam::ITstream&, double&, double&) at ??:?
Waiting for data... (interrupt to abort)/home/hej/OpenFOAM/OpenFOAM-6/bin/tools/RunFunctions: line 53: 9825 Floating point exception$APP_RUN "$@" > log.$LOG_SUFFIX 2>&1
#4 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at ??:?
#5 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at ??:?
#6 Foam::pimpleControl::loop() at ??:?
#7 ? at ??:?
#8 __libc_start_main in "/lib64/libc.so.6"
#9 ? at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:116


The crashes are reproducible at the same iteration, if the same number of CPUs (one ore x with MPI) are used.
These crashes seem not to occur with OpenFOAM 5.x

Also they occur with a case with completely different physics, geometry, mesh, ...


Steps To ReproduceStart the attached case with is based on the tutorial OpenFOAM-6/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom

Just the fvSolutions file was modified:

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 30;
    nCorrectors 2;
    nNonOrthogonalCorrectors 2;

    // OF 6
    outerCorrectorResidualControl
    {
        "(U.*|p.*)"
        {
            relTol 0;
            tolerance 0.0001;
        }
        "(h|k|epsilon)"
        {
            relTol 0;
            tolerance 0.001;
        }
    }
/*
    // OF 5
    residualControl
    {
          "(h|k|epsilon)"
          {
                relTol 0;
                tolerance 1e-3;
          }
          "(U.*|p|p_rgh)"
          {
                relTol 0;
                tolerance 1e-4;
          }

*/
}

relaxationFactors
{
  fields
    {
      p_rgh 0.6;
      p_rghFinal 1;
    }
    equations
    {
        "(T|k|omega|R)" 0.6;
        "U(x|y|z)*" 0.3;
        h 0.4;
        "(h|U.*|T|k|omega|R)Final" 1;
    }
}

Additional InformationAdditional observation: The simulation with OpenFOAM 5.x seems to converge much fast per time step.
TagsNo tags attached.

Relationships

related to 0003182 closedchris Error in Foam::pimpleControl::loop() at ??:? 

Activities

jherb

2019-02-19 15:52

reporter  

hotRoom.nOuter.tar.gz (2,950 bytes)

jherb

2019-02-19 16:04

reporter   ~0010300

I also run the test case on a different computer using the latest OpenFOAM-dev and also OpenFOAM-6. Both simulations crashed. But at different points:

OpenFOAM-6:
Courant Number mean: 0.100328 max: 0.75168
Time = 204

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: Iteration 1
...
PIMPLE: Iteration 11
DILUPBiCGStab: Solving for Ux, Initial residual = 0.000190101, Final residual = 9.03535e-08, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 0.000253735, Final residual = 1.92472e-07, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.000190101, Final residual = 9.03528e-08, No Iterations 1
DILUPBiCGStab: Solving for h, Initial residual = 0.000113681, Final residual = 1.25367e-07, No Iterations 1
DICPCG: Solving for p_rgh, Initial residual = 0.00141397, Final residual = 1.30006e-05, No Iterations 4
DICPCG: Solving for p_rgh, Initial residual = 1.30033e-05, Final residual = 6.46205e-08, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 7.67564e-08, Final residual = 5.73888e-09, No Iterations 4
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.93598e-08, global = 1.93598e-08, cumulative = 0.000519603
DICPCG: Solving for p_rgh, Initial residual = 0.000559505, Final residual = 4.68605e-06, No Iterations 4
DICPCG: Solving for p_rgh, Initial residual = 4.68644e-06, Final residual = 2.32746e-08, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 4.89851e-08, Final residual = 8.79882e-09, No Iterations 2
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.93718e-08, global = 1.93718e-08, cumulative = 0.000519622
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib64/libc.so.6"
#3 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, Foam::ITstream&, double&, double&) at ??:?
#4 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at ??:?
#5 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at ??:?
#6 Foam::pimpleControl::loop() at ??:?
#7 ? at ??:?
#8 __libc_start_main in "/lib64/libc.so.6"
#9 ? at /home/abuild/rpmbuild/BUILD/glibc-2.18/csu/../sysdeps/x86_64/start.S:125

OpenFOAM-dev:
Courant Number mean: 0.110577 max: 0.758001
Time = 358

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: Iteration 1
...
PIMPLE: Iteration 9
DILUPBiCGStab: Solving for Ux, Initial residual = 0.000159993, Final residual = 4.0151e-08, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 0.000305932, Final residual = 1.38454e-07, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.000159993, Final residual = 4.01516e-08, No Iterations 1
DILUPBiCGStab: Solving for h, Initial residual = 0.000127525, Final residual = 7.34138e-08, No Iterations 1
DICPCG: Solving for p_rgh, Initial residual = 0.000974706, Final residual = 7.24818e-06, No Iterations 3
DICPCG: Solving for p_rgh, Initial residual = 7.24994e-06, Final residual = 4.7008e-08, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 6.23827e-08, Final residual = 8.32687e-09, No Iterations 3
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.02877e-08, global = 1.02877e-08, cumulative = 0.000202414
DICPCG: Solving for p_rgh, Initial residual = 0.000385133, Final residual = 2.90124e-06, No Iterations 3
DICPCG: Solving for p_rgh, Initial residual = 2.90174e-06, Final residual = 1.85987e-08, No Iterations 35
DICPCG: Solving for p_rgh, Initial residual = 4.44122e-08, Final residual = 8.46067e-09, No Iterations 2
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.37139e-10, global = 9.16484e-12, cumulative = 0.000202414
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib64/libc.so.6"
#3 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, Foam::ITstream&, double&, double&) at ??:?
#4 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at ??:?
#5 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at ??:?
#6 Foam::pimpleControl::loop() at ??:?
#7 ? at ??:?
#8 __libc_start_main in "/lib64/libc.so.6"
#9 ? at /home/abuild/rpmbuild/BUILD/glibc-2.18/csu/../sysdeps/x86_64/start.S:125

wyldckat

2019-02-20 09:18

updater   ~0010301

@jherb: Quick question: Which compiler and which version of it did you use?
This is just in case you've used a compiler that is too old for the more recent code in OpenFOAM, which could explain some of the symptoms you are describing.

jherb

2019-02-20 11:22

reporter   ~0010302

On the first computer, Intel 18.0.2 was used, on the second computer GCC 7.2.0

will

2019-02-20 11:33

manager   ~0010304

It's not a compiler issue. I can reproduce it. The list of solver residuals is being indexed out of bounds. Either the index is incorrect or the list isn't being filled properly or is being reset.

will

2019-02-20 11:34

manager   ~0010305

With a debug build, you get:

--> FOAM FATAL ERROR:
index 6 out of range 0 ... 1

    From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::SolverPerformance<Foam::Vector<double> >; Foam::label = int]
    in file /home/bender2/will/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/UListI.H at line 106.

FOAM aborting (FOAM_ABORT set)

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
#3 Foam::UList<Foam::SolverPerformance<Foam::Vector<double> > >::checkIndex(int) const at ~/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/UListI.H:108
#4 Foam::UList<Foam::SolverPerformance<Foam::Vector<double> > >::operator[](int) const at ~/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/UListI.H:201
#5 void Foam::convergenceControl::getInitialTypeResiduals<Foam::Vector<double> >(Foam::fvMesh const&, Foam::word const&, int, Foam::ITstream&, double&, double&) at ~/OpenFOAM/OpenFOAM-dev/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControlTemplates.C:69 (discriminator 2)
#6 ...

will

2019-02-20 12:03

manager   ~0010306

The iteration index is being held per-entry in the outerCorrectorResidualControl sub-dictionary. When the field name is given as a regular expression and relates to multiple fields, and those fields have different iteration sequences (e.g., p and U), this can result in the wrong iteration index being used.

The index needs to be held per-field. I'll make this change, but might take a bit of time. It's not a simple fix.

In the mean-time, you can run the case by separating the entries for p and U; e.g.,

        "(U.*)"
        {
            relTol 0;
            tolerance 0.0001;
        }
        "(p.*)"
        {
            relTol 0;
            tolerance 0.0001;
        }

jherb

2019-02-20 13:37

reporter   ~0010308

Thank you for finding the root cause of the problem. The temporary fix to not use regular expressions is OK for now.

will

2019-02-20 14:46

manager   ~0010309

Despite what I said before, it actually wasn't that complicated. Fixed in version 6 and in dev. Commits below.

https://github.com/OpenFOAM/OpenFOAM-6/commit/e29811f5dff86b792974a11f01d4155acccb69c0
https://github.com/OpenFOAM/OpenFOAM-dev/commit/d7a5456aae71aef41cbd8cb0de7b94a530644a04

Issue History

Date Modified Username Field Change
2019-02-19 15:52 jherb New Issue
2019-02-19 15:52 jherb File Added: hotRoom.nOuter.tar.gz
2019-02-19 15:52 jherb File Added: log.buoyantPimpleFoam-5.gz
2019-02-19 15:52 jherb File Added: log.buoyantPimpleFoam-6.gz
2019-02-19 16:04 jherb Note Added: 0010300
2019-02-20 09:18 wyldckat Note Added: 0010301
2019-02-20 11:22 jherb Note Added: 0010302
2019-02-20 11:33 will Note Added: 0010304
2019-02-20 11:34 will Note Added: 0010305
2019-02-20 12:03 will Note Added: 0010306
2019-02-20 13:37 jherb Note Added: 0010308
2019-02-20 14:46 will Assigned To => will
2019-02-20 14:46 will Status new => resolved
2019-02-20 14:46 will Resolution open => fixed
2019-02-20 14:46 will Fixed in Version => 6
2019-02-20 14:46 will Note Added: 0010309
2019-03-01 15:46 will Relationship added related to 0003182