Skip to content

Commit e58e939

Browse files
committed
adding colors defaults linking in makefile, todos for docs, changelogs
1 parent de4c984 commit e58e939

File tree

6 files changed

+222
-1
lines changed

6 files changed

+222
-1
lines changed

colors/make/makefile_base

+6-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ nodeps : $(.DEFAULT_GOAL)
5757
#
5858
# COMPILATION RULES
5959

60-
COMPILE = $(COMPILE_TO_DEPLOY) $(FCfree)
60+
MOD_DEFAULTS_DIR = $(MODULE_DIR)/defaults
61+
INCLUDE_DEFAULTS = -I$(MOD_DEFAULTS_DIR)
62+
63+
MOD_INCLUDES = $(INCLUDE_DEFAULTS)
64+
65+
COMPILE = $(COMPILE_TO_DEPLOY) $(FCfree) $(MOD_INCLUDES)
6166

6267
COMPILE_CMD = $(COMPILE)
6368

docs/source/changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Removed `file_extension` option because it is redundant with `file_device`. Dele
2727
New Features
2828
------------
2929

30+
NEW ``colors`` MODULE!!! TODO: describe HERE
31+
3032
``mesa_reader`` can now be installed with ``pip``.
3133

3234
A pseudo drag term ``v_drag`` has been reintroduced for ``u_flag`` to damp spurious shocks.

docs/source/colors/defaults.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../colors/defaults/colors.defaults

docs/source/colors/interface.rst

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======================
2+
colors module Interface
3+
=======================
4+
5+
XXX TODO XXX
6+
The primary entry point to the colors module is through the routine ``colors_get``. Broadly, one provides the density, temperature and full composition information, as well as information about the free electron fraction and electron chemical potential (required for calculation of the Compton scattering opacity). Then the module returns the opacity and its temperature and density derivatives.
7+
8+
9+
.. literalinclude:: ../../../colors/public/colors_lib.f90
10+
:language: fortran
11+
:start-at: subroutine colors_get
12+
:end-at: end subroutine colors_get
13+
:linenos:

docs/source/colors/overview.rst

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
Overview of colors module
2+
=========================
3+
4+
XXX TODO XXX
5+
6+
The opacity values returned by the ``kap`` module combine opacity
7+
data from many sources. The most important opacity-related MESA
8+
options select which opacity sources to use and control the location
9+
of the blends between them. The total opacity is the appropriately
10+
combined radiative opacity :math:`\kappa_{\rm rad}` and the conductive
11+
opacity :math:`\kappa_{\rm cond}`:
12+
13+
.. math::
14+
15+
\frac{1}{\kappa} = \frac{1}{\kappa_{\rm rad}} + \frac{1}{\kappa_{\rm cond}} ~.
16+
17+
18+
Radiative Opacities
19+
-------------------
20+
21+
The radiative opacity is the Rosseland mean opacity. The opacity
22+
depends on the temperature, density, and composition. A set of
23+
opacity tables consists of a collection of individual opacity tables,
24+
each at a different composition. Each individual table is
25+
tabulated in :math:`\log T` and in :math:`\log R \equiv \log \rho - 3
26+
\log T + 18` (cgs).
27+
28+
For tables that assume a fixed metal distribution, the composition can
29+
be encoded via the variables :math:`(X, Z)`. Tables assume a
30+
particular metal abundance pattern (usually scaled solar). Some opacity
31+
table sets include additional parameters in order to allow the metal
32+
abundance pattern (often the CNO abundances) to vary. Such
33+
variation naturally occurs in the stellar core during helium burning
34+
(and beyond) and in the stellar envelope as a result of dredge-up
35+
processes.
36+
37+
38+
.. note::
39+
40+
The value of the option :ref:`kap/defaults:Zbase` provides the reference
41+
metallicity necessary to calculate element variations (e.g., carbon
42+
and oxygen enhancement) from the composition of a cell. The
43+
default opacity configuration requires this value to be specified.
44+
Physically, this usually corresponds to the initial metallicity of
45+
the star.
46+
47+
48+
In MESA, separate opacity table sets are used for high and low
49+
temperature. In the intermediate region, both opacities are evaluated
50+
and blended. The location of this blend is controlled with the
51+
options :ref:`kap/defaults:kap_blend_logT_upper_bdy` and
52+
:ref:`kap/defaults:kap_blend_logT_lower_bdy`.
53+
54+
55+
56+
------------------------------------------------
57+
High temperature :math:`(T \gtrsim 10^4\,\rm K)`
58+
------------------------------------------------
59+
60+
The OPAL tables (|OPAL|) with fixed metal distributions are called
61+
Type 1 and cover the region :math:`0.0 \leq X \leq 1-Z` and
62+
:math:`0.0\leq Z \leq 0.1`. The Opacity Project
63+
(OP; |OP|) are also available. Type 1 tables from The Los Alamos
64+
OPLIB database (OPLIB; |OPLIB|) are also available, and cover the
65+
region :math:`0.0 \leq X \leq 1-Z` and
66+
:math:`0.0\leq Z \leq 0.2`. The set of tables to be used are
67+
selected by the option :ref:`kap/defaults:kap_file_prefix`.
68+
69+
A direct comparison between the Type 1 format of OPAL/OP tables and
70+
the OPLIB tables are shown in the figure below
71+
taken from Figure 1 in `Farag et al. 2024 <https://doi.org/10.3847/1538-4357/ad4355>`_. Further comparisons
72+
between OP/OPAL/OPLIB can be found in `Farag et al. 2024 <https://doi.org/10.3847/1538-4357/ad4355>`_.
73+
74+
75+
.. figure:: type1_format.png
76+
:alt: kap blends in solar-like compositions
77+
78+
Location of each Type-1 opacity table in the :math:`X–Z` plane (left panel) and the
79+
log:math:`T`–log:math:`R` plane (right panel). Orange circles mark the location of
80+
the 126 OPAL Type-1 tables (Rogers & Iglesias 1992). Blue circles
81+
mark the location of the new 1194 Type-1 opacity tables (Farag et al. 2024).
82+
83+
Additionally, there is support for the OPAL Type 2 tables that allow
84+
for varying amounts of C and O beyond that accounted for by :math:`Z`;
85+
these are needed during helium burning and beyond. These have a range
86+
:math:`0.0 \leq X \leq 0.7`, :math:`0.0\leq Z\leq0.1`. The set of
87+
tables to be used are selected by the option :ref:`kap/defaults:kap_CO_prefix`.
88+
89+
Type 2 tables on by default (see :ref:`kap/defaults:use_Type2_opacities`) and The
90+
blends between these table sets occur based on hydrogen fraction
91+
(see :ref:`kap/defaults:kap_Type2_full_off_X` and :ref:`kap/defaults:kap_Type2_full_on_X` and )
92+
and metal enhancement (controlled by :ref:`kap/defaults:kap_Type2_full_off_dZ` and
93+
:ref:`kap/defaults:kap_Type2_full_on_dZ`).
94+
95+
96+
-------------------------------------------------
97+
Low temperature :math:`(T \lesssim 10^4\,\rm K)`
98+
-------------------------------------------------
99+
100+
Low temperature opacities are selected with the option
101+
:ref:`kap/defaults:kap_lowT_prefix`.
102+
103+
Tables based on the work of |Fergusson| include the effects of
104+
molecules and grains and cover the range
105+
:math:`2.7 \le \log T \le 4.5` and :math:`-8 \le \log R \le 1`.
106+
107+
Tables based on the work of |Freedman| include the effects of
108+
molecules and cover the range :math:`1.88 \le \log T \le 4.5` and
109+
:math:`-8 \le \log R \le 9`. The table set was privately communicated
110+
by R. S. Freedman in 2011. Unlike other opacity sources, this is a 1D
111+
sequence of tables in :math:`Z` as opposed to a 2D grid of
112+
:math:`(X,Z)` values. (The assumed H/He abundances scale with
113+
:math:`Z`.)
114+
115+
116+
Tables from ÆSOPUS (|AESOPUS|) include variation factors for the CNO
117+
isotopes. The opacity is evaluated using the global value of
118+
:math:`Z_{\rm base}` and the local (cell) values of :math:`(X, X_{\rm
119+
C}, X_{\rm N}, X_{\rm O})`.
120+
121+
The ÆSOPUS tables are provided at a set of reference metalicites. In
122+
order to interpolate to the provided :math:`Z_{\rm base}`, the opacity
123+
is evaluated at an appropriate subset of these reference values (and
124+
then interpolated). For each such :math:`Z_{\rm ref}`, the ÆSOPUS
125+
composition parameters
126+
127+
.. math::
128+
129+
\begin{eqnarray*}
130+
f_{\rm CO} = \log(X_{\rm C}/X_{\rm O}) - f_{\rm CO, ref} \\
131+
f_{\rm C} = \log(X_{\rm C}/Z_{\rm ref}) - f_{\rm C, ref} \\
132+
f_{\rm N} = \log(X_{\rm N}/Z_{\rm ref}) - f_{\rm N, ref} \\
133+
\end{eqnarray*}
134+
135+
are calculated, the opacities evaluated the tables with bracketing
136+
compositions, and the resulting opacities linearly interpolated.
137+
(Note that this means that the interpolation in :math:`Z` occurs at
138+
fixed :math:`X` and :math:`f_{\rm CO}`, but not at fixed :math:`f_{\rm
139+
C}` or :math:`f_{\rm N}`.)
140+
141+
------------------
142+
Compton Scattering
143+
------------------
144+
145+
At sufficiently high temperature :math:`(T \gtrsim 10^8\,\rm K)`, the
146+
opacity will be dominated by Compton scattering. MESA calculates the
147+
opacity of Compton scattering using the prescription of |P17|. Near the
148+
high-:math:`T` and low-:math:`R` edges of the high temperature opacity
149+
tables, MESA smoothly blends the tabulated opacity values with the
150+
Compton scattering values. The location of these blends is not
151+
user-controllable.
152+
153+
Conductive Opacities
154+
--------------------
155+
156+
The conductive opacity :math:`(\kappa_{\rm cond})` is given by the
157+
thermal conductivity :math:`(K)` appropriately recast such that the heat
158+
transfer equation resembles the form of the equation used in radiative
159+
diffusion (e.g., HKT Section 4.5). This implies
160+
161+
.. math::
162+
163+
\kappa_{\rm cond} = \frac{16 \sigma_{\rm SB} T^3}{\rho K} ~.
164+
165+
The thermal conductivities used in MESA are an extended version of the
166+
results of |Cassisi| privately communicated by A.Y. Potekhin. They
167+
are tabulated for a set of :math:`1 \le \bar{Z} \le 60`. Each table
168+
spans :math:`-6 \le \log(\rho/\rm g\,cm^{-3}) \le 11.50` and :math:`3
169+
\le \log(T/\rm K) \le 10`.
170+
171+
For H and He in the regime of moderate coupling and moderate
172+
degeneracy, the additional correction formulae of |B20| are applied.
173+
174+
.. |P17| replace:: `Poutanen (2017) <https://ui.adsabs.harvard.edu/abs/2017ApJ...835..119P/abstract>`__
175+
176+
.. |B20| replace:: `Blouin et al. (2020) <https://ui.adsabs.harvard.edu/abs/2020ApJ...899...46B/abstract>`__
177+
178+
.. |Fergusson| replace:: `Ferguson et al. (2005) <https://ui.adsabs.harvard.edu/abs/2005ApJ...623..585F/abstract>`__
179+
180+
.. |Freedman| replace:: `Freedman et al. (2008) <https://ui.adsabs.harvard.edu/abs/2008ApJS..174..504F/abstract>`__
181+
182+
.. |AESOPUS| replace:: `Marigo & Aringer 2009 <https://ui.adsabs.harvard.edu/abs/2009A%26A...508.1539M/abstract>`__
183+
184+
.. |OPAL| replace:: Iglesias & Rogers `1993 <https://ui.adsabs.harvard.edu/abs/1993ApJ...412..752I/abstract>`__, `1996 <https://ui.adsabs.harvard.edu/abs/1996ApJ...464..943I/abstract>`__
185+
186+
.. |OP| replace:: `Seaton 2005 <https://ui.adsabs.harvard.edu/abs/2005MNRAS.362L...1S/abstract>`__
187+
188+
.. |OPLIB| replace:: `Colgan 2016 <https://ui.adsabs.harvard.edu/abs/2016ApJ...817..116C/abstract>`__
189+
190+
.. |Cassisi| replace:: `Cassisi et al. (2007) <https://ui.adsabs.harvard.edu/abs/2007ApJ...661.1094C/abstract>`__
191+

docs/source/using_mesa/running.rst

+9
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,15 @@ do this your inlist might look like:
272272
/ ! end of kap namelist
273273

274274

275+
&colors
276+
! colors options
277+
! see colors/defaults/colors.defaults
278+
use_Type2_opacities = .true.
279+
Zbase = 0.02
280+
281+
/ ! end of colors namelist
282+
283+
275284
&controls
276285
! see star/defaults/controls.defaults
277286

0 commit comments

Comments
 (0)