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. |
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. |
RadionuclideConfig |
One radioisotope: name, reference time, abundance, concentration, heat production, half-life. Provides get_heating(time) (W/kg). |
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 | |
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
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 | |
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)]. |
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 |
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
|
Ratio kappa_c / kappa_h for chemical eddy diffusivity. |
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; off only for regression tests against the pre-fix CMB drain at first crystallisation. |
required |
phase_smoothing
|
str
|
Phase-boundary smoothing scheme for J_grav and J_mix:
|
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, so a drain past
S_min continues at the clamped table-edge temperature and the EOS
lookup logs its out-of-range WARNING (it raises only for an EOS
built with |
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'. |
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]. |
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 |
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
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
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 |
cp_blend
|
str
|
Mushy-zone Cp blending mode: |
required |
matprop_smooth_width
|
float
|
Half-width of the tanh used to smooth phase-dependent material properties around the rheological transition. Default 0.0 reproduces SPIDER's convention of no smoothing on the property side; 0.01 is the typical JAX setting. |
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 |
Radionuclides
RadionuclideConfig
Single radionuclide heating source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Isotope name (e.g., 'K40', 'U238'). |
required |
t0_years
|
float
|
Reference time for initial abundance [years]. |
required |
abundance
|
float
|
Isotopic abundance ratio (e.g., 40K/K). |
required |
concentration
|
float
|
Elemental concentration [ppm]. |
required |
heat_production
|
float
|
Specific heat production [W/kg]. |
required |
half_life_years
|
float
|
Half-life [years]. |
required |
get_heating(time)
Compute radiogenic heating at a given time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
float or ndarray
|
Time [years]. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Heat production [W/kg]. |
Source code in src/aragog/config/radionuclides.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
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 |