CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

SimpleFoam werid Error!

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By alexeym
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2017, 15:04
Default SimpleFoam werid Error!
  #1
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Hello Foamers,

I was using simpleFoam on a simple problem and came to an error that I don't understand what it means. The error is as follows ;


Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  acos in "/lib/x86_64-linux-gnu/libm.so.6"
#4  
 at ??:?
#5  
 at ??:?
#6  
 at ??:?
#7  
 at ??:?
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  
 at ??:?
Floating point exception (core dumped)
Thanks in advance,
tareqkh is offline   Reply With Quote

Old   January 6, 2017, 15:39
Default
  #2
Member
 
Oleg Sutyrin
Join Date: Feb 2016
Location: Russia
Posts: 41
Rep Power: 10
OlegSutyrin is on a distinguished road
It's segmentation fault. There is no way to tell more until you post the case you tried to run (whole case dir is best) here. And don't forget to tell what version of OpenFOAM you use.
OlegSutyrin is offline   Reply With Quote

Old   January 7, 2017, 06:42
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

This is NOT segmentation fault, this is floating point exception in acos. According to man acos:

Code:
SPECIAL VALUES
     acos(1) returns +0.

     acos(x) returns a NAN and raises the "invalid" floating-point exception for
     |x| > 1.
Why you are trying to calculate acos of value greater than 1?
CFD-Lover likes this.
alexeym is offline   Reply With Quote

Old   January 7, 2017, 17:22
Default Thank you both for the reply!
  #4
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
I have added a volume source term to the momentum equation to be able to simulate the flow over a HAWT using the blade element theory. I don't really know why am trying to calculate acos of value greater than 1? I am a bit confused on what to do?

Thank you,
tareqkh is offline   Reply With Quote

Old   January 7, 2017, 20:53
Default
  #5
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by alexeym View Post
Hi,

This is NOT segmentation fault, this is floating point exception in acos. According to man acos:

Code:
SPECIAL VALUES
     acos(1) returns +0.

     acos(x) returns a NAN and raises the "invalid" floating-point exception for
     |x| > 1.
Why you are trying to calculate acos of value greater than 1?

Its not clear whether he is doing or openfoam is calculating acos of x greater than 1. The programmer has to be careful about it (who so ever programmed it).
arjun is offline   Reply With Quote

Old   January 8, 2017, 03:40
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Quote:
Originally Posted by tareqkh View Post
... I am a bit confused on what to do?...
You have LOTS of choices:

1. Wait. Maybe in several days (weeks, months) you won't need the simulation.

2. Wait. Till someone with stronger mentalist powers comes to the thread, guesses your set up, guesses your modifications, and posts solution.

3. Go to $FOAM_SRC and run `ack acos`, through this you learn that in general, when using acos OpenFOAM limits argument except:

Code:
applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C
applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C
applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C
applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/insertFeaturePoints.C
applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C
applications/utilities/surface/surfaceCoarsen/bunnylod/vector.C
applications/utilities/surface/surfaceCoarsen/bunnylod/vector.h
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C
src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C
src/OpenFOAM/primitives/Tensor/tensor/tensor.C
src/OpenFOAM/primitives/quaternion/quaternion.C
src/OpenFOAM/primitives/quaternion/quaternionI.H
src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C
src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C
src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.C
src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.C
src/mesh/blockMesh/curvedEdges/arcEdge.C
src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C
Since you are taking about simpleFoam, guess, we can dismiss lagrangian and multiphase things. So only cyclics are left (more or less). Did you run checkMesh?

4. You can post your case description and case files, so people can check if you made some obvious error in case description, or just run your case and look for error. Though this could be problematic if your are under NDA.

5. Run simulation with debug version of OpenFOAM, so instead of your truncated printStack (and looking at you printStack output: do you run OpenFOAM 2.2.x?), you get output with method names and locations in the code. So you can learn, which method is calling acos.

I stop here, 5 variants are enough to start.
CFD-Lover likes this.

Last edited by alexeym; January 8, 2017 at 15:08.
alexeym is offline   Reply With Quote

Old   January 8, 2017, 03:43
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Quote:
Originally Posted by arjun View Post
Its not clear whether he is doing or openfoam is calculating acos of x greater than 1. The programmer has to be careful about it (who so ever programmed it).
Thank you, Captain!
alexeym is offline   Reply With Quote

Old   January 8, 2017, 14:11
Default Grid issue...
  #8
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 9
CFD-Lover is on a distinguished road
Hello Tareqkh,

I think the issue could be relevant to the mesh.

Best,
CFD-Lover is offline   Reply With Quote

Old   January 8, 2017, 15:16
Default
  #9
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Dear Alexy,


What this error is telling from your experience?



Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3   in "/lib/x86_64-linux-gnu/libm.so.6"
#4  exp in "/lib/x86_64-linux-gnu/libm.so.6"
#5  
 at ??:?
#6  
 at ??:?
#7  
 at ??:?
#8  
 at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10  
 at ??:?
Floating point exception (core dumped)
Best,
tareqkh is offline   Reply With Quote

Old   January 8, 2017, 15:30
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Is it some kind of joke?
alexeym is offline   Reply With Quote

Old   January 8, 2017, 15:31
Default
  #11
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Code:
You have LOTS of choices:
1. Wait. Maybe in several days (weeks, months) you won't need the simulation.
Well, I am not type of person who gives up quickly so please fix your sentence .

Code:
You have LOTS of choices:
2. Wait. Till someone with stronger mentalist powers comes to the  thread, guesses your set up, guesses your modifications, and posts  solution.
Well, are you familiar with BEM theory used to simulate wind turbines. If so, I can post the case file.

Thank you,
tareqkh is offline   Reply With Quote

Old   January 8, 2017, 15:38
Default
  #12
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Is it some kind of joke?
What do you mean? I want to know the main reason of the error because when I ran the same case using different rotational speed, it worked.

The main simulation is using the actuator disk model to simulate the flow over a wind turbine. I am using fixed wind speed with different rotational speed to obtain different tip speed so that I can build the power curve of the wind turbine. I am experiencing this issue when I increase the rotation speed, which corresponds to values above 4. That's why I posted the error to know what could be the reason and am thankful for your help.

Best,
tareqkh is offline   Reply With Quote

Old   January 8, 2017, 15:39
Default
  #13
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Quote:
Originally Posted by tareqkh View Post
Well, are you familiar with BEM theory used to simulate wind turbines. If so, I can post the case file.
I am not. And in fact I do not have to. I will just run set of standard tests and then try to figure out, where you call acos and why absolute value of argument is greater then 1. But if familiarity with BEM theory is a requirement for posting case files, then no, do not post them.
alexeym is offline   Reply With Quote

Old   January 8, 2017, 15:42
Default
  #14
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Quote:
Originally Posted by tareqkh View Post
What do you mean? I want to know the main reason of the error because when I ran the same case using different rotational speed, it worked.
To learn why you get FPE in exp call, you can just run `man exp`. On Darwin you get

Code:
SPECIAL VALUES
     ...

     For all these functions, a range error occurs if the magnitude of x is too
     large.
on Linux

Code:
Errors

See math_error(7) for information on how to determine whether an error has occurred when calling these functions.

The following errors can occur:

Range error, overflow
errno is set to ERANGE. An overflow floating-point exception (FE_OVERFLOW) is raised.
Range error, underflow
errno is set to ERANGE. An underflow floating-point exception (FE_UNDERFLOW) is raised.
I do not know why you are trying to exponentiate very large value.
alexeym is offline   Reply With Quote

Old   January 8, 2017, 15:50
Default
  #15
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Thanks again for your help and hints.

Code:
I do not know why you are trying to exponentiate very large value.
The tip speed = (rotational speed)*Radius/Wind speed.

I am trying to do a validation study and in the paper that am trying to validate with, they used fixed wind speed to create the power curve. Therefore, to get different tip speed ratios, I have to change the rotational speed to match their results.

Best,
tareqkh is offline   Reply With Quote

Old   January 8, 2017, 20:24
Default
  #16
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
First it was cos then it is exp so from it, it seems that the actual problem happenmuch earlier than these places where the values are blown up.

So the good news is that you calculation has diverged which is something could be fixed and not a programming bug. Bad news is that simulation is diverged and you don't know why.

My advise try playing with under-relaxation, courant criteria etc etc.

Good luck.
arjun is offline   Reply With Quote

Old   January 8, 2017, 20:42
Default
  #17
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Dear Arjun,

Many thanks for the hint. It might solve the issue. I will give it a try and let you know how it goes. Another issue you might know is about running in parallel and monitor the results. When I run the code (Actuator disk + simpleFoam) in single core and monitor the results i.e. forces using "log.simpleFoam", the code outputs the value. However, when I run the solver in parallel, all forces in the "log.simpleFoam" become zero even after use reconstruct. What could be the issue?

Best,
tareqkh is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." sega OpenFOAM Community Contributions 12 February 17, 2010 09:30
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 16:26.