To perform radiation hydrodynamics simulations, both the equation of state and opacity are necessary. In principle, these two should be derived from the same chemical equilibrium abundances, which often is not the case. Optab
computes opacity based on user-provided chemical equilibrium abundances, and outputs mean opacities as well as monochromatic opacities. Consequently, one can have opacity tables consistent with one's equation of state.
In case you don't have your own chemical equilibrium solver, we recommend to use public solvers
FastChem
orTEA
to compute chemical abundances, for whichOptab
provides interfaces; see an example below.
Shigenobu Hirose (JAMSTEC, shirose@jamstec.go.jp)
Hirose, S., Hauschildt, P., Minoshima, T., Tomida, K., and Sano, T.
- Astronomy and Astrophysics, in press, https://doi.org/10.1051/0004-6361/202141076
- arXiv https://arxiv.org/abs/2112.05689
-
Requirements:
- GNU Fortran (10.3.0)
- Open MPI (4.1.1)
- HDF5 (1.12.1)
You need to have the above softwares (or their equivalents) installed on your system. The numbers in the parentheses are the versions confirmed to work with
Optab
while other versions should also work unless not too old. -
Source directories:
src/
: source codes ofoptab
eos/src/
: source codes for making HDF5 chemical abundance tables read byoptab
database/src/
: source codes for making HDF5 opacity databases read byoptab
-
Build steps:
- Go to each source directory and review
Makefile
for the following variables to modify them if necessary:OPENMPI = /opt/local HDF5 = /opt/local
- Type
make
to build the executable(s):$ make
- Go to each source directory and review
-
Build the opacity source database for
Optab
. Seedatabase/README.md
for insturction. The opacity sources currently implemented are:- Line absorption
- Continuum absorption
- Bremsstrahlung
- van Hoof et al. (2014)
- John (1988): H-
- John (1975): H2-
- Photoionization
- Collision-induced absorption (EXPERIMENTAL)
- Bremsstrahlung
- Scattering
- Thomson scattering
- Rayleigh scattering
- Lee (2005): H
- Rohrmann (2017): He
- Tarafdar & Vardya (1973): H2
-
Prepare a chemical abundance table that consists of sets of P (pressure), T (temperature), and Ni (number density of species i) like below, and convert it to a specific HDF5 file to be read by
Optab
.P [bar] T[K] NH [cm-3] Ne [cm-3] ... 1.0000000000e-12 2.5200000000e+03 2.6461950252e+06 2.9824566824e+02 ... 3.1622776602e-11 2.5200000000e+03 8.3691983426e+07 8.4813733226e+03 ... ... ... ... ... ... The easiest way to do this is to use public chemical equilibrium solvers
FastChem
orTEA
sinceOptab
has conversion codes for their outputs ineos/src/
. By consulting those codes, it is not difficult to write a conversion code for your own chemical equilibrium solver's output.
Here, we explain how to make opacity tables from a chemical abundance table generated by FastChem
. We assume that you already have FastChem
ready. Below, $FASTCHEM
and $OPTAB
are, respectively, the top directroies of FastChem
and Optab
.
-
Run
FastChem
with thistable.dat
(input file) and thisconfig.input
(configuration file) placed in$FASTCHEM/input/
. The input file defines the P - T grid, whose ranges are the same as those in Fig. 5 in Stock et al. (2018) and resolution is 11 (in log P) times 11 (in θ = 5040/T).$ cd $FASTCHEM/ $ ./fastchem ./input/config.input
-
Convert the
FastChem
's output file to a specific HDF5 file forOptab
:$ cd $OPTAB/eos/FastChem $ ../src/convert_Fastchem $FASTCHEM/output/chem_output_table.dat
-
Now execute the sample script
table.sh
located in$OPTAB/sample/
to runOptab
:$ cd $OPTAB/sample/ $ bash table.sh
It takes about 45min on 2.3 GHz 8-Core Intel Core i9 with 8 MPI processes.
NOTE
Before executing the script, you need to adjust the following four parameters so that they match your environment.EOS
: path to the chemical abundance table in the HDF5 format created in the above stepOPTAB
: path to the top directory ofOptab
DATABASE
: path to the top directory ofOptab
databasejprc
: number of MPI processes
You may also want to review other parameters in the script shown below:
... ##### export EOS='/Users/shirose/opac2/eos/chem_output_table.h5' export OPTAB='/Users/shirose/opac2/' export DATABASE='/Users/shirose/database/' ... ##### SELECT A SINGLE LINE-SOURCE FOR EACH MOLECULAR ISOTOPOLOGUE cat <<EOF > input/species_id.dat ID Species Isotopologue HITRAN HITEMP Exomol 1 H2O 1H2-16O 0 HITRAN 1 HITEMP2010 0 POKAZATEL 0 BT2 1 H2O 1H2-18O 0 HITRAN 1 HITEMP2010 0 HotWat78 1 H2O 1H2-17O 0 HITRAN 1 HITEMP2010 0 HotWat78 ... 101 H3+ 1H2-2H_p 0 ST 999 dummy dummy 0 dummy EOF ##### SELECT OPACITY SOURCES TO BE CONSIDERED (1: SELECTED, 0: NOT SELECTED) cat <<EOF > input/fort.5 &switches ! selection of opacity sources line_molecules = 1 ! molecular lines line_kurucz_gfpred = 1 ! Kurucz gfpred lines line_kurucz_gfall = 1 ! Kurucz gfall lines rayleigh_scattering_h2 = 1 ! Rayleigh scattering by H2 rayleigh_scattering_he = 1 ! Rayleigh scattering by He rayleigh_scattering_h = 1 ! Rayleigh scattering by H electron_scattering = 1 ! electron scattering cia = 0 ! Collision-induced absorption (EXPERIMENTAL) photoion_h2 = 1 ! Photoionization by H2 photoion_topbase = 0 ! TOPbase photoionization photoion_mathisen = 1 ! Mathisen photoionization photoion_verner = 1 ! Verner photoionization photoion_h_minus = 1 ! Photoionization by H- brems_h_minus = 1 ! Bremsstrahlung by H- brems_h2_minus = 1 ! Bremsstrahlung by H2- brems_atomicions = 1 ! Bremsstrahlung by atomic ions / &cutoffs ! for line evaluation cutoff0_voigt = 1d2 ! cutoff for Voigt profile [in wavelenth(cm^-1)] cutoff0_gauss = 3d0 ! cutoff for Gaussian profile [in gaussian width] delta_crit = 1d-4 ! criteria for discarding weak lines delta_voigt = 1d0 ! criteria for adopting Voigt profile / &radtemp ! radiation temperature for 2-temp Planck-mean opacity temp2 = 6000d0 / &grid_log_const ! logarithmic wavenumber grid k_total = 100000 ! total number of grid points grd_min = 1d0 ! min value of wavenumber grid grd_max = 7d0 ! max value of wavenumber grid / &mpi_decomp ! total number of MPI processes = kprc * jprc * mprc * jprc kprc = 1 ! number of processes in wavenumber grid (EXPERIMENTAL) lprc = 1 ! number of processes in line loop (EXPERIMENTAL) mprc = 1 ! number of processes in reading line-block loop (EXPERIMENTAL) jprc = 8 ! number of processes in layer loop / ... EOF ...
-
Optab
outputs a single HDF5 file for each set of (T, P, Ni), namedmono_?????.h5
, which contains:- Rosseland-mean opacity
- Planck-mean opacity
- two-temperature Planck-mean opacity
- monochromatic absorption and scattering opacities
These quantities can be visualized by the IDL codes
opac.pro
andmono.pro
in$OPTAB/sample/
as follows. The fourth command plots monochromatic opacities at layer #80. You need TeXtoIDL and Coyote libraries to run the codes.$ export IDL_PATH=./idl:$PATH_TO_TEXTOIDL:$PATH_TO_COYOTE:"<IDL_DEFAULT>" $ idl -e 'opac, dir="table", mean="ross"' $ idl -e 'opac, dir="table", mean="pla"' $ idl -e 'opac, dir="table", mean="pla2"' $ idl -e 'mono, dir="table", layer=80'
EOF