danieljprice / phantom

Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
https://phantomsph.github.io
Other
103 stars 230 forks source link

Error in density calculations after splittting a dump #517

Closed cpinte closed 3 months ago

cpinte commented 7 months ago

This dump https://drive.google.com/file/d/1v5IPb75diINIYfrKZHGCGOvYmS6C7aIx/view?usp=drive_link has been split once on ozstar, but phantom does not manage to restart on it and complains with the error message: (.in file is here: https://drive.google.com/file/d/17D72EkKUM6d_MDk5C5PsgV7CuPJnnp4V/view?usp=drive_link)

reading setup from file: LkCa15_00200_split_00000 on unit 9 FT:Phantom:2024.0.0: (hydro): 08/03/2024 21:45:06.6 npart = 10450609 npart(total) = 10450609 setting isothermal sound speed^2 (polyk) = 1.150000000000000E-003 gamma = 1.00000000000000 qfacdisc = 0.250000000000000 time = 669779.392000000

--> ALLOCATING ALL ARRAYS

Total memory allocated to arrays: 8.147 GB n = 10450609

reading particles 1: 10450609, from block 1 lims= 1- 10450609 got 19 sink properties from 2 sink particles

ID| Mass | Racc | Macc | hsoft | Lsink |

1| 1.2 | 1.0 | 4.05E-04 | 1.0 | 0.0 | 2| 5.35E-03 | 4.5 | 5.76E-04 | 4.5 | 0.0 |

<<< finished reading (hydro) file

Centre of mass is at (x,y,z) = ( 4.997E-03, 1.119E-02, 1.632E-04) Particle setup OK npart total = 10450609 nptmass = 2 dt(sink-sink) = 62.1908020240717 dt(sink-gas) = 2.532998195616959E-002 ERROR: density iteration failed after 50 iterations hnew = 6764.35136427104 hi_old = 1.08127152919769 nneighi = 98 rhoi = 2.144451944989055E-021 gradhi = 0.785017767609221 error = 9.90720626262160 tolh = 1.000000000000000E-004 itype = 1 x,y,z = -35900.9025100264 -5205.28495706179 -1021.25515070480 vx,vy,vz = -4.309947602583077E-002 -5.614629737591005E-003 4.219597899871647E-003

FATAL ERROR! densityiterate: could not converge in density on particle 3088705: error = 9.907E+00

becnealon commented 7 months ago

Has this been split with the moddump routine?

cpinte commented 7 months ago

Yes, I created the split part moddump with make MAXP=20000000 splitpart

danieljprice commented 3 months ago

short update here: I can reproduce this, seems like just a bad guess for the smoothing length after splitting causes very slow convergence on the density iteration. The simple fix is to increase the maximum number of iterations to 100 instead of 50, I will push this. A longer fix would be to choose a better guess for h after splitting...

cpinte commented 3 months ago

Thanks. Dump before split is here : https://drive.google.com/file/d/1osbVxDbAKue7ICml_GfaIeVm66Tt1yZW/view?usp=drive_link

becnealon commented 3 months ago

Sorry, this fell off the list. I think I have a much better way of doing a split for moddump purposes but agree with this current solution