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

Floating point exception

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By ano
  • 1 Post By jpeter3
  • 2 Post By ano

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2017, 12:45
Question Floating point exception
  #1
New Member
 
Chen Sihe
Join Date: Sep 2017
Posts: 26
Rep Power: 9
cshsgy is on a distinguished road
Hello My Friends
I am solving a wedge-shaped case. It generates quite small cells-but in order to get the inner boundaries match I have to do so. I don't know whether this is the problem but what I am seeing is that the Courant Number blows up quickly and I am given the error "floating point exception (core dumped)". The program only runs for 3 timesteps, i.e. 0.06 case time before it is forced to stop.
I am not quite sure what caused the problem. So I have put my boundary conditions as well as my meshing file here. Can anyone please help to point out where the problem is happening?
Thanks a lot!

blockMeshDict File:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
    (149.857 -6.543 0)
    (149.857 -6.543 450)
    (74.929 -3.271 450)
    (74.929 -3.271 0)
    (149.857 6.543 0)
    (149.857 6.543 450)
    (74.929 3.271 450)
    (74.929 3.271 0)
    (9.990 -0.436 0)
    (9.990 -0.436 450)
    (0 0 450)
    (0 0 0)
    (9.990 0.436 0)
    (9.990 0.436 450)
);

blocks
(
    hex (0 3 2 1 4 7 6 5) (50 3 200) simpleGrading (1 1 1)
    hex (3 8 9 2 7 12 13 6) (50 3 200) simpleGrading (1 1 1)
    hex (8 11 10 9 12 11 10 13) (50 3 200) simpleGrading (1 1 1)
);

edges
(
    arc 3 7  (75 0 0)
    arc 2 6  (75 0 450)
    arc 8 12 (10 0 0)
    arc 9 13 (10 0 450)
    arc 0 4  (150 0 0)
    arc 1 5  (150 0 450)
);

boundary
(
    inletAnnular
    {
        type patch;
        faces
        (
            (7 4 0 3)
        );
    }

    inletCentral
    {
        type patch;
        faces
        (
            (8 11 11 12)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (1 5 6 2)
            (2 6 13 9)
            (9 13 10 10)
        );
    }

    bottom1
    {
        type empty;
        faces
        (
            (0 1 2 3)
        );
    }
    bottom2
    {
        type empty;
        faces
        (
            (3 2 9 8)
        );
    }
    bottom3
    {
        type empty;
        faces
        (
            (8 9 10 11)
        );
    }

    top1
    {
        type empty;
        faces
        (
            (4 5 6 7)
        );
    }
    top2
    {
        type empty;
        faces
        (
            (7 6 13 12)
        );
    }
    top3
    {
        type empty;
        faces
        (
            (12 13 10 11)
        );
    }

    bluffBody
    {
        type wall;
        faces
        (
            (7 3 8 12)
        );
    }
    cylinderWall
    {
        type wall;
        faces
        (
            (4 5 1 0)
        );
    }

    centerLine
    {
        type empty;
	faces
	(
	    (10 11 11 10)
	);
    }

);

mergePatchPairs
(
);

// ************************************************************************* //
Boundary Conditions(p):
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inletAnnular
    {
        type            zeroGradient;
    }
    inletCentral
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    bluffBody
    {
        type            zeroGradient;
    }
    cylinderWall
    {
        type            zeroGradient;
    }

    bottom1
    {
        type            empty;
    }
    bottom2
    {
        type            empty;
    }
    bottom3
    {
        type            empty;
    }
    top1
    {
        type            empty;
    }
    top2
    {
        type            empty;
    }
    top3
    {
        type            empty;
    }
}

// ************************************************************************* //
Boundary Conditions (U):
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    bluffBody
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    cylinderWall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    inletAnnular
    {
        type            fixedValue;
        value           uniform (0 0 6);
    }
    inletCentral
    {
        type            fixedValue;
        value           uniform (0 0 4);
    }
    outlet
    {
        type            zeroGradient;
    }
    bottom1
    {
        type            empty;
    }
    bottom2
    {
        type            empty;
    }
    bottom3
    {
        type            empty;
    }
    top1
    {
        type            empty;
    }
    top2
    {
        type            empty;
    }
    top3
    {
        type            empty;
    }


}

// ************************************************************************* //
Have a nice day everyone!
cshsgy is offline   Reply With Quote

Old   October 10, 2017, 06:51
Default
  #2
ano
Member
 
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10
ano is on a distinguished road
Hi cshsgy,

did you already try to make your time step size adjustable in your controlDict?
Code:
adjustTimeStep true;
maxCo 0.3;
In the beginning of a simulation the physical fields often do not match which can give rise to floating point exceptions in the solution process. With decreasing your time step to fullfil the Courant criterion you can reduce this problem.
cshsgy likes this.
ano is offline   Reply With Quote

Old   October 10, 2017, 08:11
Default
  #3
New Member
 
Chen Sihe
Join Date: Sep 2017
Posts: 26
Rep Power: 9
cshsgy is on a distinguished road
Quote:
Originally Posted by ano View Post
Hi cshsgy,

did you already try to make your time step size adjustable in your controlDict?
Code:
adjustTimeStep true;
maxCo 0.3;
In the beginning of a simulation the physical fields often do not match which can give rise to floating point exceptions in the solution process. With decreasing your time step to fullfil the Courant criterion you can reduce this problem.
Hi ano,
Thanks for your suggestion. I have actually just adjusted the timesteps manually, and after it has executed 4 times regardless of the timestep I use, the error message is given in the attachment (sorry I think I could make it easier to read, but I dunt know how to insert the graph directly into the thread...)
Attached Images
File Type: png error image.png (27.0 KB, 105 views)
cshsgy is offline   Reply With Quote

Old   October 10, 2017, 11:45
Default Wedge boundary condition
  #4
ano
Member
 
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10
ano is on a distinguished road
Hi Chen Sihe,1. The error just tells you that the simulation was in the process of solving an equation with a smoother method and somehow it got a floating point exception. This normally means, that something went wrong before that (like very high Courant number).
2. Sorry. I didn't read your message well enough for the first time. I noticed that you use a wedgebut in the boundary conditions I see "empty".
If I remember correctly from the code, OpenFoam projects your vectors (such as velocity) in the plane and assumes that the "empty" sides are parallel. But for a wedge, where your sides are not parallel you should use the wedge boundary condition and an angle of 2.5 degree of your wedge.
For a simple example you can have a look at the case in tutorials/multiphase/interFoam/les/nozzleFlow2D. Set your empty boundary conditions to wedge and change your constant/polyMesh/boundary accordingly.
3. If 2. is not working, consider using pimpleFoam which is very stable in the solving process.
ano is offline   Reply With Quote

Old   October 11, 2017, 11:20
Default
  #5
New Member
 
Chen Sihe
Join Date: Sep 2017
Posts: 26
Rep Power: 9
cshsgy is on a distinguished road
Quote:
Originally Posted by ano View Post
Hi Chen Sihe,1. The error just tells you that the simulation was in the process of solving an equation with a smoother method and somehow it got a floating point exception. This normally means, that something went wrong before that (like very high Courant number).
2. Sorry. I didn't read your message well enough for the first time. I noticed that you use a wedgebut in the boundary conditions I see "empty".
If I remember correctly from the code, OpenFoam projects your vectors (such as velocity) in the plane and assumes that the "empty" sides are parallel. But for a wedge, where your sides are not parallel you should use the wedge boundary condition and an angle of 2.5 degree of your wedge.
For a simple example you can have a look at the case in tutorials/multiphase/interFoam/les/nozzleFlow2D. Set your empty boundary conditions to wedge and change your constant/polyMesh/boundary accordingly.
3. If 2. is not working, consider using pimpleFoam which is very stable in the solving process.
Hi ano,
Thanks for your suggestion!
However, as long as I have changed my boundary conditions (I changed all those faces to "wedge", which is correct according to the examples either you suggested or for other wedge geometries), the error continues. Since the geometry may be not direct for you to check, I have simplified my geometry. It still stops after 4 iterations, and gives just the same error. I have attached the simplified version of files here, and sketched a graph as well. I think this could be a very very simple case for you then... So is it possible for you to help figure out where the problem is (with the boundary types here)?
Thanks!

blockMeshDict(I have checked with paraview that the geometry is right)
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
    (149.857 -6.543 0)
    (149.857 -6.543 450)
    (149.857 6.543 0)
    (149.857 6.543 450)
    (0 0 450)
    (0 0 0)
);

blocks
(
    hex (0 5 4 1 2 5 4 3) (20 1 60) simpleGrading (1 1 1)
);


boundary
(
    inlet
    {
        type patch;
        faces
        (
            (2 0 5 5)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (3 4 4 1)
        );
    }

    bottom
    {
        type wedge;
        faces
        (
            (0 1 4 5)
        );
    }
    top
    {
        type wedge;
        faces
        (
            (2 5 4 3)
        );
    }
    cylinderWall
    {
        type wall;
        faces
        (
            (2 3 1 0)
        );
    }

    axis
    {
        type empty;
	faces
	(
	    (4 5 5 4)
	);
    }

);

mergePatchPairs
(
);

// ************************************************************************* //
boundary value p in t=0:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    cylinderWall
    {
        type            zeroGradient;
    }

    bottom
    {
        type            wedge;
    }
    top
    {
        type            wedge;
    }
    axis
    {
        type            empty;
    }
}

// ************************************************************************* //
boundary value U in t=0:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    cylinderWall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    inlet
    {
        type            fixedValue;
        value           uniform (0 0 6);
    }
    outlet
    {
        type            zeroGradient;
    }
    bottom
    {
        type            wedge;
    }
    top
    {
        type            wedge;
    }

    axis
    {
        type            empty;
    }
}

// ************************************************************************* //
Attached Images
File Type: jpg 1507734919639.jpg (54.0 KB, 46 views)
cshsgy is offline   Reply With Quote

Old   October 15, 2017, 09:50
Default
  #6
New Member
 
JPeternel
Join Date: Oct 2014
Posts: 19
Rep Power: 11
jpeter3 is on a distinguished road
Have you checked the mesh using checkMesh? It should give you mesh OK message at the end.

Also the way you defined inlet patch is somewhat strange:
type patch;
faces
(
(2 0 5 5)
);

Define vertices in direction which points the face normal out of the domain, something like (2 5 0 2). That 5 5 at the end in your defintiion may be causing truble.
0
/ |
5 |
\ |
2
cshsgy likes this.
jpeter3 is offline   Reply With Quote

Old   October 16, 2017, 12:07
Default change grading in blockMeshDict
  #7
ano
Member
 
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10
ano is on a distinguished road
Jaka's comment was helpful. checkMesh returned a bad aspect ratio above 3000 (if I remember correctly up to 1000 is ok) and that many edges were not aligned with or perpendicular to non-empty directions.

Your mistake is in your blockMeshDict at the definition of your cells. You have to swap the 1 and the 60 in (20 1 60) so that you get:
Code:
blocks
(
    hex (0 5 4 1 2 5 4 3) (20 60 1) simpleGrading (1 1 1)
);
The small mistake is that x,y,z are defined in the grading part by the local coordinate system of your hexaeder and do not (necessarily) match the x,y,z coordinate system you used for defining the vertices.

A description of the local coordinate system can be found here
cshsgy and jousefm like this.
ano is offline   Reply With Quote

Old   October 21, 2017, 05:02
Default
  #8
New Member
 
Chen Sihe
Join Date: Sep 2017
Posts: 26
Rep Power: 9
cshsgy is on a distinguished road
Quote:
Originally Posted by ano View Post
Jaka's comment was helpful. checkMesh returned a bad aspect ratio above 3000 (if I remember correctly up to 1000 is ok) and that many edges were not aligned with or perpendicular to non-empty directions.

Your mistake is in your blockMeshDict at the definition of your cells. You have to swap the 1 and the 60 in (20 1 60) so that you get:
Code:
blocks
(
    hex (0 5 4 1 2 5 4 3) (20 60 1) simpleGrading (1 1 1)
);
The small mistake is that x,y,z are defined in the grading part by the local coordinate system of your hexaeder and do not (necessarily) match the x,y,z coordinate system you used for defining the vertices.

A description of the local coordinate system can be found here
Oh yes thanks ano and Jaka. I have fixed the problem and the mesh is now OK. In order to runner the simulation successfully, another issue is that the icofoam file needs to have some modification before we are using adjustable time steps. Thanks a lot bro and have a nice day
cshsgy is offline   Reply With Quote

Old   August 31, 2023, 08:39
Default floating point exception problem
  #9
New Member
 
Vishal Garg
Join Date: Jun 2023
Posts: 13
Rep Power: 3
Vishal Garg is on a distinguished road
Facing floating point problem while increasing the length of system.

#0 Foam::error:rintStack(Foam::Ostream&) in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#1 Foam::sigFpe::sigHandler(int) in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#2 ? in /lib/x86_64-linux-gnu/libc.so.6
#3 Foam::basicFvGeometryScheme::deltaCoeffs() const in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#4 Foam::surfaceInterpolation::deltaCoeffs() const in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#5 Foam::fvPatch::deltaCoeffs() const in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#6 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#7 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#8 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#9 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#10 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#11 Foam::rhoThermo::addfvMeshConstructorToTable<Foam: :heRhoThermo<Foam::rhoThermo, Foam:ureMixture<Foam::constTransport<Foam::speci es::thermo<Foam::hConstThermo<Foam::rhoConst<Foam: :specie> >, Foam::sensibleEnthalpy> > > > >::New(Foam::fvMesh const&, Foam::word const&) in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#12 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#13 Foam::rhoThermo::New(Foam::fvMesh const&, Foam::word const&) in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so
#14 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/bin/chtMultiRegionSimpleFoam
#15 ? in /lib/x86_64-linux-gnu/libc.so.6
#16 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#17 ? in /usr/lib/openfoam/openfoam2212/platforms/linux64GccDPInt32Opt/bin/chtMultiRegionSimpleFoam
Floating point exception (core dumped)

as i am running for 100 m length of pipe, it is running well. but when i increase the length of the pipe more than 100m, it gets dumped.
i have checked mesh by checkmesh command, it says mesh ok

please reply on this post.
Vishal Garg is offline   Reply With Quote

Reply

Tags
error, openfoam


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
icoFoam floating point exception (8) leizhao512 OpenFOAM Running, Solving & CFD 7 November 1, 2018 11:43
A floating point exception has occurred: floating point exception [Overflow]. starlight STAR-CCM+ 4 May 4, 2016 09:08
A floating point exception - SEM Model yansheng STAR-CCM+ 1 April 4, 2016 04:57
Floating point exception from twoPhaseEulerFoam openfoammaofnepo OpenFOAM Running, Solving & CFD 1 March 19, 2016 13:56
Floating point exception (core dumped) for GAMG solver yuhou1989 OpenFOAM Running, Solving & CFD 2 March 24, 2015 19:28


All times are GMT -4. The time now is 20:19.