CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   pow function or pos().z error, please help (

Disco_Caine August 26, 2010 07:02

pow function or pos().z error, please help
Hi, ive been using funkysetfields to set the following initial conditions through out my mesh. Ive posted this earlier in the funkysetfields thread, however, its not a problem with FSF.

Anyways, the condition is this:


Part: temperature1
 Putting "pow(pos().z,0.1)" into field T at t = "0" if condition "(pos().x <= 0.0105) && (pos().z <= 0.15) && (pos().z > 0)" is true

And this works when z is bigger than 19. However when i change to values smaller than 19 (which coincidentally, i really need to do). I have a conversion factor of 0.01 (im typing in cm, solving in meters). I get this error:


#0  Foam::error::printStack(Foam::Ostream&) in "/home/gustavo/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/"
#1  Foam::sigFpe::sigFpeHandler(int) in "/home/gustavo/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/"
#2  in "/lib/"
#3  in "/lib/"
#4  Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, double const&) in "/home/gustavo/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/"
 in "/home/gustavo/OpenFOAM/gustavo-1.6.x/applications/bin/linux64GccDPOpt/funkySetFields"
 in "/home/gustavo/OpenFOAM/gustavo-1.6.x/applications/bin/linux64GccDPOpt/funkySetFields"
 in "/home/gustavo/OpenFOAM/gustavo-1.6.x/applications/bin/linux64GccDPOpt/funkySetFields"
 in "/home/gustavo/OpenFOAM/gustavo-1.6.x/applications/bin/linux64GccDPOpt/funkySetFields"
 in "/home/gustavo/OpenFOAM/gustavo-1.6.x/applications/bin/linux64GccDPOpt/funkySetFields"
#10  __libc_start_main in "/lib/"
 at /build/buildd/eglibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:116
Floating point exception

In an effort to try and elucidate this, i got some tips from a fellow poster, if i run the condition as pos().z i get no error, and as expected the values vary from 0.0001 to 0.149. If i try the pow function with those loweest and highest values to the power i need, i get no error.

The error only appers when the pos().z is in the pow function for some values of z.

I really have no clue how to fix this. As i dont really understand whats going on. I am more than glad to post anything else that might help.

I really need help; thanks for your time.

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