CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Division by zero error in Thomas algorithm in SIMPLER code execution

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 2 Post By arjun
  • 2 Post By arjun
  • 1 Post By Dharma Vedula

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2017, 21:39
Default Division by zero error in Thomas algorithm in SIMPLER code execution
  #1
New Member
 
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8
Dharma Vedula is on a distinguished road
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?
Dharma Vedula is offline   Reply With Quote

Old   June 24, 2017, 21:56
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
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.
FMDenaro and Dharma Vedula like this.
arjun is offline   Reply With Quote

Old   June 24, 2017, 22:36
Default
  #3
New Member
 
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8
Dharma Vedula is on a distinguished road
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.
Dharma Vedula is offline   Reply With Quote

Old   June 24, 2017, 23:20
Default
  #4
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
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.
FMDenaro and Dharma Vedula like this.
arjun is offline   Reply With Quote

Old   June 24, 2017, 23:40
Default
  #5
New Member
 
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8
Dharma Vedula is on a distinguished road
I will check for 'boundedness'. Thank you.
Dharma Vedula is offline   Reply With Quote

Old   June 25, 2017, 04:22
Default
  #6
New Member
 
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8
Dharma Vedula is on a distinguished road
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.
arjun likes this.
Dharma Vedula is offline   Reply With Quote

Old   July 5, 2017, 21:43
Default Number of grids problem. Rectified.
  #7
New Member
 
Dharma
Join Date: Jun 2017
Posts: 13
Rep Power: 8
Dharma Vedula is on a distinguished road
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.
Dharma Vedula 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
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


All times are GMT -4. The time now is 17:01.