damping

Module

Description

Various implementations for artificial damping of velocities either to relax particles into equilibrium or enforce boundary conditions

References:

Gingold & Monaghan (1977) MNRAS 181, 375 Reichardt et al. (2019) MNRAS 484, 631 (used idamp=2) González-Bolívar et al. (2022) MNRAS 517, 3181 (making idamp=2 obsolete)

Owner:

Daniel Price

Runtime parameters:
  • damp : damping timescale as fraction of orbital timescale

  • idamp : artificial damping of velocities (0=off, 1=constant, 2=star, 3=disc)

  • r1in : inner boundary of inner disc damping zone

  • r1out : inner boundary of outer disc damping zone

  • r2in : outer boundary of inner disc damping zone

  • r2out : outer boundary of outer disc damping zone

  • tdyn_s : dynamical timescale of star in seconds - damping is dependent on it

Dependencies:

infile_utils, io, physcon, units

Quick access

Variables:

idamp_max, r1in, r1out, r2in, r2out, tdyn_s

Routines:

apply_damp(), calc_damp(), get_damp_fac_disc(), read_options_damping(), write_options_damping()

Variables

  • damping/damp [real,public/optional/default=0.0]
  • damping/idamp [integer,public/optional/default=0]
  • damping/idamp_max [integer,private/parameter/optional/default=3]

    maximum allowed value of idamp

  • damping/r1in [real,public/optional/default=0.3]
  • damping/r1out [real,public/optional/default=2.52]
  • damping/r2in [real,public/optional/default=0.357]
  • damping/r2out [real,public/optional/default=3.0]
  • damping/tdyn_s [real,public/optional/default=0.0]

Subroutines and functions

subroutine  damping/calc_damp(time, damp_fac)
Parameters:
  • time [real,in]

  • damp_fac [real,out] :: fraction per timestep

Use :

units (utime()), physcon (pi())

subroutine  damping/apply_damp(fextx, fexty, fextz, vxyz, xyz, damp_fac)
Parameters:
  • fextx [real,inout]

  • fexty [real,inout]

  • fextz [real,inout]

  • vxyz (3) [real,in]

  • xyz (3) [real,in]

  • damp_fac [real,in]

Call to:

get_damp_fac_disc()

function  damping/get_damp_fac_disc(xyz, v0)
Parameters:
  • xyz (3) [real,in] :: cos(phi) = x/R

  • v0 (3) [real,out]

Return:

fac [real]

Use :

physcon (pi())

Called from:

apply_damp()

subroutine  damping/write_options_damping(iunit)
Parameters:

iunit [integer,in]

Use :

infile_utils (write_inopt())

subroutine  damping/read_options_damping(name, valstring, imatch, igotall, ierr)
Parameters:
  • name [character,in]

  • valstring [character,in]

  • imatch [logical,out]

  • igotall [logical,out]

  • ierr [integer,out]

Use :

io (fatal())