CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   pisoFoam : error floating point (http://www.cfd-online.com/Forums/openfoam-solving/94788-pisofoam-error-floating-point.html)

Dbutant November 25, 2011 11:35

pisoFoam : error floating point
 
5 Attachment(s)
Hello,
I'm trying to use pisoFoam on a test case.
This is just a box (1m) in a flow of 24m/s.
I want use a k-epsilon model, transient, incompressible, turbulent.
But there is an error and pisoFoam stop calculation :

Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/libc.so.6"
#3  Foam::DILUPreconditioner::calcReciprocalD(Foam::Field<double>&, Foam::lduMatrix const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::DILUPreconditioner::DILUPreconditioner(Foam::lduMatrix::solver const&, Foam::dictionary const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  Foam::lduMatrix::preconditioner::addasymMatrixConstructorToTable<Foam::DILUPreconditioner>::New(Foam::lduMatrix::solver const&, Foam::dictionary const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6  Foam::lduMatrix::preconditioner::New(Foam::lduMatrix::solver const&, Foam::dictionary const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#7  Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#8 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
#9 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
#10 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
#11  __libc_start_main in "/lib/libc.so.6"
#12 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
Exception en point flottant

I've done the mesh on gmsh. The file .geo compressed is Attachment 10203
The 0 folder is Attachment 10204.
The system folder is Attachment 10205
The properties files are Attachment 10206
And the boundaries Attachment 10207

When I execute checkMesh, it's ok.

I tried to unset the FOAM_SIGFPE in etc/bashrc but nothing change.

I'm not sure of my initial conditions for R, epsilon and k. I don't know which values I need to put, so I let the default values from the tutorial.

I don't know if it's can provide from the mesh that I need to refine.

I'm waiting your answers.

Thanks

gwierink November 26, 2011 05:22

Hi there,

What are you trying to set up? Your BCs seem a bit strange. If you would like to have a flow inlet on the left and outflow on the right, you probably want to specify U at the inlet, have inletOutlet for U at the outlet, have p zeroGradient at the inlet, and fix p at, say, 0 at the outlet. have a look at $FOAM_TUTORIALS/incompressible/pisoFoam/les/pitzDaily for some inspiration.

k and \varepsilon can be modelled as (have a look at the User Guide):

k = \tfrac{3}{2} \left( UI \right)^{2},

where I is turbulent intensity (guestimate can be e.g. 0.02 or 0.05), and

\varepsilon = \frac{C_{\mu}^{0.75} k^{1.5}}{L},

where C_{\mu}=0.09 and L is a characteristic length scale (e.g. 20% of channel inlet diameter).

From $FOAM_TUTORIALS/incompressible/pisoFoam/les/pitzDaily you can see that e.g. 0/U has the following for the inlet:
Code:

    inlet
    {
        type                  turbulentInlet;
        referenceField    uniform (10 0 0); // main flow U
        fluctuationScale  (0.02 0.01 0.01); // I in x, y, and z direction
        value                  uniform (10 0 0);
    }

Hope this helps you on your way a bit :).

Dbutant November 28, 2011 10:19

Thank you for your answer, I have changed my BC but it doesn't work, could you say me if everything is ok.

0/epsilon :
Code:

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

internalField  uniform 0.04571;

boundaryField
{
    AvtArr
    {
        type            empty;
    }
    HautBas
    {
        type            fixedValue;
        value          uniform 0.04571;
    }
    Sortie
    {
        type            fixedValue;
        value          uniform 0.04571;
    }
    Entree
    {
        type            fixedValue;
        value          uniform 0.04571;
    }
    Objet
    {
        type            epsilonWallFunction;
        value          uniform 0.04571;
    }
}

0/k :
Code:

internalField  uniform 0.0864;

boundaryField
{
    AvtArr
    {
        type            empty;
    }
    HautBas
    {
        type            fixedValue;
        value          uniform 0.0864;
    }
    Sortie
    {
        type            fixedValue;
        value          uniform 0.0864;
    }
    Entree
    {
        type            fixedValue;
        value          uniform 0.0864;
    }
    Objet
    {
        type            kqRWallFunction;
        value          uniform 0.0864;
    }
}

0/p :
Code:

internalField  uniform 0;

boundaryField
{
    Entree     
    {
        type            zeroGradient;
    }

    Sortie     
    {
        type            fixedValue;
        value          uniform 0;
    }
    Objet   
    {
        type            zeroGradient;
    }
    HautBas   
    {
        type            zeroGradient;
    }

    AvtArr   
    {
        type            empty;
    }
}

0/U :
Code:

internalField  uniform (0 0 0);

boundaryField
{
    Entree     
    {
        type        turbulentInlet;
        referenceField    uniform (24 0 0); // main flow U
        fluctuationScale  (0.01 0.01 0.01); // I in x, y, and z direction
        value        uniform (24 0 0);
    }

    Sortie     
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value          uniform (0 0 0);
    }
    Objet   
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    HautBas   
    {
        type            freestream;
        freestreamValue uniform (0 0 0);
    }

    AvtArr   
    {
        type            empty;
    }
}

I don't understand what I need to do.

gwierink November 28, 2011 17:02

Ok, what is the error you get?
I noticed that your mesh is 3D. Do you want your domain to be a thin 3D slice, or do you want 2D? In OpenFOAM the 2D mesh will be one cell thick, looking like 3D, but I don't think you need to do that in your meshing tool. The mesh converter will take care of that.
Another thing is what you want to do. What kind of simulation are you interested in? What are the boundaries? For example, if HautBas are your lower and upper walls, you probably want to set something like fixedValue (0 0 0) there for velocity ...

Dbutant November 29, 2011 06:14

1 Attachment(s)
The error that I get is :
Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/libc.so.6"
#3  Foam::LimitedScheme<double, Foam::limitedLinearLimiter<Foam::NVDTVD>, Foam::limitFuncs::magSqr>::limiter(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#4  Foam::limitedSurfaceInterpolationScheme<double>::weights(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#5  Foam::fv::gaussConvectionScheme<double>::fvmDiv(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#6  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::word const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#7  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#8  Foam::incompressible::RASModels::kEpsilon::correct() in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#9 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
#10  __libc_start_main in "/lib/libc.so.6"
#11 
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/pisoFoam"
Exception en point flottant

I want a 2D domain so I have done a 3D with one cell thick.

Attachment 10238
The HautBas is not wall.

I tried with this 0/U :
Code:

internalField  uniform (24 0 0);

boundaryField
{
    Entree     
    {
        type                  turbulentInlet;
        referenceField    uniform (24 0 0); // main flow U
        fluctuationScale  (0.01 0.01 0.01); // I in x, y, and z direction
        value                  uniform (24 0 0);
    }
    Sortie     
    {
        type            zeroGradient;
    }
    Objet   
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    HautBas   
    {
        type            zeroGradient;
    }
    AvtArr   
    {
        type            empty;
    }
}

And that :

Code:

internalField  uniform (24 0 0);

boundaryField
{
    Entree     
    {
        type                  turbulentInlet;
        referenceField    uniform (24 0 0); // main flow U
        fluctuationScale  (0.01 0.01 0.01); // I in x, y, and z direction
        value                  uniform (24 0 0);
    }
    Sortie     
    {
        type            fixedValue;
        value          uniform (24 0 0);
    }
    Objet   
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    HautBas   
    {
        type            fixedValue;
          value          uniform (24 0 0);
    }
    AvtArr   
    {
        type            empty;
    }
}

But there is always an error.

I have reduced my deltaT in controlDict to 0.00001, my smallest deltaX is 0.005. So my Courant number is 0.048<1.
But when I see the last iteration, the log write a max Courant number of 97 :
Code:

Time = 5e-05

Courant Number mean: 0.00490689 max: 0.796989
DILUPBiCG:  Solving for Ux, Initial residual = 0.825801, Final residual = 3.40013e-06, No Iterations 11
DILUPBiCG:  Solving for Uy, Initial residual = 0.93573, Final residual = 4.85214e-06, No Iterations 11
DICPCG:  Solving for p, Initial residual = 0.787761, Final residual = 0.0756733, No Iterations 9
time step continuity errors : sum local = 9.71158e-06, global = -2.36612e-09, cumulative = -1.1106e-07
DICPCG:  Solving for p, Initial residual = 0.364313, Final residual = 9.27039e-07, No Iterations 336
time step continuity errors : sum local = 1.96103e-09, global = -1.34322e-11, cumulative = -1.11073e-07
DILUPBiCG:  Solving for epsilon, Initial residual = 0.123204, Final residual = 7.07044e-06, No Iterations 7
bounding epsilon, min: -2.42782e+10 max: 2.51261e+11 average: 3.90569e+07
DILUPBiCG:  Solving for k, Initial residual = 0.986799, Final residual = 6.01388e-06, No Iterations 11
bounding k, min: -5539.94 max: 8.89783e+06 average: 10386.5
ExecutionTime = 2.34 s  ClockTime = 2 s

Time = 6e-05

Courant Number mean: 0.00545273 max: 97.8431
DILUPBiCG:  Solving for Ux, Initial residual = 0.681026, Final residual = 8.30994e-06, No Iterations 4
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 9.54478e-09, No Iterations 5
DICPCG:  Solving for p, Initial residual = 0.448027, Final residual = 0.0447951, No Iterations 72
time step continuity errors : sum local = 9.72168e-05, global = 1.50061e-08, cumulative = -9.60673e-08
DICPCG:  Solving for p, Initial residual = 0.0616509, Final residual = 9.43425e-07, No Iterations 334
time step continuity errors : sum local = 6.20469e+10, global = 6.24885e+08, cumulative = 6.24885e+08


gwierink November 30, 2011 06:01

You are using pisoFoam, so that means you want to do LES? What turbulence model are you using? I see that k and epsilon go unbounded. Is that you subgrid model, or are you using RAS properties with and LES solver? Also, I see that you fix k everywhere, which is neither physical, nor stable. Can you perhaps upload the case, so I can have a look?

Dbutant November 30, 2011 08:50

1 Attachment(s)
I want a RAS, k-epsilon model.
My 0 folder is this one : Attachment 10264
I am a beginner on OpenFOAM and try to copy the tutorials files but I don't find really BCs I want...
Thanks

gwierink November 30, 2011 11:30

Perhaps it is worth checking out $FOAM_TUTORIALS//incompressible/pimpleFoam/TJunction. It is a RAS kEpsilon case with inlet and outlets, using pimpleFoam. Can you use your mesh with that case (with the correct boundary names etc)?

Dbutant December 8, 2011 07:01

Thank you.
I have resolved my problem see this http://www.cfd-online.com/Forums/ope...rror-gamg.html
I put in fvSolution : nCorrectors to 3 and relTol to 0 for p.

sheikh nasir February 8, 2012 02:16

Floating error
 
Hello.
I am getting floating error:invalid number. I am working on train moving in tunnel. Can any body help me. My email is sheikhnasir39@gmail.com
thanks

cfdonline2mohsen October 9, 2012 09:45

Hi all
I had a same problem (Floating point exception) when running pisoFoam for a RAS simulation
Floating point exception means that you have division by zero somewhere in your solution especially for k or e (see the k-e equations, they appear in the denominator somewhere! ).
check your 0 folder and instead of giving zero for the initial values of k or e, give a very small number (e.g.1e-20)
It worked for me!
If it didn't work, as already Dbutant mentioned above, follow the instructions in the following post pisoFoam floating point error - GAMG for changing your system folder parameters.

Best Wishes


All times are GMT -4. The time now is 03:21.