CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Catching an exception - division by zero.

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   February 15, 2014, 23:36
Default Catching an exception - division by zero.
Join Date: Oct 2013
Location: Göteborg
Posts: 37
Rep Power: 6
MaLa is on a distinguished road

I need a little help. I wrote a turbulence model and was trying to test it. But I ran into a division-by-zero error (I think):

#0 Foam::error:rintStack(Foam::Ostream&) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
#1 Foam::sigFpe::sigHandler(int) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
at sigaction.c:0
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
#4 void Foam::divide<Foam::fvPatchField>(Foam::FieldField< Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, Foam::FieldField<Foam::fvPatchField, double> const&) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
#6 Foam::incompressible::RASModels::kOmegaSST_Wallin_ CC::correct() in "/chalmers/users/mananl/OpenFOAM/mananl-2.2.x/platforms/linux64Gcc47DPOpt/lib/"
in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/bin/simpleFoam"
#8 __libc_start_main in "/lib64/"
in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/bin/simpleFoam"

Can people share their experiences about the best way to figure where the exception is occuring or how to trouble shoot in such a situation?

Thanks so much.
MaLa is offline   Reply With Quote

Old   February 16, 2014, 12:00
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,759
Rep Power: 29
ngj will become famous soon enoughngj will become famous soon enough

You divide by 0 in one of the boundary conditions. Visible from error #4, which includes a fvPatchField.

Good luck,

Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Division by zero exception - loop over scalarField Pat84 OpenFOAM Programming & Development 6 February 18, 2017 06:57
pimpleDyMFoam constantly giving floating point exception and solution divergence fedvasu OpenFOAM Running, Solving & CFD 0 November 28, 2013 01:53
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
reactingFoam floating point exception pajofego OpenFOAM 0 November 6, 2010 18:29
Cannot Open .sim (Floating Point Exception) trex930 STAR-CCM+ 1 July 30, 2010 06:51

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