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

tf

50000

every run

desired final time to stop simulation

dtout

100

every run

how often an out*.sph files should be dumped

nitpot

1

nothing, see below

number of iterations between evaluation of the gravitational potential energy.

tjumpahead

1d30

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

rjump

1d30

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

rjumpfactor

0d0

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

reentryfactor

1d0

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

tscanon

0

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

sepfinal

1.d30

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

throwaway

.true.

every run

when skipping ahead, discard the debris and the material the accretor has taken, keeping only the surviving body and the point masses

internal_energy_fraction

0d0

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

n

100000

every run

desired number of particles. if n<0 then |n|=number of particles *per solar mass*. used only if making a new star.

nnopt

22+gflag

every run

controls neighbor number. leave it at 22 to get almost 40 neighbors.

equalmass

0

1es 1mc erg meq

particle mass is proportional to rho^(1-equalmass), so equalmass=1 has equal mass particles and equalmass=0 is for constant number density.

starmass

1d0

1es 1mc

mass of the polytrope to build, in solar masses

starradius

1d0

1es 1mc

radius of the polytrope to build, in solar radii

hco

-1d30

every run

softening/smoothing length for compact object or core particle (<0 for auto-set)

mco

-1d30

erg

mass of compact object or core particle

hfloor

0d0

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

neos

1

every run

0 for polytropic equation of state (eos), 1 for ideal gas + radiation pressure, 2 for tabulated eos

gam

5.d0/3.d0

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)

nav

3

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

navsw

1

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

nriemann

1

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

alpha

1

every run

av coefficient for term linear in mu

beta

2

every run

av coefficient for mu^2 term

ngr

3

every run

gravity flag. leave it at 3. if your want no gravity, ngr=0 might still work.

nselfgravity

1

every run

0 if just do gravity to point particles, 1 if self-gravitating

nkernel

2

every run

smoothing kernel: 0=cubic spline, 1=Wendland 3,3, 2=Wendland C4

ncooling

0

every run

0 if no cooling, otherwise radiative cooling

teq

100d0

every run

background temperature the cooling relaxes towards, in K. Only used when ncooling>0

reat

-1.d0

every run

radius within which a point mass swallows SPH particles. Negative disables eating

Relaxation

Variable

Default

Applies to

Meaning

nrelax

1

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

trelax

1.d30

every run

drag timescale. 0 derives it from the model, a very large value disables the drag

treloff

0

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

tresplintmuoff

0.

every run

time to stop resplinting the mean molecular weight. leave this at 0.

omega_spin

0.d0

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

sep0

200

every run

initial separation of two stars in a binary or collision calculation, and the separation a scan starts from and holds until tscanon

rp

-1.d30

every run

separation at closest approach. Set any two of rp, vinf2, e0 and semimajoraxis and the rest follow

impactparameter

-1.d30

hbs hyp

impact parameter at infinity, an alternative to rp, converted to it using angular momentum

e0

-1.d30

bph hbs hyp

orbital eccentricity: 1 is parabolic, above 1 hyperbolic, below 1 bound

semimajoraxis

0.d0

bph hbs hyp

orbital semimajor axis. 0 means unset, so that it is deduced from the others

vinf2

1.d30

bph hbs hyp

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

mbh

10d0

2cr hbs hyp

mass of the point mass used as the second object when startfile2 is absent

dynhco

0

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

hcomin

0d0

every run

dynhco=2: lower limit on a point particle’s softening length (<=0: no limit)

hcomax

0d0

every run

dynhco=2 or 3: upper limit on a point particle’s softening length (<=0: no limit)

hcopnorm

8d0

every run

dynhco=2 or 3: sharpness p of the smooth limits h=((h_dyn^p+hcomin^p)^(-1)+hcomax^(-p))^(-1/p)

bbh_m1

-1d0

hyp

first mass of a compact-object binary. Required, and only used, when bbh_m2 is positive

bbh_m2

-1d0

hyp

second mass of a compact-object binary. Negative means unset, giving a single point mass of mass mbh

bbh_rp

-1.d30

hyp

separation at closest approach for the compact-object binary

bbh_semimajoraxis

0.d0

hyp

semimajor axis of the compact-object binary. 0 means unset

bbh_vinf2

1.d30

hyp

square of the relative speed at infinity for the compact-object binary. 1d30 means unset

bbh_e0

-1.d30

hyp

eccentricity of the compact-object binary

bbh_trueanomaly

0d0

hyp

true anomaly of the compact-object binary, in degrees

bbh_argperi

0d0

hyp

argument of periapsis of the compact-object binary, in degrees

bbh_inclination

0d0

hyp

inclination of the compact-object binary, in degrees

bbh_longitude

0d0

hyp

longitude of the ascending node of the compact-object binary, in degrees

Timestep control

Variable

Default

Applies to

Meaning

nintvar

2

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

cn1

.3d0

every run

dt1=cn1*h/v_signal

cn2

1.d30

every run

dt2=cn2*(h/|a-a_smoothed|)^0.5

cn3

0.1d0

every run

dt3=cn3*u/|du/dt|

cn4

1.d30

every run

dt4=cn4*v_signal/|a-a_smoothed|

cn5

0.02d0

every run

dt5=cn5*r_ij/v_ij (minimized over all other particles j)

cn6

0.02d0

every run

dt6=cn6*(r_ij/a_ij)^.5 (minimized over all other particles j)

cn7

4.d0

every run

r_ij=(x_ij^2+y_ij^2+z_ij^2+cn7*h_i^2)^.5

nblock

0

every run

0: one shared timestep. 1: block (power-of-2) timesteps, for dynamical runs only (see the docs for the settings it needs)

nbinmax

20

every run

nblock=1: smallest step is dtmaxblk/2**nbinmax

dtmaxblk

-1d0

every run

nblock=1: largest step (<=0: use dtout)

nblimit

2

every run

nblock=1: a step may be at most 2**nblimit times a neighbour’s

nblockfull

0

every run

nblock=1 testing: 1 recomputes h and hydro for all particles every substep

dtforce

-1d0

every run

testing only: >0 forces the shared timestep to this value

nstartramp

-1

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

ngravprocs

0

every run

the number of gravity processors (must be <= min(nprocs,ngravprocsmax))

qthreads

0

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.

ppn

16

every run

cpu cores per node, used to spread the gravity processes over nodes

computeexclusivemode

0

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

gflag

1

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

runit

6.957d10

every run

number of cm in the unit of length. use 6.957d10 if want MESA solar radius.

munit

1.9884098706980504d33

every run

number of g in unit of mass. use 1.9884098706980504E+033 if want MESA solar mass.

gravconst

6.67430d-08

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

boxx

0d0

every run

period in x of a periodic box running from -boxx/2 to boxx/2. 0 leaves x open

boxy

0d0

every run

period in y, as for boxx

boxz

0d0

every run

period in z, as for boxx

Input files

Variable

Default

Applies to

Meaning

startfile1

'sph.start1u'

2cr bhe bph bps hbs hyp pbx res tri

first body of the encounter, in out*.sph format, usually the last snapshot of a relaxation

startfile2

'sph.start2u'

2cr bhe bps hyp tri

second body, same format as startfile1. If absent, a single point mass of mass mbh is used

startfile3

'sph.start3u'

tri

third body of a triple, same format as startfile1

binaryfile

'input.bs'

2cr bps

text file describing the binary, read by bps and 2cr

triplefile

'input.3s'

bhe tri

text file describing the third body, read by bhe and tri

bpbhfile

'sph.bpbh'

bph

text file giving the orientation angles and black hole mass, read by bph

imagefile

'sph.image'

txt

ASCII picture that txt turns into a particle layout

advectedfile

'sph.passivelyAdvected'

hyp

per-particle passively advected quantities, read by hyp when present

eosfile

'sph.eos'

every run

tabulated equation of state, read when neos selects a table

opacityfile

'sph.opacity'

every run

tabulated opacities, read when cooling needs them

profilefile

'eg.last1.muse_s2mm'

erg

stellar-evolution profile that erg builds its star from

stellarevolutioncodetype

1

erg

which code wrote profilefile, since the column layouts differ

Other settings

Variable

Default

Applies to

Meaning

tswitchtou

-1.d0

every run

nintvar=12 or 32: time to hand over to u. <0 means use treloff.

twozone

0

erg

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

rtwozone

0d0

erg

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

rjumppercent

95d0

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

ndtoutafter

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