danieljprice / phantom

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

Error running grtde when "relax=T"(Also for grstar) #546

Closed Shigaharuki3012 closed 4 months ago

Shigaharuki3012 commented 4 months ago

Hi,maybe some problems still exit when relaxing stars. In grtde(or grstar) setup,I used:

make 
make setup
./phantomsetup star
./phantomsetup star.setup

Then when relaxing,it'll be :

 Total memory allocated to arrays:    5.836 GB n =      5200000
------------------------------------------------------------

-----------------------------------------------------------------
 Tidal disruption in GR
-----------------------------------------------------------------

reading setup options from star.setup
 opening database from star.setup with 13 entries

 Using Polytrope

 placed    1000000 particles in random-but-symmetric sphere
 >>>>>>  s  t  r  e   t    c     h       m     a    p   p  i  n  g  <<<<<<
 stretching to match tabulated density profile in r direction
 density at r =    0.0000000000000000       is    1.3652390048668861E-005
 total mass      =    9.9935806368935410E-007
 >>>>>> done

 rstar =   0.47130706849000675       mstar =    9.9935806369259844E-007  tdyn =    359.50112059569619     

Warning: velocity dependant external forces are not compatible with FSI switch back to Leapfrog...

 RELAX-A-STAR-O-MATIC: Etherm:  1.063E-12 Epot: -1.818E-12 R*:  0.471    
       WILL stop when Ekin/Epot <   1.000E-07 OR Iter=1000

-------->   TIME =    0.000    : full dump written to file relax_00000   <--------

 Relaxing star: Iter   1/1000, dens error: 19.07%, R*:  0.468     Ekin/Epot:  5.911E-03
 Relaxing star: Iter  10/1000, dens error:  6.36%, R*:  0.464     Ekin/Epot:  4.549E-04
 Relaxing star: Iter  20/1000, dens error:  3.68%, R*:  0.461     Ekin/Epot:  9.361E-05
 Relaxing star: Iter  30/1000, dens error:  2.65%, R*:  0.458     Ekin/Epot:  3.348E-05
 Relaxing star: Iter  40/1000, dens error:  2.12%, R*:  0.457     Ekin/Epot:  1.648E-05
 Relaxing star: Iter  50/1000, dens error:  1.79%, R*:  0.456     Ekin/Epot:  9.726E-06
 Relaxing star: Iter  60/1000, dens error:  1.56%, R*:  0.455     Ekin/Epot:  6.426E-06
 Relaxing star: Iter  70/1000, dens error:  1.40%, R*:  0.454     Ekin/Epot:  4.583E-06
 Relaxing star: Iter  80/1000, dens error:  1.27%, R*:  0.453     Ekin/Epot:  3.454E-06
  pmom =                       NaN                       NaN                       NaN
  rho* =   9.1252019529669531E-006
  en   =                       NaN

 FATAL ERROR! cons2prim: could not solve rootfinding on particle 117933

Note that all the options are default.I think the problems maybe on the unit overwritten...and I am looking for it. And it seems like sometimes it's a probability of this problem occurring (Also failed on an older version where the "prim2consall" sentence is commented,just pointed out by @tajjankovic as before)

danieljprice commented 4 months ago

hmmm, thanks for reporting, will see if I can reproduce

danieljprice commented 4 months ago

I had a look at this, I think you just need to pull the latest code from master, as the current code no longer prints the warning about velocity-dependent external forces. The relaxation process seems to all work fine from my end.

Shigaharuki3012 commented 4 months ago

I had a look at this, I think you just need to pull the latest code from master, as the current code no longer prints the warning about velocity-dependent external forces. The relaxation process seems to all work fine from my end.

Thank you for fixing...it seemed like I downloaded the version that haven't fixed the bug at 5.17,when the commit related to the bug was just pushed.