|
[Sponsors] |
Division by zero error in Thomas algorithm in SIMPLER code execution |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 24, 2017, 21:39 |
Division by zero error in Thomas algorithm in SIMPLER code execution
|
#1 |
New Member
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8 |
What shall I do when a "division by zero" error is shown in Thomas algorithm? I wrote SIMPLER code to solve steady state 3-D momentum plus continuity equations. Getting results successfully. But when I increase the number of nodes (to increase accuracy of results), the following error is shown and the execution is stopped. Versteeg and Malalasekera (Second Edition) give even smaller details very well. Grateful to them.
A[j]=alfa[j]/(D[j]-beta[j]*A[j-1]) ZeroDivisionError: float division by zero Can any body tell me - what to do to get over this difficulty and continue execution - like any if-condition? |
|
June 24, 2017, 21:56 |
|
#2 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34 |
check your descretization. You are making mistake. Thomas algo shall not fail so easily at least not less than few million grid points if it at all fails.
|
|
June 24, 2017, 22:36 |
|
#3 |
New Member
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8 |
Thank you very much for your reply.
My code doesn't show 'zerodivisionerror' for certain combinations of geometric dimensions (height, width and length) and grid sizes (dx, dy and dz). Also the results, which I am getting for pressure drop and velocity profiles, are almost the same as those calculated using standard equations. This error comes randomly when I make a change in one (or some) of the above. |
|
June 24, 2017, 23:20 |
|
#4 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34 |
Since you are working with Thomas Algo, the matrix shall be easy to print and analyse.
Check it for https://en.wikipedia.org/wiki/Scarborough_criterion For thomas algo to fail, you must be failing this. This is why i said you shall check descretization because if you did that correctly this does not fail. If it does not fail Thomas algo does not fail. |
|
June 24, 2017, 23:40 |
|
#5 |
New Member
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8 |
I will check for 'boundedness'. Thank you.
|
|
June 25, 2017, 04:22 |
|
#6 |
New Member
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8 |
I found that there is a convergence problem, and my important variables are going beyond the expected magnitude. I corrected the error and the results coming normally now. Thank you very much for pointing out the mistake correctly.
|
|
July 5, 2017, 21:43 |
Number of grids problem. Rectified.
|
#7 |
New Member
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8 |
I found out the error and rectified. Mine is a problem of laminar flow in a microchannel. I found that the velocity is high enough for even a moderate laminar Reynolds number because of very low equivalent diameter. I must increase the number of grids in the flow (u-velocity) direction even though the length of the channel is the same. When I did that, the results are coming alright.
Thank you for your help. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SIMPLE (or SIMPLER) fortran code | Francesco Di Maio | Main CFD Forum | 6 | January 18, 2017 04:59 |
SIMPLER Algorithm question | Erik | Main CFD Forum | 1 | May 23, 2004 03:57 |
SIMPLER source code in C/C++ or Matlab | Shreya | Main CFD Forum | 3 | April 5, 2004 00:58 |
2D CFD code using SIMPLE algorithm | bfan | Main CFD Forum | 3 | June 22, 2002 22:01 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 15:56 |