aragog.config
The aragog.config package provides the modern attrs-based configuration classes and the Config facade used by the PROTEUS wrapper. Each subclass corresponds to one TOML section; the facade composes them into a legacy Parameters object that the solver consumes internally.
| Name | Role |
|---|---|
Config |
Top-level facade. Static constructors from_toml(path), from_dict(data), and from_file(*paths) return a legacy Parameters ready for EntropySolver. |
BoundaryConfig |
Surface and core boundary settings: outer_boundary_condition, inner_boundary_condition, emissivity, core_bc mode (energy_balance default, quasi_steady, gradient, bower2018, core_module), the core_module_params of the core_module mode, UTBL toggle. |
EnergyConfig |
Physics toggles (conduction, convection, gravitational separation, mixing, radionuclides, tidal), eddy-diffusivity ratio, tidal-array buffer. |
InitialConditionConfig |
IC type (linear, user-defined, adiabatic), surface and basal temperatures, init-file path. |
MeshConfig |
Mesh geometry, EOS method (Adams-Williamson or user-defined), surface density, gravity, bulk modulus, mass-coordinate flag, surface pressure. |
MixedPhaseConfig |
Mushy-zone parameters: latent heat, rheological transition, smoothing widths, solidus/liquidus paths, cp_blend strategy, separation_viscosity drag source, separation_buoyancy buoyancy reference. |
PhaseConfig |
Single-phase (solid or liquid) properties: density, heat capacity, conductivity, expansivity, viscosity, optional entropy lookup. Each property accepts a float or a path-string lookup. |
SolverConfig |
ODE driver settings: start_time, end_time, atol, rtol, surface-T step cap. |
For the TOML field syntax expected on disk, see How-to: configuration.
The facade returns a Parameters dataclass tree from the legacy aragog.parser module; that is the object EntropySolver actually consumes internally. The attrs Config classes documented here are the public construction surface.
Facade
Config
Top-level Aragog configuration.
Facade that constructs a Parameters object from attrs-based
sub-configs or from TOML/dict input. Solver consumes the
Parameters instance directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solver
|
dict
|
ODE solver parameters. |
required |
boundary_conditions
|
dict
|
Boundary condition parameters. |
required |
mesh
|
dict
|
Mesh parameters. |
required |
energy
|
dict
|
Energy source toggles. |
required |
initial_condition
|
dict
|
Initial condition parameters. |
required |
phase_liquid
|
dict
|
Liquid phase properties. |
required |
phase_solid
|
dict
|
Solid phase properties. |
required |
phase_mixed
|
dict
|
Mixed phase parameters. |
required |
radionuclide_
|
Radionuclide sections (any key starting with 'radionuclide_'). |
required |
from_dict(data, config_dir=None)
staticmethod
Construct a Parameters object from a nested dictionary.
This is the primary construction path used by the PROTEUS wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Nested dictionary with section names as keys. |
required |
config_dir
|
path - like
|
Directory of the file |
None
|
Returns:
| Type | Description |
|---|---|
Parameters
|
Legacy Parameters object, ready for Solver. |
Source code in src/aragog/config/__init__.py
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 | |
from_file(*filenames)
staticmethod
Load from a file, auto-detecting format (TOML or INI).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filenames
|
str
|
One or more file paths. |
()
|
Returns:
| Type | Description |
|---|---|
Parameters
|
|
Source code in src/aragog/config/__init__.py
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 | |
from_toml(filename)
staticmethod
Load configuration from a TOML file and return a Parameters object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the TOML file. |
required |
Returns:
| Type | Description |
|---|---|
Parameters
|
Legacy Parameters object, ready for Solver. |
Source code in src/aragog/config/__init__.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
Boundary conditions
BoundaryConfig
Boundary condition parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outer_boundary_condition
|
int
|
1: Grey-body, 2: Zahnle, 3: Atmodeller, 4: Prescribed flux, 5: Prescribed T |
required |
outer_boundary_value
|
float
|
Value for outer BC (flux in W/m^2 or T in K, depending on type). |
required |
inner_boundary_condition
|
int
|
1: Core cooling, 2: Prescribed flux, 3: Prescribed T |
required |
inner_boundary_value
|
float
|
Value for inner BC. |
required |
emissivity
|
float
|
Surface emissivity for grey-body BC. |
required |
equilibrium_temperature
|
float
|
Equilibrium temperature for grey-body BC [K]. |
required |
core_heat_capacity
|
float
|
Core heat capacity [J/(kg K)]. Not used with |
required |
tfac_core_avg
|
float
|
Core adiabat correction factor (Bower+2018). |
required |
param_utbl
|
bool
|
Enable upper thermal boundary layer parameterization. |
required |
param_utbl_const
|
float
|
UTBL constant. |
required |
core_bc
|
str
|
Core boundary formulation for |
required |
top_node
|
str
|
Entropy of the top basic node: 'linear' (default) extrapolates the top 2 cells; 'limited'
reduces that half step smoothly near a table edge, so the node rises with the top cell
and stays in the table ( |
required |
subgrid_lid
|
bool
|
Carry a conductive lid thinner than the top cell as two extra states (thickness and
energy per area); |
required |
lid_delta_on
|
float
|
Quasi-steady crust thickness [m] above which the lid acts; a thinner crust is left to
the mesh. Must stay below 0.8 of the top-cell width, and below 0.7 of it with
|
required |
lid_delta_lo
|
float or None
|
Thickness [m] of the hidden (phantom) lid and of the melt-back stop; None gives
|
required |
lid_handover_cells
|
int
|
With |
required |
lid_ra_crit
|
float
|
Critical Rayleigh number of the boundary-layer flux under the lid [-]. |
required |
lid_mush_base
|
bool
|
With the solid rheology on: the lid base lies at the solidus, the mush gives the lid
the floor flux plus the boundary-layer flux, the top cell stays above the solidus and
the lid hands over at |
required |
lid_surface_flux_cap
|
float or None
|
With the held lid surface ( |
required |
lid_surface_flux_slope
|
float or None
|
With |
required |
open_lid_flux
|
float or None
|
With |
required |
open_surface_slope
|
float or None
|
With |
required |
open_skin_conductance
|
float or None
|
With |
required |
open_lid_conductance
|
float or None
|
With |
required |
surface_temperature
|
float or None
|
Surface temperature [K] of the planet, held through a call; the caller sets it between
calls. With |
required |
Energy sources
EnergyConfig
Physics toggle flags, heating parameters, and solver knobs.
Defaults are aligned with the PROTEUS production path (SUNDIALS CVODE + JAX analytic Jacobian + tanh phase smoothing with the bottom-up gravitational-separation gate enabled and a phase-dependent eddy-diffusivity floor of 10 m^2/s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conduction
|
bool
|
|
required |
convection
|
bool
|
|
required |
gravitational_separation
|
bool
|
|
required |
mixing
|
bool
|
|
required |
radionuclides
|
bool
|
|
required |
tidal
|
bool
|
|
required |
eddy_diffusivity_chemical
|
float
|
Factor on the mixing-length kappa_h, before the floor and before
|
required |
eddy_diffusivity_thermal
|
float
|
Multiplier on the raw thermal eddy diffusivity \(\kappa_h\)
before the floor is applied. The SPIDER convention also
permits negative values, in which case the diffusivity is
pinned to |
required |
kappah_floor
|
float
|
Phase-dependent eddy-diffusivity floor [m^2/s]. Clamps the
eddy diffusivity from below by |
required |
convective_threshold
|
float
|
Entropy gradient D [J/kg/K/m]. The mixing-length drive acts only where dS/dr < 0 and uses max(|dS/dr|, D) there, so an unstable node gets at least the eddy diffusivity of a gradient D. The phase-modulated kappa_h floor applies wherever dS/dr < D, so a node with 0 <= dS/dr < D gets the floor alone. Default 0.0, the dS/dr < 0 switch with no minimum drive. D = 1e-6 gives one end state in 3 replayed coupled calls that end in one of 2 states under that switch, but with D > 0 kappa_h jumps at dS/dr = 0 from the floor to the mixing-length value at D (where that is above the floor), which can stall CVODE at a node whose gradient stays near 0. |
required |
bottom_up_grav_sep
|
bool
|
SPIDER-analogue bottom-up gate for the gravitational mass-flux: only allow melt/solid separation across an interface when the staggered cell below is non-pure. Default True; with it off, J_grav drains the CMB cell at first crystallisation, so only regression tests turn it off. |
required |
phase_smoothing
|
str
|
Phase-boundary smoothing of J_grav (the mixing flux has none):
|
required |
solver_method
|
str
|
ODE backend: |
required |
use_jax_jacobian
|
bool
|
When True and |
required |
phi_step_cap
|
float or None
|
Per-call mass-weighted |
required |
temperature_step_cap
|
float or None
|
Per-call per-cell |
required |
entropy_step_cap
|
float or None
|
Per-call per-cell |
required |
eos_floor_margin
|
float or None
|
Margin m [J/kg/K] above the minimum entropy S_min of the EOS
tables. A CVODE root (scipy: a terminal event) ends the call when
the smaller of the top basic-node entropy, which sets the surface
temperature, and the smallest cell entropy reaches S_min + m, or
S_min + m/2 when the call starts below S_min + m; the call then
returns a shorter step. A call that starts at or below S_min + m/2
arms a level at half its distance to S_min, and does not advance
(status 1) when that entropy falls fast enough to reach the level
before the call ends; a caller that retries with a shorter span can
then advance closer to S_min; there the top node counts as falling
only when the top cell falls too. At or below S_min + 2e-6 m the call
does not advance on any fall, the top node at its own rate, at every span,
and a start at or below S_min, also of the extrapolated top node alone, or
with no level between it and S_min, does not advance at all. A call
whose stop lands below S_min through the root location error, which
grows with the call time, is discarded as a refusal. A call with no
span skips the floor. Default 0: the floor is off. A drain past S_min
then meets the EOS table guard, the safety net of the solver: with
the rheology off, a call with a cell entropy outside the
global entropy range of the loaded tables, by more than 1e-3 J/kg/K,
fails with status -1 after it ends and holds its states from before
the first one outside (its start state for a start outside), so a
caller can retry it with a shorter step, which does not help for a
start outside; with the rheology on an invariant raises. The guard
does not judge the extrapolated basic nodes, the padded rows of a
pressure column or constant properties. A positive margin
turns it on (100 is the tested value) and must stay below the
entropy span of the tables; |
required |
phase_boundary_entropy_margin
|
float
|
Proximity band [J/kg/K] within which a staggered cell counts as
"near" a phase boundary, tightening the integrator |
required |
phase_boundary_cap
|
str or None
|
How |
required |
tidal_array
|
ndarray
|
Tidal heating per unit mass [W/kg] at each layer. |
required |
Initial condition
InitialConditionConfig
Initial condition parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
initial_condition
|
int
|
1: Linear profile, 2: User-defined from file, 3: Adiabatic profile. |
required |
surface_temperature
|
float
|
Surface temperature [K]. |
required |
basal_temperature
|
float
|
Basal temperature [K]. |
required |
init_file
|
str
|
Path to user-defined temperature file (for IC type 2). |
required |
Mesh
MeshConfig
Mesh and static pressure profile parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outer_radius
|
float
|
Outer radius of the mantle shell (planet radius minus atmosphere
depth, in practice the same as |
required |
inner_radius
|
float
|
Inner radius of the mantle shell, i.e. the core-mantle boundary (CMB) radius [m]. |
required |
number_of_nodes
|
int
|
Number of basic mesh nodes. |
required |
mixing_length_profile
|
str
|
'constant' or 'nearest_boundary'. With |
required |
mixing_length_constant_fraction
|
float
|
Fraction of the mantle thickness to use as the mixing length
when |
required |
core_density
|
float
|
Core density [kg/m^3]. Not used with |
required |
eos_method
|
int
|
1: Adams-Williamson, 2: User-defined. |
required |
surface_density
|
float
|
Surface-mantle density anchor [kg/m^3]. Used only by the analytic
Adams-Williamson EOS ( |
required |
gravitational_acceleration
|
float
|
Gravitational acceleration [m/s^2]. |
required |
adiabatic_bulk_modulus
|
float
|
Adiabatic bulk modulus [Pa]. |
required |
surface_pressure
|
float
|
Surface pressure [Pa]. |
required |
mass_coordinates
|
bool
|
Use uniform spacing in mass-coordinate space instead of radius. Gives larger cells at the surface (lower density) and matches SPIDER's mesh. Default True matches the PROTEUS production path. |
required |
eos_file
|
str
|
Path to user-defined EOS file. |
required |
surface_cell_thickness
|
float or str
|
Radial thickness [m] of the outermost and innermost basic cell; the mesh refines
towards each set end with the same number of nodes. 0 leaves that end unset.
|
required |
cmb_cell_thickness
|
float or str
|
Radial thickness [m] of the outermost and innermost basic cell; the mesh refines
towards each set end with the same number of nodes. 0 leaves that end unset.
|
required |
Phases (single and mixed)
PhaseConfig(density, heat_capacity, melt_fraction, thermal_conductivity, thermal_expansivity, viscosity, entropy='', rheology=None, **flat_rheo)
Single-phase (solid or liquid) material properties.
Each property can be a float (constant value) or a str (path to
a lookup table file). Rheology parameters are owned by SolidRheologyParams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
density
|
float or str
|
Reference density [kg/m^3] or path to lookup table. |
required |
heat_capacity
|
float or str
|
Specific heat capacity [J/kg/K] or path to lookup table. |
required |
melt_fraction
|
float
|
Melt fraction (0 for solid, 1 for liquid). |
required |
thermal_conductivity
|
float or str
|
Thermal conductivity [W/m/K] or path to lookup table. |
required |
thermal_expansivity
|
float or str
|
Thermal expansivity [1/K] or path to lookup table. |
required |
viscosity
|
float or str
|
Dynamic viscosity [Pa s] or path to lookup table. |
required |
entropy
|
float or str
|
Reference entropy [J/kg/K] or path to lookup table. Empty string means unused. |
''
|
rheology
|
SolidRheologyParams
|
Solid-state rheology parameters container. Each |
None
|
**flat_rheo
|
Any
|
Flat rheology attributes forwarded to rheology container. |
{}
|
Source code in src/aragog/config/phases.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
MixedPhaseConfig
Mixed-phase (mushy zone) parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latent_heat_of_fusion
|
float
|
Latent heat [J/kg]. |
required |
rheological_transition_melt_fraction
|
float
|
Melt fraction at rheological transition. |
required |
rheological_transition_width
|
float
|
Width of the tanh smoothing around the transition. |
required |
solidus
|
str
|
Path to solidus lookup file. |
required |
liquidus
|
str
|
Path to liquidus lookup file. |
required |
phase
|
str
|
Active phase mode: 'solid', 'liquid', 'mixed', or 'composite'. |
required |
phase_transition_width
|
float
|
Width of smoothing at phase boundaries. |
required |
grain_size
|
float
|
Grain size [m] for permeability calculations. |
required |
separation_viscosity
|
str
|
Drag viscosity source for gravitational separation:
|
required |
separation_buoyancy
|
str
|
Buoyancy of the separation velocity: |
required |
cp_blend
|
str
|
Mushy-zone Cp blending mode: |
required |
matprop_smooth_width
|
float
|
Width of the tanh blend between the two-phase and the single-phase properties at the solidus and the liquidus, in melt-fraction units, strictly between 0 and 1. Default 0.01, as in PROTEUS. |
required |
const_properties
|
bool
|
Replace the EOS-tabulated \((\rho, c_p, \alpha, k)\) and
\(\log_{10}\eta\) with the seven constant-property values
below. Mirrors SPIDER's |
required |
const_rho
|
float
|
Constant density [kg/m^3] when |
required |
const_Cp
|
float
|
Constant heat capacity [J/(kg K)] when |
required |
const_alpha
|
float
|
Constant thermal expansivity [1/K] when |
required |
const_cond
|
float
|
Constant thermal conductivity [W/(m K)] when
|
required |
const_log10visc
|
float
|
Constant \(\log_{10}\) dynamic viscosity [log10(Pa s)] when
|
required |
const_T_ref
|
float
|
Reference temperature [K] for the constant-properties EOS, used to anchor \(T(P, S)\) on the analytic isentrope. |
required |
const_S_ref
|
float
|
Reference entropy [J/(kg K)] for the constant-properties
EOS, paired with |
required |
Solver driver
SolverConfig
ODE solver parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_time
|
float
|
Start time [years]. |
required |
end_time
|
float
|
End time [years]. |
required |
atol
|
float
|
Absolute tolerance, floored at 1e-8. Default 1e-8. |
required |
rtol
|
float
|
Relative tolerance. Default 1e-8, the value at which
|
required |
tsurf_poststep_change
|
float
|
Maximum surface temperature change per step [K]. |
required |
cvode_output_points
|
int
|
Number of points on the CVODE dense output grid. |
required |
max_steps
|
int
|
Maximum number of internal CVODE steps per output interval (SUNDIALS mxstep). |
required |
tcore_change_limit
|
float or None
|
Optional per-solve core-temperature change limit [K]. The flag is also set, independent of this limit, when any sampled core temperature is non-finite. |
required |
strict_accepted_range
|
bool
|
With the rheology off: an accepted state of a call outside the entropy range of the EOS
tables raises |
required |
eos_domain_check
|
str
|
Check of the EOS lookup points of each call against the valid window of the tables
( |
required |
eos_domain_tolerance_cells
|
float
|
Distance outside the window, in table entropy cells, beyond which a point counts. Default 5. |
required |