Configuration (config.toml)¶
The model is configured by a single TOML file named
config.toml in the model folder. It is parsed by
agb::ModelConfig (src/config/config.cpp) using toml++.
Conventions¶
Stellar parameters are given in solar units and converted to cgs internally.
The parser is lenient about numeric types: an integer literal also satisfies a floating-point key and vice versa (e.g.
resolution = 1000is accepted for adoublefield).Any missing key falls back to a built-in default defined in
src/config/config.h. Only the[star]block, the starting model, the spectral grid, and the opacity list are practically required.Output and data paths are interpreted relative to the model folder (except the opacity
pathand dustrefractive_index_file, which are full paths).
A complete annotated example is shown at the bottom of this page.
[star] — stellar parameters¶
Key |
Units |
Description |
|---|---|---|
|
\(R_\odot\) |
Stellar (reference) radius \(R_\star\). |
|
\(M_\odot\) |
Stellar mass \(M_\star\) (sets gravity). |
|
\(L_\odot\) |
Stellar luminosity \(L_\star\) (the flux target the temperature correction drives toward and the driving luminosity of the wind). |
|
\(M_\odot\,\mathrm{yr}^{-1}\) |
Mass-loss rate. Used as a prescribed value or as the seed for the eigenvalue solve, depending on the wind setup. |
|
— |
Carbon-to-oxygen ratio. Must be > 1 for a carbon star; the condensable carbon is \(\varepsilon_C-\varepsilon_O\) (all oxygen is assumed locked in CO). |
[model]¶
Key |
Description |
|---|---|
|
A path to a structure file (format), or
the literal |
|
FastChem parameter / element-abundance file (relative to the model folder). |
[spectral_grid]¶
Key |
Units |
Description |
|---|---|---|
|
μm |
Lower wavelength bound of the spectral grid. |
|
μm |
Upper wavelength bound. |
|
— |
Constant spectral resolving power \(R=\lambda/\Delta\lambda\) of the internal grid. |
|
— |
Number of impact parameters that intersect the stellar core, used by the ray (impact-parameter) radiative-transfer geometry. Default 20. |
[radiative_transfer]¶
Key |
Default |
Description |
|---|---|---|
|
30 |
Maximum number of variable-Eddington-factor iterations per RT solve. |
|
1e-4 |
Relative convergence criterion of the RT iteration. |
|
false |
Use cubic-spline ( |
|
true |
Compute the frequency-integrated flux from the flux-divergence form (thesis eq. 2.59), consistent with the moment-equation solve, so \(r^2 H\) is conserved at radiative equilibrium. The per-frequency flux stays on the transport form (eq. 2.58) so the monochromatic spectrum is non-negative. |
[temperature]¶
This block controls the radiative-equilibrium temperature determination (Radiative-equilibrium temperature correction) and its robustness machinery (Numerical methods and robustness).
Core¶
Key |
Default |
Description |
|---|---|---|
|
200 |
Maximum number of global (outer) temperature iterations. |
|
1e-2 |
Convergence threshold applied jointly to the flux deviation, the gas and dust energy-balance residuals, and the maximum relative temperature change. |
|
0.005 |
Per-step cap on \(|\Delta T|/T\). Keeps each step small enough for the interleaved hydro–dust cycle to re-converge. |
|
true |
Apply a 1–2–1 smoothing pass to the temperature profile. |
|
false |
Hard-clip the profile to be strictly outward-decreasing (\(T_i\to0.99\,T_{i-1}\)). Default off — it fights the correction wherever radiative equilibrium wants a flatter profile or a dust-front inversion and drives a ±cap limit cycle. |
Full-linearisation corrector¶
Key |
Default |
Description |
|---|---|---|
|
true |
Enable the full-linearisation (Newton) corrector in addition to / instead of Unsöld–Lucy. |
|
0.5 |
Global under-relaxation of the Newton step (dust-front stability). |
|
true |
Two-phase corrector: start with the robust Unsöld–Lucy iteration and latch
onto the linearisation only once it is safe. Set |
|
0.5 |
Switch when |
|
3e-2 |
… and the max radiative-equilibrium residual is below this … |
|
3 |
… for this many consecutive steps (then latch one-way). |
|
true |
Add the composite flux-constancy term (thesis eq. 3.64/3.65) to the local-RE constraint. See Radiative-equilibrium temperature correction. |
|
1.0 |
Weight \(\xi\) of the local radiative-equilibrium term. |
|
1.0 |
Optical-depth scale in \(\zeta(r)=\tau/(\tau+\tau_\mathrm{scale})\), the depth-dependent weight of the flux-constancy term. |
Robustness (Unsöld–Lucy under-relaxation and Anderson)¶
Key |
Default |
Description |
|---|---|---|
|
1.0 |
Initial per-layer under-relaxation factor \(\omega\). |
|
0.05 / 1.0 |
Floor / ceiling for \(\omega\). |
|
0.5 |
Factor applied to \(\omega\) when the correction flips sign (oscillation). |
|
1.3 |
Factor applied to \(\omega\) when the correction keeps its sign. |
|
true |
Enable Anderson mixing on the temperature profile. |
|
4 |
History depth \(m\) of the Anderson mixing. |
|
2 |
Number of plain damped iterations before acceleration starts. |
|
0.5 |
Accelerate only once |
[hydrodynamics]¶
Key |
Default |
Description |
|---|---|---|
|
200 |
Maximum number of chemistry–hydrodynamics inner iterations. |
|
1e-2 |
Relative convergence threshold on the radiative acceleration \(\alpha\). |
|
false |
Use the Henyey global-Newton structure solver instead of the Melia |
[grid] — only used for starting_model = "grey"¶
Key |
Default |
Description |
|---|---|---|
|
260 |
Number of logarithmically spaced radial cells. |
|
1.0 |
Inner boundary in units of \(R_\star\). |
|
25.0 |
Outer boundary in units of \(R_\star\). |
|
1.0e-4 |
Grey gas mass-opacity (\(\mathrm{cm^2\,g^{-1}}\)) that sets the optical-depth scale and hence the photospheric density of the seed. |
[dust]¶
Key |
Description |
|---|---|
|
Path to the optical constants (complex refractive index vs. wavelength) of the dust material, e.g. amorphous carbon (Rouleau, Maron). Fed to Mie theory to produce the grain absorption/scattering efficiencies. |
[movable_grid] — adaptive radial grid (default off)¶
See Numerical methods and robustness for the equidistribution scheme.
Key |
Default |
Description |
|---|---|---|
|
false |
Master switch for the movable grid. |
|
5 |
Redistribute nodes every N outer iterations. |
|
0.1 |
Under-relaxation \(\omega_\mathrm{grid}\) of the node motion. |
|
1.0 |
Weight of the flux-mean extinction in the monitor function. |
|
0.0 |
Weight of the gas temperature. |
|
1.0 |
Weight of the dust nucleation rate. |
|
1.0 |
Weight of the wind velocity (clusters nodes at the sonic point). |
|
4 |
Number of smoothing passes applied to the monitor. |
|
20.0 |
Cap on the monitor (maximum cell-size ratio). |
|
1e-8 |
Per-quantity floor relative to its peak. |
[opacity]¶
Key |
Description |
|---|---|
|
Absolute path to the opacity database (HELIOS-K cross-section folders).
The wavenumber grid is read from |
|
An array of |
[output]¶
Each value is a path relative to the model folder; an empty value or "none"
disables that output.
Key |
Output |
|---|---|
|
Converged structure (format). |
|
Emergent spectrum. |
|
Dust distribution and moments. |
|
Wind structure. |
Complete example (IRC+10216)¶
# AGB dust-driven wind model configuration (IRC+10216)
[star]
radius = 1050.0 # R_sun
mass = 0.7 # M_sun
luminosity = 3.0e4 # L_sun
mass_loss_rate = 8.0e-5 # M_sun / yr
c_o_ratio = 1.40
[model]
starting_model = "atmosphere_converged.dat" # a path, or "grey"
fastchem_parameter_file = "fastchem_parameters.dat"
[spectral_grid]
min_wavelength = 0.3 # micron
max_wavelength = 50.0 # micron
resolution = 1000
[radiative_transfer]
nb_iterations = 40
convergence = 1.0e-4
use_spline_discretisation = false
flux_from_divergence = true
[temperature]
nb_iterations = 300
convergence = 1.0e-3
max_relative_change = 0.01
smooth_profile = false
use_linearisation = true
linearisation_relaxation = 0.5
linearisation_start_unsoeld_lucy = true
linearisation_switch_dt_fraction = 0.5
linearisation_switch_re_residual = 0.03
linearisation_switch_count = 3
linearisation_flux_constraint = true
linearisation_xi = 1.0
linearisation_zeta_tau_scale = 1.0
[hydrodynamics]
nb_iterations = 60
convergence = 1.0e-3
use_henyey_solver = false
[dust]
refractive_index_file = "../opacity_data/Amorphous_C_Rouleau.dat"
[movable_grid]
enabled = false
[opacity]
path = "/media/data/opacity_data/helios-k/"
species = [
{ symbol = "CIA-H2-H2", folder = "CIA/H2-H2" },
{ symbol = "CIA-H2-He", folder = "CIA/H2-He" },
{ symbol = "CIA-H-He", folder = "CIA/H-He" },
{ symbol = "H-", folder = "none" },
{ symbol = "H2", folder = "none" },
{ symbol = "He", folder = "none" },
{ symbol = "H", folder = "none" },
{ symbol = "H2O", folder = "Molecules/1H2-16O__POKAZATEL_e2b" },
{ symbol = "CO", folder = "Molecules/12C-16O__Li2015_e2b" },
{ symbol = "CO2", folder = "Molecules/12C-16O2__UCL-4000_e2b" },
{ symbol = "C2H2", folder = "Molecules/12C2-1H2__aCeTY_e2b" },
]
[output]
spectrum = "spectrum.dat"
atmosphere = "atmosphere.dat"
dust = "dust.dat"
hydro = "hydro.dat"