View Issue Details

IDProjectCategoryView StatusLast Update
0004034OpenFOAMBugpublic2023-11-16 16:23
Reportergeorgescovici Assigned Tohenry  
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Product Version10 
Fixed in Version11 
Summary0004034: Bug for pimpleFoam, parallel, outerCorrectorResidualControl, when using moveMeshOuterCorrectors true
DescriptionThe bug below has been observed when using the Red Hat Enterprise Linux 8.8 operating system.

I am trying to run a simulation where it is important that the mesh is deformed at each outer corrector of the PIMPLE algorithm. Since it is also a large case, I want to run it in parallel. To limit the number of outer correctors executed at each timestep, I am interested in imposing that the outer corrector loop is stopped when low-enough values of the fluid residuals have been obtained.

To impose the movement of the mesh at each outer corrector, I set moveMeshOuterCorrectors to true, and for the outer corrector convergence criterion I created an entry within the outerCorrectorResidualControl subdict. Both of these options are set from the PIMPLE dict in fvSolution. When imposing both of them and running PIMPLE in parallel, the simulation crashes. When only 2 of the 3 options (movement of the mesh at each outer corrector, advancement of the timestep based on the fluid residuals, running the case in parallel) are activated, the method works just fine.
Steps To ReproduceThe bug was initially found in OF8, but has been found to also occur in OF10. It can be reproduced by copying from the movingCone case. Now, by running successively blockMesh, decomposePar, and mpirun -n 4 pimpleFoam -parallel, the simulation works just fine.

Next, set moveMeshOuterCorrectors to true in fvSolution. This requires an extra subdict entry in the "solvers" dict in fvSolution, for cellMotionUxFinal. For simplicity, I added:

    cellMotionUxFinal
    {
        $cellMotionUx
    }

I also added nOuterCorrectors 25. Now, run Allclean, then blockMesh, decomposePar, and mpirun -n 4 pimpleFoam -parallel. The method works well.

Next, add a residual-based outer corrector residual criterion, by using the outerCorrectorResidualControl subdict in the fvSolution/PIMPLE dict. For example:

    outerCorrectorResidualControl
    {
      p
      {
              relTol 1e-4;
              tolerance 1e-5;
      }
    }

Now, do an Allclean, then blockMesh, then decomposePar. The simulation "hangs" at the third outer corrector of the first timestep. If one cleans the case and simply runs the pimpleFoam command (which uses a single core), there is no hanging. If one comments out the moveMeshOuterCorrector entry in fvSolution and runs the case in parallel, the method again behaves normally.
TagsNo tags attached.

Activities

henry

2023-11-13 10:14

manager   ~0013152

The corrector loops and residual control have been substantially rewritten for the modular solver system in OpenFOAM-11, please upgrade to 11 and re-test and report back with details if the issues remains.

georgescovici

2023-11-15 13:34

reporter   ~0013153

Hello, henry! Thank you for your quick response. As suggested, I ran the movingCone case in OF 11 (debug mode), and the simulation crashed. I am getting the same error that I also observed in OF 8 (debug mode), namely:

[3]
[3]
[3] --> FOAM FATAL ERROR:
[3] index 1 out of range 0 ... 0
[3]
[3] From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::SolverPerformance<double>; Foam::label = int]
[3] in file /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H at line 106.
[3]
FOAM parallel run aborting
[3]
[2]
[2]
[2] --> FOAM FATAL ERROR:
[2] index 1 out of range 0 ... 0
[2]
[2] From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::SolverPerformance<double>; Foam::label = int]
[2] in file /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H at line 106.
[2] [0]
[0]
[0] --> FOAM FATAL ERROR:
[0] index 1 out of range 0 ... 0
[0]
[1]
[1]
[1] --> FOAM FATAL ERROR:
FOAM parallel run aborting
[2]
[0] From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::SolverPerformance<double>; Foam::label = int]
[0] in file /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H at line 106.
[0]
FOAM parallel run aborting
[0]

[1] index 1 out of range 0 ... 0
[1]
[1] From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::SolverPerformance<double>; Foam::label = int]
[1] in file /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H at line 106.
[1]
FOAM parallel run aborting
[1]
[1] #0 [0] #0 [2] #0 [3] #0 Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&) at /software/OpenFOAM/OpenFOAM-11/src/OSspecific/POSIX/printStack.C:218
[0] #1 Foam::error::abort() at /software/OpenFOAM/OpenFOAM-11/src/OSspecific/POSIX/printStack.C:218
[1] #1 Foam::error::abort() at /software/OpenFOAM/OpenFOAM-11/src/OSspecific/POSIX/printStack.C:218
[2] #1 Foam::error::abort() at /software/OpenFOAM/OpenFOAM-11/src/OSspecific/POSIX/printStack.C:218
[3] #1 Foam::error::abort() at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/error.C:187
[0] #2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
[0] #3 Foam::UList<Foam::SolverPerformance<double> >::checkIndex(int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/error.C:187
[1] #2 at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/error.C:187
[2] #2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>)Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/error.C:187
[3] #2 at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
[1] #3 Foam::UList<Foam::SolverPerformance<double> >::checkIndex(int) constFoam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
[2] #3 Foam::UList<Foam::SolverPerformance<double> >::checkIndex(int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
[3] #3 Foam::UList<Foam::SolverPerformance<double> >::checkIndex(int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:108
 at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:108
[1] #4 Foam::UList<Foam::SolverPerformance<double> >::operator[](int) const[0] #4 Foam::UList<Foam::SolverPerformance<double> >::operator[](int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:108
[2] #4 Foam::UList<Foam::SolverPerformance<double> >::operator[](int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:108
[3] #4 Foam::UList<Foam::SolverPerformance<double> >::operator[](int) const at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:201
[0] #5 void Foam::convergenceControl::getInitialTypeResiduals<double>(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:201
[1] #5 void Foam::convergenceControl::getInitialTypeResiduals<double>(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:201
[2] #5 void Foam::convergenceControl::getInitialTypeResiduals<double>(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/UListI.H:201
[3] #5 void Foam::convergenceControl::getInitialTypeResiduals<double>(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControlTemplates.C:83
 at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControlTemplates.C:83
[0] #6 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, double&, double&)[1] #6 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControlTemplates.C:83
[3] #6 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControlTemplates.C:83
[2] #6 Foam::convergenceControl::getInitialResiduals(Foam::fvMesh const&, Foam::word const&, int, double&, double&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControl.C:66
[0] #7 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControl.C:66
[1] #7 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControl.C:66
[3] #7 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/convergenceControl/convergenceControl.C:66
[2] #7 Foam::singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied() const at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/singleRegionCorrectorConvergenceControl/singleRegionCorrectorConvergenceControl.C:199
[0] #8 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/singleRegionCorrectorConvergenceControl/singleRegionCorrectorConvergenceControl.C:199
[1] #8 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/singleRegionCorrectorConvergenceControl/singleRegionCorrectorConvergenceControl.C:199
[3] #8 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/singleRegionCorrectorConvergenceControl/singleRegionCorrectorConvergenceControl.C:199
[2] #8 Foam::pimpleLoop::loop(Foam::correctorConvergenceControl&) at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C:107 (discriminator 1)
[0] #9 Foam::pimpleSingleRegionControl::loop() at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C:107 (discriminator 1)
[1] #9 Foam::pimpleSingleRegionControl::loop() at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C:107 (discriminator 1)
[3] #9 Foam::pimpleSingleRegionControl::loop() at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C:107 (discriminator 1)
[2] #9 Foam::pimpleSingleRegionControl::loop() at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleSingleRegionControl/pimpleSingleRegionControl.C:95
[0] #10 ? at /software/OpenFOAM/OpenFOAM-11/applications/solvers/foamRun/foamRun.C:136
[0] #11 __libc_start_main at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleSingleRegionControl/pimpleSingleRegionControl.C:95
[1] #10 in "/lib64/libc.so.6"
[0] #12 ?? at ??:?
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI COMMUNICATOR 3 SPLIT FROM 0
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
 at /software/OpenFOAM/OpenFOAM-11/applications/solvers/foamRun/foamRun.C:136
[1] #11 __libc_start_main in "/lib64/libc.so.6"
[1] #12 at /software/OpenFOAM/OpenFOAM-11/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleSingleRegionControl/pimpleSingleRegionControl.C:95

henry

2023-11-16 14:32

manager   ~0013154

Try this:

commit 7dec67e9d7fd935bebd474b2acf19fb4f68bbee8 (HEAD -> master, origin/master, origin/HEAD)
Author: Henry Weller <http://cfd.direct>
Date: Thu Nov 16 14:30:47 2023 +0000

    Residuals: Updated from a GeometricMeshObject to a UpdateableMeshObject
    
    so that the stack of residuals is maintained following any kind of mesh change.
    
    Resolves bug-report https://bugs.openfoam.org/view.php?id=4034

henry

2023-11-16 16:23

manager   ~0013156

Resolved in OpenFOAM-dev by commit 7dec67e9d7fd935bebd474b2acf19fb4f68bbee8
Resolved in OpenFOAM-11 by commit 88eee60ddee573a04ecd9bc4adf7c88cf5f2d59c

Issue History

Date Modified Username Field Change
2023-11-13 09:49 georgescovici New Issue
2023-11-13 10:14 henry Note Added: 0013152
2023-11-15 13:34 georgescovici Note Added: 0013153
2023-11-16 14:32 henry Note Added: 0013154
2023-11-16 16:23 henry Assigned To => henry
2023-11-16 16:23 henry Status new => resolved
2023-11-16 16:23 henry Resolution open => fixed
2023-11-16 16:23 henry Fixed in Version => 11
2023-11-16 16:23 henry Note Added: 0013156