# fluent计算错误分析

1. FlUENT

1.1 求解方面

1.1.1 floating point error是什么意思？怎样避免它？

Floating point error已经提过很多次了并且也已经对它讨论了许多。下面是在Fluent论坛上的一些答案：

1）非法运算：最简单的例子是使用Newton Raphson方法来求解f(x)=0的根时，如果执行第N次迭代时有，x=x(N)，f’(x(N))=0，那么根据公式x(N+1)=x(N)-f(x(N))/ f’(x(N))进行下一次迭代时就会出现被0除的错误。

2）上溢或下溢：这种错误是数据太大或太小造成的，数据太大称为上溢，太小称为下溢。这样的数据在计算机中不能被处理器的算术运算单元进行计算。

3）舍入错误：当对数据进行舍入时，一些重的数字会被丢失并且不可再恢复。例如，如果对0.1进行舍入取整，得到的值为0，如果再对它又进行计算就会导致错误。

1.1.2 coupled和segregated求解有什么区别？

Coupled会同时求解所有的方程（质量守恒方程、动量守恒方程和能量守恒方程）而不是单个方程求解（方程互相分离）。当速度和压力高度耦合（高压和高速）时应该使用耦合求解，但这样会需要较长的计算时间。

Coupled方法使用默认设置时往往是比较稳定的。Segregated方法常常对容许极根很敏感。当使用segregated方法求解时，不要提高turbulent viscosity ration limit（除非你根据过去的经验或者你的物理模型有很好的理由超过这个极限，但我从没有听说这样是比较理想的）。不要给压力和温度极限限定的合理的范围（例如Plimits=Pstatic+/-(2*dynamic pressure)）来计算适当的温度。

What does "floating point error" mean? How can I avoid it?

The floating point error has been reported many times and discussed a lot. Here are some of the answers found in the Fluent Forum:

From numerical computation view point , the basic operations performed by computer are represented inside computer in what is called floating point numbers. The errors that are either because of invalid numeric computation initiated by user or limitation of machine that is used are floating point errors.

1)Invalid Operations:- Simplest example is if one uses Newton Raphson root finding method to solve f(x)=0 and for some Nth iteration if we get x = x(N) such that derivative of function f(x), f'(x(N))=0 then formula for calculating next iterate x(N+1) = x(N) - f(x(N))/f'(x(N)) requires division by f'(x(N)) which is zero. Here you get divide by zero type of floating point error.

2) Over or Underflow:- Another type is having data with either too large or too small magnitude called 'overflow' or 'underflow' respectively.Such data cannot be physically represented on computer for direct processing by arithmetic processing part of Processor.

3) Rounding off errors :- While rounding off a decimal number , some significant digits are lost which cannot be recovered . e.g. if we round off 0.1 to integer (not greater than it called 'floor' of the given no.) then it is zero. If this value if further used for computation then it may lead to several errors.

SOLVER AND ITERATION -----I think if you set shorter time step, it may be good. Or changing little Under-Relaxiation-Factors, it may be good. In my experience, I set 1/3 Under-Relaxiation-Factors as default.? -----?also lower the values of under relaxation factor and use the coupled implicit solver? -----?Try to change under-relaxation factors and if it is unsteady problem maybe time step is to large.? -----?you can improve the ratio in the solve--control--limits, maybe that can help.? -----?you will need to decrease

the Courant number? -----?If you still get the error, initialize the domain with nothing to 'Compute from...' Then click 'init'. Again select the surface from which you want to compute the initial values & iterate. This should work.? -----?Another reason could be a to high courant number - that means, that the steps between two iterations are too large and the change in the results is too large as well (high residuals)?

GRID PROBLEMS -----?this error comes when I start scaling grid. in gambit, all my dimension is in mm, when in fluent i convert it in meter using buttone SCALE. after it, when i iterate, about hundred iteration, this error appeared. but when i not scale my drawing to m...and let it be as in gambit..then the iteration is success. -----?hi I think you should check your mesh grid mesh is very high. your problem solve by selection a low mesh.? -----?Your mesh is so heavy that your computers resources are not enough. try to use coarser mesh.?

BOUNDARY CONDITIONS -----?In my case I had set a wall boundary condition instead of an axis boundary condition and then FLuent refuses to calculate telling me 'floating point error'.? -----?Your Boudary Conditions do not represent real physis.?-----?wrong boundary condition definition might cause the floating point error. For example setting an internal boundary as interior?-----?Once I had the problem, simulating a 2D chamber with a symmetry BC. I set the symmetry somewhere as ?axe symmetric? and the floating point error occur? -----?check the turbulence parameter you set. reduce the turbulence intensity to less that one for first, say 50 iterations.

MULTI PROCESSOR ISSUES -----"I've had similar problems recently with floating point errors on a multi processor simulation. The solution for my problem seems to be to run on a single processor, where it runs fine....??

WRONG INITIATION ----- Initiating the case with wrong conditions may lead to floating point error when the iterations start.