Free Access
Issue
A&A
Volume 659, March 2022
Article Number A87
Number of page(s) 14
Section Numerical methods and codes
DOI https://doi.org/10.1051/0004-6361/202141076
Published online 10 March 2022

© ESO 2022

1. Introduction

Thanks to recent progress in high-performance computing, radiation hydrodynamics (RHD) simulations are now popular in many research fields in astrophysics. Accordingly, numerical schemes for RHD simulations have been developed. However, it is also crucial to use appropriate opacities in order to obtain correct solutions of RHD equations, which is the focus of this study. To save computational time in RHD simulations, it is fairly common to solve a frequency-averaged radiative transfer equation with the local thermodynamic equilibrium (LTE) assumption. In this case, Rosseland and Planck mean opacities as functions of temperature and pressure are required to perform RHD simulations (e.g., Hirose et al. 2014).

Although the methods for calculating gas opacities have been established, significant effort is required to calculate them in practice. For example, one has to gather data pertaining to relevant opacity sources scattered throughout the literature or on the web and develop complicated interfaces capable of reading various types of data. Moreover, it is computationally intensive to calculate line opacities from very large line lists such as those provided by Exomol1 (Tennyson & Yurchenko 2012). Therefore, researchers tend to use publicly available opacity tables. In the literature, there are a number of papers that provide opacity tables (Cox & Stewart 1970a,b; Alexander 1975; Alexander et al. 1983; Sharp 1992; Alexander & Ferguson 1994; Bell & Lin 1994; Pollack et al. 1994; Henning & Stognienko 1996; Helling et al. 2000; Semenov et al. 2003; Ferguson et al. 2005; Freedman et al. 2008; Helling & Lucas 2009; Malygin et al. 2014), including OPAL Project2 (Rogers & Iglesias 1992) and Opacity Project3 (Seaton et al. 1992).

As summarized in Table A.1 in Semenov et al. (2003), the various opacity tables differ depending on the research purpose and thus differ in composition, opacity sources, ranges of temperature and pressure, and outputs. Consequently, one cannot always obtain an opacity table that meets one’s research purpose. One can create a hybrid table that covers larger ranges by combining different tables (e.g., Fig. 2 in Hirose et al. 2014); however, it is not guaranteed that the tables will share the same boundary values. As pointed out by Malygin et al. (2014), disagreements in opacity values between different tables could be caused not by only different assumptions being applied but also because of the use of different sampling points. This makes comparison of different opacity tables difficult unless table codes are publicly available. Another issue is that not all public tables are updated regularly.

For these reasons, we decided to develop a public code, named OPTAB, that can be used to generate opacity tables using opacity sources and sampling points chosen by the user. In the first version of the code, we consider only gas opacities, whose physics are well understood. Our code outputs Rosseland, Planck, and two-temperature Planck mean opacities, as well as the monochromatic opacity. The two-temperature Planck mean opacity (Eq. (28)) is needed when one considers the case in which the radiation and gas temperatures differ, such as an accretion disk irradiated by the central star (e.g., Hirose & Shi 2019). In the literature, the public code DFSYNTHE (Castelli 2005) can be used to generate opacity tables (Malygin et al. 2014). Additionally, OPAL4 (Rogers & Iglesias 1992) and Semenov et al. (2003)5 provide public codes for generating opacity tables. In contrast to these codes, our code is developed for modern high-performance computing – it is written in Fortran 90 using Message Passing Interface (MPI) and Hierarchical Data Format, Version 5 (HDF5)6 – and addresses both readability and portability. Furthermore, our code is available at GitHub7 and allows for continuous updates through contributions by users.

The goal of this code is not to provide complete opacity tables for a specific purpose, but to provide a platform on which users can generate opacity tables for their own purposes. Therefore, while opacity sources initially implemented in our code are basic ones, the code is written so that a user can easily modify, change, or add opacity sources.

We note that OPTAB does not solve the chemical equilibrium (CE) condition to obtain equilibrium abundances of species that are needed for calculating opacities. We assume that the user has obtained this solution using an external program. Recently, public CE solvers for astrophysics, including FASTCHEM (Stock et al. 2018) and TEA (Blecic et al. 2016), have been made available.

In Sect. 2, the structure of the code and the opacity sources implemented in our code are described. In Sect. 3, the details of the opacity calculations in our code are given. In Sect. 4, a method to reduce the computational effort in line opacity calculations is described. In Sect. 5, the results of validation tests to evaluate the performance of our code are presented. Finally, future aspects are discussed in Sect. 6.

2. Code description

OPTAB is written in Fortran 90 using the MPI library for parallel computing as well as the HDF5 library for flexible and efficient parallel Input/Output (I/O) of very large atomic or molecular line lists.

In Table 1, we list the opacity sources implemented in the first version of OPTAB. All sources are publicly available, and the choice of sources is based on the PHOENIX code (Hauschildt & Baron 1999; Allard & Hauschildt 1995)8. Because each subroutine calculating each opacity is modularized, the user can easily modify the code to change or add opacity sources. To calculate opacities, in addition to the opacity sources, some supplementary data providing atomic properties are needed, which are obtained from the National Institute of Standards and Technology (NIST) Atomic Spectra Database (ASD) levels form9 (Kramida et al. 2020) and NIST Atomic Weights and Isotopic Compositions with Relative Atomic Masses (AWIC)10 (Meija et al. 2016; Berglund & Wieser 2011).

Table 1.

Opacity sources implemented in the first version of OPTAB.

As shown in Table 1, OPTAB currently accepts the Kurucz line lists11 for atomic lines, and the HITRAN12 (Gordon et al. 2017) and Exomol line lists for molecular lines. Because these line lists are extremely large and are repeatedly accessed in the code, they are converted to HDF5 files from their original ASCII files beforehand. In addition, HITRAN collision-induced absorption (CIA) data and the supplementary data for atomic properties taken from the NIST ASD/AWIC are converted and stored in an HDF5 file, respectively. The details of these conversions are described in Appendix A.

Figure 1 shows the flowchart for OPTAB. First, the code reads parameters that determine the opacity sources to be considered, the wave number grid ν k $ {{\tilde{\nu}}}_k $ [cm−1] (k is the grid index), and the line profile evaluation described in Sect. 4. Then, it reads CE abundances based on which the opacities are computed, which are prepared by the user for some pairs of temperature and pressure (i.e., “layers”). The equilibrium abundances needs to be stored in a specified HDF5 format; the OPTAB package provides codes for storing the outputs of FASTCHEM and TEA in the HDF5 format.

thumbnail Fig. 1.

Flowchart of OPTAB. The external files in the gray boxes are in the HDF5 format, which have been converted from their original ASCII files (Appendix A).

After reading the above data, the code computes the continuum opacities, line opacities, and the mean opacities, and repeats the computations for each layer. Here, opacity sources of small size are coded inline, while those of large size are read from external files. MPI parallelization is performed for the layer loop (Sect. 5.3). As the final step of the layer loop, the absorption and scattering coefficients together with the mean opacities for each layer are written into a single HDF5 file.

3. Opacity calculations

While we use the wavenumber ν $ {{\tilde{\nu}}} $ for the computational grid in OPTAB, we also use the frequency ν = c ν $ \nu = c{{\tilde{\nu}}} $, photon energy E = h c ν $ E = hc{{\tilde{\nu}}} $, or wavelength λ = 1 / ν $ \lambda = 1/{{\tilde{\nu}}} $ in the following sections, depending on the context. Here, c and h are the speed of light and the Planck constant, respectively.

3.1. Notes on partition functions

The opacity calculation for LTE gas uses the fact that the level population obeys the Maxwell-Boltzmann distribution, where the number density of a species in energy level l at temperature T and pressure P is written as

N l ( T , P ) = N ( T , P ) g l e E l E 1 k B T Q ( T ) . $$ \begin{aligned} N_l(T,P) = N(T,P)\dfrac{{g}_l\mathrm{e} ^{-\frac{E_l - E_1}{k_{\rm B}T}}}{Q(T)}. \end{aligned} $$(1)

Here, Q(T) is the internal partition function defined as

Q ( T ) l g l e E l E 1 k B T , $$ \begin{aligned} Q(T) \equiv \sum _l{g}_l\mathrm{e} ^{-\frac{E_l - E_1}{k_{\rm B}T}}, \end{aligned} $$(2)

gl and El are the statistical weight and energy of the level l, respectively (E1 is the energy of the ground state), and kB is the Boltzmann constant.

The total number density N(T, P) = ∑lNl(T, P) in Eq. (1) for each species is determined by a CE calculation, where Q(T) also plays an important role. This is because the chemical potential μ(T, P) [J mol−1] used in a CE calculation is uniquely related to Q(T) as

μ ( T , P ) N A E 1 = R T ln ( P k B T ( h 2 2 π m k B T ) 3 2 1 Q ( T ) ) , $$ \begin{aligned} \mu (T,P) - N_{\rm A}E_1 = RT\ln \left(\dfrac{P}{k_{\rm B}T}\left(\dfrac{h^2}{2\pi mk_{\rm B}T}\right)^\frac{3}{2}\dfrac{1}{Q(T)}\right), \end{aligned} $$(3)

where NA is the Avogadro constant [mol−1], R is the gas constant [J K−1 mol−1], and m is the mass of the atom or molecule (Eq. (24.50) in McQuarrie & Simon 1997). Therefore, for the LTE opacity to be consistent with the CE, the same partition function should be used. For more details, we refer the readers to Appendix C.

In practice, this cannot be done for the following reasons: i) In a CE calculation, μ is usually computed from thermochemical databases based on experiments such as NIST-JANAF (Chase 1998) or NASA Chemical Equilibrium with Applications (CEA) (Mcbride & Gordon 1992). However, because such thermochemical databases do not consider isotoplogues, they cannot be used to calculate Q(T) (by means of Eq. (C.4)) for the LTE opacity calculations, in which isotopologues are considered. ii) On the other hand, the number of species for which Q(T) is provided along with the line lists is not sufficient for performing a CE calculation. For example, the number of molecular species in the HITRAN line lists is 55, whereas that used in a CE solver FASTCHEM is 436 (Table 2 in Stock et al. 2018).

Because of reasons (i) and (ii), we have to admit that in practice different partition functions may be used between the CE calculation and the LTE opacity calculations. In our code, for Kurucz atomic lines, we use the Kurucz level data gf????(z).gam13 to calculate Q(T) from the definition (Eq. (2)). We note that the Kurucz level data are not available for some species, for which we use the NIST ASD levels instead. For molecular lines, we employ tabulated partition functions provided with the line lists.

Hereafter, we omit the dependence of number densities N on temperature T and pressure P for brevity. Accordingly, we omit the dependence of absorption coefficients α [cm−1] on P.

3.2. Bremsstrahlung

The absorption coefficient of the bremsstrahlung of an atomic ion of charge Ze (where Z ≥ 1 is the charge number and e is the elementary charge) is written as (e.g., Rybicki & Lightman 2008)

α bre ( ν ; T ) N e N ion = ( 4 3 2 π m e 3 e 6 m e 2 c h ) 1 e h ν k B T k B T ν 3 Z 2 g ¯ ff ( γ 2 , u ) . $$ \begin{aligned} \dfrac{\alpha _{\rm bre}(\nu ;T)}{N_{\rm e}N_{\rm ion}} = \left(\dfrac{4}{3}\sqrt{\dfrac{2\pi m_{\rm e}}{3}}\dfrac{e^6}{m_{\rm e}^2ch}\right)\dfrac{1 - \mathrm{e}^{-\frac{h\nu }{k_{\rm B}T}}}{\sqrt{k_{\rm B}T}{\nu }^3}Z^2{\bar{g}_{\rm ff}}(\gamma ^2,u). \end{aligned} $$(4)

Here, the thermally averaged Gaunt factor, g ¯ ff $ \bar{g}_{\mathrm{ff}} $, is a function of the scaled quantities γ2 ≡ Z2Ry/kBT and u ≡ /kBT, and Ne, Nion, and me are the number densities of free electrons and ions, and the electron mass, respectively. Ry is an energy unit, the Rydberg, which is approximately 13.6 eV. Our code employs a numerical table for g ¯ ff ( γ 2 , u ) $ {\bar{g}_{\mathrm{ff}}}(\gamma^2,u) $ provided by Hoof et al. (2014) to compute Eq. (4) for elements ranging from hydrogen (H) to zinc (Zn). Then, the total coefficient is obtained by summing up the coefficients of H+, He+, He2+, …, and Zn30+.

In addition, we have implemented the bremsstrahlung absorption of H and H 2 $ \rm{H}_2^- $ based on John (1988) and John (1978), respectively. In the former, the absorption coefficient per electron pressure (Pe) per number density of H (NH) [cm2 dyne−1] is given as a function of λ and T. In the latter, the absorption coefficient per Pe per NH2 is given as a function of ν $ {{\tilde{\nu}}} $ and T.

3.3. Photoionization

A general expression for the photoionization absorption coefficient is

α pho ( ν ; T ) = ( 1 e h ν k B T ) l σ l N l , $$ \begin{aligned} \alpha _{\rm pho}(\nu ;T) = \left(1-\mathrm{e}^{-\frac{h\nu }{k_{\rm B}T}}\right)\sum _l \sigma _{l} N_{l}, \end{aligned} $$(5)

which is rewritten using Eq. (1) as

α pho ( ν ; T ) N = ( 1 e h ν k B T ) 1 Q ( T ) l σ l g l e E l k B T , $$ \begin{aligned} \dfrac{\alpha _{\rm pho}(\nu ;T)}{N}= \left(1-\mathrm{e}^{-\frac{h\nu }{k_{\rm B}T}}\right) \dfrac{1}{Q(T)}\sum _l \sigma _{l}{{g}_{l}\mathrm{e}^{-\frac{E_{l}}{k_{\rm B}T}}}, \end{aligned} $$(6)

where σl is the photoionization cross-section of energy level l, and (1 − e/kBT) is a correction factor for the induced absorption.

For atoms and their positive ions, the last factor in Eq. (6) (a summation on the energy levels) is expressed in our code as

l σ l g l e E l k B T = σ 1 g 1 + l 2 σ l g l e E l k B T , $$ \begin{aligned}&\sum _l \sigma _{l}{{g}_{l}\mathrm{e}^{-\frac{E_{l}}{k_{\rm B}T}}} = \sigma _{1}{g}_1 + \sum _{l\ge 2} \sigma _{l}{{g}_{l}\mathrm{e}^{-\frac{E_{l}}{k_{\rm B}T}}}, \end{aligned} $$(7)

σ 1 { σ ( v 96 ) ( E ) E E max nm σ nm ( v 95 ) ( E ) E > E max , $$ \begin{aligned}&\sigma _{1} \equiv {\left\{ \begin{array}{ll} \sigma ^\mathrm{(v96)}(E)&E \le E_{\rm max}\\ \sum _{nm}\sigma _{nm}^\mathrm{(v95)}(E)&E > E_{\rm max} \end{array}\right.}, \end{aligned} $$(8)

where n and m are the principal quantum number of the shell and the subshell orbital quantum number, respectively.

Equation (8) indicates that we employ a hybrid of Verner & Yakovlev (1995) and Verner et al. (1996) ( σ nl ( v 95 ) $ \sigma_{nl}^{\mathrm{(v95)}} $ and σ(v96), respectively) for photoionization originating from the ground level (l = 1) depending on Emax, which is a parameter given in Verner et al. (1996) and is specific to the species. Verner & Yakovlev (1995) proposed a fitting formula to the partial photoionization cross-sections based on Hartree-Dirac-Slater calculations for the ground state shells (of elements from H to Zn). Verner et al. (1996) presented a set of analytic fits to the photoionization cross-sections (of elements from H to Si, and for S, Ar, Ca, and Fe) calculated by the Opacity Project (OP), which are more accurate at low energies. In Fig. 2, the brown curve shows how the above hybrid photoionization cross-section is applied to Mg atoms, where Emax = 54.90 eV, or ν = 4.428 × 10 5 $ \tilde\nu = 4.428\times10^5 $ cm−1.

thumbnail Fig. 2.

Magnesium photoionization absorption coefficients per Mg atom [cm2] at 5000 K. The brown curve indicates the photoionization from the ground level, and is a hybrid of Verner et al. (1996) (outer-subshell contributions; yellow) and Verner & Yakovlev (1995) (inner-subshell contributions; cyan). Both the magenta and black thin curves indicate the photoionization from excited levels; the former is based on the Mathisen (1984) compilation, whereas the latter is based on TOPbase.

As for photoionization cross-sections from excited states (l ≥ 2), OPTAB provides two options: cross-sections compiled by Mathisen (1984) and cross-sections available at the Opacity Project online atomic database, TOPbase (Cunto & Mendoza 1992). Both databases provide a set of {σl,gl,El} for selected photoionization channels of selected species that can be used in Eq. (6). TOPbase is generally more comprehensive and more complete than the Mathisen’s compilation14. In Fig. 2, we compare the photoionization cross-sections from excited states between the Mathisen’s compilation (magenta; Vernazza et al. 1976, 1981; Thompson et al. 1974; Bradley et al. 1976) and TOPbase (thin black). We observe that more detailed structures are resolved in the TOPbase photoionization cross-sections; however, they require higher computational costs.

For H and He+ (hydrogenic atoms and ions), the photoionization cross-section is written in terms of Kramers’ semi-classical formula as (e.g., Carson et al. 1968)15

σ n ( ν ) [ 64 π 4 3 3 ( m e e 10 c h 6 ) ( Z 4 n 5 ) 1 ν 3 ] g ( h ν Z 2 Ry , n ) , $$ \begin{aligned} \sigma _n(\nu ) \equiv \left[\dfrac{64\pi ^4}{3\sqrt{3}}\left(\dfrac{m_{\rm e}e^{10}}{ch^6}\right)\left(\dfrac{Z^4}{n^5}\right)\dfrac{1}{\nu ^3}\right] {g}\left(\dfrac{h\nu }{Z^2\mathrm{Ry}},n\right), \end{aligned} $$(9)

where n is the principal quantum number. For the Gaunt factor g(/Z2Ry, n), fitting formulae by Chapman (1969, 1970) for the tables given in Karzas & Latter (1961) are recommended in Mathisen (1984). However, we use the original tables in our code instead because we found the fitting formulae diverge in some cases.

In addition to the above, we have implemented photoionization absorption for H and H2. For the former and latter, we employ the cross-section formulas given in Ohmura & Ohmura (1960) and Yan et al. (2001), respectively.

3.4. Line absorption

The line absorption coefficient for the transition from state l to state u is expressed as

α line ( ν ; T ) = N l ( π e 2 m e c ) f lu ϕ ul ( ν ) c ( 1 e c 2 ν / T ) , $$ \begin{aligned} \alpha _{\rm line}({\tilde{\nu }};T) = {N_l}\left(\dfrac{\pi e^2}{m_{\rm e}c}\right) f_{lu} \dfrac{\phi _{ul}({\tilde{\nu }})}{c}\left(1 - \mathrm{e} ^{-c_2{\tilde{\nu }}/T}\right), \end{aligned} $$(10)

where c2 ≡ hc/kB, ϕ ul ( ν ) $ \phi_{ul}({{\tilde{\nu}}}) $ [cm] is the line profile in terms of the wavenumber ν $ {{\tilde{\nu}}} $, and flu is the oscillator strength from state l to state u16. Because we consider LTE, the number density at state l of the species being considered can be written as (cf. Eq. (1))

N l = x ( iso ) N g l e c 2 E l / T Q ( T ) , $$ \begin{aligned} N_l = x^\mathrm{(iso)}N \dfrac{{g}_l\mathrm{e} ^{-c_2\tilde{E}_l/T}}{Q(T)}, \end{aligned} $$(11)

where N is the total number density of the species, and E l E l / h c $ \tilde{E}_l \equiv E_l / hc $ is the level energy in terms of the wavenumber. We have introduced the isotope or isotopologue fraction x(iso) (cf. Appendix A) because the line transitions are different between different isotope or isotoplogues. Then the absorption coefficient is written as

α line ( ν ; T ) N = x ( iso ) S lu ϕ ul ( ν ) ( 1 e c 2 ν / T ) , $$ \begin{aligned}&\dfrac{\alpha _{\rm line}({\tilde{\nu }};T)}{N} = x^\mathrm{(iso)} S_{lu}\phi _{ul}({\tilde{\nu }}) { \left(1 - \mathrm{e} ^{-{c_2{\tilde{\nu }}}/{T}}\right)},\end{aligned} $$(12)

S lu ( π e 2 m e c 2 ) ( g l f lu ) e c 2 E l / T Q ( T ) , $$ \begin{aligned}&S_{lu} \equiv {\left(\dfrac{\pi e^2}{m_{\rm e}c^2}\right) \left({g}_l f_{lu}\right) \dfrac{\mathrm{e} ^{-c_2\tilde{E}_l/T}}{Q(T)}}, \end{aligned} $$(13)

where Slu [cm] is the line intensity, and the factor (glflu) is called the g-f value.

3.5. Line profile evaluation

In our code, we generally apply the Voigt profile, a convolution of the Gaussian and Lorentzian profiles, for the line profile ϕ ul ( ν ) $ \phi_{ul}({{\tilde{\nu}}}) $:

ϕ ul ( ν ) = { 1 π σ G e ( ( ν ν ul ) / σ G ) 2 } { 1 π γ ( ν ν ) 2 + γ 2 } d ν = 1 π σ G K ( x , y ) . $$ \begin{aligned}&\phi _{ul}({\tilde{\nu }}) = \int _{-\infty }^\infty \left\{ \dfrac{1}{\sqrt{\pi }\sigma _{\rm G}}\mathrm{e} ^{-\left(({{\tilde{\nu }}^{\prime } - {\tilde{\nu }}_{ul}})/{\sigma _{\rm G}}\right)^2}\right\} \left\{ \dfrac{1}{\pi } \dfrac{\gamma }{({\tilde{\nu }}- {\tilde{\nu }}^{\prime })^2 + \gamma ^2} \right\} \mathrm{d}{\tilde{\nu }}^{\prime }\nonumber \\&\qquad = \dfrac{1}{\sqrt{\pi }\sigma _{\rm G}} K(x,{ y}). \end{aligned} $$(14)

Here, K(x, y) is the Voigt function defined as

K ( x , y ) y π e t 2 ( x t ) 2 + y 2 d t , $$ \begin{aligned}&K(x,{ y}) \equiv \dfrac{{ y}}{\pi }\int _{-\infty }^\infty \dfrac{\mathrm{e} ^{-t^2}}{(x - t)^2 + { y}^2} \mathrm{d}t,\end{aligned} $$(15)

x ν ν ul σ G , $$ \begin{aligned}&x \equiv \dfrac{{\tilde{\nu }}- {\tilde{\nu }}_{ul}}{\sigma _{\rm G}},\end{aligned} $$(16)

y γ σ G , $$ \begin{aligned}&{ y} \equiv \dfrac{\gamma }{\sigma _{\rm G}}, \end{aligned} $$(17)

and ν ul ν u ν l $ {{\tilde{\nu}}}_{ul} \equiv {{\tilde{\nu}}}_{u} - {{\tilde{\nu}}}_{l} $ is the wavenumber of the line transition.

The Gaussian profile arises from the Doppler broadening owing to the thermal and turbulent motion of the absorbing particle. The Gaussian width σG [cm−1] is expressed as

σ G 2 k B T / m + v turb c ν ul , $$ \begin{aligned} \sigma _{\rm G} \equiv \dfrac{\sqrt{2k_{\rm B}T/m} + v_{\rm turb}}{c}{\tilde{\nu }}_{ul}, \end{aligned} $$(18)

where m denotes the mass of the absorber. We have not implemented the turbulent velocity vturb in our code, but it can be easily implemented by modifying the source code.

The Lorentzian profile arises from both natural broadening and collisional (pressure) broadening caused by neighboring perturbers. The Lorentz width – the half-width at half-maximum (HWHM) of the Lorentz profile – γ [cm−1] can be written as the sum of the two broadening widths:

γ = γ nat + γ coll . $$ \begin{aligned} \gamma = \gamma _{\rm nat} + \gamma _{\rm coll}. \end{aligned} $$(19)

For the natural broadening γnat, if its width is not provided with the line list, we substitute the classical damping constant

γ nat = 1 2 1 2 π c ( 2 3 e 2 ω ul 2 m c 3 ) , $$ \begin{aligned} \gamma _{\rm nat} = \dfrac{1}{2}\dfrac{1}{2\pi c}\left(\dfrac{2}{3}\dfrac{e^2\omega _{ul}^2}{mc^3}\right), \end{aligned} $$(20)

where ω ul = 2 π c ν ul $ \omega_{ul} = 2{\pi}c{{\tilde{\nu}}}_{ul} $ is the angular frequency of the line transition. For the collisional broadening γcoll, the molecular line lists in HITRAN or Exomol contain the van der Waals broadening width for most species, while the Kurucz atomic line list contains both the quadratic Stark broadening and the van der Waals broadening widths for most species. When the broadening widths are not available in the Kurucz line list, we compute them classically or semi-classically, as described in Appendix B.

In our code, we use direct sampling to evaluate the line profile ϕ ul ( ν ) $ \phi_{ul}({{\tilde{\nu}}}) $ at a wavenumber grid point ν k $ {{\tilde{\nu}}}_k $, which means that

ϕ ul ( ν ) | ν = ν k = ϕ ul ( ν k ) . $$ \begin{aligned} \left.\phi _{ul}({\tilde{\nu }})\right|_{{\tilde{\nu }}= {\tilde{\nu }}_k} = \phi _{ul}({\tilde{\nu }}_k). \end{aligned} $$(21)

We note that there is another strategy to evaluate the line profile, which is to average the line profile over a grid bin. A comparison between direct sampling and a binned profile is available in Yurchenko et al. (2018).

To evaluate the Voigt function K(x, y), we employ an algorithm introduced in Sect. 4.3.4.5 in Aller et al. (1982):

K ( x , y ) { y x 2 j = 0 6 c j x 2 j + ( 1 + y 2 ( 1 2 x 2 ) ) e x 2 y 10 1 , | x | 2.5 R [ j = 0 6 a j ξ j ( ξ 7 + j = 0 6 b j ξ j ) ] otherwise , $$ \begin{aligned} K(x,{ y})\! \approx \!\! {\left\{ \begin{array}{ll} \displaystyle {{ y}x^{-2}\sum _{j=0}^6c_jx^{-2j} + \left(1+{ y}^2(1-2x^2)\right)\mathrm{e} ^{-x^2}}&{ y}\le 10^{-1}, |x|\ge 2.5\\ \displaystyle {\mathfrak{R} \left[\dfrac{\displaystyle {\sum _{j=0}^6a_j\xi ^j}}{\displaystyle {\left(\xi ^7 + \sum _{j=0}^6b_j\xi ^j\right)}}\right]}&\mathrm{otherwise}, \end{array}\right.} \end{aligned} $$(22)

where ξ ≡ y − ix and the coefficients aj, bj, and cj are listed in Table 2. The accuracy of Eq. (22) for a domain of (0 ≤ x ≤ 25, 10−10 ≤ y ≤ 102) is shown in Fig. 3 in terms of relative errors to the reference of wofz in SciPy. (Here, we intended to use the same color scale as in Schreier 2018 so that the accuracy can be directly compared with that of their methods.) The maximum error, which occurs around (x, y)≈(4, 10−1), is less than 1%. We also measured the computational time of Eq. (22), where an array of size 101 was assigned for the x domain (0 ≤ x ≤ 25) while y was being fixed, which is similar to the actual line-profile calculation. The result is shown on the right-hand side in Fig. 3 as a function of y, where the reference is the computational time of a Gaussian function. The computational speed of Eq. (22) is ∼2.5 times slower than that of the Gaussian function for y < 10−1 and is ∼4.5 times slower for y ≧ 10−1. Both the accuracy and computational speed of Eq. (22) are satisfactory for our purpose.

thumbnail Fig. 3.

Error of the approximated Voigt function (Eq. (22)) relative to the wofz reference (left; logarithmic) and computational time relative to that of the Gaussian function (right; linear).

Table 2.

Coefficients in the approximated Voigt function (Eq. (22)).

3.6. Collision-induced absorption

HITRAN provides tabulated coefficients k ν ( A , B ) $ k_{{\tilde{\nu}}}^{(\mathrm{A,B})} $ [cm5 molecules−2] for a binary collision complex involving species A and B, from which the total absorption coefficient of CIA is computed as

α CIA ( ν , T ) = ( A , B ) k ν ( A , B ) N A N B . $$ \begin{aligned} { \alpha _{\rm CIA}(\nu ,T) = \sum _{(A,B)} k_{\tilde{\nu }}^{(\mathrm{A,B})}N_{\rm A}N_{\rm B}}. \end{aligned} $$(23)

Here, the coefficients k ν ( A , B ) $ k_{{\tilde{\nu}}}^{(\mathrm{A,B})} $ includes the correction factor of induced absorption. In our code, we consider pairs of (A,B) = (H2,H2), (H2,He), (N2,N2), (CH4,He), (CO2,CH4), (CO2,CO2), (CO2,H2), (CO2,He), (H2,CH4), (H2,H), (He, H), (N2,H2O), (N2,H2), (N2,He), (O2,CO2), (O2,O2), and (O2,N2).

3.7. Scattering

With respect to scattering, in addition to Thomson scattering, whose cross-section is

σ T = 8 π 3 ( e 2 m e c 2 ) 2 , $$ \begin{aligned} \sigma _{\rm T} = \dfrac{8\pi }{3}\left(\dfrac{e^2}{m_{\rm e}c^2}\right)^2, \end{aligned} $$(24)

we have implemented the Rayleigh scattering of H in the ground state (Lee 2005), H2 (Tarafdar & Vardya 1973), and He in the ground state (Rohrmann 2017). Lee (2005) reported an exact low-energy expansion of the cross-section redward of Lyman α. Rohrmann (2017) reported analytical expressions for the cross-section including resonances, with reasonable precision up to the 15th resonance.

We assume that the scattering is isotropic and coherent, in which case, any induced scattering is canceled out between the in- and out-scattering. Then, the scattering coefficient can be written as the sum of the number density N times the scattering cross-section σ(s):

α ( s ) ( ν ; T ) = N e σ T + i = H , He N i 1 σ i ( s ) ( ν ) + N H 2 σ H 2 ( s ) ( ν ) , $$ \begin{aligned} { \alpha ^\mathrm{(s)}({\tilde{\nu }};T) = N_{\rm e}\sigma _{\rm T} + \sum _{i = \mathrm{{H},{He}}}{{N_i}_1}\sigma ^\mathrm{(s)}_i({\tilde{\nu }}) + N_{\mathrm{H}_2}\sigma ^\mathrm{(s)}_{\mathrm{H}_2}({\tilde{\nu }}),} \end{aligned} $$(25)

where Ni1 ≡ Nigi1/Qi and σ i (s) $ \sigma^{\rm (s)}_i $ denote the number density in the ground state and the scattering cross-section of species i, respectively.

3.8. Mean opacities

The total absorption coefficient is the sum of all the absorption coefficients described above:

α total α bre + α pho + α line + α CIA , $$ \begin{aligned} { \alpha _{\rm total} \equiv \alpha _{\rm bre} + \alpha _{\rm pho} + \alpha _{\rm line} + \alpha _{\rm CIA}}, \end{aligned} $$(26)

where necessary sums related to species and transitions are taken for each term.

The Rosseland mean opacity α ¯ R $ {\bar{\alpha}}_{\mathrm{R}} $ and Planck mean opacity α ¯ P $ {\bar{\alpha}}_{\mathrm{P}} $ are defined, respectively, as

1 α ¯ R ( T ) 1 α total ( ν ; T ) + α ( s ) ( ν ; T ) B ν ( T ) T d ν / B ν ( T ) T d ν , $$ \begin{aligned}&\dfrac{1}{\bar{\alpha }_{\rm R}(T)} \!\equiv \! \left. \int \dfrac{1}{\alpha _{\rm total}({\tilde{\nu }};T)+\alpha ^\mathrm{(s)}({\tilde{\nu }};T)} \dfrac{{\partial }B_{\tilde{\nu }}(T)}{{\partial }T}\mathrm{d}{\tilde{\nu }}/ \int \dfrac{{\partial }B_{\tilde{\nu }}(T)}{{\partial }T}\mathrm{d}{\tilde{\nu }}\right., \end{aligned} $$(27)

α ¯ P ( T ; T 2 ) α total ( ν ; T ) B ν ( T 2 ) d ν B ν ( T 2 ) d ν , $$ \begin{aligned}&{ \bar{\alpha }_{\rm P}(T;T_{2}) \equiv \dfrac{\int \alpha _{\rm total}({\tilde{\nu }};T) B_{\tilde{\nu }}(T_{\rm 2})\mathrm{d}{\tilde{\nu }}}{\int B_{\tilde{\nu }}(T_{2})\mathrm{d}{\tilde{\nu }}}}, \end{aligned} $$(28)

where T2 = T (gas temperature) for the normal Planck mean opacity and T2 = Trad (external radiation temperature) for the two-temperature Planck mean opacity. B ν ( T ) $ B_{{\tilde{\nu}}}(T) $ and B ν / T $ {{\partial}}B_{{\tilde{\nu}}}/{{\partial}}T $ are, respectively, the Planck function in terms of wavenumber ν $ {{\tilde{\nu}}} $ and its temperature derivative:

B ν ( T ) B ν ( T ) d ν d ν = 2 h c 2 ν 3 exp ( c 2 ν / T ) 1 , $$ \begin{aligned}&B_{\tilde{\nu }}(T) \equiv B_\nu (T)\dfrac{\mathrm{d}\nu }{\mathrm{d}{\tilde{\nu }}} = 2hc^2\dfrac{{\tilde{\nu }}^3}{\exp (c_2{\tilde{\nu }}/T) - 1}, \end{aligned} $$(29)

B ν ( T ) T = 2 h c 2 c 2 ν 4 exp ( c 2 ν / T ) T 2 ( exp ( c 2 ν / T ) 1 ) 2 , $$ \begin{aligned}&\dfrac{{\partial }B_{\tilde{\nu }}(T)}{{\partial }T} = 2hc^2\dfrac{c_2{\tilde{\nu }}^4\exp (c_2{\tilde{\nu }}/T)}{T^2(\exp (c_2{\tilde{\nu }}/T) - 1)^2}, \end{aligned} $$(30)

where Bν(T) is the Planck function in terms of frequency ν. We note that the dependence of the opacities on pressure P is omitted here.

We use the trapezoid rule to evaluate integrals on wavenumber ν $ {{\tilde{\nu}}} $ for the Rosseland mean opacity α ¯ R $ {\bar{\alpha}}_{\mathrm{R}} $. As for the Planck mean opacity α ¯ P $ {\bar{\alpha}}_{\mathrm{P}} $, the integration of absorption coefficients on the wavenumber ν $ {{\tilde{\nu}}} $ strongly depends on the grid resolution, particularly for lines. Therefore, while we evaluate the continuum part of the Planck mean opacity using the trapezoid rule on the wavenumber grid, we evaluate the line part as follows (cf. Mayer & Duschl 2005):

α ¯ P line ( T ; T 2 ) lu N x ( iso ) S lu ( 1 exp ( c 2 ν ul / T ) ) B ν ul ( T 2 ) B ν ( T 2 ) d ν , $$ \begin{aligned} \bar{\alpha }^\mathrm{line}_{\rm P}(T;T_2) \approx \dfrac{\sum _{lu}Nx^\mathrm{(iso)}S_{lu}\left(1 - \exp \left(-c_2{\tilde{\nu }}_{ul}/T\right)\right)B_{{\tilde{\nu }}_{ul}}(T_2)}{\int B_{\tilde{\nu }}(T_{2})\mathrm{d}{\tilde{\nu }}}, \end{aligned} $$(31)

which is independent of the wavenumber grid. Here, we assume the line profile ϕ ul ( ν ) δ ( ν ν ul ) $ \phi_{ul}({{\tilde{\nu}}}) \approx \delta({{\tilde{\nu}}}-{{\tilde{\nu}}}_{ul}) $, and the summation ∑lu is taken for all the transitions (the summation on the species is omitted for brevity). The validation of this method to evaluate the Planck mean opacity is described in Sect. 5.2.

4. Reducing computational effort in the line opacity calculations

The bottleneck in the opacity calculations is the line absorption, particularly the Voigt profile calculation. This is because computation of the Voigt function K(x, y) requires significant time (e.g., discussion in Schreier 2018), and because the Voigt profile has wide wings and thus the number of grid points over which the function is evaluated is relatively large compared to the Gaussian profile. Ideally, the Voigt profile calculation should be performed for all line transitions at all grid points. However, the number of transitions in the Kurucz atomic line list is several 108, and that in the Exomol database exceeds 1010 for some species. Clearly, it is not practical to evaluate the line profile for all these transitions over grid points that can easily exceed 105. In reality, not all transitions are strong enough to be evaluated, and the value of opacity may be negligible at grid points far from the line center.

Following the PHOENIX code, we have implemented an algorithm in our code to reduce the number of “Voigt lines”: lines for which the Voigt profile needs to be evaluated. The algorithm is represented by the pseudo code in Algorithm 1. Suppose a line transition whose center and intensity are ν ul $ {{\tilde{\nu}}}_{ul} $ and Slu, respectively. We use the Gaussian profile to evaluate the nominal absorption coefficient at the line center as

α line x ( iso ) N S lu π σ G . $$ \begin{aligned} \alpha _{\rm line}^* \equiv \dfrac{x^\mathrm{(iso)}NS_{lu}}{\sqrt{\pi }{ \sigma _{\rm G}}}. \end{aligned} $$(32)

Then we consider the following ratio:

δ α line α cont , $$ \begin{aligned}&\delta \equiv \dfrac{\alpha _{\rm line}^*}{\alpha _{\rm cont}^*}, \end{aligned} $$(33)

α cont α bre ( ν k ) + α pho ( ν k ) + α CIA ( ν k ) . $$ \begin{aligned}&{ \alpha _{\rm cont}^* \equiv \alpha _{\rm bre}({\tilde{\nu }}_{k^*}) + \alpha _{\rm pho}({\tilde{\nu }}_{k^*}) + \alpha _{\rm CIA}({\tilde{\nu }}_{k^*})}. \end{aligned} $$(34)

Here α cont * $ \alpha_{\rm cont}^* $ is the continuum absorption coefficient at the grid point ( ν k $ {{\tilde{\nu}}}_{k^*} $) nearest to the line center ( ν ul $ {{\tilde{\nu}}}_{ul} $). If δ < δcrit (typically 10−4 in our code), we consider the line to be too weak to contribute the total opacity and discard it. If δ > δvoigt (typically unity in our code), we consider the line to be sufficiently strong and evaluate the Voigt profile at grid points in the range ν ul Δ V ν ν ul + Δ V $ {{\tilde{\nu}}}_{ul} - \Delta_{\mathrm{V}} \le {{\tilde{\nu}}}\le {{\tilde{\nu}}}_{ul} + \Delta_{\mathrm{V}} $, where ΔV is the search window (typically ΔV = 100 cm−1 in our code). In other cases, where δcrit < δ < δvoigt, we consider that only the vicinity of the line center contributes to the total opacity and evaluate the Gaussian profile instead of the Voigt profile (we call this a “Gauss line”). The search window for Gauss lines (typically ΔG = 3σG in our code) is usually much smaller than that for Voigt lines. These values of search windows for Voigt lines and Gauss lines, as well as the values of δvoigt and δcrit, are user-defined parameters.

Figure 4 demonstrates how the above algorithm considerably reduces the number of the time-consuming Voigt lines without introducing notable errors into the total opacity and mean opacities. The upper panel shows the dependence on the parameter δcrit with δvoigt = 0 fixed; that is, all considered lines are Voigt lines here. (For comparison, the case in which the HITRAN’s dynamic intensity cutoff (Rothman et al. 2013) is used instead of δcrit is shown in the leftmost.) For example, when δcrit = 10−3, the number of Voigt lines is reduced to 53 % of that in the reference (δcrit = δvoigt = 0); however, the error in the mean opacity defined as ( ( α ¯ α ¯ ( r ) ) / α ¯ ( r ) ) 2 $ \sqrt{\left(\left(\bar{\alpha} - \bar{\alpha}^{\mathrm{(r)}}\right)/\bar{\alpha}^{\mathrm{(r)}}\right)^2} $ as well as that in the monochromatic opacity defined as k ( ( α k α k ( r ) ) / α k ( r ) ) 2 / k $ \sqrt{\left.\sum\nolimits_k \left(\left({\alpha_k - \alpha^{\mathrm{(r)}}_k}\right)/{\alpha^{\mathrm{(r)}}_k}\right)^2 /\sum\nolimits_k\right.} $ are negligible (specifically, the largest error is 0.0020, occurring in the Rosseland mean opacity). Here, the superscript (r) and the subscript k denote the reference and the grid point index, respectively. The lower panel shows the dependence on the parameter δvoigt with δcrit = 10−4 fixed. For example, when δvoigt = 1, the number of Voigt lines is reduced to 8% of that in the reference, and the errors are sufficiently low (specifically, the largest error of 0.0042 occurred in the monochromatic opacity).

thumbnail Fig. 4.

Relative number of the Voigt lines (gray bar) (as well as that of Gauss lines; light gray bar) against the total number of lines in the reference case (δvoigt = δcrit = 0). Also, relative errors of the Rosseland (triangle) and Planck (square) mean opacity as well as of the monochromatic absorption coefficient (filled circle) are plotted. The CE abundance data used here are taken from the first layer of a demo output produced by FASTCHEM, chem_output_agb_stellar_wind.dat. The asterisk in the upper panel indicates a run that employs HITRAN’s dynamic strength cutoff, instead of δcrit.

Algorithm 1Computation of the line absorption cofficients. The number in the parentheses indicates the corresponding equation.

1: Procedure LINE

2:  Prepare layers and grid points

3:  Open a line list

4:  repeat

5:   Read a line block from the list

6:   for all layers prepared do

7:    if partition function Q is not defined then

8:     Cycle

9:    end if

10:    if number density N = 0 then

11:     Cycle

12:    end if

13:    for all lines in the read block do

14:     Compute line intensity S (13)

15:     Sum up S for Planck mean (31)

16:     Compute Gaussian width σG (18)

17:     Compute relative line strength δ (33)

18:     ifδ < δcrit then

19:      Cycle

20:     else ifδ > δvoigt then

21:      Set profile Voigt

22:      Set search window ΔV

23:     else

24:      Set profile Gaussian

25:      Set search window ΔG

26:     end if

27:     Search grid points in the window

28:     if no grid point in the window then

29:      Cycle

30:     end if

31:     Compute Lorentz width γ (19)

32:     for all grid points in the window do

33:      Compute line profile ϕ (14)

34:      Sum up absorption coefficient α (12)

35:     end for

36:    end for

37:   end for

38:  until end of the line list

39:  Close the line list

40: end procedure

5. Code validation and performance study

CE abundances for results presented in this section were obtained using the CE solver ACES employed in the PHOENIX code. Here, the element abundance was based on Asplund et al. (2005) and the total number of chemical species considered was 676, which consisted of 428 atomic species (including highly ionized ions) and 248 molecular species.

5.1. Comparison with PHOENIX

For the validation of the code, we compared the mean opacities generated by OPTAB with those generated by PHOENIX. In Fig. 5, the Rosseland mean, Planck mean, and two-temperature Planck mean (at a radiation temperature of 6000 K) opacities are compared as functions of temperature for different total pressures. Here, exactly the same wavenumber grid and CE abundances were used. The opacity sources were chosen from those implemented in both OPTAB and PHOENIX– specifically, Kurucz atomic lines, Rayleigh scattering by H, He, and H2, and bremsstrahlung and photoionization by atomic ions, including H. The line evaluation parameters described in Sect. 4 are set as δcrit = 10−4, δvoigt = 1, ΔV = 100 cm−1V = 100 Å for Phoenix runs), and ΔG = 3σG. Moreover, here we use the trapezoid rule to evaluate Planck mean opacities (cf. Sect. 3.8) because PHOENIX uses that method.

thumbnail Fig. 5.

Comparison of mean opacities between OPTAB (thin solid) and PHOENIX (thick): Rosseland mean (black), Planck mean (red), and two-temperature Planck mean for Tred = 6000 K (blue) at log P = 7 (top), log P = 2 (middle), and log P = −3 (bottom). The data represented by the thin dotted curves are explained in the text.

Figure 5 shows that the mean opacities generated by OPTAB basically agree with those generated by PHOENIX. However, there are some discrepancies, particularly in the highest-pressure case (log P = 7), at low temperatures for the Rosseland mean and at high temperatures for the Planck mean. We have identified that the former discrepancy originates from the line profile evaluation, whereas the latter originates from the collisional broadening evaluation. The line profile evaluation is performed in the wavenumber basis in OPTAB, whereas it is performed in the wavelength basis in PHOENIX. As these two bases are identical only near the line center, there may be differences when line profile evaluations are performed for wide ranges. As for the collisional broadening evaluation, when the Kurucz database does not provide the value, OPTAB and PHOENIX calculate it based on slightly different models (cf. Appendix B for the model employed by OPTAB). The difference is notable when the collisional broadening becomes significant at high pressures. When OPTAB employed the same methods as PHOENIX for evaluating the line profile and the collisional broadening, the generated mean opacities, represented by thin dotted curves in Fig. 5, agreed with PHOENIX almost perfectly, as expected.

5.2. Dependence on the number of grid points

In this section, we examine the dependence of mean opacities on the grid parameters. Figure 6 shows the Rosseland mean, Planck mean, and two-temperature Planck mean opacities at log P = 2 as a function of temperature. The opacity sources we adopted here are Kurucz atomic lines, HITRAN and HITEMP molecular lines, Rayleigh scattering by H, He, and H2, and bremsstrahlung and photoionization by atomic ions, including H and H2. The wavenumber grid points were equally spaced on a logarithmic grid covering from 10 to 107 cm−1.

thumbnail Fig. 6.

Dependence of Rosseland mean (top), Planck mean (middle), and two-temperature Planck mean for Trad = 6000 K at log P = 2 on the number of grid points, equally spaced on a logarithmic grid. The thick light curves in the middle and the bottom panels are obtained via grid-independent calculations.

In each panel, curves of darker colors correspond to calculations using more grid points, ranging from 103 to 107. The Rosseland mean opacities (shown in the top panel) are almost identical when the grid points are 104 or more. This is because the Rosseland mean opacities here are basically determined by the continuum sources. In contrast, the Planck mean and the two-temperature Planck mean opacities (shown in the middle and bottom panels, respectively) strongly depend on the number of the grid points because more line opacities are resolved with more grid points. For the Planck mean opacities (middle panel), as many as 106 grid points are required for convergence, whereas convergence is not observed for the two-temperature Planck mean opacities (bottom panel) with 107 or fewer grid points.

To avoid the issue of convergence, OPTAB calculates Planck mean and two-temperature Planck mean opacities for lines in a grid-independent way as described in Sect. 3.8, which are represented by thick light curves in the middle and bottom panels in Fig. 6. As evident from the figures, the grid-independent calculation agrees with a grid-dependent calculation with the largest number of grid points for both Planck mean and two-temperature Planck mean opacities, which validates the method of the grid-independent calculation.

As mentioned in Sect. 4, OPTAB has parameters that determines the grid-search window sizes, ΔG(=3σG) and ΔV(=100 cm−1), where the values in the parenthesis are code defaults. We also investigated the dependence of the Rosseland mean opacities on these parameters, which was observed to be weak. As mentioned earlier, this is because the Rosseland mean opacities are mainly determined by the continuum sources in the case investigated here.

5.3. MPI parallelization and its performance

In OPTAB, MPI parallelization on the layer loop (Fig. 1) has been implemented. The parallelization performance is shown in Fig. 7 against the mean opacity calculations for 64 layers in total (composed of 8 grid points both in the temperature and pressure grids as shown in Fig. 8). The opacity sources were the same as those described in Sect. 5.2, and the number of the wavenumber grid points for computing the Rosseland mean opacities was 105. The code parameters used were δcrit = 10−4, δvoigt = 1, ΔG = 3σG, and ΔV = 100 cm−1.

thumbnail Fig. 7.

MPI parallel performance for parallelization on the layer loop (upper) and the load balance in the case of 8 MPI processes (lower). The white, gray, and black bars correspond, respectively, to the wall times for atomic lines, molecular lines, and continuum. The computation was performed, using gfortran 10.2 + Open MPI 4.1 + HDF5 1.12, on 2.3 GHz 8-Core Intel Core i9 processors.

thumbnail Fig. 8.

Rosseland mean (top), Planck mean (middle), and two-temperature Planck mean (bottom) opacities on the temperature–pressure grid composed of 64 points (layers).

The dependence of the wall time on the number of MPI processes is shown in the upper panel in Fig. 7. While the computation on each MPI process is independent (i.e., no message passing is necessary), it is often difficult to achieve the load balance between the MPI processes, as shown in the lower panel. This is because the most time-consuming part (i.e., the computation of line opacities) can differ significantly between the layers. Hence, the parallel performance becomes worse as the number of processes increases. We will attempt to improve the parallel performance in the future version of the code.

6. Discussion on future aspects

As demonstrated in the previous section, we have successfully developed a code that generates mean opacity tables. The main features are that the code is public and runs based on the user’s choice of CE abundances, opacity sources, and sampling grid. In this section, we discuss some aspects that remain for future work.

Including dust opacities in our code is obviously the next target. We did not include them in the first version of our code because they depend on a dust model, which has not yet been established. In addition, the degree to which the dust abundances are involved in the CE of the gas mixture is not trivial. (If the dust abundances are independent from the CE of the gas mixture, one may simply add dust opacities taken from the literature (e.g., Semenov et al. 2003) to the gas opacities computed by our code, assuming some dust-to-gas mass ratio.) We need to solve these issues in order to include dust opacities.

There are a few issues related to line broadening, although they may not affect the mean opacities. For example, we left implementing the linear Stark effect for hydrogen atoms (e.g., Sect. 8.2.8 in Hertel & Schulz 2014) as future work. We are planning to use the tables provided in Stehlé & Hutcheon (1999), Stehlé & Fouquet (2010) to implement the linear Stark effect. Another issue is that pressure broadening parameters are not always provided together with a line list. If not provided, we can evaluate them for atoms using the (semi-)classical theory described in Appendix B. However, we are not aware of a proper way to evaluate them for molecules.

Finally, the opacity sources implemented in the first version of the code are basic ones. We will continue to compile additional opacity sources to enhance our code, and we also expect to receive user contributions via GitHub.


14

We note that some major species, including Fe I and Fe II, are not available at the web interface (http://cdsweb.u-strasbg.fr/topbase/xsections.html) but they are available in the ftp version (http://cdsweb.u-strasbg.fr/topbase/ftp.html).

15

There is an exact analytic expression of the cross-sections for the ground level of hydrogenic atoms and ions (Eq. (13.1) in Draine 2011).

16

Exactly speaking, the line profile ϕ ul ( ν ) $ \phi_{ul}({{\tilde{\nu}}}) $ also depends on T and P via broadening parameters, which is omitted for brevity here.

17

H = 001.00, He = 002.00, He+ = 002.01, …

Acknowledgments

We thank the anonymous referee for his/her valuable comments to improve our manuscript as well as our code. This work was supported by JSPS KAKENHI (Grant Number JP18K03716). P.H.H. gratefully acknowledges support from the DFG under grants HA 3457/20-1 and HA 3457/23-1. P. H. H. gratefully acknowledges the support of NVIDIA Corporation with the donation of the Quadro P6000 GPU used in this research.

References

  1. Alexander, D. R. 1975, ApJS, 29, 363 [NASA ADS] [CrossRef] [Google Scholar]
  2. Alexander, D. R., & Ferguson, J. W. 1994, ApJ, 437, 879 [NASA ADS] [CrossRef] [Google Scholar]
  3. Alexander, D. R., Johnson, H. R., & Rypma, R. L. 1983, ApJ, 272, 773 [NASA ADS] [CrossRef] [Google Scholar]
  4. Allard, F., & Hauschildt, P. H. 1995, ApJ, 445, 433 [NASA ADS] [CrossRef] [Google Scholar]
  5. Aller, L. H., Appenzeller, I., Baschek, B., et al. 1982, "Landolt-Börnstein: Numerical Data and Functional Relationships in Science and Technology - New Series" Gruppe/Group 6 Astronomy and Astrophysics "Volume 2 Schaifers/Voigt: Astronomy and Astrophysics / Astronomie und Astrophysik" Stars and Star Clusters / Sterne und Sternhaufen, 2, 54 [Google Scholar]
  6. Asplund, M., Grevesse, N., & Sauval, A. J. 2005, Cosmic Abundances as Records of Stellar Evolution and Nucleosynthesis in honor of David L. Lambert, 336, 25 [NASA ADS] [Google Scholar]
  7. Bell, K. R., & Lin, D. N. C. 1994, ApJ, 427, 987 [NASA ADS] [CrossRef] [Google Scholar]
  8. Berglund, M., & Wieser, M. E. 2011, Pure Appl. Chem., 83, 397 [CrossRef] [Google Scholar]
  9. Blecic, J., Harrington, J., & Bowman, M. O. 2016, ApJS, 225, 4 [CrossRef] [Google Scholar]
  10. Bradley, D. J., Dugan, C. H., Ewart, P., & Purdie, A. F. 1976, Phys. Rev. A, 13, 1416 [CrossRef] [Google Scholar]
  11. Carson, T. R., Mayers, D. F., & Stibbs, D. W. N. 1968, MNRAS, 140, 483 [NASA ADS] [CrossRef] [Google Scholar]
  12. Castelli, F. 2005, Mem. Soc. Astron. It. Suppl., 8, 34 [Google Scholar]
  13. Chapman, R. D. 1969, J. Quant. Spectr. Rad. Transf., 9, 315 [NASA ADS] [CrossRef] [Google Scholar]
  14. Chapman, R. D. 1970, J. Quant. Spectr. Rad. Transf., 10, 1151 [NASA ADS] [CrossRef] [Google Scholar]
  15. Chase, M. W. J. 1998, NIST-JANAF Thermochemical Tables (American Institute of Physics) [Google Scholar]
  16. Cox, A. N., & Stewart, J. N. 1970a, ApJS, 19, 243 [NASA ADS] [CrossRef] [Google Scholar]
  17. Cox, A. N., & Stewart, J. N. 1970b, ApJS, 19, 261 [NASA ADS] [CrossRef] [Google Scholar]
  18. Cunto, W., & Mendoza, C. 1992, Rev. Mex. Astron. Astrofis., 23 [Google Scholar]
  19. Draine, B. T. 2011, in Physics of the Interstellar and Intergalactic Medium, ed. Bruce T. Draine (Princeton University Press), Physics of the Interstellar and Intergalactic Medium [CrossRef] [Google Scholar]
  20. Ferguson, J. W., Alexander, D. R., Allard, F., et al. 2005, ApJ, 623, 585 [Google Scholar]
  21. Freedman, R. S., Marley, M. S., & Lodders, K. 2008, ApJS, 174, 504 [NASA ADS] [CrossRef] [Google Scholar]
  22. Gordon, I. E., Rothman, L. S., Hill, C., et al. 2017, J. Quant. Spectr. Rad. Transf., 203, 3 [Google Scholar]
  23. Griem, H. R. 1974, Spectral Line Broadening by Plasmas (New York: Academic Press) [Google Scholar]
  24. Hanson, R. K., Spearrin, R. M., & Goldenstein, C. S. 2015, Spectroscopy and Optical Diagnostics for Gases (Springer) [Google Scholar]
  25. Hauschildt, P. H., & Baron, E. 1999, J. Comput. Appl. Math., 109, 41 [NASA ADS] [CrossRef] [Google Scholar]
  26. Helling, C., & Lucas, W. 2009, MNRAS, 398, 985 [NASA ADS] [CrossRef] [Google Scholar]
  27. Helling, C., Winters, J. M., & Sedlmayr, E. 2000, A&A, 358, 651 [NASA ADS] [Google Scholar]
  28. Henning, T., & Stognienko, R. 1996, A&A, 311, 291 [NASA ADS] [Google Scholar]
  29. Hertel, I. V., & Schulz, C.-P. 2014, Atoms, Molecules and Optical Physics 1, (Springer) [Google Scholar]
  30. Hirose, S., & Shi, J.-M. 2019, MNRAS, 485, 266 [Google Scholar]
  31. Hirose, S., Blaes, O., Krolik, J. H., Coleman, M. S. B., & Sano, T. 2014, ApJ, 787, 1 [NASA ADS] [CrossRef] [Google Scholar]
  32. Hoof, P. A. M. V., Williams, R. J. R., Volk, K., et al. 2014, MNRAS, 444, 420 [NASA ADS] [CrossRef] [Google Scholar]
  33. John, T. L. 1975, MNRAS, 172, 305 [NASA ADS] [Google Scholar]
  34. John, T. L. 1978, A&A, 67, 395 [NASA ADS] [Google Scholar]
  35. John, T. L. 1988, A&A, 193, 189 [NASA ADS] [Google Scholar]
  36. Karzas, W. J., & Latter, R. 1961, ApJS, 6, 167 [Google Scholar]
  37. Kramida, A., Ralchenko, Y., Reader, J., & NIST ASD Team 2020, NIST Atomic Spectra Database (version 5.8) [Google Scholar]
  38. Lee, H.-W. 2005, MNRAS, 358, 1472 [NASA ADS] [CrossRef] [Google Scholar]
  39. Malygin, M. G., Kuiper, R., Klahr, H., Dullemond, C. P., & Henning, T. 2014, A&A, 568, A91 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  40. Mathisen, R. 1984, Photo Cross Sections for Stellar Atmosphere Calculations - Compilation of references and data, Tech. rep. [Google Scholar]
  41. Mayer, M., & Duschl, W. J. 2005, MNRAS, 358, 614 [NASA ADS] [CrossRef] [Google Scholar]
  42. Mcbride, B. J., & Gordon, S. 1992, NASA Ref. Publ., 1271 [Google Scholar]
  43. McQuarrie, D. A., & Simon, J. D. 1997, Physical chemistry: a molecular approach (Sausalito, Calif: University Science Books) [Google Scholar]
  44. Meija, J., Coplen, T. B., Berglund, M., et al. 2016, Pure Appl. Chem., 88, 265 [Google Scholar]
  45. Mihalas, D. 1970, Stellar atmospheres, Series of Books in Astronomy and Astrophysics (San Francisco: Freeman) [Google Scholar]
  46. Ohmura, T., & Ohmura, H. 1960, Phys. Rev., 118, 154 [CrossRef] [Google Scholar]
  47. Pollack, J. B., Hollenbach, D., Beckwith, S., et al. 1994, ApJ, 421, 615 [Google Scholar]
  48. Rogers, F. J., & Iglesias, C. A. 1992, ApJ, 401, 361 [NASA ADS] [CrossRef] [Google Scholar]
  49. Rohrmann, R. D. 2017, MNRAS, 473, 457 [Google Scholar]
  50. Rothman, L. S., Gordon, I. E., Babikov, Y., et al. 2013, J. Quant. Spectr. Rad. Transf., 130, 4 [Google Scholar]
  51. Rybicki, G. B., & Lightman, A. P. 2008, Radiative Processes in Astrophysics (John Wiley & Sons) [Google Scholar]
  52. Schreier, F. 2018, MNRAS, 479, 3068 [NASA ADS] [CrossRef] [Google Scholar]
  53. Schwerdtfeger, P., & Nagle, J. K. 2019, Mol. Phys., 477, 1 [Google Scholar]
  54. Seaton, M. J., Zeippen, C. J., Tully, J. A., et al. 1992, Rev. Mex. Astron. Astrofis., 23 [Google Scholar]
  55. Semenov, D., Henning, T., Helling, C., Ilgner, M., & Sedlmayr, E. 2003, A&A, 410, 611 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  56. Sharp, C. M. 1992, A&AS, 94, 1 [NASA ADS] [Google Scholar]
  57. Smith, W. R., & Missen, R. W. 1982, Chemical Reaction Equilibrium Analysis (John Wiley& Sons Incorporated) [Google Scholar]
  58. Sousa-Silva, C., Hesketh, N., Yurchenko, S. N., Hill, C., & Tennyson, J. 2014, J. Quant. Spectr. Rad. Transf., 142, 66 [NASA ADS] [CrossRef] [Google Scholar]
  59. Stehlé, C., & Fouquet, S. 2010, Int. J. Spectrosc., 2010, 1 [CrossRef] [Google Scholar]
  60. Stehlé, C., & Hutcheon, R. 1999, A&AS, 140, 93 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  61. Stock, J. W., Kitzmann, D., Patzer, A. B. C., & Sedlmayr, E. 2018, MNRAS, 479, 865 [NASA ADS] [Google Scholar]
  62. Tarafdar, S. P., & Vardya, M. S. 1973, MNRAS, 163, 261 [CrossRef] [Google Scholar]
  63. Tennyson, J., & Yurchenko, S. N. 2012, MNRAS, 425, 21 [Google Scholar]
  64. Thompson, D. G., Hibbert, A., & Chandra, N. 1974, J. Phys. B: At. Mol. Phys., 7, 1298 [NASA ADS] [CrossRef] [Google Scholar]
  65. Valenti, J. A., & Piskunov, N. 1996, A&AS, 118, 595 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  66. Vernazza, J. E., Avrett, E. H., & Loeser, R. 1976, ApJS, 30, 1 [Google Scholar]
  67. Vernazza, J. E., Avrett, E. H., & Loeser, R. 1981, ApJS, 45, 635 [Google Scholar]
  68. Verner, D. A., & Yakovlev, D. G. 1995, A&AS, 109, 125 [NASA ADS] [Google Scholar]
  69. Verner, D. A., Ferland, G. J., & Korista, K. T. 1996, ApJ, 465, 487 [NASA ADS] [CrossRef] [Google Scholar]
  70. Wilkins, R. L., & Taylor, H. S. 1968, J. Chem. Phys., 48, 4934 [NASA ADS] [CrossRef] [Google Scholar]
  71. Yan, M., Sadeghpour, H. R., & Dalgarno, A. 2001, ApJ, 559, 1194 [NASA ADS] [CrossRef] [Google Scholar]
  72. Yurchenko, S. N., Al-Refaie, A. F., & Tennyson, J. 2018, A&A, 614, A131 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]

Appendix A: Data conversions of line lists into the HDF5 format

For flexible and efficient I/O of very large atomic or molecular line lists (Kurucz, HITRAN, and Exomol), their original ASCII files are converted into HDF5 files beforehand. Furthermore, the atomic properties in ASCII format collected from NIST ASD/AWIC, TOPbase energy levels and photoionization cross-sections, and HITRAN CIA data are converted into a single HDF5 file, respectively. Programs for these conversions to HDF5 (written in Fortran 2003) are associated with the code package. Table A.1 summarizes the external sources for the isotope or isotopologue fraction, partition function, and mass that are needed for making these HDF5 files. The structure of the HITRAN CIA file in HDF5 format is simple and thus is not explained here.

Table A.1.

External sources for the isotope or isotopologue fraction, partition function, and mass.

A.1. NIST atomic property file in HDF5 format

Fig. A.1 depicts the data structure in the NIST atomic property file in HDF5 format. The data sets nstates, term, ene, gtot, and eneion are taken from the NIST ASD levels form, whereas mass is taken from NIST AWIC.

thumbnail Fig. A.1.

Structure of the NIST atomic property file in HDF5 format. Data sets with asterisks are arrays of size nstates.

A.2. Kurucz atomic line lists in HDF5 format

In the Kurucz database, there are two categories of line lists for atoms, “gfall” and “gfpred.” All lines in the gfall files are based on laboratory-measured energy levels, while the gfpred files contain only predicted lines to complement the gfall files. In Sect. 5, we used both kinds of the line lists.

In the Kurucz line lists, each line transition is labeled by its species code17, and for each line transition, E l $ \tilde{E}_l $, E u $ \tilde{E}_u $, log(glflu) and log x lu (iso) $ \log x_{lu}^\text{(iso)} $, as well as Δ E l $ \Delta\tilde{E}_l $, Δ E u $ \Delta\tilde{E}_u $, and Δlog(glflu) are provided. The quantities including Δ are corrections required because of hyperfine shifts. The wavenumber of the line transition is then calculated as

ν ul = ( | E u | + Δ E u ) ( | E l | + Δ E l ) , $$ \begin{aligned} {\tilde{\nu }}_{ul} = \left(|{\tilde{E}}_u| + \Delta {\tilde{E}}_u\right) - \left(|{\tilde{E}}_l| + \Delta {\tilde{E}}_l\right), \end{aligned} $$(A.1)

where absolute values are used for E u $ {{\tilde{E}}}_u $ and E l $ {{\tilde{E}}}_l $, because in the Kurucz line lists, the level energies have a negative sign when the involving line transition is a predicted (not a measured) one.

Isotopic shifts in energy levels are miniscule for most atoms, for which the Kurucz line lists do not include distinct isotopes, where log x lu (iso) =0 $ \log x_{lu}^\text{(iso)} = 0 $. However, there are a small number of strong lines whose isotopic shifts have been measured in laboratories. In Kurucz’s line lists, such lines are indicated by a finite value of log x lu (iso) $ \log x_{lu}^\text{(iso)} $. Therefore, we redefine the g-f values by considering the hyperfine and isotopic shifts as

( g l f lu ) = 10 log ( g l f lu ) + Δ log ( g l f lu ) + log x lu (iso) $$ \begin{aligned} (g_lf_{lu})^{\prime } = 10^{\log (g_lf_{lu}) + \Delta \log (g_lf_{lu}) + \log x_{lu}^\text{(iso)}} \end{aligned} $$(A.2)

and use this relationship to compute the absorption coefficient (cf. Eq. 12):

α line Kurucz ( ν ) N = S lu ϕ ul ( ν ) , $$ \begin{aligned} \dfrac{\alpha_\text{line}^\text{Kurucz}({\tilde{\nu }})}{N}&= S^{\prime }_{lu}\phi _{ul}(\tilde{\nu }), \end{aligned} $$(A.3)

S lu ( π e 2 m e c 2 ) ( g l f lu ) e c 2 E l / T Q ( T ) ( 1 e c 2 ν ul / T ) . $$ \begin{aligned} S^{\prime }_{lu}&\equiv \left(\dfrac{\pi e^2}{m_{\rm e}c^2}\right)(g_lf_{lu})^{\prime }\dfrac{\mathrm{e} ^{-c_2\tilde{E}_l/T}}{Q(T)}\left(1 - \mathrm{e} ^{-c_2\tilde{\nu }_{ul}/T}\right). \end{aligned} $$(A.4)

Because the Kurucz line lists have some incorrect values of log x lu (iso) $ \log x_{lu}^\text{(iso)} $, we replace them in Eq. (A.2) with those computed from the NIST AWIC (Table A.1).

For line broadening, the Kurucz line lists provide three damping constants (in terms of the angular frequency ω), the natural damping constant Γ nat (ω) $ \Gamma^{(\omega)}_\text{nat} $ [s−1], the quadratic Stark damping constant (divided by the free electron number density) Γ Stark (ω) / N e $ \Gamma^{(\omega)}_\text{Stark}/N_\text{e} $, and the damping constant of van der Waals broadening by H atoms (divided by the atomic hydrogen number density) Γ vdW (ω) / N H $ \Gamma^{(\omega)}_\text{vdW}/N_\text{H} $. The total Lorentzian half-width in terms of the wavenumber is then calculated as

γ = 1 2 1 2 π c ( Γ nat ( ω ) + ( Γ Stark ( ω ) N e ) N e + ( Γ vdW ( ω ) N H ) N H ) . $$ \begin{aligned} \gamma = \dfrac{1}{2}\dfrac{1}{2\pi c}\left(\Gamma ^{(\omega )}_\text{nat} + \left(\dfrac{\Gamma ^{(\omega )}_\text{Stark}}{N_\text{e}}\right)N_\text{e} + \left(\dfrac{\Gamma ^{(\omega )}_\text{vdW}}{N_\text{H}}\right)N_\text{H}\right). \end{aligned} $$(A.5)

Fig. A.2 depicts the data structure in the Kurucz line list in HDF5 format. It shows that the quantities necessary for calculating the line opacity Eq. (A.3) are stored in the data sets wnum, lowe, gfva, gm_0, gm_1, and gm_2 in the group trans. The data set rsqd is used in Eq. (B.4) in Appendix B. The data set code is necessary to identify the species of each line since the line transitions of all the species are stored in a single file. The partition function for each species is computed from the NIST energy level data, that is, data sets ene and gtot stored in the NIST HDF5 file (Fig. A.1). This is because, in the Kurucz line lists, partition functions computed from all measured and predicted levels are provided, but only for a limited number of species.

thumbnail Fig. A.2.

Structure of the Kurucz atomic line list in HDF5 format. Data sets with asterisks are arrays of size nlines.

A.3. HITRAN and Exomol molecular line lists in HDF5 format

Because the isotopic shifts can be significant in molecules, the line list and the partition function table are provided for each isotopologue in databases HITRAN and Exomol. As for the isotopologue abundances x(iso), HITRAN provides them separately from the line list as “Isotopologue Metadata”18 while Exomol does not provide them. Therefore, for Exomol, we compute x(iso) using NIST AWIC (Table A.1), assuming the terrestrial isotopic abundances of elements.

The HITRAN and Exomol line lists give the Einstein coefficients Aul and statistical weights gu, from which the g-f value is calculated as

( g l f lu ) = c m e 8 π 2 e 2 ν ul 2 A ul g u . $$ \begin{aligned} \left(g_lf_{lu}\right) = \dfrac{cm_{\rm e}}{8\pi ^2e^2{\tilde{\nu }}_{ul}^2}A_{ul}g_u. \end{aligned} $$(A.6)

For line broadening, HITRAN and Exomol consider the van der Waals broadening only and employ the same convention to compute the corresponding Lorentzian half-width as a function of temperature T and the perturber’s partial pressure p as

γ vdW ( p , T ) = ( T ref T ) n γ vdW , ref ( p p ref ) , $$ \begin{aligned} \gamma _{\rm vdW}(p,T) = \left(\dfrac{T_{\rm ref}}{T}\right)^{n} \gamma _{\rm vdW,\,ref} \left(\dfrac{p}{p_{\rm ref}}\right), \end{aligned} $$(A.7)

where Tref = 296 K and pref = 1 ([atm] in HITRAN and [bar] in Exomol) are the reference temperature and pressure, respectively. The exponent n and the reference width γvdW,  ref ≡ γvdW(pref, Tref) [cm−1] are parameters given in the line list and depend on the perturbers considered. Both HITRAN and Exomol consider two kinds of perturbers for broadening: HITRAN considers air (p = ptotal − pself) and self (p = pself) broadening, while Exomol considers, in most cases, broadening by H2 molecules (p = pH2) and by He atoms (p = pHe). In our code, we determine the total Lorentzian half-width considering both the natural broadening (Eq. 20) and the van der Waals broadening by the two kinds of perturbers:

γ = γ nat + γ vdW # 1 + γ vdW # 2 . $$ \begin{aligned} \gamma = \gamma _{\rm nat} + \gamma _{\rm vdW}^{\#1}+ \gamma _{\rm vdW}^{\#2}. \end{aligned} $$(A.8)

Here, the perturbers {#1, #2} denote, respectively, {“air”, “self”} for HITRAN and {H2, He} for Exomol.

The structure of the molecular line list in HDF5 format for a single molecular species is shown in Fig. A.3. The species is identified by the data set id in the group prop. The quantities necessary to compute the line opacity (Eq. 12) are stored in the data sets in groups prop and trans. The former contains quantities specific to the species while the latter contains those specific to the line. The partition function is calculated by the linear interpolation of the table provided with the line list, which is stored in the data set pf in the group prop. When the temperature to be considered is not within the data set temp, the temperature range of the partition function, the line absorption is not considered, as described in line 8 of Algorithm 1.

thumbnail Fig. A.3.

Structure of molecular line list in HDF5 format. Data sets with asterisks are arrays of size nlines, whereas those with double asterisks are arrays of size ntemp.

Appendix B: Calculation of collisional damping widths for atomic lines

Here we describe how to calculate collisional damping widths for atomic lines when they are not given in the Kurucz atomic line lists. We consult NIST ASD/AWIC for the ionization energy and mass of atoms, which are quantities required to calculate the line broadening parameters in this section.

B.1. Quadratic Stark broadening

According to a semi-empirical formula in Griem (1974, Eqs. 459, 460),

Γ Stark ( ω ) 2 = 8 ( π 3 ) 3 2 ħ a 0 m N e ( I H k B T ) 1 2 ( R 2 a 0 2 u g ( 3 k B T 2 Δ E u ) + R 2 a 0 2 l g ( 3 k B T 2 Δ E l ) ) , $$ \begin{aligned} \dfrac{\Gamma _\text{Stark}^{(\omega )}}{2}&= 8\left(\dfrac{\pi }{3}\right)^\frac{3}{2}\dfrac{\hbar a_0}{m}N_\text{e}\left(\dfrac{I_\text{H}}{k_{\rm B}T}\right)^\frac{1}{2}\nonumber \\&\left(\langle \dfrac{R^2}{a_0^2}\rangle _u g\left(\dfrac{3k_{\rm B}T}{2\Delta E_u}\right) + \langle \dfrac{R^2}{a_0^2}\rangle _l g\left(\dfrac{3k_{\rm B}T}{2\Delta E_l}\right)\right), \end{aligned} $$(B.1)

where IH is the ionization energy of hydrogen, and ΔEi is the perturbed energy in state i due to a collision. The radiator’s effective radius squared (in terms of the Bohr radius a0) in state i is evaluated as

R 2 a 0 2 i = 1 2 ( n i Z + 1 ) 2 [ 5 n i 2 + 1 3 l i ( l i + 1 ) ] . $$ \begin{aligned} \langle \dfrac{R^2}{a_0^2}\rangle _i = \dfrac{1}{2}\left(\dfrac{n^*_i}{Z+1}\right)^2\left[5{n^*_i}^2 + 1 - 3l_i(l_i + 1)\right]. \end{aligned} $$(B.2)

Here, li is the orbital quantum number of the valence electron in state i, and the effective principal quantum number in state i is defined as

n i = ( Z + 1 ) ( I H I E i ) 1 2 , $$ \begin{aligned} n^*_i = (Z+1)\left(\dfrac{I_\text{H}}{I - E_i}\right)^\frac{1}{2}, \end{aligned} $$(B.3)

where Z, I, and Ei are the charge number, the ionization energy, and the energy in state i of the radiator, respectively.

In our code, for simplicity, we employ the following approximations:

R 2 a 0 2 i 5 2 n i 4 ( Z + 1 ) 2 , $$ \begin{aligned}&\langle \dfrac{R^2}{a_0^2}\rangle _{ i} \approx \dfrac{5}{2}\dfrac{{n^*_{ i}}^4}{(Z+1)^2}, \end{aligned} $$(B.4)

g ( x ) 0.2 . $$ \begin{aligned}&g(x) \approx 0.2. \end{aligned} $$(B.5)

The approximation given by Eq. (B.5) is based on the discussion above pertaining to Eq. 459 in Griem (1974).

B.2. van der Waals broadening

According to the Lindholm approximation in classical impact theory (e.g., p.258 in Mihalas 1970),

Γ vdW ( ω ) 2 = N pert v pert 0 ρ ( 1 cos ( ( 3 π / 8 ) C 6 v ρ 5 ) ) d ρ = f C 6 2 5 v pert 3 5 N pert , $$ \begin{aligned} \dfrac{\Gamma _\text{vdW}^{(\omega )}}{2}&= N_\text{pert}v_\text{pert}\int _0^\infty \rho \left(1-\cos \left(\dfrac{(3\pi /8)C_6}{{v}\rho ^5}\right)\right)d\rho \nonumber \\&= f C_6^\frac{2}{5} v_\text{pert}^\frac{3}{5} N_\text{pert},\end{aligned} $$(B.6)

f ( 1 + 5 ) Γ ( 2 5 ) π 5 ( 3 π 8 ) 2 5 8.08 , $$ \begin{aligned}&f \equiv -\left(1+\sqrt{5}\right)\Gamma \left(-\dfrac{2}{5}\right)\dfrac{\pi }{5}\left(\dfrac{3\pi }{8}\right)^\frac{2}{5} \approx 8.08, \end{aligned} $$(B.7)

where Npert and vpert are the number density and the velocity of the perturber, respectively, and Γ(x) is the Gamma function. Based on quantum theory (e.g., p.297 in Mihalas 1970), the factor C6 is evaluated as

C 6 = e 2 a 0 2 ħ α pert ( pol ) ( R 2 a 0 2 u R 2 a 0 2 l ) , $$ \begin{aligned} C_6 = \dfrac{e^2a_0^2}{\hbar }\alpha ^{(\text{pol})}_\text{pert} \left(\langle \dfrac{R^2}{a_0^2}\rangle _u - \langle \dfrac{R^2}{a_0^2}\rangle _l\right), \end{aligned} $$(B.8)

where α pert (pol) $ \alpha^{(\text{pol})}_\text{pert} $ is the polarizability of the perturber.

In our code, we evaluate the velocity of the perturber as

v pert = v 2 pert = 3 k B T m pert , $$ \begin{aligned} v_\text{pert} = \sqrt{{v^2}_\text{pert}} = \sqrt{\dfrac{3k_{\rm B}T}{m^*_\text{pert}}}, \end{aligned} $$(B.9)

where ⟨⟩ denotes the thermal average and m pert * $ m^*_\text{pert} $ is the reduced mass of the perturber with the radiator. Although we have implemented van der Waals broadening caused only by atomic hydrogen, molecular hydrogen, and helium (Schwerdtfeger & Nagle 2019; Wilkins & Taylor 1968), it is straightforward to add broadening caused by other species if { v pert , N pert , α pert (pol) } $ \left\{v_\text{pert}, N_\text{pert}, \alpha_\text{pert}^{(\text{pol})}\right\} $ are available.

It is known that the damping constant evaluated in the above requires some correction. In our code, we multiply Γ vdW (ω) $ \Gamma_\text{vdW}^{(\omega)} $ by a correction factor of 2.5 based on Valenti & Piskunov (1996).

Appendix C: Partition function, chemical potential, and thermochemical database

In this section, for reference, we summarize the relationships among the partition function, chemical potential, and thermochemical database.

Chemical equilibrium is obtained by minimizing the Gibbs free energy [J mol−1] of the system:

G ( T , P ) = i x i μ i ( T , P ) , $$ \begin{aligned} G(T,P) = \sum _i x_i \mu _i(T,P), \end{aligned} $$(C.1)

where x is the molar fraction and index i denotes the species. In the chemical equilibrium calculation, the chemical potential μ [J mol−1] is usually computed from thermochemical databases as (e.g., Eq.(3.12-5a) in Smith & Missen 1982)

μ ( T , P ) = R T ln ( P P ° ) + R T { Δ H f ° ( 298 ) T ( G ° ( T ) H ° ( 298 ) T ) } , $$ \begin{aligned} \mu (T,P)= RT\ln \left(\dfrac{P}{P^\circ }\right) + RT\left\{ \Delta H^\circ _\text{f}(298) - T\left(-\dfrac{{G^\circ }(T) - {H^\circ }(298)}{T}\right)\right\} , \end{aligned} $$(C.2)

where H indicates the total enthalpy and ΔHf indicates the enthalpy of formation, and the superscript ° denotes the standard pressure. The quantities ΔH°f(298) and −(G°(T)−H°(298))/T are provided in thermochemical databases such as NIST-JANAF or NASA CEA. We note that the values of the chemical potential, Eq. (C.2), and Eq. (3) differ by a constant because different values of the zero energy are considered.

The partition function Q(T) can be computed using thermochemical databases. Hereafter we consider the standard pressure. For a pure substance, because the chemical potential is equal to the Gibbs free energy, Eq. (3) can be written as (Eq. (24.50) in McQuarrie & Simon 1997)

G ° ( T ) H ° ( 0 ) = R T ln ( P ° k B T ( h 2 2 π m k B T ) 3 2 1 Q ( T ) ) . $$ \begin{aligned} G^\circ (T) - H^\circ (0) = RT\ln \left(\dfrac{P^\circ }{k_{\rm B}T}\left(\dfrac{h^2}{2\pi mk_{\rm B}T}\right)^\frac{3}{2}\dfrac{1}{Q(T)}\right). \end{aligned} $$(C.3)

Then, the partition function is computed as

ln Q ( T ) = { 3 2 ln ( m m u ) 5 2 ln ( T T 1 ) ( S 0 R 5 2 ) } + black { G ° ( T ) H ° ( 298 ) T } 1 R + black { H ° ( 0 ) H ° ( 298 ) } RT , $$ \begin{aligned} \ln Q(T)&= \left\{ -\dfrac{3}{2}\ln \left(\dfrac{m}{m_\text{u}}\right) - \dfrac{5}{2}\ln \left(\dfrac{T}{T_1}\right) -\left(\dfrac{S_0}{R} - \dfrac{5}{2}\right)\right\} \nonumber \\&+ {{black}\left\{ -\dfrac{G^\circ (T)-H^\circ (298)}{T}\right\} }\dfrac{1}{R} + \dfrac{{black}\left\{ H^\circ (0) - H^\circ (298)\right\} }{RT},\nonumber \\ \end{aligned} $$(C.4)

where mu is the atomic mass unit, T1 = 1 K, and

S 0 R ln { ( 2 π m u k B T 1 h 2 ) 3 2 k B T 1 P ° } + 5 2 = 1.15170753706 $$ \begin{aligned} \dfrac{S_0}{R} \equiv \ln \left\{ \left(\dfrac{2\pi m_\text{u}k_{\rm B}T_1}{h^2}\right)^\frac{3}{2}\dfrac{k_{\rm B}T_1}{P^\circ }\right\} + \dfrac{5}{2} = -1.15170753706 \end{aligned} $$(C.5)

is the Sackur-Tetrode constant. The quantity H° (0)−H° (298) is provided in thermochemical databases.

We note that the partition functions computed by Eq. (C.4) differ by a factor of the nuclear partition function from those provided with the corresponding line list, such as HITRAN or Exomol (Hanson et al. 2015). This is because the nuclear partition function is included in the total partition function in the line lists, but is not in the thermochemical databases (Sousa-Silva et al. 2014). We also note that the atomic partition functions in our code, which are computed from the NIST ADS levels form, do not include the nuclear partition function.

All Tables

Table 1.

Opacity sources implemented in the first version of OPTAB.

Table 2.

Coefficients in the approximated Voigt function (Eq. (22)).

Table A.1.

External sources for the isotope or isotopologue fraction, partition function, and mass.

All Figures

thumbnail Fig. 1.

Flowchart of OPTAB. The external files in the gray boxes are in the HDF5 format, which have been converted from their original ASCII files (Appendix A).

In the text
thumbnail Fig. 2.

Magnesium photoionization absorption coefficients per Mg atom [cm2] at 5000 K. The brown curve indicates the photoionization from the ground level, and is a hybrid of Verner et al. (1996) (outer-subshell contributions; yellow) and Verner & Yakovlev (1995) (inner-subshell contributions; cyan). Both the magenta and black thin curves indicate the photoionization from excited levels; the former is based on the Mathisen (1984) compilation, whereas the latter is based on TOPbase.

In the text
thumbnail Fig. 3.

Error of the approximated Voigt function (Eq. (22)) relative to the wofz reference (left; logarithmic) and computational time relative to that of the Gaussian function (right; linear).

In the text
thumbnail Fig. 4.

Relative number of the Voigt lines (gray bar) (as well as that of Gauss lines; light gray bar) against the total number of lines in the reference case (δvoigt = δcrit = 0). Also, relative errors of the Rosseland (triangle) and Planck (square) mean opacity as well as of the monochromatic absorption coefficient (filled circle) are plotted. The CE abundance data used here are taken from the first layer of a demo output produced by FASTCHEM, chem_output_agb_stellar_wind.dat. The asterisk in the upper panel indicates a run that employs HITRAN’s dynamic strength cutoff, instead of δcrit.

In the text
thumbnail Fig. 5.

Comparison of mean opacities between OPTAB (thin solid) and PHOENIX (thick): Rosseland mean (black), Planck mean (red), and two-temperature Planck mean for Tred = 6000 K (blue) at log P = 7 (top), log P = 2 (middle), and log P = −3 (bottom). The data represented by the thin dotted curves are explained in the text.

In the text
thumbnail Fig. 6.

Dependence of Rosseland mean (top), Planck mean (middle), and two-temperature Planck mean for Trad = 6000 K at log P = 2 on the number of grid points, equally spaced on a logarithmic grid. The thick light curves in the middle and the bottom panels are obtained via grid-independent calculations.

In the text
thumbnail Fig. 7.

MPI parallel performance for parallelization on the layer loop (upper) and the load balance in the case of 8 MPI processes (lower). The white, gray, and black bars correspond, respectively, to the wall times for atomic lines, molecular lines, and continuum. The computation was performed, using gfortran 10.2 + Open MPI 4.1 + HDF5 1.12, on 2.3 GHz 8-Core Intel Core i9 processors.

In the text
thumbnail Fig. 8.

Rosseland mean (top), Planck mean (middle), and two-temperature Planck mean (bottom) opacities on the temperature–pressure grid composed of 64 points (layers).

In the text
thumbnail Fig. A.1.

Structure of the NIST atomic property file in HDF5 format. Data sets with asterisks are arrays of size nstates.

In the text
thumbnail Fig. A.2.

Structure of the Kurucz atomic line list in HDF5 format. Data sets with asterisks are arrays of size nlines.

In the text
thumbnail Fig. A.3.

Structure of molecular line list in HDF5 format. Data sets with asterisks are arrays of size nlines, whereas those with double asterisks are arrays of size ntemp.

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.