The value of R2IJ may be treated as zero and make the result incorrect

10 views
Skip to first unread message

wenwang liao

unread,
Aug 23, 2023, 12:39:43 AM8/23/23
to pysph-users
Hi all, 

I find a problem when I need to divide the R2IJ. If I do it, the calculation process blows up. The reason may be that my particle spacing is too small (dx = 0.02). If I remove the R2IJ, It can run, but the result is incorrect. What can I do to make the R2IJ can be divided?

Attached is my code and error message.
Thanks for your help.

Wenwang

LEA~{%3VP(LSL7E2Z5R4PXH.png1692765420368.jpg

Stephan

unread,
Aug 23, 2023, 4:19:38 AM8/23/23
to pysph-users
The loop goes over all particle pairs, also the pair ii. Obviously, RII is 0 and thus R2II is also 0. You can remove this issue by adding a small value in your computation, e.g. R2IJ_1 = 1.0 / (R2IJ + EPS).

Op woensdag 23 augustus 2023 om 06:39:43 UTC+2 schreef wwli...@gmail.com:

wenwang liao

unread,
Aug 23, 2023, 4:25:54 AM8/23/23
to pysph-users
Hi Stephan, 

Thanks for your advisable reply.

regards,
Wenwang

Reply all
Reply to author
Forward
0 new messages