|
[Sponsors] |
Floating Point Exception -after adding a filter |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 29, 2014, 03:21 |
Floating Point Exception -after adding a filter
|
#1 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
Dear Foamers,
I am running a case with a solver developed by me for packed bed wood chip combustion.My problem is when the input radiation temperature is increased to about 1100K the iterations stop around 2600 with a floating point exception.According to the error it is in the following equation; Code:
volScalarField rCH4=AG*exp(-AF/tg)*pow(YCH4*rho/(16*pow(scalar(10),-3)),0.7)*pow(YO2*rho/(32*pow(scalar(10),-3)),0.8);
Code:
forAll(YO2,cellI) {if (YO2[cellI]<0.0) YO2[cellI]=1.0e-60; }
Code:
#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/printStack.C:221 #1 Foam::sigFpe::sigHandler(int) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/signals/sigFpe.C:117 #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 in "/lib/x86_64-linux-gnu/libm.so.6" #4 Foam::pow(double, double) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/doubleFloat.H:78 #5 Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, double const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/fields/Fields/scalarField/scalarField.C:118 (discriminator 2) #6 void Foam::pow<Foam::fvPatchField>(Foam::FieldField<Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, double const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/scalarFieldField.C:94 (discriminator 2) #7 void Foam::pow<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensioned<double> const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:275 #8 at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:328 #9 at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:350 #10 at ~/OpenFOAM/thamali-2.2.2/applications/solvers/my_fireFoam14dryDiffwithPfilterschanged/UEqn.H:145 (discriminator 3) #11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #12 at ??:? Floating point exception (core dumped) can someone tell me any thing wrong in the filter or what my problem would be?? Last edited by Thamali; May 29, 2014 at 03:31. Reason: adding error |
|
May 29, 2014, 04:50 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Thamali,
The only thing I see is that Y02 can be allowed to be 0, which should not be a problem. However, whenever I have this type of problem, I always go for a little bit more conservative solution: Code:
if (Y02[cellI] < SMALL) { Y02[cellI] = SMALL; } Code:
16.0*Foam::pow(scalar(10), -3) Finally, I would recommend that you always add Code:
Foam:: Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 29, 2014, 04:51 |
|
#3 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
P.S. You can also use
Code:
VSMALL
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 29, 2014, 06:17 |
|
#4 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
First of all,thank you very much for your reply.
Yeah I edited the code as you mentioned,but it still my problem remains. I don't get why this "Floating Point Exception" error still occurring,after the filter is added. When I check the values of "YO2" using "write()" function,it shows the VSMALL(1e-300) value,but why that value is not taking in to account of calculating rCH4 in the next step?? (This problem occurs at only one point) Code:
volScalarField rCH4=AG*exp(-AF/tg)*Foam::pow(YCH4*rho/0.016,0.7)*Foam::pow(YO2*rho/0.032,0.8) Code:
#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/printStack.C:221 #1 Foam::sigFpe::sigHandler(int) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/signals/sigFpe.C:117 #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 in "/lib/x86_64-linux-gnu/libm.so.6" #4 Foam::pow(double, double) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/doubleFloat.H:78 #5 Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, double const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/fields/Fields/scalarField/scalarField.C:118 (discriminator 2) #6 void Foam::pow<Foam::fvPatchField>(Foam::FieldField<Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, double const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/scalarFieldField.C:94 (discriminator 2) #7 void Foam::pow<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensioned<double> const&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:275 #8 at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:328 #9 at ~/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricScalarField.C:350 #10 at ~/OpenFOAM/thamali-2.2.2/applications/solvers/my_fireFoam14dryDiffwithPfilterschanged/UEqn.H:135 (discriminator 3) #11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #12 at ??:? Floating point exception (core dumped) Last edited by Thamali; May 29, 2014 at 06:18. Reason: error |
|
May 29, 2014, 10:05 |
|
#5 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
You could try to evaluate each term with an Info statement in between. This will narrow it down to which of the two pow, which cause the problem.
Thereafter, you can look at the values of the fields, which go wrong and the whole argument, e.g. by use of the write() method of volField<Type>. Could it be that your values at thw boundaries become negative? If you do not use correctBoundaryConditions() method after the filter, then zeroGradient type boundary conditions will still hold the original value of the internal field. Good luck, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 30, 2014, 03:36 |
|
#6 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
Dear Niels,
HTML Code:
Could it be that your values at thw boundaries become negative? If you do not use correctBoundaryConditions() method after the filter, then zeroGradient type boundary conditions will still hold the original value of the internal field. Code:
interFace { type groovyBC; valueExpression "1e-25"; gradientExpression "0"; fractionExpression "(internalField(YO2) == 1e-25) ? 1 : 0"; value 0.2314; } Code:
interFace { type groovyBC; valueExpression "1e-25"; gradientExpression "0"; fractionExpression "(internalField(YO2) <0) ? 1 : 0"; value 0.2314; } Code:
interFace { type groovyBC; valueExpression "1e-25"; gradientExpression "0"; fractionExpression "(YO2 <0) ? 1 : 0"; value 0.2314; } Do you see anything wrong?? Thanks in advance. Regards, Thamali |
|
May 30, 2014, 05:57 |
|
#7 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
ok.I added the following just after the filter in the solver and it worked.
Code:
YO2.correctBoundaryConditions(); Thamali |
|
May 30, 2014, 06:04 |
|
#8 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
You are welcome. Good that it worked.
Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating point exception with pimpleDyMFoam | ebah6 | OpenFOAM Running, Solving & CFD | 9 | November 1, 2017 06:58 |
Inlet Velocity Profile BC - Floating Point exception during solution initialization | Janshi | STAR-CCM+ | 4 | March 14, 2012 11:21 |
simpleFoam Floating point exception error -help | sudhasran | OpenFOAM Running, Solving & CFD | 3 | March 12, 2012 17:23 |
Pipe flow in settlingFoam floating point exception | jochemvandenbosch | OpenFOAM Running, Solving & CFD | 4 | February 16, 2012 04:24 |
block-structured mesh for t-junction | Robert@cfd | ANSYS Meshing & Geometry | 20 | November 11, 2011 05:59 |