Floating Point Exception -after adding a filter
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)
Code:
#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/printStack.C:221 can someone tell me any thing wrong in the filter or what my problem would be?? |
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) Code:
16.0*Foam::pow(scalar(10), -3) Finally, I would recommend that you always add Code:
Foam:: Kind regards, Niels |
P.S. You can also use
Code:
VSMALL |
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??:confused: (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 |
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 |
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 Code:
interFace Code:
interFace Do you see anything wrong??:mad: Thanks in advance. Regards, Thamali |
ok.I added the following just after the filter in the solver and it worked.
Code:
YO2.correctBoundaryConditions(); Thamali |
You are welcome. Good that it worked.
Kind regards, Niels |
All times are GMT -4. The time now is 05:17. |