sph.input
Every run is controlled by a Fortran namelist in sph.input. A minimal file
sets only what it needs, and anything omitted takes the default below. The file
begins with &input and ends with &end:
&input
tf=200,
n=20000,
&end
Note
The variables, defaults and descriptions on this page are read directly
from the namelist declaration and the default-initialisation block in
parallel_bleeding_edge/src/init.f. There are 101 settings.
Time and output
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
desired final time to stop simulation |
|
|
every run |
how often an out*.sph files should be dumped |
|
|
nothing, see below |
number of iterations between evaluation of the gravitational potential energy. |
|
|
every run |
time after which a wide orbit is skipped rather than integrated, by advancing it analytically around the Kepler two-body solution. The default never fires; any other value is honoured |
|
|
every run |
fixed separation of the two stars beyond which a bound, receding orbit is skipped ahead by jumpahead, which advances it analytically around the Kepler two-body solution. The default never fires. Set this or rjumpfactor, not both, to turn on automatic jumping |
|
|
every run |
the alternative to rjump: a value above 0 makes the jump separation rjumpfactor times the larger tidal radius R*(M_other/M)^(1/3) of the two bodies, where R encloses rjumppercent percent of a body’s mass. It is remeasured at every output, so a star puffed up by earlier passages must recede farther before it jumps. The default never fires |
|
|
every run |
after a jump the star is put back on the infalling branch of its orbit at reentryfactor times the separation it jumped from. 1 is what the published runs did: the tides the star feels on re-entry are no stronger than when it jumped. Must be above 0 and at most 1. A jump whose re-entry separation would lie inside periastron stops the run |
|
|
every run |
time that the scan of a binary starts. The separation is held at sep0 until then, which gives the stars time to settle into the shape the corotating frame asks for |
|
|
every run |
final separation for the scan of a binary, reached at min(tf,treloff). The scan is exponential in separation, so it changes by a fixed fraction per unit time. Set it equal to sep0 for a corotating run that does not scan |
|
|
every run |
when skipping ahead, discard the debris and the material the accretor has taken, keeping only the surviving body and the point masses |
|
|
every run |
how much of a particle’s specific internal energy counts toward unbinding it when compbest3 sorts particles into components. 0 leaves it out, as Nandez, Ivanova & Lombardi (2014) argue for; 1 counts all of it, as in Kremer et al. (2022) |
The particles
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
desired number of particles. if n<0 then |n|=number of particles *per solar mass*. used only if making a new star. |
|
|
every run |
controls neighbor number. leave it at 22 to get almost 40 neighbors. |
|
|
|
particle mass is proportional to rho^(1-equalmass), so equalmass=1 has equal mass particles and equalmass=0 is for constant number density. |
|
|
|
mass of the polytrope to build, in solar masses |
|
|
|
radius of the polytrope to build, in solar radii |
|
|
every run |
softening/smoothing length for compact object or core particle (<0 for auto-set) |
|
|
|
mass of compact object or core particle |
|
|
every run |
hp(i) = hptilde(i) + hfloor, where hp(i)=smoothing length and hptilde(i) is used in eq.(A1) of GLPZ 2010. With dynhco=3 instead the smooth floor hp(i)=(hptilde(i)^p+hfloor^p)^(1/p), p=hcopnorm |
Equation of state and physics
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
0 for polytropic equation of state (eos), 1 for ideal gas + radiation pressure, 2 for tabulated eos |
|
|
every run |
leave this set at a reasonable value even if using neos=1 or 2 (because the value of gam is used in estimating the local sound speed in balav3.f) |
|
|
every run |
artificial viscosity (av) flag. 3: hybrid balsara-monaghan av with alpha and beta. 4: dissipation from a riemann solver between each pair of particles, with no alpha or beta |
|
|
every run |
nav=4 only: 0 for no switch, 1 to multiply the dissipation by balsara’s switch of particle i (as nav=3 does), 2 to apply it to approaching pairs only, 3 for both |
|
|
every run |
nav=4 only: 1 for the star pressure from toro’s adaptive guess and one newton step, about 15% faster per step in a shock tube. 0 to iterate newton to convergence |
|
|
every run |
av coefficient for term linear in mu |
|
|
every run |
av coefficient for mu^2 term |
|
|
every run |
gravity flag. leave it at 3. if your want no gravity, ngr=0 might still work. |
|
|
every run |
0 if just do gravity to point particles, 1 if self-gravitating |
|
|
every run |
smoothing kernel: 0=cubic spline, 1=Wendland 3,3, 2=Wendland C4 |
|
|
every run |
0 if no cooling, otherwise radiative cooling |
|
|
every run |
background temperature the cooling relaxes towards, in K. Only used when ncooling>0 |
|
|
every run |
radius within which a point mass swallows SPH particles. Negative disables eating |
Relaxation
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
relaxation flag. 0=dynamical calculation, 1=relaxation of single star, 2=relaxation of binary in corotating frame with centrifugal force, 3=calculation rotating frame with centrifugal and coriolis forces |
|
|
every run |
drag timescale. 0 derives it from the model, a very large value disables the drag |
|
|
every run |
time the drag switches off and the run turns dynamical. It ends a scan as well, since a scan runs until min(tf,treloff). 0 asks for it to be derived as 10*trelax, which for a single star needs trelax=0 as well |
|
|
every run |
time to stop resplinting the mean molecular weight. leave this at 0. |
|
|
every run |
angular rotation rate of star, used in nrelax=1 relaxations to give a rigidly rotating model |
Orbit of the encounter
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
initial separation of two stars in a binary or collision calculation, and the separation a scan starts from and holds until tscanon |
|
|
every run |
separation at closest approach. Set any two of rp, vinf2, e0 and semimajoraxis and the rest follow |
|
|
|
impact parameter at infinity, an alternative to rp, converted to it using angular momentum |
|
|
|
orbital eccentricity: 1 is parabolic, above 1 hyperbolic, below 1 bound |
|
|
|
orbital semimajor axis. 0 means unset, so that it is deduced from the others |
|
|
|
square of the relative speed at infinity. 1d30 means unset, so it is deduced from the others |
Compact object and black hole
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
|
mass of the point mass used as the second object when startfile2 is absent |
|
|
every run |
0: point particles (u=0) keep the constant softening hco. 1: their softening is solved from eq.(A1) like an SPH smoothing length. 2: as 1 but smoothly limited to [hcomin,hcomax]. 3: every particle’s h=(htilde^p+hfloor^p)^(1/p) with htilde from eq.(A1), and point particles also capped at hcomax |
|
|
every run |
dynhco=2: lower limit on a point particle’s softening length (<=0: no limit) |
|
|
every run |
dynhco=2 or 3: upper limit on a point particle’s softening length (<=0: no limit) |
|
|
every run |
dynhco=2 or 3: sharpness p of the smooth limits h=((h_dyn^p+hcomin^p)^(-1)+hcomax^(-p))^(-1/p) |
|
|
|
first mass of a compact-object binary. Required, and only used, when bbh_m2 is positive |
|
|
|
second mass of a compact-object binary. Negative means unset, giving a single point mass of mass mbh |
|
|
|
separation at closest approach for the compact-object binary |
|
|
|
semimajor axis of the compact-object binary. 0 means unset |
|
|
|
square of the relative speed at infinity for the compact-object binary. 1d30 means unset |
|
|
|
eccentricity of the compact-object binary |
|
|
|
true anomaly of the compact-object binary, in degrees |
|
|
|
argument of periapsis of the compact-object binary, in degrees |
|
|
|
inclination of the compact-object binary, in degrees |
|
|
|
longitude of the ascending node of the compact-object binary, in degrees |
Timestep control
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
1=integrate entropic variable a, 2=integrate internal energy u, 3=integrate buoyancy ln A (needs neos=1), 12=a then u, 32=ln A then u |
|
|
every run |
dt1=cn1*h/v_signal |
|
|
every run |
dt2=cn2*(h/|a-a_smoothed|)^0.5 |
|
|
every run |
dt3=cn3*u/|du/dt| |
|
|
every run |
dt4=cn4*v_signal/|a-a_smoothed| |
|
|
every run |
dt5=cn5*r_ij/v_ij (minimized over all other particles j) |
|
|
every run |
dt6=cn6*(r_ij/a_ij)^.5 (minimized over all other particles j) |
|
|
every run |
r_ij=(x_ij^2+y_ij^2+z_ij^2+cn7*h_i^2)^.5 |
|
|
every run |
0: one shared timestep. 1: block (power-of-2) timesteps, for dynamical runs only (see the docs for the settings it needs) |
|
|
every run |
nblock=1: smallest step is dtmaxblk/2**nbinmax |
|
|
every run |
nblock=1: largest step (<=0: use dtout) |
|
|
every run |
nblock=1: a step may be at most 2**nblimit times a neighbour’s |
|
|
every run |
nblock=1 testing: 1 recomputes h and hydro for all particles every substep |
|
|
every run |
testing only: >0 forces the shared timestep to this value |
|
|
every run |
1: a new run from t=0 takes a first step 1/64 of what the timestep limits give, then at most doubles each step (for initial discontinuities). 0: off. <0: on only for a new shock-tube run (iname=’pbx’, nrelax=0) |
Parallelism and GPUs
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
the number of gravity processors (must be <= min(nprocs,ngravprocsmax)) |
|
|
every run |
number of gpu threads per particle. typically set to 1, 2, 4, or 8. set to a negative value to optimize the number of threads by timing. set to 0 to guess the best number of threads without timing. |
|
|
every run |
cpu cores per node, used to spread the gravity processes over nodes |
|
|
every run |
set this to 1 if on machine like grapefree with gpus in compute exclusive mode; set this to 0 on supercomputers like lincoln |
|
|
every run |
set to 0 for g function from appendix of gaburov et al. (2010); set to 1 for a g function that works better when there are black holes, or 2 for G=(1-q^3)^2 with q=r/2h, which decreases strictly with r so that the h solution has no flat stretches. It gives about 3*nnopt neighbours within 2h, so it needs about half the nnopt of gflag=1 for the same neighbour count |
Units
These three set the physical meaning of every code unit; see code units for what the derived units work out to.
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
number of cm in the unit of length. use 6.957d10 if want MESA solar radius. |
|
|
every run |
number of g in unit of mass. use 1.9884098706980504E+033 if want MESA solar mass. |
|
|
every run |
newton’s gravitational constant in cgs. 2018 CODATA value; older StarSmasher runs used 6.67390d-08 |
Periodic box
A positive period makes that direction periodic: positions are wrapped
into the box and every pair separation uses the nearest periodic image.
Each 2h must stay below half of each period. A periodic run needs
ngr=0 and nblock=0, and is usually started with INAME='pbx',
which reads the particles from startfile1.
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
period in x of a periodic box running from -boxx/2 to boxx/2. 0 leaves x open |
|
|
every run |
period in y, as for boxx |
|
|
every run |
period in z, as for boxx |
Input files
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
|
first body of the encounter, in out*.sph format, usually the last snapshot of a relaxation |
|
|
|
second body, same format as startfile1. If absent, a single point mass of mass mbh is used |
|
|
|
third body of a triple, same format as startfile1 |
|
|
|
text file describing the binary, read by bps and 2cr |
|
|
|
text file describing the third body, read by bhe and tri |
|
|
|
text file giving the orientation angles and black hole mass, read by bph |
|
|
|
ASCII picture that txt turns into a particle layout |
|
|
|
per-particle passively advected quantities, read by hyp when present |
|
|
every run |
tabulated equation of state, read when neos selects a table |
|
|
every run |
tabulated opacities, read when cooling needs them |
|
|
|
stellar-evolution profile that erg builds its star from |
|
|
|
which code wrote profilefile, since the column layouts differ |
Other settings
Variable |
Default |
Applies to |
Meaning |
|---|---|---|---|
|
|
every run |
nintvar=12 or 32: time to hand over to u. <0 means use treloff. |
|
|
|
1: when building a star from a profile, give equal masses to particles beyond 90% of the radius where A=P/rho^(5/3) first decreases outward (two-zone scheme). 0: n ~ rho**equalmass throughout |
|
|
|
twozone=1 only: >0 places the transition at this radius instead of finding it from A. <=0: 90% of the first radius beyond 10% of the star’s where A=P/rho^(5/3) decreases outward |
|
|
every run |
the percentage of a body’s mass enclosed by the radius R in the tidal radius that rjumpfactor multiplies. Only used when rjumpfactor is set. Must be above 0 and at most 100 |
|
|
every run |
once a jump-ahead run (automatic jumping on) has lost its star, leaving a point mass as the only body, run on for this many dtout and stop, unless tf comes first |