Repository navigation
Expand file tree
/
Copy pathOpacityCalculation.tex
More file actions
895 lines (794 loc) · 56.7 KB
/
Copy pathOpacityCalculation.tex
File metadata and controls
895 lines (794 loc) · 56.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
% INSTRUCTION FOR LLM:
% 1. Keep the multiline writing style and keep minimal diff when editing. If possible dont rewrite all text but
% edit only the relvent line. Avoid merging lines into one.
\documentclass[final,5p,times,twocolumn]{elsarticle}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{url}
\usepackage[colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
% Top-align floats on float-only pages (avoids a nearly blank page with the figure at the bottom).
\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother
\DeclareRobustCommand{\secref}[1]{\hyperref[#1]{Section~\ref*{#1}}}
\DeclareRobustCommand{\figref}[1]{\hyperref[#1]{Figure~\ref*{#1}}}
\DeclareRobustCommand{\figsref}[2]{\hyperref[#1]{Figures~\ref*{#1}} and~\hyperref[#2]{\ref*{#2}}}
\DeclareRobustCommand{\eqnref}[1]{\hyperref[#1]{Eq.~(\ref*{#1})}}
\renewcommand{\ttdefault}{lmtt}
\journal{High Energy Density Physics}
\begin{document}
\begin{frontmatter}
%% Title, authors and addresses
\author[1]{Roy G. Yaron}
\cortext[cor1]{Corresponding author: \href{mailto:udini@tauex.tau.ac.il}{udini@tauex.tau.ac.il}}
\affiliation[1]{organization={School of Physics and Astronomy, Tel Aviv University},
city={Tel Aviv},
postcode={6997801},
country={Israel}}
\title{Defining an Effective Rosseland Mean for Expansion Opacity} %% Article title
%% Abstract
\begin{abstract}
The standard Rosseland mean does not account for the Doppler shift of photons through spectral lines during expansion
and can substantially misestimate the opacity of line-rich ejecta.
For each frequency, we define an effective expansion opacity from the distance an outward
travelling photon covers before reaching optical depth unity,
$\kappa_{\rm exp}=1/(\rho\Delta x)$. Its Rosseland mean, $\kappa_R^{\rm exp}$, provides a gray
transport opacity for expanding media where bound-bound transitions dominate.
For kilonova ejecta, this method allows us to determine the effective opacity as a function of
lanthanide mass fraction $X_{\rm lan}$. Using an eight-element composition derived from the solar
$r$-process pattern, we obtain the approximate effective Rosseland opacity
$\kappa_{\rm avg}\simeq0.34+99X_{\rm lan}^{0.72}$~cm$^2$/g during the diffusion-dominated phase,
for the adopted composition and atomic data.
Single-group Monte Carlo simulations using this opacity reproduce the trends of full frequency-group
calculations for Type~Ia supernova and kilonova ejecta, with kilonova peak luminosities differing
by $7$--$33\%$. For lanthanide-rich kilonova ejecta, the single-group calculation is faster by around 2
orders of magnitude.
\end{abstract}
%% Keywords
\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
opacity \sep Rosseland mean \sep expansion opacity \sep kilonova \sep supernovae
\end{keyword}
\end{frontmatter}
%% main text
\section{Introduction}
\label{SecIntro}
The interaction between radiation and matter is primarily determined by the material properties such as composition, density,
and temperature, as well as the spectral characteristics of the radiation.
In expanding plasmas, due to the Doppler effect, as photons travel through the plasma, their frequency changes.
This effect is mainly important for bound-bound transitions, because their narrow line structure in frequency causes photons to interact
with different lines as they travel through the plasma.
This effect is known as expansion opacity, and it is important for many astrophysical applications, such as Type Ia supernovae,
kilonovae and stellar winds.
%Under the reasonable condition of non-ultra relativistic velocities,
%the frequency shift due to the Doppler shift is approximately $\Delta \nu = \nu_0 \frac{\Delta v}{c}$.
%to write its usually less then 10\% of the frequency.
For non-moving plasmas, the radiation flux can be approximated well using the Rosseland mean opacity, which is a weighted
average of the opacity over all frequencies. However, for expanding plasmas with significant bound-bound opacity, the Rosseland mean
opacity is not a good approximation, since the width of the bb lines is negligible and photons interact with them only due to their
frequency change as they travel through the plasma.
Therefore the average distance a photon travels cannot be derived from $\kappa(\nu)$
alone because it inherently depends on the photon's direction of movement and the plasma's velocity gradient.
To avoid this problem and to allow calculation of transport that can inherently depend on the photon's direction of movement and
velocity gradient, radiation transport in systems with expansion opacity is usually calculated using Monte Carlo simulations,
which track individual photons and their frequency evolution as they propagate through the expanding medium.
Calculating an effective Rosseland mean opacity has several motivations: a single opacity value
(1) is required for analytic
models and closed-form solutions, which cannot treat full frequency-dependent opacity; (2) gives direct physical
intuition for how temperature and composition affect the opacity and hence the light curve; and (3) enables
faster and simpler simulations than full frequency-dependent calculations.
Previous attempts to address this problem have been proposed. Fontes et al. \cite{fontes2015opacity,fontes2017linesmeared}
suggested using artificial
line broadening by assigning a line width corresponding to unphysical high temperature of 20 MeV,
which effectively smears the bound-bound lines
over a finite frequency range. This approach preserves the integral of the opacity over
frequency (area-preserving line profiles) and for NSM ejecta it
produces frequency-dependent opacities that are one to two orders of magnitude greater than those
obtained with expansion opacities in
the Sobolev approximation without broadening. Fontes et al. \cite{fontes2020opacity} demonstrated that
their smeared opacity tables,
calculated using the Sobolev formalism, yield light curves for multigroup radiative transfer simulations
that are similar to those
obtained from full line-by-line Monte Carlo radiation transport (using the superNu code) for kilonovae (neutron
star mergers).
However, this approach still requires multigroup frequency-dependent opacity tables rather than
a single gray (frequency-averaged) Rosseland mean opacity and uses an unphysical assumption that
has been verified only for specific ejecta.
Several works \cite{deprince2024kilonova,just2022properties,tanaka2020systematic} have shown how opacity depends on composition,
temperature, density, and time by comparing the Planck mean expansion opacity over those parameters.
The Planck mean is nevertheless not the appropriate average for the opacity that controls photon
escape from the ejecta. In a non-expanding medium this transport opacity is the Rosseland mean,
which weights the low-opacity frequency windows through which photons preferentially diffuse.
In an expanding medium the same transport character is needed, but the opacity must also include
the line absorption encountered as the photon redshifts through the expanding flow.
In this paper we present the effective expansion opacity, $\kappa_{\rm exp}$, which accounts for
bound-bound expansion opacity. The method follows an outward-moving photon in homologous expansion
($r=vt$) and calculates the distance over which it reaches optical depth $\tau\simeq1$.
Taking the Rosseland mean of $\kappa_{\rm exp}$ defines the effective expansion Rosseland mean,
$\kappa_R^{\rm exp}(T,\rho,t)$.
This gray-opacity method assumes that the photons dominating the diffusion are close to a
blackbody spectrum. It is therefore useful for bolometric luminosities and characteristic
temperatures, but not for detailed line spectra.
The structure of the paper is as follows: In \secref{SecExpansion} we describe how the expansion opacity is calculated,
and define the effective expansion opacity.
In \secref{SecRosseland}, we show the variation of $\kappa_R^{\rm exp}$ with composition, temperature, density, and time
and show how it scales differently from the Planck mean.
In \secref{SecRadiationSimulations} we demonstrate the use of $\kappa_R^{\rm exp}$ in radiative transfer simulations and compare the
results to the full frequency-group calculations.
In \secref{SecTypicalOpacity} we determine the effective opacity sampled by the diffusion
region and derive its dependence on the kilonova lanthanide fraction.
In \secref{SecSummary} we summarize the results.
%which means that the time is the velocity and frequency gradient $t = \frac{dv}{dR} = \frac{d\nu}{dR}$.
\section{Expansion Opacity}
\label{SecExpansion}
The total opacity $\kappa$ is the sum of contributions from different physical processes:
\begin{equation}
\kappa = \kappa_{\mathrm{T}} + \kappa_{\mathrm{ff}} + \kappa_{\mathrm{bf}} + \kappa_{\mathrm{bb}}
\end{equation}
where $\kappa_{\mathrm{T}}$ is Thomson scattering, $\kappa_{\mathrm{ff}}$ is free-free opacity, $\kappa_{\mathrm{bf}}$ is
bound-free opacity (which we neglect in this work), and $\kappa_{\mathrm{bb}}$ is bound-bound opacity from atomic line
transitions.
The bound-bound opacity $\kappa_{\mathrm{bb}}$ depends on the ionization and excitation populations
of the material. We obtain the ionization fractions from the Saha equation and the level
populations from the Boltzmann distribution, and use them to calculate the optical depth of each line.
The optical depth of the bound-bound line is then calculated using the Sobolev approximation \cite{eastmanpinto1993}.
\begin{equation}
\tau_{j_l,j_u} = \frac{\pi e^{2}}{m_{e}} \frac{f_{j_l,j_u}}{\nu_{j_l,j_u}} t \left(N_{m,i,j_l} - \frac{g_{j_l}}{g_{j_u}} N_{m,i,j_u}\right)
\end{equation}
where $m$ is the material index, $i$ is the ionization state, $j_l$ and $j_u$ are the lower and upper energy levels respectively,
$f_{j_l,j_u}$ is the oscillator strength of the transition
from the energy level $j_l$ to the energy level $j_u$, $\nu_{j_l,j_u}$ is the frequency of the transition, $N_{m,i,j_l}$ and $N_{m,i,j_u}$
are the number densities of the lower and upper levels respectively, $g_{j_l}$ and $g_{j_u}$ are their degeneracies, and $t$ is the time from explosion.
We use two forms of the bound-bound opacity, saturated and unsaturated:
\begin{equation}
\kappa_{bb,saturated}(\nu) = \sum_l \frac{\nu_l}{\rho c t} \delta(\nu - \nu_{l}) \cdot (1 - \exp(-\tau_{j_l,j_u}))
\end{equation}
\begin{equation}
\kappa_{bb,unsaturated}(\nu) = \sum_l \frac{\nu_l}{\rho c t} \delta(\nu - \nu_{l}) \cdot \tau_{j_l,j_u}
\end{equation}
The saturated opacity gives the contribution of a narrow line to a larger finite frequency bin,
by capping its effect once it becomes optically thick, since a single line has a maximal effect on the opacity
once all photons in the line's frequency are absorbed.
The unsaturated opacity gives the optical depth accumulated by a photon that crosses the
full frequency bin.
We define the effective expansion opacity, $\kappa_{\rm exp}$, from the distance an outward travelling photon
moves through the plasma before accumulating optical depth unity.
The effective expansion Rosseland mean, $\kappa_R^{\rm exp}$, is then the Rosseland mean of
$\kappa_{\rm exp}$.
An outward travelling photon with frequency $\nu_0$ will reach a new spectral line with frequency
$\nu_{l}$ after a velocity shift of $\Delta v = -c \ln(\nu_0/\nu_{l})$ which corresponds to a
distance of $\Delta x = -c t \ln(\nu_0/\nu_{l})$.
For that we define the cumulative frequency optical depth as:
\begin{equation}
\tau(\nu) = \int \kappa(\nu) \rho \, dx = ct \int \kappa(\nu) \rho \frac{d\nu}{\nu}
\end{equation}
For each frequency $\nu_i$, given the frequency $\nu_j$ such that $\tau(\nu_j) - \tau(\nu_i) = 1$,
we define the effective expansion opacity as:
\begin{equation}
\label{eq:kappa_eff_simple}
\kappa_{\rm exp}(\nu_i) = \frac{1}{\rho \Delta x}
= \frac{1}{\rho ct \ln(\nu_j/\nu_i)}
\end{equation}
For finite size frequency bins this process is done by estimating where inside the stopping
bin the photon reaches optical depth unity. This is needed because assigning the stopping
point to the edge of a frequency bin would make the minimum travel distance depend on the
chosen bin width, rather than on the line opacity inside the bin.
Numerically, after discretizing the frequency, the stopping bin is found with the unsaturated
optical depth by finding the first bin $j$ such that
\begin{equation}
\tau(\nu_{j-1}) - \tau(\nu_i) < 1,
\qquad
\tau(\nu_j) - \tau(\nu_i) > 1
\end{equation}
Unsaturated opacity is used for this step because it identifies where the photon reaches true
optical depth unity; with saturated opacity alone, a strong line with $\tau \gg 1$ contributes
only $1-\exp(-\tau)$ and cannot set the stopping point by itself.
We then estimate the sub-bin stopping frequency in bin $j$ using the saturated opacity. If the
saturated optical depth in this bin can supply the remaining optical depth to unity, we use
\begin{equation}
\begin{aligned}
\Delta\nu_{\tau=1,i} &= \nu_{j-1} - \nu_i + (\nu_j - \nu_{j-1})
\frac{1 - (\tau(\nu_{j-1})-\tau(\nu_i))}{\Delta\tau^{s}_j},\\
\nu_{\tau=1,i} &= \nu_i + \Delta\nu_{\tau=1,i}.
\end{aligned}
\end{equation}
where $\Delta\tau^{s}_j$ is the saturated optical depth of bin $j$. Otherwise, if
$\Delta\tau^{s}_j < 1 - (\tau(\nu_{j-1})-\tau(\nu_i))$, we set
$\Delta\nu_{\tau=1,i}=\nu_j-\nu_i$.
The effective opacity is then calculated from $\Delta x_i = ct\ln(\nu_{\tau=1,i}/\nu_i)$. When a
single bin dominates, we instead use
\begin{equation}
\label{eq:kappa_eff}
\kappa_{\rm exp}(\nu_i) = \frac{ \sum_l (1 - \exp(-\tau(\nu_l)))}{\rho ct \ln(\nu_{i+1}/\nu_i)} + \kappa_{\mathrm{T}} + \kappa_{ff}(\nu_i)
\end{equation}
This interpolation is approximate, but it is accurate when
$\Delta\tau \ll 1$ or $\Delta\tau \gg 1$. For the intermediate case, $\Delta\tau \sim 1$, it
introduces a small error which should mostly cancel on average.
\figref{fig:BB_line_example} shows the unsaturated opacity, saturated opacity, and effective
expansion opacity of iron after 3 days, for density $1 \times 10^{-12}$~g/cm$^3$ and temperature
0.5~eV.
%Top: frequency-dependent opacity showing unsaturated opacity, saturated opacity, and effective
%expansion opacity. Bottom: zoom into a narrow photon-energy range with the same quantities.
For elements with $Z\leq28$ in Type~Ia supernova compositions we use the atomic line data of Kurucz \& Bell
(1995; CD~23) \cite{kurucz1995}. For kilonova compositions, where the relevant elements have $Z>28$,
we use the NIST Atomic Spectra Database \cite{nistASD}.
% NOTE (editors / future AI): For vertically stacked panels use top/middle/bottom (not left/right). For a true side-by-side layout, left/right is fine. Do not set panel labels in \textbf{...}; keep them in normal weight.
\begin{figure}[h]
% How to create:
% Script: plots/plot_kappa_smoothed_vs_raw.py
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plots/plot_kappa_smoothed_vs_raw.py --png
% mv kappa_smoothed_vs_raw.png build_paper/figs/kappa_smoothed_vs_raw.png
% mv kappa_smoothed_vs_raw_error.png build_paper/figs/kappa_smoothed_vs_raw_error.png
% (Two rows in the PDF: row~1 = first PNG; row~2 = zoomed opacity comparison.)
\centering
\includegraphics[width=\columnwidth]{figs/kappa_smoothed_vs_raw.png}\\[0.5em]
\includegraphics[width=\columnwidth]{figs/kappa_smoothed_vs_raw_error.png}
\caption{Unsaturated opacity, saturated opacity, and effective expansion opacity,
for iron at $\rho = 1 \times 10^{-12}$~g/cm$^3$, $T = 0.5$~eV, $t = 3$~days.
For large (top) and zoomed (bottom) energy ranges.}
\label{fig:BB_line_example}
\end{figure}
\section{Rosseland Mean of Effective Expansion Opacity}
\label{SecRosseland}
The Planck mean opacity is an emission-weighted average, while the Rosseland mean opacity is a
transport-weighted harmonic mean:
\begin{equation}
\kappa_P = \frac{\int \kappa_\nu B_\nu(T) d\nu}{\int B_\nu(T) d\nu},
\qquad
\frac{1}{\kappa_R} =
\frac{\int \frac{1}{\kappa_\nu} \frac{\partial B_\nu(T)}{\partial T} d\nu}
{\int \frac{\partial B_\nu(T)}{\partial T} d\nu}.
\end{equation}
where $B_\nu(T)$ is the Planck function.
When the Rosseland average is applied to the usual frequency-dependent opacity $\kappa_\nu$ we denote
the result by $\kappa_R$. When it is applied to the effective expansion opacity $\kappa_{\rm exp}$,
we denote the result by $\kappa_R^{\rm exp}$.
The main problem with applying the Rosseland mean directly to the expansion opacity is that zero-width
bound-bound lines cannot contribute to a frequency-integrated harmonic mean; numerically, this appears as
a vanishing bound-bound contribution as the frequency bins are refined.
\figref{fig:convergence} shows the convergence of the Rosseland mean opacities as a function of the
frequency resolution $\Delta\nu/\nu$ (for logarithmically spaced frequency bins)
for iron (Fe, $Z=26$) in top and erbium (Er, $Z = 68$) in bottom.
Iron is an iron-group element with an open d-block, representative of the heavy material in
Type~Ia supernova ejecta. Erbium is a lanthanide with an open f-block, which is common in
kilonova compositions and gives a much larger bound-bound opacity than iron.
In \figref{fig:convergence} we plot the ordinary Rosseland mean of the saturated expansion opacity,
$\kappa_R$, and the effective expansion Rosseland mean, $\kappa_R^{\rm exp}$.
\begin{figure}[h]
% How to create:
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python convergence_tests/plot_opac_vs_bins.py --T 1.0 --png 1e-13 20.0
% mv convergence_Fe_rho1.00e-13_t20.0days.png build_paper/figs/
% python plot_opac_vs_bins.py --composition Er --T 1.0 1e-12 1.0 --png
% mv convergence_Er_rho1.00e-12_t1.0days.png build_paper/figs/
\centering
\makebox[\columnwidth][c]{\includegraphics[width=1.0\columnwidth]{figs/convergence_Fe_rho1.00e-13_t20.0days.png}}\\[0.5em]
\makebox[\columnwidth][c]{\includegraphics[width=1.0\columnwidth]{figs/convergence_Er_rho1.00e-12_t1.0days.png}}
\caption{Convergence of the Rosseland mean opacities vs. the frequency resolution in $\Delta\nu/\nu$.
Top: iron for Type~Ia-like conditions, $\rho = 1 \times 10^{-13}$~g/cm$^3$, $T = 1$~eV, $t = 20$~days.
Bottom: erbium (lanthanide, $Z = 68$); $\rho = 1 \times 10^{-12}$~g/cm$^3$, $T = 1$~eV, $t = 1$~day.
In each panel the blue solid curve is the ordinary Rosseland mean $\kappa_R$ of the saturated expansion opacity,
and the orange dashed curve is the effective expansion Rosseland mean $\kappa_R^{\rm exp}$.}
\label{fig:convergence}
\end{figure}
The results show that $\kappa_R^{\rm exp}$ is barely dependent on the frequency resolution
and gives converged opacity even for low resolutions such as
$\Delta\nu/\nu \gtrsim 4\cdot 10^{-2}$ (which is equivalent to less than 200 bins for the full spectrum used).
The reason the effective opacity gives correct results even for large bins is that the spectral lines are
randomly distributed within each frequency bin. As long as the lines are randomly
distributed, \eqnref{eq:kappa_eff} provides a good approximation since it represents the typical distance
a photon travels in a frequency bin. The fact that we observe good agreement between low-resolution and
high-resolution calculations for $\kappa_R^{\rm exp}$ for both iron and erbium confirms
that the line locations are indeed close enough to randomly distributed within large bins.
This also offers a rationale for the success of the artificial line-broadening prescription
of Fontes et al.\ \cite{fontes2015opacity,fontes2017linesmeared}:
spreading line opacity over frequency is analogous to many narrow lines at random positions within
a coarse bin, so either picture can yield similar cumulative opacity in the bin,
consistent with smeared Sobolev tables reproducing Monte Carlo transport \cite{fontes2020opacity}.
At low frequency resolution $\kappa_R$ of the saturated expansion opacity and
$\kappa_R^{\rm exp}$ are close because a single wide bin often sets the stopping distance. In that limit,
\eqnref{eq:kappa_eff} applies and the effective opacity is the same as the saturated opacity.
Using the formalism described above, we calculated the opacity for different times,
densities, and temperatures and constructed tables for Type~Ia supernova and kilonova
simulations.
To simulate Type~Ia supernova ejecta, we created two tables for two compositions.
The first for the outer layer of the supernova, which is a mixture of Silicon, Sulfur, Argon, and Calcium
in the ratio of 0.535, 0.32, 0.062, and 0.083 respectively.
%Si: 0.535, S: 0.32, Ar: 0.062, Ca: 0.083
The second represents the supernova core and follows the $^{56}$Ni decay chain,
$^{56}{\rm Ni}\rightarrow{}^{56}{\rm Co}\rightarrow{}^{56}{\rm Fe}$, using the composition appropriate
for each time window. We assumed the half-lives of
$t_{1/2}(^{56}{\rm Ni}) = 6.075$ days and $t_{1/2}(^{56}{\rm Co}) = 77.233$ days.
Kilonova ejecta contain essentially every $r$-process species, and computing a line list for
each of them is impractical. We therefore built the kilonova table for a reduced mixture of
eight representative elements derived directly from the solar $r$-process abundance pattern.
We start from the solar $r$-process residuals $N_r(A)$, i.e.\ the solar isotopic abundances
with the calculated $s$-process contribution subtracted, taken from Cowan et al.\
\cite{cowan2006nucleosynthesis}.
Converting to mass, $M(A)\propto A\,N_r(A)$, we restrict the sum to $90<A\leq215$,
which holds $20\%$ of the mass of the tabulated pattern ($69\leq A\leq238$) and covers the
second ($A\approx130$) and third ($A\approx195$) $r$-process peaks together with the
lanthanides between them.
This range is then divided into eight contiguous windows in $A$, each represented by the one
element whose standard atomic weight falls inside it, and each representative is given the
mass fraction accumulated in its own window. \figref{fig:kilonova_composition} shows the
cumulative mass as a function of $A$ with the window boundaries and the resulting fractions.
The eight representatives are Zr ($Z=40$), Ru ($44$), Xe ($54$), Nd ($60$), Eu ($63$),
Er ($68$), Re ($75$), and Pb ($82$), with mass fractions
$0.049$, $0.108$, $0.460$, $0.043$, $0.030$, $0.047$, $0.206$, and $0.057$.
Splitting by valence shell, the mixture is $51.7\%$ $p$-block, $36.2\%$ $d$-block, and
$12.1\%$ $f$-block, so the lanthanide mass fraction of the solar-derived mixture is
$X_{\rm lan}=0.121$.
Because $X_{\rm lan}$ is the quantity that varies most strongly between kilonova ejecta
components, we also built six rescaled tables in which the three lanthanides are scaled to a
prescribed $X_{\rm lan}$ between $10^{-6}$ and $10^{-1}$, keeping their relative proportions,
and the five remaining elements are renormalized to $1-X_{\rm lan}$ keeping theirs.
These tables are used in \secref{SecRadiationSimulations}.
\begin{figure}[h]
% How to create (run from python_opac_calc2):
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_solar_metal_mass.py
% cp solar_metal_mass_fraction_reps.png build_paper/figs/kilonova_composition.png
\centering
\includegraphics[width=\columnwidth]{figs/kilonova_composition.png}
\caption{Cumulative mass of the solar $r$-process residual pattern
\cite{cowan2006nucleosynthesis} as a function of mass number, normalized to the
total mass in $90<A\leq215$. Colors mark the eight contiguous $A$ windows and the legend gives
the element chosen to represent each window, its valence block, and the mass fraction contained
in the window. Black circles are placed at the standard atomic weight of each representative.}
\label{fig:kilonova_composition}
\end{figure}
Each table stores, at every $(T,\rho,t)$, $\kappa_R^{\rm exp}$, $f_{\rm abs}$,
$\kappa_P^{\rm abs}$, and $\kappa_P^{\rm tot}$.
The fraction $f_{\rm abs}$ is the Rosseland mean of
$\kappa_{\rm abs}/(\kappa_{\rm abs}+\kappa_{\rm scat})$ with
$\kappa_{\rm abs}=\kappa_{\rm exp}-\kappa_{\rm T}$ and $\kappa_{\rm scat}=\kappa_{\rm T}$,
\begin{equation}
f_{\rm abs} =
\frac{\int \frac{\kappa_{\rm abs}}{\kappa_{\rm abs}+\kappa_{\rm scat}}
\frac{\partial B_\nu}{\partial T}\,d\nu}
{\int \frac{\partial B_\nu}{\partial T}\,d\nu}.
\end{equation}
In transport we use $\kappa_R^{\rm abs}=f_{\rm abs}\,\kappa_R^{\rm exp}$ and
$\kappa_R^{\rm scat}=(1-f_{\rm abs})\,\kappa_R^{\rm exp}$: absorption deposits energy and
re-emits the packet (IMC), while scatter only redirects it.
The last two entries are Planck means of the saturated opacity and are not used for the same
purpose. $\kappa_P^{\rm abs}$ is the Planck mean of the saturated absorption opacity,
$\kappa_{\rm sat}-\kappa_{\rm T}$; it sets the cell temperature, which is chosen so that the
thermal emission $4\pi\kappa_P^{\rm abs}\rho B(T)$ balances the energy deposited in the cell.
$\kappa_P^{\rm tot}$ is the Planck mean of the total saturated opacity, including Thomson
scattering. It takes no part in the transport and is stored only so that the Planck and
Rosseland weightings can be compared with the same physical processes included in both,
as we do next.
Since the ordinary Rosseland mean opacity is problematic to define for expansion opacity, previous works
\cite{deprince2024kilonova,just2022properties,tanaka2020systematic} often
used the Planck mean opacity to compare the opacity of different compositions in different temperatures.
We compare $\kappa_R^{\rm exp}$ to the Planck mean through their
ratio as a function of temperature and density.
For consistency in this comparison we use the Planck mean of the total saturated opacity,
$\kappa_P^{\rm tot}$, including Thomson scattering, so that both means contain the same physical
processes and the ratio tests how much the frequency weighting differs rather than whether
scattering is included in one mean but not the other.
\figref{fig:rosseland_planck_ni},
\figref{fig:rosseland_planck_sn1a_outer}, and \figref{fig:rosseland_planck_kilonova}
show $\kappa_R^{\rm exp}$ and the ratio $\kappa_P^{\rm tot}/\kappa_R^{\rm exp}$ for
the $^{56}{\rm Ni}$ decay chain, Type~Ia outer-layer composition, and kilonova composition.
\begin{figure*}[t]
% How to create (run from python_opac_calc2):
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_opac_cont.py -d opac_libs/tables/NiCoFe_t1_t10 -t 1 -c 5e-3 0.2 --ratio-limits 1 40 --planck-rosseland --png -yl 1e-14 1e-10
\centering
\makebox[\textwidth][c]{%
\includegraphics[width=0.48\textwidth]{figs/ni_rosseland_t1d.png}\hspace{0.02\textwidth}%
\includegraphics[width=0.48\textwidth]{figs/ni_t1d_ratio.png}}
\caption{Type~Ia core composition at $t=1$~day: $\kappa_R^{\rm exp}$ (left) and $\kappa_P^{\rm tot}/\kappa_R^{\rm exp}$ ratio (right).
Density $10^{-14}$--$10^{-10}$~g/cm$^3$.}
\label{fig:rosseland_planck_ni}
\end{figure*}
\begin{figure*}[t]
% How to create (run from python_opac_calc2):
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_opac_cont.py -d opac_libs/tables/SN1A_t1_t10_table -t 1 -c 5e-3 0.2 --ratio-limits 0.9 6 --planck-rosseland --png -yl 1e-14 1e-10
\centering
\makebox[\textwidth][c]{%
\includegraphics[width=0.48\textwidth]{figs/sn1a_outer_rosseland_t1d.png}\hspace{0.02\textwidth}%
\includegraphics[width=0.48\textwidth]{figs/sn1a_outer_ratio_t1d.png}}
\caption{Type~Ia outer-layer composition at $t=1$~day: $\kappa_R^{\rm exp}$ (left) and $\kappa_P^{\rm tot}/\kappa_R^{\rm exp}$ ratio (right).
The composition is Si, S, Ar, and Ca with mass fractions 0.535, 0.32, 0.062, and 0.083.
Density $10^{-14}$--$10^{-10}$~g/cm$^3$.}
\label{fig:rosseland_planck_sn1a_outer}
\end{figure*}
\begin{figure*}[t]
% How to create (run from python_opac_calc2):
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_opac_cont.py -d opac_libs/tables/reps8_t1_table -t 1 -yl 1e-16 1e-11 -xl 0.15 2 -c 1e-1 1e2 --ratio-limits 1.5 50 --planck-rosseland --png
% cp t_1days_rosseland.png t_1days_ratio.png $BUILD_PAPER/figs/ as kilonova_rosseland_t1d.png, kilonova_ratio_t1d.png
\centering
\makebox[\textwidth][c]{%
\includegraphics[width=0.48\textwidth]{figs/kilonova_rosseland_t1d.png}\hspace{0.02\textwidth}%
\includegraphics[width=0.48\textwidth]{figs/kilonova_ratio_t1d.png}}
\caption{Solar-derived kilonova composition ($X_{\rm lan}=0.121$) at $t=1$~day:
$\kappa_R^{\rm exp}$ (left) and $\kappa_P^{\rm tot}/\kappa_R^{\rm exp}$ ratio (right).
Density $10^{-16}$--$10^{-11}$~g/cm$^3$, the range spanned by the diffusion surface in the
transport calculations of \secref{SecRadiationSimulations}. The temperature range is cut at
$2$~eV, above which the mean ionization saturates at the three-electron limit of our atomic
data (see text). Both colorbars are clipped at both ends; within the plotted range
$\kappa_R^{\rm exp}$ spans $0.006$--$103$~cm$^2$/g and the ratio spans $1.6$--$132$.}
\label{fig:rosseland_planck_kilonova}
\end{figure*}
For both the Ni-rich and kilonova compositions, where bound-bound lines dominate,
the opacity tends to decrease with density.
This trend follows from the structure of
\eqref{eq:kappa_eff}: each line contributes a blocking factor $1-\exp(-\tau_l)$ divided by
$\rho c t$, and the Sobolev depth $\tau_l$ is itself proportional to $\rho t$. A weak line with
$\tau_l\ll1$ therefore contributes in proportion to the number of absorbers, the two density
factors cancel, and its opacity per unit mass is independent of $\rho$. A strong line with
$\tau_l\gg1$ instead saturates at $1-\exp(-\tau_l)\to1$: it already blocks its entire frequency
interval, and adding more absorbers cannot block any more. For strong lines,
the total blocked fraction stops growing with density but their opacity contribution falls as $1/\rho$.
The ratio between the Planck and Rosseland means varies strongly with temperature and density
for the Ni-rich core and kilonova composition. At one day, it reaches approximately
$39$ and $132$, respectively. Therefore, the Planck mean is not a good proxy for the
expansion Rosseland mean.
We note that the kilonova figures are cut at $T=2$~eV because our atomic data contain only the first three
ionization stages, so the mean ionization is capped at $\langle Z\rangle=3$. Above that
temperature the material is held artificially at the third stage rather than being stripped
further, and the opacity is incorrect. This does not affect the transport calculations of
\secref{SecRadiationSimulations}, because the emergent radiation is set by the diffusion
surface and not by the optically thick interior: the plasma temperature at that diffusion surface never
exceeds $1.8$~eV in any of the runs (\figref{fig:kilonova_diffusion_surface}),
so the opacity that shapes the light curves is always
taken from within the reliable range, even though the deeply buried cells are assigned
higher temperatures.
\section{Monte Carlo Simulation With Single Group Opacity}
\label{SecRadiationSimulations}
We performed radiation transport simulations to test the effective expansion Rosseland opacity model.
The simulations were performed using URILIGHT \cite{urilightCode,urilight1,urilight2}, a Monte Carlo
radiative transfer code written by Elbaz et al.\ and designed for supernova ejecta.
For this work we made several modifications to the code, including support for
Rosseland and Planck mean opacity tables and related changes needed for the simulations
presented here, alongside technical changes like parallelization and performance optimization.
With permission from the code writers, we published the modified version in a Git
repository (\url{https://github.com/roee2000/Urilight_SN}).
The Type~Ia supernova model is one-dimensional and spherically
symmetric, and the ejecta has two composition layers: an inner
$0.98~M_\odot$ layer of $^{56}{\rm Ni}$ and an outer $0.4~M_\odot$ layer of Si, S, Ar, and Ca.
The simulation starts at $t=2$~days and ends at $t=80$~days.
Energy is deposited by the $^{56}{\rm Ni}\rightarrow{}^{56}{\rm Co}\rightarrow{}^{56}{\rm Fe}$
decay chain through gamma-ray and positron transport. Radiation transport is performed with
photon packets emitted according to the fraction of the total gamma-ray and positron energy
deposited in each cell. Existing photon packets are propagated with effective scattering: when a
packet is absorbed it is not removed, but is re-emitted with a frequency sampled according to the local cell
emission spectrum.
The kilonova simulation uses a one-dimensional ejecta profile with total mass $0.05~M_\odot$,
from $t=0.05$ days to $t=100$ days.
The composition is the eight-element solar-derived mixture described in
\secref{SecRosseland}. The heating is
an external power law per unit mass \cite{korobkin2012kilonova},
$\dot{\epsilon}=10^{10}(t/1~{\rm day})^{-1.3}~{\rm erg~s^{-1}~g^{-1}}$.
We repeated the kilonova simulation for the six rescaled compositions, with $X_{\rm lan}$
between $10^{-6}$ and $10^{-1}$, using the matching opacity table in each case.
In the full frequency-group calculation, photon packets retain their frequency and interact with
frequency-dependent opacity groups. At each time step the simulation calculates the ionization
state of each material and processes its bound-bound line list at the local temperature and density.
In the single-group calculation, the photon mean free path is set by $\kappa_R^{\rm exp}$,
interpolated from the opacity table using local $(T,\rho,t)$.
The table value $f_{\rm abs}$ splits this into absorbing and scattering Rosseland means
($\kappa_R^{\rm abs}$ and $\kappa_R^{\rm scat}$) as described above.
The cell temperature is determined by requiring the emitted energy to match the
deposited energy; for this step we use $\kappa_P^{\rm abs}$, the Planck mean of the saturated
absorption opacity.
The Type~Ia model uses an exponential density profile matching the W7 model \cite{nomoto1984w7},
$\rho(v,t)=\rho_{\rm Ia,0}t^{-3}\exp(-v/v_e)$, normalized to $1.38~M_\odot$, with
$v_e=2.7\times10^8~{\rm cm~s^{-1}}$ ($0.009c$) and an outer edge at $0.093c$.
The kilonova model has a flat inner profile $\rho=\rho_0t^{-3}$ for $v<0.1c$ and
$\rho=\rho_0t^{-3}(v/0.1c)^{-4.5}$ for $0.1c<v<0.4c$, following
\cite{hotokezaka2020macronova}, with $\rho_0$ normalized to a total mass of $0.05~M_\odot$.
\figref{fig:comparison} compares the light curves obtained with the single-group calculation,
using $\kappa_R^{\rm exp}$, to the full frequency-group calculation for both ejecta
models. The one-group and multigroup results follow the same qualitative trends in both cases,
showing that the averaged opacity captures the main transport behavior while avoiding the cost of
recalculating the full frequency-dependent opacity during the transport calculation.
For the kilonova we show three lanthanide fractions spanning four decades,
$X_{\rm lan}=10^{-5}$, $10^{-2}$, and $10^{-1}$. At peak, the single-group luminosity is
$33\%$ brighter, $7\%$ fainter, and $17\%$ brighter than the multigroup value, respectively.
After about $10$~days all curves converge, because the ejecta become optically thin and the
luminosity simply tracks the heating rate regardless of the opacity.
\begin{figure*}[t]
% How to create (run from python_opac_calc2):
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_luminosity_models.py --png build_paper/figs/luminosity_models.png
\centering
\includegraphics[width=\textwidth]{figs/luminosity_models.png}
\caption{Bolometric luminosity from the Type~Ia (left) and kilonova (right) validation
simulations. For each model we compare the single-group calculation using $\kappa_R^{\rm exp}$
(solid, circles) with the corresponding full frequency-group calculation (dashed, squares).
The kilonova runs share the same ejecta profile and heating rate and differ only in the
lanthanide mass fraction of the composition, and hence in the opacity table.
The final observer times, which can receive photons emitted after the simulation ends, are
excluded by requiring $t<t_{\rm end}(1-\beta_{\rm max})$.}
\label{fig:comparison}
\end{figure*}
We define the effective optical depth from the ejecta edge as
$\tau_{\rm eff}=\tau_{\rm abs}(1+\tau_{\rm scat})$, where $\tau_{\rm abs}$ and
$\tau_{\rm scat}$ are the integrated absorption and scattering optical depths.
\figref{fig:trad_vs_phot} compares the multigroup escape-averaged radiation temperature
$T_{\rm rad}$ with the single-group plasma temperature at $\tau_{\rm eff}=1$.
At the earliest kilonova epochs, the single-group estimate is about $20$--$35\%$ below
$T_{\rm rad}$.
The curves are truncated once the outer ejecta cool below $0.15$~eV, because our model neither includes molecular
opacity nor provides opacity-table data in this regime.
\begin{figure}[t]
% How to create:
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_trad_paper.py
\centering
\includegraphics[width=\columnwidth]{figs/trad_vs_phot.png}
\caption{Multigroup escape-averaged radiation temperature compared with the single-group
plasma temperature at $\tau_{\rm abs}(1+\tau_{\rm scat})=1$ for Type~Ia and
three kilonova lanthanide fractions.}
\label{fig:trad_vs_phot}
\end{figure}
\figref{fig:profile_colormap} maps $T_{\rm plasma}$ and $\kappa_R^{\rm exp}$ in the Type~Ia
validation simulation on the $(v,t)$ grid. The temperature is taken from the URILIGHT profiles.
The opacity in each cell is interpolated from the precomputed NiCoFe and SN1A tables using local
$(T,\rho,t)$, with $\rho$ from homologous expansion and the ejecta geometry. The Ni/IME boundary
is marked by a black dashed line. With time, the ejecta cools and the outer layers become more
transparent.
On the opacity panel, the red curves are the $\tau_{\rm eff}=1$ surfaces: at each $t$ we
integrate $\tau_{\rm abs}$ and $\tau_{\rm scat}$ inward from the outer edge until
$\tau_{\rm abs}(1+\tau_{\rm scat})=1$. Each velocity shell has radial thickness
$\Delta R_i=t\,\Delta v_i$, and $f$ is a dimensionless path-length factor multiplying its optical depth.
We use $f=1$ for radial propagation and $f=3$ to approximate three-dimensional diffusion.
The cyan curves mark where the random-walk photon leakage time equals the dynamical time,
$t_{\rm phot}=t$, for the same two choices of $f$. For these curves, the cumulative optical
depth to shell $i$ is
$\tau_i=\tau_{i+1}+f\kappa_{R,i}^{\rm exp}\,\rho_i\,\Delta R_i$, with $\tau=0$ at the outer edge.
A diffusing photon does not cross a shell once: each scatter can send it back, so on average it
traverses the thickness $(2\tau_i+1)$ times before leaking outward.
Each traversal takes time $\Delta R_i/c$, so
\begin{equation}
\Delta t_i = \frac{(2\tau_i+1)\,\Delta R_i}{c}.
\end{equation}
Starting from the outer edge and accumulating inward, we locate the velocity where
$t_{\rm phot}=t$. Together, the red and cyan curves mark the effective photosphere and the
diffusion depth relevant at time $t$.
\begin{figure*}[t]
% How to create:
% cd ~/Documents/PHD/URILIGHT/python_opac_calc2
% python plot_profile_colormap.py --png build_paper/figs/profile_colormap_dreff_compare.png
\centering
\includegraphics[width=\textwidth]{figs/profile_colormap_dreff_compare.png}
\caption{$T_{\rm plasma}$ (left) and $\kappa_R^{\rm exp}$ (right) in the Type~Ia validation
simulation. The black dashed line marks the Ni/IME boundary.
On the opacity map, red curves show the $\tau_{\rm abs}(1+\tau_{\rm scat})=1$ surface and
cyan curves show the $t_{\rm phot}=t$ surface. Solid curves use $f=1$ and dashed curves use
$f=3$ (see text).}
\label{fig:profile_colormap}
\end{figure*}
\subsection{Runtime Advantage of Single-Group Transport}
The single-group calculation is faster for three main reasons. First, each photon packet
samples a Rosseland-mean transport opacity, so fewer packets are needed to obtain a stable
estimate of the frequency-averaged energy transport. In a multigroup calculation, the same
average behavior is recovered only statistically from packets distributed over frequency,
which requires more packets to reduce numerical noise. Second, each packet propagation is
cheaper. In a line-rich multigroup calculation, photons can repeatedly redshift into dense
groups of bound-bound lines, be absorbed after very short path lengths, and be re-emitted
until they enter a more transparent frequency window. These repeated short propagation
steps add many microsteps inside a single time step. The single-group calculation replaces
this behavior with an averaged mean free path, so packet histories contain fewer, more
uniform transport steps. Third, the multigroup calculation must recompute the
frequency-dependent opacity for every cell from its local $(T,\rho,t)$ by going through the
bound-bound line list of the material. The single-group calculation instead interpolates
one value from a precomputed opacity table.
The speedup depends on which part of the multigroup calculation is the bottleneck.
For example, for lanthanide-rich kilonova ejecta, where photon transport through many bound-bound lines
can dominate the runtime, the single-group calculation can be about 60 times faster and has
smaller numerical noise for the same number of packets.
\section{Typical Effective Rosseland Opacity}
\label{SecTypicalOpacity}
Analytic, semi-analytic, and simplified transport calculations of kilonovae require a gray
opacity for each ejecta component
\cite{villar2017combined,metzger2019kilonovae,collins2023critical,hotokezaka2020macronova,just2022properties}.
Common choices are $\kappa\simeq0.5$--$1$~cm$^2$/g for lanthanide-poor material and
$\kappa\simeq10$~cm$^2$/g for lanthanide-rich material. Their widespread use reflects the
practical need for a constant opacity, even when it is only approximate.
One approach is to fit the gray opacity to a multigroup light curve or to observations
\cite{tanaka2013radiative,villar2017combined}. A single constant does not always work.
Hotokezaka \& Nakar \cite{hotokezaka2020macronova} therefore used different opacities in the
outer and inner ejecta, while Banerjee et al.\ \cite{banerjee2024diversity} showed that no single
value reproduces every epoch of a lanthanide-rich multigroup light curve. Just et al.\
\cite{just2022properties} similarly used an opacity that varies with $X_{\rm lan}$ and $T$.
Another approach is to use a Planck mean as a proxy for the transport opacity
\cite{tanaka2020systematic}. This requires choosing representative values of $T$, $\rho$, and
$t$, and the result is not the Rosseland mean that controls diffusion.
\subsection{Determining the representative opacity}
\label{SecRepresentativeOpacity}
Our method supplies a physically defined gray transport opacity without fitting a light curve
or selecting a representative thermodynamic point. At each time we locate the diffusion surface
where $t_{\rm phot}=t$, denoted $t_{\rm diff}=t$ below, and interpolate
$\kappa_R^{\rm exp}(T,\rho,t)$ in the leaking envelope. We then define the
effective gray value as the column-mass-weighted Rosseland opacity outside
$t_{\rm diff}=t$,
\begin{equation}
\kappa_{\rm avg}(t)=
\frac{\displaystyle\int_{v_{\rm diff}}^{v_{\rm max}}
\kappa_R^{\rm exp}\rho\,t\,dv}
{\displaystyle\int_{v_{\rm diff}}^{v_{\rm max}}\rho\,t\,dv}
=\frac{\tau(v_{\rm diff})}{\Sigma(v_{\rm diff})}.
\label{eq:kappa_avg}
\end{equation}
This is the constant opacity that reproduces the same optical depth through the leaking
envelope at that time while following the temperature, density, and time actually sampled by
the transport.
\figref{fig:all_lanthanides_opacity} shows that the opacity decrease near
$T\simeq1.2$~eV is a nearly universal property of the high-opacity lanthanides in the
NIST/HFR atomic database adopted here, rather than a peculiarity of the lanthanides in our
eight-element mixture. At this temperature the triply ionized state (ion IV) becomes dominant.
Our frequency-dependent calculations for Nd, Eu, and Er show relatively low opacity,
$\kappa_{\rm exp}\lesssim0.1$~cm$^2$/g, at $h\nu/kT\lesssim2$, even while most of the spectrum
remains highly opaque. This likely reflects the smaller number of low-frequency lines of the
triply ionized ions. These low-opacity frequencies strongly reduce the harmonic Rosseland mean
but have much less influence on the Planck mean. The feature is present for all of
the lanthanides with large opacity in this database.
\begin{figure*}[t]
\centering
\includegraphics[width=\textwidth]{figs/all_lanthanides_opacity.pdf}
\caption{Temperature dependence of the effective expansion Rosseland mean (left) and
total Planck mean (right) for all lanthanides in the adopted NIST/HFR database, evaluated
at $\rho=10^{-13}$~g/cm$^3$ and $t=1$~day.}
\label{fig:all_lanthanides_opacity}
\end{figure*}
\figref{fig:kappa_composition_slices} isolates the corresponding temperature and density
dependence of the mixtures. At fixed $\rho=10^{-13}$~g/cm$^3$, increasing $X_{\rm lan}$
raises the opacity strongly below $T\simeq1$~eV. Around $T\simeq1.2$~eV, however, all five
kilonova curves fall toward the same opacity: they differ by less than a factor of two despite
five decades in $X_{\rm lan}$. The lanthanide lines no longer fill the low-frequency
Rosseland-weighted windows, and the non-lanthanide background sets the opacity floor. This
convergence explains why the earliest diffusion-surface opacity and luminosity depend only
weakly on $X_{\rm lan}$. The fixed-temperature slice shows that away from this transition the
composition ordering remains over the full density range.
\begin{figure*}[t]
% python plot_kappa_eff_paper.py --fig slices --png build_paper/figs/kappa_composition_slices.png
\centering
\includegraphics[width=\textwidth,height=0.36\textheight,keepaspectratio]{figs/kappa_composition_slices.png}
\caption{Effective expansion Rosseland opacity for the five kilonova compositions and one
Type~Ia outer-layer composition. Left: temperature dependence at
$\rho=10^{-13}$~g/cm$^3$. Right: density dependence at
$T=0.7$~eV. Both compositions are evaluated at exactly one day.}
\label{fig:kappa_composition_slices}
\end{figure*}
\figref{fig:kilonova_diffusion_surface} then shows the velocity, temperature, density, and
opacity sampled by the diffusion region.
\begin{figure*}[t]
% python plot_kappa_eff_paper.py --fig surface --png build_paper/figs/kilonova_diffusion_surface.png
\centering
\includegraphics[width=\textwidth,height=0.72\textheight,keepaspectratio]{figs/kilonova_diffusion_surface.png}
\caption{Properties sampled by the diffusion region. Top: velocity, plasma temperature, and
density at the kilonova diffusion surface $t_{\rm diff}=t$, for six lanthanide mass fractions.
The dotted line marks $T=1.8$~eV. Bottom left: local Type~Ia opacity at the diffusion surface.
Bottom right: column-averaged kilonova opacity outside the diffusion surface. Black markers
show where each surface crosses $v_{\rm diff}=0.3c$ and $0.1c$.}
\label{fig:kilonova_diffusion_surface}
\end{figure*}
Increasing $X_{\rm lan}$ keeps the kilonova diffusion surface at larger velocity and lower
density for longer. At the earliest times all six surfaces lie at
$T_{\rm eff}\simeq1.5$--$1.8$~eV, where the opacity tables converge. Their early
$\kappa_{\rm avg}$ values consequently differ by less than a factor of two, and the light curves
in \figref{fig:comparison} initially show little lanthanide dependence. As the surface cools,
the lanthanide contribution becomes important and the luminosities separate. The diffusion
surface never exceeds $1.8$~eV; hotter cells lie deeper and do not set the emerging luminosity.
The lower panels show the opacity itself. For the Type~Ia calculation the diffusion surface is
already inside the $^{56}$Ni-rich layer at the first simulated epoch:
$v_{\rm diff}<0.029c$, whereas the Ni/outer-layer boundary is at $0.033c$. We therefore quote
only the local Ni-rich opacity at that surface,
$\kappa_R^{\rm exp}(v_{\rm diff})\simeq0.05$--$0.07$~cm$^2$/g over the simulated interval.
For the kilonova, after the short high-temperature phase, each composition has an extended
interval over which $\kappa_{\rm avg}$ changes slowly. The black markers delimit
$0.1c<v_{\rm diff}<0.3c$; averaging over this interval gives $0.36$, $0.37$, $0.39$, $0.99$, $4.64$, and
$18.45$~cm$^2$/g for $X_{\rm lan}=10^{-6}$, $10^{-5}$, $10^{-4}$, $10^{-3}$,
$10^{-2}$, and $10^{-1}$, respectively. These values naturally recover the usual lanthanide-poor and
lanthanide-rich opacity scales without calibrating to the light curves.
\subsection{A composition-dependent gray-opacity prescription}
To test whether the inferred values depend strongly on the assumed ejecta profile, we repeated
the six-composition calculation for outer density slopes $\alpha=-3.5$, $-4.5$, and $-5.5$,
and for ejecta masses $0.1$ and $10$ times the fiducial mass. For each run we average
\eqref{eq:kappa_avg} over the time during which
$0.1c<v_{\rm diff}<0.3c$, weighting uniformly in $\ln t$. This selects the phase during which
the diffusion surface crosses the power-law envelope and excludes the final transparent phase,
when the luminosity no longer depends on opacity.
A single fit in $\ln\kappa$ to all 30 simulations gives
\begin{equation}
\boxed{\displaystyle
\kappa_{\rm avg}(X_{\rm lan}) =
0.34 + 99\,X_{\rm lan}^{0.72}\ {\rm cm^2\,g^{-1}} .}
\label{eq:kappa_xlan}
\end{equation}
\begin{figure*}[!t]
% python plot_kappa_eff_paper.py --fig kappax --png build_paper/figs/kappa_vs_xlan.png
\centering
\includegraphics[width=\textwidth,height=0.36\textheight,keepaspectratio]{figs/kappa_vs_xlan.png}
\caption{Composition dependence of the representative gray opacity. Left: density profiles at
one day; the shaded region marks $0.1c<v<0.3c$. Right: logarithmic-time-weighted mean and
standard deviation of $\kappa_{\rm avg}$ while the diffusion surface crosses that interval.
Colors identify ejecta profiles rather than compositions. The dashed curve is one fit to all
30 simulations, given by \eqref{eq:kappa_xlan}.}
\label{fig:kappa_xlan}
\end{figure*}
\figref{fig:kappa_xlan} shows that composition produces a nearly two-order-of-magnitude change,
whereas changing the density profile mainly shifts the normalization. The fit applies only to
our adopted eight-element composition and atomic data; different representative elements or a
more complete atomic model can give different coefficients. It should therefore be treated as
an approximate prescription rather than a universal opacity. Its sublinear exponent and
low-$X_{\rm lan}$ floor are consistent with the saturation of strong lanthanide lines discussed
by Kasen et al.\ \cite{kasen2013opacities} and with the empirical prescription of
Just et al.\ \cite{just2022properties}; the difference is that \eqref{eq:kappa_xlan} is derived from the
Rosseland transport opacity rather than fitted to a bolometric light curve.
\subsection{Why an approximately constant opacity produces a power-law light curve}
As shown in \secref{SecRepresentativeOpacity}, the effective opacity remains nearly constant
through most of the diffusion-dominated phase. We can therefore use a constant-opacity
analytical model to explain the kilonova luminosity plateau in \figref{fig:comparison}.
Consider homologous ejecta with gray opacity $\kappa$,
density $\rho(v,t)=A t^{-3}v^\alpha$, and heating per unit mass
$\dot{\epsilon}\propto t^{-\beta}$. The optical depth exterior to velocity $v$ is
\begin{equation}
\tau(v,t)=\int_v^{v_{\rm max}}\kappa\rho\,t\,dv'
\propto \kappa t^{-2}v^{\alpha+1},
\end{equation}
where the outer-boundary term is negligible for $\alpha<-1$ and
$v\ll v_{\rm max}$. With $t_{\rm diff}\sim\tau vt/c$, the diffusion surface
$t_{\rm diff}=t$ follows
\begin{equation}
v_{\rm diff}(t)\propto
\left(\frac{t^2}{\kappa}\right)^{1/(\alpha+2)}.
\end{equation}
The mass exterior to this surface is $M(>v_{\rm diff})\propto
v_{\rm diff}^{\alpha+3}$ for $\alpha<-3$. While the diffusion surface is inside the
power-law envelope, the luminosity is therefore
\begin{equation}
L(t)\simeq \dot{\epsilon}(t)M(>v_{\rm diff})
\propto
\kappa^{-(\alpha+3)/(\alpha+2)}
t^{-\beta+2(\alpha+3)/(\alpha+2)} .
\label{eq:kilonova_powerlaw}
\end{equation}
For our $\alpha=-4.5$ profile and $\beta=1.3$ heating law,
$L\propto\kappa^{-0.6}t^{-0.1}$, so the luminosity is almost constant while the
diffusion surface moves through the power-law envelope. This is the same physical scaling used
in analytic kilonova models \cite{waxman2018constraints}. It explains both features of the
kilonova panel in \figref{fig:comparison}: each composition produces an extended luminosity
plateau, while increasing $X_{\rm lan}$ raises $\kappa$ and lowers the plateau approximately as
$\kappa^{-0.6}$. Once the ejecta become transparent,
all of the deposited energy escapes and $L$ instead approaches
$M_{\rm ej}\dot{\epsilon}\propto t^{-1.3}$, as seen after approximately ten days in
\figref{fig:comparison}.
\section{Summary}
\label{SecSummary}
We introduced the effective expansion opacity,
$\kappa_{\rm exp}=1/(\rho\Delta x)$, based on the distance an outward-travelling photon covers
before reaching optical depth unity in homologous expansion. Taking its Rosseland mean defines
$\kappa_R^{\rm exp}$, a gray transport opacity that accounts for bound-bound interactions
encountered as the photon redshifts. Unlike the ordinary Rosseland mean of narrow lines,
$\kappa_R^{\rm exp}$ converges with frequency resolution. Its ratio to the Planck mean varies
strongly with temperature and density and reaches approximately $10^2$ for the kilonova
composition, showing that the Planck mean is not a reliable transport-opacity proxy.
Single-group URILIGHT calculations using $\kappa_R^{\rm exp}$ reproduce the main light-curve trends
of multigroup calculations for Type~Ia supernova and three kilonova compositions spanning four
decades in $X_{\rm lan}$. The kilonova peak luminosities differ by $7$--$33\%$, while allowing the
calculation to run faster by orders of magnitude.
For kilonova ejecta, we constructed an eight-element composition from the solar $r$-process
residual pattern and varied its lanthanide mass fraction from $X_{\rm lan}=10^{-6}$ to $10^{-1}$.
Following the temperature, density, and opacity sampled by the diffusion region gives
representative opacities from $0.36$ to $18.45$~cm$^2$/g. For the adopted composition and atomic
data, the tested ejecta profiles are approximately described by
$\kappa_{\rm avg}=0.34+99X_{\rm lan}^{0.72}$~cm$^2$/g. These coefficients are model dependent and
should not be interpreted as a universal opacity prescription. The effective opacity remains
nearly constant during most of the diffusion-dominated phase, explaining the luminosity plateau
through the scaling $L\propto\kappa^{-0.6}t^{-0.1}$.
The Python code for building opacity tables using this algorithm is available at
\url{https://github.com/roee2000/expansion_opacity_calculation}.
\bibliographystyle{elsarticle-num}
\bibliography{refs}
\end{document}