- **OpenFOAM**
(*https://www.cfd-online.com/Forums/openfoam/*)

- - **Why simulation results showing "nan" values?**
(*https://www.cfd-online.com/Forums/openfoam/106703-why-simulation-results-showing-nan-values.html*)

Why simulation results showing "nan" values?Hello everyone,
I am running solidDisplacementFoam for 3D model. After simulation log file is showing "nan" values as given below: Iteration: 98 GAMG: Solving for T, Initial residual = 3.24013e-09, Final residual = 3.24013e-09, No Iterations 0 Min/Max/Ave T:-99.9999 99.9998 4.79039 GAMG: Solving for Dx, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dy, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dz, Initial residual = nan, Final residual = nan, No Iterations 1000 Min/Max/Ave DEqn:(nan nan nan) (nan nan nan) (nan nan nan) ExecutionTime = 19286.7 s ClockTime = 19301 s Iteration: 99 GAMG: Solving for T, Initial residual = 3.24013e-09, Final residual = 3.24013e-09, No Iterations 0 Min/Max/Ave T:-99.9999 99.9998 4.79039 GAMG: Solving for Dx, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dy, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dz, Initial residual = nan, Final residual = nan, No Iterations 1000 Min/Max/Ave DEqn:(nan nan nan) (nan nan nan) (nan nan nan) ExecutionTime = 19321.6 s ClockTime = 19336 s Iteration: 100 GAMG: Solving for T, Initial residual = 3.24013e-09, Final residual = 3.24013e-09, No Iterations 0 Min/Max/Ave T:-99.9999 99.9998 4.79039 GAMG: Solving for Dx, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dy, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for Dz, Initial residual = nan, Final residual = nan, No Iterations 1000 Min/Max/Ave DEqn:(nan nan nan) (nan nan nan) (nan nan nan) Max sigmaEq = nan ExecutionTime = 19357.5 s ClockTime = 19372 s Does anyone have any idea why this problem is coming? Thanks, Sangeeta |

Greetings Sangeeta,
That basically means that the solver started to diverge when trying to solve Dx, Dy and Dz.You should look higher in the log file and look for where the simulation starts diverging. It can happen due to several reasons: - Bad boundary conditions.
- Bad mesh for the case you're trying to solve.
- Bad "fvSchemes" settings and/or relaxation values.
- etc...
About keeping a log: taking as an example the tutorial "stressAnalysis/solidDisplacementFoam/plateHole", you can easily run that tutorial and clean that case by running the following commands: - Code:
`foamRunTutorials`
**blockMesh**and then the application defined in "controlDict". It will keep a log of both runs. - Code:
`foamCleanTutorials`
*standard*case files that**foamRunTutorials**generates.
Bruno |

Quote:
Hi Bruno, Thank you for the reply. I have generated a 3D mesh in snappyHexMesh and using this mesh for solving stress analysis by using solidDisplacementFoam solver. I have re-checked my boundary conditions, and fvSchemes (relaxation value etc.). I have used tighter tolerance and increased number of ncorrectors but still I am having same problem. I have gotten good simulation results for similar problem for 2D. Do you think that this problem is coming because of 3D geometry? Thanks in advance. Regards, Sangeeta |

Hi Sangeeta,
OK, there are two other points you can check/test: - What does
**checkMesh**tell you when you check you mesh? Just in case you don't know, you can check your mesh by simply running:Code:`checkMesh`
- Find out more commands for
**checkMesh**:Code:`checkMesh -help`
- You can see an example for removing
*bad*cells from the mesh: http://openfoamwiki.net/index.php/SetSet - although it can also be just as*hazardous*to simply remove the bad cells... Anyway, from that example you can see a couple of additional useful options for**checkMesh**.
- Find out more commands for
- Try with a simply 3D example, to check if your settings are good enough.
Bruno |

Quote:
Thanks a lot for the reply. I hope this will help to solve my problem. Regards, Sangeeta |

All times are GMT -4. The time now is 04:39. |