Implementing potential

From: Jesus <jesusms_at_astro.ucla.edu>
Date: Sun, 20 Sep 2015 11:46:45 -0700

I have written my own potential at the end of gravity_tree(), just as instructed in http://wwwmpa.mpa-garching.mpg.de/gadget/gadget-list/0232.html
However, Gadget is giving me the error:

Error: A timestep of size zero was assigned on the integer timeline!
We better stop.
Task=5 Part-ID=285634 dt=7.4194e-09 tibase=7.45058e-09 ti_step=0 ac=1.12005e+12 xyz=(3.24349|-7.37641|0.00861514) tree=(-4.50823e+11|1.02527e+12-1.54804e+09)

hydro-frc=(4.55549e+08|2.50445e+08|-2.86563e+08)
task 5: endrun called with an error level of 818


--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 5 in communicator MPI_COMM_WORLD
with errorcode 818.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun has exited due to process rank 5 with PID 38354 on….


The only problem I can think of is that somehow I did not use the correct units that the computes with.
This is what I have

for(i = 0; i < NumPart; i++)
  if(P[i].Ti_endstep == All.Ti_Current)
  { double R_2 = ( (P[i].Pos[0]*P[i].Pos[0]) + (P[i].Pos[1]*P[i].Pos[1]) + (P[i].Pos[2]*P[i].Pos[2]) ) ;
      double R_1 = sqrt(R_2);
      double R_3 = R_1 * R_2;
      
   P[i].GravAccel[0] += ( (my_potential*conversion) - (All.G*40.0*P[i].Pos[0]/R_3) ) ;
    etc

The second term is just the potential of a point mass at the origin with mass = 40 mass units (code units).
my_potential() function is a custom function I added to Gadget to calculate another potential term, which result is in km/s^2. The "conversion" converts the km/s^2 into code units, (first converting to cm/s^2, and then to code units by dividing by 1 acceleration unit, which I computed by doing unit_velocity_in_cm_per_s/unit_time_in_seconds).

Am I doing the right unit conversion?

Thank you for your time.

Jesus Salas
Received on 2015-09-20 20:46:20

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:32 CET