Crate kappa

Source
Expand description

§Introduction

This tool produces complex dust particle opacities right from the command line. It is derived from Michiel Min’s DHS OpacityTool and also implements Ryo Tazaki’s MMF theory for highly porous aggregates.

For a brief overview behind the details of the implementation from a theoretical perspective, read the book.

§Capabilities

  • stand-alone tool, fully command line driven, no input files need to be edited
  • full scattering matrix output in several formats, including for RADMC-3D
  • combining materials through mixing into a complex grain with porosity
  • built-in: a curated collection of materials for applications in astronomy
  • external refractive index data can be used just as easily
  • computational methods: (i) DHS (Distribution of Hollow Spheres) for irregular grains and low-porosity aggregates. Standard Mie theory for perfect spheres is available as a limiting case. (ii) MMF (Modified Mean Field) theory for high-porosity/fractal aggregates. (iii) CDE approximation in the Rayleigh limit.
  • Python interface module for plotting and post-processing

§Physical units used by kappa

Due to conventions in our field, the input and output of kappa uses the following units

  • grain sizes and wavelengths are in microns
  • mass densities of materials are in g/cm^3
  • opacities are in cm^2/g
  • scattering matrices are in sr^-1 or cm^-1 g^-1 sr^-1

§Examples

A simple grain made only of the default pyroxene, for the default grain size distribution ($a^{-3.5}$ powerlaw from 0.05 to 3000μm), on the default wavelength grid (0.05μm to 1cm).

§Installation

The easiest way to install kappa is to first get the source code from GitHub:

git clone https://github.com/ProsiaLAB/kappa.git

Then, you can build the executable with cargo:

cd kappa
cargo build --release

This will create a binary called kappa in the target/release directory.

§Usage

The command line interface is documented in the help message:

kappa --help

§Grain composition

If no composition is specified, the DIANA composition is used by default.

§Core material

Specify a material to include in the grain. MATERIAL can be the key for a builtin material, the path to an lnk file, or colon-separated numbers n:k:rho3. MFRAC is the mass fraction (default 1.0) of the material. You can give up to 20 materials to build up the grain. Mass fractions do not have to add up to one, they will be renormalized. All materials will be mixed together using the Bruggeman rule, and vacuum can be added through the porosity. -c in front of each material is optional.

§Mantle material

Like -c, but place this material into the grain mantle. Multiple mantle materials will be mixed using the Bruggeman rule, and then that mix will be added to the core using the Maxwell-Garnett rule. The -m is not optional, it must be present.

§Porosity

Porosity, the volume fraction of vacuum, a number smaller than 1. The default is 0. A single value will apply to both core and mantle, but a second value will be specific for the mantle (and may be 0).

§Grain geometry and computational method

If no method is explicitly specified, the default is -dhs 0.8, i.e. DHS with fmax=0.8.

§Distribution of Hollow Spheres

Use the Distribution of Hollow Spheres (DHS, Min+ 2005) approach to model deviations from perfect spherical symmetry and low-porosity aggregates. Spheres with inner holes with volume fractions between 0 and fmax (default 0.8) are averaged to mimic irregularities. fmax=0 means to use solid spheres (Mie theory), i.e. perfectly regular grains. For backward compatibility, -fmax can be used instead of -dhs

§Modified Mean Field theory

Use Modified Mean Field theory (MMF, Tazaki & Tanaka 2018) to compute opacities of highly porous or fractal aggregates. -c, -m, and -p determine the composition of monomers with radius A0 (default 0.1μm). Particles will be aggregates with a compact size given by the -a switch, giving rise to N = a3/a30 monomers. DFRAC-OR-FILL specifies either the fractal dimension (if >1) or the volume filling factor (if <1). The default is 0.2. KF may be used to change the default prefactor.

§Mie theory

Do a standard Mie calculation for perfect spheres. This is short for -dhs 0

§Continuum Distribution of Ellipsoids

Compute CDE (continuous distribution of ellipsoids) Rayleigh limit opacities

§Grain size distribution

Grain size distributions can be specified using a powerlaw, a (log-)normal or from a file.

§Powerlaw size distribution

Specify (minimum) grain radius, and optionally maximum grain radius, the size distribution powerlaw and the number of size bins. You may also use options to set individual values with -amin, -amax, -apow, -na. The defaults are 0.05 μm, 3000 μm, 3.5, and 15 per size decade with a fixed minimum of 5, respectively.

§(Log-)normal size distribution

Specify the centroid size and the logarithmic width for a log-normal size distribution. You may also use -amean and -asig options to set these values. If ASIG is negative, create a normal distribution with that width (in μm) around AMEAN.

§Wavelength grid

Specify the (minimum) wavelength, and optionally the maximum wavelength and the number of wavelengths points for the construction of the wavelength grid. The default values are 0.05 μm, 10000 μm, and 300, respectively. You may also use the options -lmin, -lmax, and -nlam (or -nl) to set individual values.

If only one wavelength is specified with -l, then λmax=λmin and nλ=1 are implied.

Grid can also be read from a file.

§Controlling the output

The standard output is the file dustkappa.dat, with the opacities and the asymmetry parameter g. The following options control and extend the output.

  • Put the output files in directory DIR instead of the current working directory. ./output will be used if -o is present but DIR is not specified.
  • Include the scattering matrix in the output. NANG may optionally change the number of equally-spaced angular grid points to cover the range of angles between 0 and 180 degrees. The default for NANG is 180 and should normally be just fine.
  • Divide the computation up into na parts to produce a file for each grain size. Each size will be an average over a range of NSUB grains around the real size.
  • Cap the first NDEG (2 if unspecified) degrees of the forward scattering peak.
  • Write dustkappa.fits instead of ASCII output. With -d, write na files.
  • RADMC-3D uses a different angular grid and scattering matrix normalization. File names will contain LABEL if specified and have the extension .inp.
  • Write to STDOUT instead of files. The default is to write λ, κabs, κsca, κext, and g. Many other outputs are possible, run optool -print ? for a full list. For readability, a header line may be printed to STDERR, but STDOUT gets only numbers which can be used in pipes and for redirection. You can use this to extract a single value, for example the 850μm extinction opacity of grains between 1 and 3mm: optool -a 1000 3000 -l 850 -print kext
  • Write the files optool_sd.dat and optool_lam.dat with the grain size distribution and the wavelength grid, respectively. Also, write optool_mix.lnk with the result of mixing refractive index data. Exit without doing a computation.

§Material properties

kappa needs refractive index data to work. For your convenience, a useful list of materials is compiled into kappa. You can also find and use other data. To access one of the built-in materials, specify the corresponding key string like pyr-mg70. In each material class we have selected a useful default, accessible with an even simpler generic key (for example, pyr is an alias for pyr-mg70). Most of the built-in refractive index datasets have a reasonably wide wavelength coverage - the few exceptions are highlighted by bold-face numbers. If a material is being used outside of the measured region, kappa will still function, using extrapolated optical properties.

Even the limited number of materials we have selected to include with kappa can be daunting. To get started with some kind of standard opacity, we recommend to work with pyroxene pyr, carbon c, and, at low temperatures, water ice h2o (Woitke+ 2016). If you need to account for sulfur, you may want to include troilite tro (Birnstiel+ 2016).

KeyMaterialState$\rho \mathrm{(g/cm^3)}$$\lambda_{min}$ ($\mu{}m$)$\lambda_{max}$ ($\mu{}m$)Reference
pyr-mg100$\mathrm{MgSiO_3}$Amorphous2.710.2500Dorschner+95
pyr-mg95$\mathrm{Mg_{0.95}Fe_{0.05}SiO_3}$Amorphous2.740.2500Dorschner+95
pyr-mg80$\mathrm{Mg_{0.8}Fe_{0.2}SiO_3}$Amorphous2.90.2500Dorschner+95
pyr-mg70 (pyr)$\mathrm{Mg_{0.7}Fe_{0.3}SiO_3}$Amorphous3.010.2500Dorschner+95
pyr-mg60$\mathrm{Mg_{0.6}Fe_{0.4}SiO_3}$Amorphous3.10.2500Dorschner+95
pyr-mg50$\mathrm{Mg_{0.5}Fe_{0.5}SiO_3}$Amorphous3.20.2500Dorschner+95
pyr-mg40$\mathrm{Mg_{0.4}Fe_{0.6}SiO_3}$Amorphous3.30.2500Dorschner+95
pyr-c-mg96 (ens)$\mathrm{Mg_{0.96}Fe_{0.04}SiO3}$Crystalline2.82.099Jäger+98
ol-mg50 (ol)$\mathrm{MgFeSiO_4}$Amorphous3.710.2500Dorschner+95
ol-mg40$\mathrm{Mg_{0.8}Fe_{1.2}SiO_4}$Amorphous3.710.2500Dorschner+95
ol-c-mg100 (for)$\mathrm{Mg_{2}SiO_4}$Crystalline3.275.0200Suto+06
ol-c-mg95$\mathrm{Mg_{1.9}Fe_{0.1}SiO_4}$Crystalline3.332.08190Fabian+01
ol-c-mg00 (fay)$\mathrm{Fe_{2}SiO_4}$Crystalline4.393.0250Fabian+01
astrosil$\mathrm{MgFeSiO_4}$Mixed3.3$6\times 10^-5$$1 \times 10^5$Draine+03
c-z (c)$\mathrm{C}$Amorphous?1.80.05$1 \times 10^4$Zubko+96
c-p$\mathrm{C}$Amorphous1.80.11800Preibisch+93
c-gra (gra)$\mathrm{C}$ graphiteCrystalline2.16?0.0011000Draine+03
c-org (org)$\mathrm{CHON}$ organicsAmorphous1.40.1$1 \times 10^5$Henning+96
fe-c (iron)$\mathrm{Fe}$Metal7.870.1$1 \times 10^5$Henning+96
c_nano$\mathrm{C}$ nano-diamondCrystalline2.30.02110Mutschke+04
fes (tro)$\mathrm{FeS}$Metal4.830.1$1 \times 10^5$Henning+96
sic$\mathrm{SiC}$Crystalline3.220.0011000Laor93
sio2 (qua)$\mathrm{SiO_2}$Amorphous2.650.0006500Kitamura+07
cor-c (cor)$\mathrm{Al_{2}O_3}$Crystalline4.00.540Koike+95
h2o-w (h2o)Water iceCrystalline0.920.04$2 \times 10^6$Warren+08
h2o-aWater iceAmorphous0.920.04$2 \times 10^6$Hudgins+93
co2-w (co2)$\mathrm{CO_2}$ iceCrystalline1.60.05$2 \times 10^5$Warren+86
nh3-m (nh3)$\mathrm{NH_3}$ iceCrystalline0.750.14$2 \times 10^0$Martonchik+83
co-a (co)$\mathrm{CO}$ iceAmorphous0.813.85.8Palumbo+06
co2-a / c$\mathrm{CO_2}$ iceAmorphous / Crystalline1.22.520Gerakines+20
ch4-a / c$\mathrm{CH_4}$ iceAmorphous / Crystalline0.472.020Gerakines+20
ch3oh-a / c$\mathrm{CH_{3}OH}$ iceAmorphous / Crystalline0.78/1.022.024Gerakines+20

Modules§

cli
Command line interface for the kappa.
components
This module defines structs, variables and other statically defined data structures for built-in materials in kappa.
config
dhs
Distribution of Hollow Spheres (DHS) for irregular grains and low-porosity aggregates. In order to simulate irregularities in grains (irregular shapes, or the properties of low-porosity aggregates), kappa averages the opacities of grains with an inner empty region, over a range of volume fractions of this inner region between 0 and fmax. The subroutine used to compute the opacities and scattering matrix elements for these structures is toon_ackerman_1981 (Toon & Ackerman 1981). For speed, you can set xlim 1e3 or so to set a limit for the size parameter (x = 2πa/λ) where kappa switches from DHS to crate::mie::de_rooij_1984.
fractal
Computes light scattering properties of randomly oriented fractal dust aggregates by means of the modified mean field theory developed in Tazaki & Tanaka (2018). This code is also capable of computing the light scattering solution based on the Rayleigh-Gans-Debye theory and the Mean field theory.
geofractal
io
Read the lnk files
mie
Mie scattering calculation
opac
The heart of kappa. This module contains the main routines to compute opacities and scattering matrices.
types
utils