set_disc

Module

Description

This module contains utility routines for accretion disc setups

References:

Lodato & Pringle (2007), MNRAS 381, 1287-1300 Lodato & Price (2010), MNRAS 405, 1212-1226 Meru & Bate (2012), MNRAS 427, 2022-2046

Owner:

Daniel Price

Runtime parameters:
  • G : in code units

  • M_disc : disc mass

  • M_star : mass of central star

  • Qmin : minimum Toomre Q parameter

  • R_c : characteristic radius of the exponential taper

  • R_in : inner disc boundary

  • R_out : outer disc boundary

  • R_ref : reference radius

  • R_warp : position of warp

  • T_in : temperature (K) at R=R_in

  • T_out : temperature (K) at R=R_out

  • T_ref : temperature (K) at R=R_ref

  • alphaSS_max : maximum Shakura-Sunyaev alpha viscosity in disc

  • alphaSS_min : minimum Shakura-Sunyaev alpha viscosity in disc

  • c : in code units

  • cs0 : sound speed at R=1

  • n : number of particles in the disc

  • p_index : power law index of surface density profile

  • psi_max : maximum warp amplitude

  • q_index : power law index of sound speed profile

  • sig_in : surface density (g/cm^2) at R=R_in

  • sig_max : maximum surface density (g/cm^2)

  • sig_out : surface density (g/cm^2) at R=R_out

  • sig_ref : surface density (g/cm^2) at R=R_ref

  • udist : distance units (cgs)

  • umass : mass units (cgs)

  • utime : time units (cgs)

Dependencies:

allocutils, centreofmass, dim, eos, eos_stamatellos, externalforces, fileutils, grids_for_setup, infile_utils, io, mpidomain, mpiutils, options, part, physcon, random, table_utils, units, vectorutils

Quick access

Variables:

adjust_centre_of_mass, cs_func, distr_ecc_corr, ecc_distrib, get_honh, get_honr, get_t_from_lum, get_u_stamatellos, m_to_f, maxbins, set_disc_positions, set_disc_velocities, write_discinfo

Routines:

get_cs_from_lum(), get_disc_mass(), scaled_sigma(), set_disc(), set_incline_or_warp()

Needed modules

  • dim (maxvxyzu(), disc_viscosity())

  • mpidomain (i_belong_i4())

  • io (warning(), error(), fatal())

  • mpiutils (reduceall_mpi())

  • part (igas(), labeltype(), maxp())

  • physcon (c(), gg(), pi()): Physical and mathematical constants (as in sphNG)

  • units (umass(), udist(), utime(), unit_angmom()): This module contains information about physical units (irrelevant if simulations are scale free except that the units are printed in the dump file header

Variables

  • setdisc/adjust_centre_of_mass [private]
  • setdisc/cs_func [private]
  • setdisc/distr_ecc_corr [private]

    *&

  • setdisc/ecc_distrib [private]
  • setdisc/get_honh [private]
  • setdisc/get_honr [private]
  • setdisc/get_t_from_lum [private]
  • setdisc/get_u_stamatellos [private]
  • setdisc/m_to_f [private]
  • setdisc/maxbins [integer,public/parameter/optional/default=4096]
  • setdisc/set_disc_positions [private]
  • setdisc/set_disc_velocities [private]
  • setdisc/write_discinfo [private]

Subroutines and functions

subroutine  setdisc/set_disc(id, master[, mixture[, nparttot, npart[, npart_start, rmin, rmax[, rmindust[, rmaxdust[, phimin[, phimax[, indexprofile[, indexprofiledust[, rc[, rcdust, p_index[, p_indexdust, q_index[, q_indexdust, hoverr[, hoverrdust, gamma[, disc_mass[, disc_massdust[, sig_norm[, star_mass[, xyz_origin[, vxyz_origin[, particle_type, particle_mass, hfact, xyzh, vxyzu, polyk[, position_angle[, inclination[, ismooth[, alpha[, rwarp[, warp_smoothl[, e0[, eindex[, phiperi[, eccprofile[, bh_spin[, bh_spin_angle[, rref[, enc_mass[, r_grid[, writefile[, ierr[, prefix[, lumdisc[, l_star[, t_bg[, verbose]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]])
Parameters:
  • id [integer,in]

  • master [integer,in]

  • mixture [logical,in,]

  • nparttot [integer,in,]

  • npart [integer,inout]

  • npart_start [integer,in,]

  • rmin [real,in]

  • rmax [real,in]

  • rmindust [real,in,]

  • rmaxdust [real,in,]

  • phimin [real,in,]

  • phimax [real,in,]

  • indexprofile [integer,in,]

  • indexprofiledust [integer,in,]

  • rc [real,in,]

  • rcdust [real,in,]

  • p_index [real,in]

  • p_indexdust [real,in,]

  • q_index [real,in]

  • q_indexdust [real,in,]

  • hoverr [real,in] :: –HoverR is H/R at R=R_ref (R_ref=R_in unless specified)

  • hoverrdust [real,in,]

  • gamma [real,in]

  • disc_mass [real,in,]

  • disc_massdust [real,in,]

  • sig_norm [real,in,]

  • star_mass [real,in,]

  • xyz_origin (3) [real,in,]

  • vxyz_origin (3) [real,in,]

  • particle_type [integer,in,]

  • particle_mass [real,out]

  • hfact [real,in]

  • xyzh (,) [real,out]

  • vxyzu (,) [real,out]

  • polyk [real,out]

  • position_angle [real,in,]

  • inclination [real,in,]

  • ismooth [logical,in,]

  • alpha [real,inout,]

  • rwarp [real,in,]

  • warp_smoothl [real,in,]

  • e0 [real,in,]

  • eindex [real,in,]

  • phiperi [real,in,]

  • eccprofile [integer,in,]

  • bh_spin [real,in,]

  • bh_spin_angle [real,in,]

  • rref [real,in,]

  • enc_mass (maxbins) [real,in,]

  • r_grid (maxbins) [real,in,]

  • writefile [logical,in,]

  • ierr [integer,out,]

  • prefix [character,in,]

  • lumdisc [logical,in,]

  • l_star [real,in,]

  • t_bg [real,in,]

  • verbose [logical,in,]

Use :

io (stdout()), part (maxp(), idust(), maxtypes()), centreofmass (get_total_angular_momentum()), allocutils (allocate_array()), grids_for_setup (init_grid_sigma(), init_grid_ecc(), deallocate_sigma(), deallocate_ecc())

Called from:

test_lum(), test_setdisc()

Call to:

get_disc_mass(), set_incline_or_warp(), get_total_angular_momentum()

subroutine  setdisc/set_incline_or_warp(xyzh, vxyzu, npart_tot, npart_start, posangl, incl, rwarp, hwarp, psimax)
Parameters:
  • xyzh (,) [real,inout]

  • vxyzu (,) [real,inout]

  • npart_tot [integer,in]

  • npart_start [integer,in]

  • posangl [real,in]

  • incl [real,in]

  • rwarp [real,in]

  • hwarp [real,in]

  • psimax [real,out]

Use :

vectorutils (rotatevec())

Called from:

set_disc()

function  setdisc/scaled_sigma(r, sigmaprofile, pindex, r_ref, r_in, r_out, r_c)
Parameters:
  • r [real,in]

  • sigmaprofile [integer,in]

  • pindex [real,in]

  • r_ref [real,in]

  • r_in [real,in]

  • r_out [real,in]

  • r_c [real,in]

Return:

sigma [real]

Use :

table_utils (interpolate_1d()), grids_for_setup (datasigma(), sigma_initialised(), dsigmadx())

Called from:

get_disc_mass()

Call to:

interpolate_1d()

subroutine  setdisc/get_disc_mass(disc_m, enc_m, rad, toomre_min, sigmaprofile, sigma_norm, star_m, pindex, qindex, r_in, r_out, r_ref[, r_c, h_r])
Parameters:
  • disc_m [real,out]

  • enc_m (*) [real,out]

  • rad (*) [real,in]

  • toomre_min [real,out]

  • sigmaprofile [integer,in]

  • sigma_norm [real,in]

  • star_m [real,in]

  • pindex [real,in]

  • qindex [real,in]

  • r_in [real,in]

  • r_out [real,in]

  • r_ref [real,in]

  • r_c [real,in,]

  • h_r [real,in]

Called from:

set_disc()

Call to:

scaled_sigma()

function  setdisc/get_cs_from_lum(l_star, r, t_bg, gamma)
Parameters:
  • l_star [real,in]

  • r [real,in]

  • t_bg [real,in]

  • gamma [real,in]

Return:

get_cs_from_lum [real,pure]

Use :

physcon (kb_on_mh(), steboltz(), solarl(), fourpi()), units (udist(), unit_velocity())