pub struct SolverConfig {
pub z_start: f64,
pub z_end: f64,
pub dy_max: f64,
pub dz_min: f64,
pub dtau_max: f64,
pub nc_z_min: f64,
pub dtau_max_photon_source: f64,
pub max_newton_iter: usize,
pub cn_dcbr: bool,
}Expand description
Tunable solver parameters.
Defaults are production-quality and match the values used for all paper
runs. The fields that most users will want to change are Self::z_start,
Self::z_end, and Self::dtau_max.
Fields§
§z_start: f64Upper redshift at which integration begins (solver evolves from
z_start down to z_end). Must satisfy z_start > z_end.
z_end: f64Lower redshift at which integration ends.
dy_max: f64Maximum fractional change in ln(1+z) per step (limits step size for
slow-varying sources). Default 0.02. Historical value 0.005 was
calibrated for photon-injection bursts; for smooth (continuous) heat
injection scenarios 0.02 gives the same μ/y to 4 significant figures
with 5–6× fewer steps, since dtau_max takes over as the binding
constraint at z ≲ 1.5×10⁶.
dz_min: f64Minimum allowed step size in z; smaller values trigger a warning. Default 1e-6.
dtau_max: f64Maximum Compton optical depth per step. With exact exponential DC/BR (unconditionally stable), this primarily limits Kompaneets CN accuracy. Default 10.0 matches the CLI default (the value used for all paper runs). Raise to ~50 for exploratory runs where modest accuracy loss is acceptable.
nc_z_min: f64Minimum redshift for number-conserving T-shift subtraction. Default 5e4: only subtract at z > nc_z_min where DC/BR is significant. Set to 0.0 to subtract at all redshifts (CosmoTherm-like behavior).
dtau_max_photon_source: f64Maximum dtau per step during active photon source injection. Limits the Kompaneets Δn² nonlinearity at the injection spike, which causes timestep-dependent wake formation at intermediate x. Default 1.0 (production quality, ~1% from converged). Set to 10.0 for exploratory/fast runs (~3% from converged).
max_newton_iter: usizeMaximum number of Newton iterations per Kompaneets step. Default 10. Increase for extreme injection parameters.
cn_dcbr: boolUse Crank-Nicolson (instead of backward Euler) for DC/BR. Second-order in time, matching CosmoTherm’s scheme. May be less stable at very low x where DC/BR rates diverge.
Implementations§
Trait Implementations§
Source§impl Clone for SolverConfig
impl Clone for SolverConfig
Source§fn clone(&self) -> SolverConfig
fn clone(&self) -> SolverConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more