zephyrus.fractionation
fractionation
fractionation.py
Simultaneous N-species fractionation closure for a hydrodynamic wind.
Author: Mara Attia
solve_closure(phi, X, m, T, g0, b, return_diag=False)
Active-set solution of the N-species fractionation closure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
float
|
Total mass flux at the base [g cm^-2 s^-1], non-negative. |
required |
X
|
array
|
Mole fractions, non-negative, summing to 1. |
required |
m
|
array
|
Particle masses [g]. |
required |
T
|
float
|
Temperature [K]. |
required |
g0
|
float
|
Gravity at the base [cm s^-2]. |
required |
b
|
array
|
Symmetric matrix of binary diffusion parameters [cm^-1 s^-1], diagonal ignored (conventionally np.inf). |
required |
return_diag
|
bool
|
When True, also return the multiplier |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
Phi |
array
|
Number fluxes [cm^-2 s^-1], guaranteed non-negative and satisfying
|
Source code in src/zephyrus/fractionation.py
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 | |
solve_fixed_active(phi, X, m, T, g0, b, active)
Solve the linear closure on a fixed active set.
Unknowns: w_j for j in active and the inverse 1/Hbar of the
shared density scale height. Returns (w_full, inv_h_bar) with
w = 0 for retained species. The single-active case is solved
analytically, the general case with two-sided diagonal equilibration,
which controls the roughly 25 decades the matrix entries can span.
Source code in src/zephyrus/fractionation.py
82 83 84 85 86 87 88 89 90 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 | |
first_threshold(X, m, T, g0, b)
Mass flux at which the first heavy species entrains, in g cm^-2 s^-1.
Below this flux only the lightest species escapes; the value is the smallest crossover over the heavier species of the multi-background drag balance.
Source code in src/zephyrus/fractionation.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
closure_per_species(mdot, element_fractions, T_wind, M_p, r_base)
Per-element escape rates [kg/s] from the closure at the wind base.
SI boundary around the cgs solver: the bulk rate mdot [kg/s]
converts to the base mass flux, the closure partitions it over the
atomized composition with the binary-diffusion library coefficients,
and the number fluxes convert back to per-element mass rates that sum
to the bulk rate. Rock-forming species (Na, Mg, Si, Fe) raise the
rock_former_bij flag: their coefficients sit in the widest
provenance class, and Na and Mg ionize where rock vapor exists while
these are neutral-gas coefficients. Elements with no kinetic diameter
(Al, P, Cl, K, Ca, Ti) take the coefficients of their nearest-mass
covered substitute and raise the substituted_bij flag; their own
masses still enter the closure.
Returns (per_element, diagnostics, flags) with the diagnostics
carrying the active set, the retained species, the multiplier, the
relative mass-conservation residual, and the per-pair coefficient
provenance.
Source code in src/zephyrus/fractionation.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
unfractionated_split(mdot, reservoirs, element_fractions)
Split a bulk rate over elements without fractionation.
The protocol of the energy-limited path: reservoir mass fractions when
reservoir masses are supplied; otherwise the mass fractions of the
atomized wind-base composition, with the split_from_base_composition
flag recording the substitution. A reservoir that has run dry carries no
proportions to split by, so it falls back to the same composition, which
is the state the end of an evolutionary track reaches. Negative reservoir
masses are malformed input. The split conserves the bulk rate exactly.
Source code in src/zephyrus/fractionation.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |