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/)
-   -   Catching an exception - division by zero. (http://www.cfd-online.com/Forums/openfoam-solving/129906-catching-exception-division-zero.html)

MaLa February 15, 2014 23:36

Catching an exception - division by zero.
 
Hello,

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::printStack(Foam::Ostream&) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/lib/libOpenFOAM.so"
#2
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/libOpenFOAM.so"
#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/libincompressibleRASModels.so"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<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/libincompressibleRASModels.so"
#6 Foam::incompressible::RASModels::kOmegaSST_Wallin_ CC::correct() in "/chalmers/users/mananl/OpenFOAM/mananl-2.2.x/platforms/linux64Gcc47DPOpt/lib/libaddedIncompressibleRASModels.so"
#7
in "/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc47DPOpt/bin/simpleFoam"
#8 __libc_start_main in "/lib64/libc.so.6"
#9
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.

ngj February 16, 2014 12:00

Hallo,

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

Good luck,

Niels


All times are GMT -4. The time now is 18:22.