Skip to main content
Sandbox Physics
Planetary atmospheres from thermal tails to winds

AC13 · L3

Solve and check a critical atmospheric wind

Find the critical radius numerically, integrate the accelerating solution from both sides of it, and test its conserved quantities. Then compare the power requirement and collision condition before interpreting a computed rate.

Save the input before running anything

Download the scripts, input, provenance, instructions and frozen outputs listed below into one ordinary folder. The input defines five synthetic single-component atmospheres: default wind, a strongly bound tail, a sparse atmosphere, an XUV power shortfall and a critical point below the reservoir. No observed planet profile or MESA evolution output enters this experiment.

The JSON fixes SI constants, boundary radius, density, prescribed temperature, XUV irradiance and usable power fraction. The script hashes the exact input bytes into the output. Keep the downloaded input unchanged for the first run; use a separately named copy for experiments. The provenance file lists the byte counts and SHA-256 values and distinguishes authored teaching inputs from the papers that motivate the equations.

python3 -W error replay-wind.py --input escape-input.json --out wind-replay-rerun.json
# Optional analytic reference, in a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements-reference.txt
python3 reference-lambert.py --out lambert-reference-rerun.json

Reading: Cranmer 2004, New views of the solar wind with the Lambert W function, v1 · Volkov et al. 2011, Thermally driven atmospheric escape, arXiv v1

Bracket the place where both terms vanish

The critical radius is found by bisection on 2c2/r−GM/r22c^2/r-GM/r^2 between 0.01Rb0.01R_{\rm b} and 100Rb100R_{\rm b}. At every step retain the half-interval with a sign change. A missing sign change raises an error. All five fixed examples are bracketed; arbitrary new inputs must be checked.

Compare the result with GM/(2c2)GM/(2c^2). For the default it is 2.41574013×107 m2.41574013\times10^7\,\mathrm m. This root only locates the zero of the numerator. The velocity still has to pass through u=cu=c on the accelerating branch. Directly dividing numerator by denominator at that point produces zero divided by zero.

Reading: Cranmer 2004, New views of the solar wind with the Lambert W function, v1

Start with a regular slope, not a singular division

Integrate q=ln⁡Mq=\ln\mathcal M instead of velocity. This keeps the state finite even for extremely small subsonic speeds. Start at x=1±10−5x=1\pm10^{-5} with the local expansion below, then integrate inward or outward using fourth-order Runge–Kutta. Targets closer than 10−410^{-4} to the sonic point use the expansion directly.

The maximum radial step is 0.0015min⁡(x,1)0.0015\min(x,1). Each requested radius is integrated independently from the regular sonic neighborhood. The output also halves this maximum step at seven radii from 0.03rs0.03r_{\rm s} to 12rs12r_{\rm s}, and saves the change in log Mach number. This checks numerical sensitivity of the ODE path; its agreement with a separate analytic solution tests a different implementation.

dqdx=2(1/x−1/x2)e2q−1,q=δ−δ2+1312δ3+O(δ4)\frac{dq}{dx}=\frac{2(1/x-1/x^2)}{e^{2q}-1},\quad q=\delta-\delta^2+\frac{13}{12}\delta^3+O(\delta^4)
The exponential-minus-one function avoids loss of precision in the small denominator away from the exact critical point. The series handles the critical neighborhood.

Reading: Cranmer 2004, New views of the solar wind with the Lambert W function, v1

Compare with two analytic branches

Set D=x−4e3−4/xD=x^{-4}e^{3-4/x}. The implicit Parker relation can be inverted using the Lambert-W function, defined by W(z)eW(z)=zW(z)e^{W(z)}=z. In the interval of interest it has two real branches. The branch names in SciPy are zero and minus one.

The optional script evaluates the principal branch below the sonic radius and the other real branch above it. At exactly x=1x=1 it assigns the regular limit explicitly. It compares eleven radii with the independently integrated ODE. At twice the sonic radius, choosing the principal branch gives a subsonic root instead of the intended accelerating wind. Both can satisfy an implicit equation, which is why a small algebraic residual alone cannot identify the physical branch.

M2=−W0(−D)(x<1),M2=−W−1(−D)(x>1)\mathcal M^2=-W_0(-D)\quad(x<1),\qquad\mathcal M^2=-W_{-1}(-D)\quad(x>1)
The full accelerating solution switches real branches at their common sonic endpoint.

Reading: Cranmer 2004, New views of the solar wind with the Lambert W function, v1

Test the flow and the approximations separately

Recover density from the base boundary and calculate 4πr2ρu4\pi r^2\rho u at all saved radii. Also compute u2/2+c2ln⁡(n/nb)−GM/ru^2/2+c^2\ln(n/n_{\rm b})-GM/r, the isothermal momentum integral. The first check tests the density normalization; the second responds to errors in the independently integrated velocity shape.

The frozen default has relative mass-flux spread of order ten to the minus fifteen and a momentum-integral spread below ten to the minus ten in sound-speed-squared units. Those are numerical residuals. They do not include an uncertainty in temperature, the collision cross section or the omission of cooling.

The table and curve below use the public replay output. The strongly bound case gives an illustrative Jeans rate near ten milligrams per second, but its formal Parker sonic Knudsen number is enormous. The shortfall case has a well-behaved numerical wind and a power requirement about 752 times the available XUV power. The buried-critical case is already supersonic at the reservoir. The output retains each failed interpretation beside its numerical results.

01234124812Mach number
Independent regularized ODE result, default synthetic inputs. Horizontal axis is radius divided by the reservoir radius, logarithmic; the dashed line marks the numerically located critical radius.
Actual synthetic results from replay-wind.py: fixed neutral-H-like particle mass and effective collision cross section, prescribed temperature, two-Earth-radius reservoir, outer radius twelve times the reservoir. Inputs include the full settings for each case. Formal wind rates are listed even when their physical assumptions fail.
CaseSonic radius / baseFormal Parker rate · kg/sSonic KnudsenRequired / available power
Default wind1.91.97.70×1067.70\times10^{6}4.02×10−34.02\times10^{-3}2.28×10−12.28\times10^{-1}
Rare tail1.52×1011.52\times10^{1}6.77×10−46.77\times10^{-4}1.83×1081.83\times10^{8}2.05×10−92.05\times10^{-9}
Sparse gas5.065.067.90×1027.90\times10^{2}9.05×1019.05\times10^{1}2.80×10−42.80\times10^{-4}
Heat shortfall1.261.261.84×1071.84\times10^{7}1.37×10−31.37\times10^{-3}7.52×1027.52\times10^{2}
Buried critical point2.11×10−12.11\times10^{-1}7.11×1077.11\times10^{7}7.26×10−57.26\times10^{-5}3.783.78

Reading: Volkov et al. 2011, Thermally driven atmospheric escape, arXiv v1 · Murray-Clay, Chiang & Murray2009, Atmospheric escape from hot Jupiters, v2

Make one controlled modification

Copy the input and double only the base number density in the default case. Predict the wind rate, the sonic Knudsen number and the required-to-available power ratio before running. The respective changes should be factors of two, one half and two. The velocity shape stays fixed because its equation contains gravity and sound speed, not the density normalization.

For a second experiment, change only the declared outer radius from twelve to twenty-four base radii. Re-run the mechanical-energy comparison. More work and acceleration must be supplied as gas travels farther. Keep track of this outer boundary whenever you quote an isothermal heat requirement.

The public files may be reused as the scientific teaching material described in their README. They contain standalone numerical analysis, not a copy of the protected interactive Lab. To study a particular planet, replace the prescribed temperature model with an energy/chemistry calculation and establish appropriate lower and outer boundaries.

Reading: Murray-Clay, Chiang & Murray2009, Atmospheric escape from hot Jupiters, v2 · Cranmer 2004, New views of the solar wind with the Lambert W function, v1

Exercises and explanations

  1. Your implicit equation residual is tiny, but the speed falls below the sound speed beyond the critical radius. Which test catches the mistake?

    Read the explanation

    Check the branch and the sign of acceleration. At x>1 the accelerating transonic solution must use the supersonic Lambert-W branch. The principal branch can satisfy the same implicit relation, so equation residual alone is insufficient.

  2. The output input hash differs from the frozen reference. Can you compare all last digits directly?

    Read the explanation

    First identify the input change. A different boundary, density or temperature is a different calculation. Restore the fixed input for a numerical reproduction, then use a separate modified run for a physical experiment.

Try the prediction

Compare the saved wind with the interactive one

  1. Reset the Lab and export its calculation. Compare the default critical radius, mass flow, power ratio and sonic Knudsen number with the Python output.
  2. Choose Collisions run out and identify which mathematical curves remain computable after the fluid interpretation fails.
  3. Change only the base density and test the predicted factors before trying a different temperature.

Save these files together. The numerical replay uses the Python3.10+ standard library. Only the optional Lambert-W comparison needs the pinned NumPy/SciPy dependencies.

Sources and calculation scope

  1. Cranmer 2004, New views of the solar wind with the Lambert W function, v1

    7June2004; AJP 72,1397–1403. Full text, SectionsIII–IV, equations12–16: isothermal momentum equation, critical point and the two real Lambert-W branches. The solar ionized-hydrogen sound-speed convention is replaced by our explicitly fixed single-particle mass.

  2. Volkov et al. 2011, Thermally driven atmospheric escape, arXiv v1

    26September2010 preprint, published ApJL729,L24(2011). Full text, Section 2 and Figures1–5: hard-sphere mean free path, radius-based versus local scale-height Knudsen numbers, kinetic escape and conditional Jeans corrections. Their heating below the lower boundary differs from a globally maintained isothermal wind. The adopted Lab collision cross section is a teaching input, not their molecular-nitrogen value.

  3. Murray-Clay, Chiang & Murray2009, Atmospheric escape from hot Jupiters, v2

    18November2008 revision, ApJ 693,23(2009). Full text, Section 3.2, equations19/22 and Figure 7: absorbing area, energy-limited scaling and the cooling/recombination limitations of a fixed efficiency. This source develops hot-Jupiter radiation hydrodynamics; the small-planet illustration uses only the explicitly stated global power comparison.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy