MicroNanoFlows / OpenFOAM-2.4.0-MNF

OpenFOAM 2.4.0 plus the MicroNanoFlow Group Codes
http://www.micronanoflows.ac.uk/
Other
50 stars 37 forks source link

reconstructPar fails on Ubuntu 18.04.4 LTS #8

Closed ecrichton closed 2 years ago

ecrichton commented 4 years ago

I found dsmcFoamPlus fails for me with loadBalancing enabled and it appears to be related to reconstructPar apparently not working. (have lots of success running 2.4.0-MNF cases on earlier versions of Ubuntu).

Quick example steps to reproduce: 1) Add a simple 2x2x1 decomposeParDict to tutorial/incompressible/icoFoam/cavity/system 2) blockMesh 3) decomposeMesh 4) mpirun -np 4 icoFoam -parallel 5) reconstructPar

Output of reconstructPar below. Have confirmed that if I switch to openfoam 7 for the just the final reconstructPar the case reconstructs without errors.

/---------------------------------------------------------------------------\ | ========= | | | \ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \ / O peration | Version: 2.4.0-MNF | | \ / A nd | Web: www.OpenFOAM.org | | \/ M anipulation | | *---------------------------------------------------------------------------*/ Build : 2.4.0-MNF Exec : reconstructPar Date : Feb 11 2020 Time : 11:03:28 Host : "openfoam" PID : 3792 Case : /home/openfoam/OpenFOAM/openfoam-2.4.0-MNF/run/cavity nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations

// * // Create time

Reconstructing fields for mesh region0

Time = 0.1

Reconstructing FV fields

Reconstructing volScalarFields

    p

0 Foam::error::printStack(Foam::Ostream&) at ??:?

1 Foam::sigSegv::sigHandler(int) at ??:?

2 ? in "/lib/x86_64-linux-gnu/libc.so.6"

3 Foam::fvPatchField::addpatchMapperConstructorToTable<Foam::zeroGradientFvPatchField >::New(Foam::fvPatchField const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?

4 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

5 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

6 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

7 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

8 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"

10 ? in "/home/openfoam/OpenFOAM/OpenFOAM-2.4.0-MNF/platforms/linux64GccMNFDPOpt/bin/reconstructPar"

Segmentation fault (core dumped)

gargtarang commented 4 years ago

ReconstructPar is failing for me also

gargtarang commented 4 years ago

I found the solution. There is somewhere divide by zero error. Adding -O0 in $FOAM_SRC/finiteVolume/Make/options just before LIB_LIBS seems to do the trick.

craigwhite87 commented 4 years ago

I'm not sure it is a divide by zero, it is a segmentation fault, not a floating point error. I'm also not sure what adding an optimisation flag to the finite volume class is doing to other parts of OpenFOAM so I would be wary about implementing this.

In the case where you were experiencing this, were there cells that reported a negative translational temperature (and therefore negative pressure)? I ask because I have noticed sometimes that in cells where no particles have been present a very small negative value is written out for the temperature instead of zero.

gargtarang commented 4 years ago

I am also not sure what could be the problem, I tried this program on our cluster, there I compiled it using intel2016/u2 and -O3 flag. The program compiles and reconstructPar works well. I could not dwell much below it.

The problem was not related to negative temperature or volume. However, other versions of openfoam like v6 and v8 were able to reconstruct the fvm fields but not lagrangian fields.

facq commented 3 years ago

i had the same error. The only solution i found was to use intel compiler (i.e. intel/2019.1.144, changing the compiler to "Icc" in the configuration file)

YuLong-F1112 commented 2 years ago

I found the solution. There is somewhere divide by zero error. Adding -O0 in $FOAM_SRC/finiteVolume/Make/options just before LIB_LIBS seems to do the trick.

I also had the same problem as you and tried your method. But it didn't work. Is there any other solution?

hamidmoezzi1988 commented 2 years ago

Hi all, Have you solved the problem regarding the reconstructPar segmentation fault?

Thank you.

craigwhite87 commented 2 years ago

I suspect it's just a problem with an older version of OpenFOAM and newer compilers. In my research group, we are now using OpenFOAM-v2112 (and v2206) and moving the code to these versions has solved this issue, which we can hopefully make public soon.

OlivierMiriel commented 2 years ago

I am using OF-v2112 and the problem still exists. With InterFOAM, reconstructPar fails as below:

Reconstructing FV fields

    Reconstructing volScalarFields

        Co
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libpthread.so.0
#3  Foam::IOobject::path() const at ??:?