1 The Shock Jump Conditions

Some models for high-energy radiation from compact objects involve gas free-falling onto the surface of the object at a velocity near the object’s escape speed. This speed is very supersonic relative to the star, so the gas must pass through a shock (called either an “accretion” or “standoff” shock) before it settles on the surface. Assuming that this is a strong shock, estimate the post-shock temperatures for a white dwarf (with M? = 1 M and R? = 109 cm) and a neutron star (with M? = 1 M and R? = 106 cm). You can assume γ = 5/3, μ = mp, and that the standoff shock is just above the surface of the star. (For the pedantic among you: you can use the expressions in this problem set, even though this shock is actually spherical rather than planar.)

Code
Pkg.resolve()
Pkg.instantiate()

using DrWatson
using Unitful: Mass, Length
include(srcdir("astr145/main.jl"))
    Updating `~/projects/beforerr/Project.toml`
  [634d3b9d] + DrWatson v2.19.1
  [1986cc42] + Unitful v1.27.0
  [6112ee07] + UnitfulAstro v1.2.2
    Updating `~/projects/beforerr/Manifest.toml`
  [0b6fb165] + ChunkCodecCore v1.0.1
  [4c0bbee4] + ChunkCodecLibZlib v1.0.0
  [55437552] + ChunkCodecLibZstd v1.0.0
  [634d3b9d] + DrWatson v2.19.1
  [5789e2e9] + FileIO v1.17.1
  [076d061b] + HashArrayMappedTries v0.2.0
  [033835bb] + JLD2 v0.6.3
  [692b3bcd] + JLLWrappers v1.7.1
  [1914dd2f] + MacroTools v0.5.16
  [bac558e1] + OrderedCollections v1.8.1
  [aea7be01] + PrecompileTools v1.3.3
  [21216c6a] + Preferences v1.5.1
  [ae029012] + Requires v1.3.1
  [7e506255] + ScopedValues v1.5.0
  [6c6a2e73] + Scratch v1.3.0
  [3a884ed6] + UnPack v1.0.2
  [1986cc42] + Unitful v1.27.0
  [6fb2a4bd] + UnitfulAngles v0.7.2
  [6112ee07] + UnitfulAstro v1.2.2
  [3161d3a3] + Zstd_jll v1.5.7+1
  [0dad84c5] + ArgTools v1.1.2
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [ade2ca70] + Dates v1.11.0
  [f43a241f] + Downloads v1.7.0
  [7b1f6079] + FileWatching v1.11.0
  [ac6e5ff7] + JuliaSyntaxHighlighting v1.12.0
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2 v1.11.0
  [8f399da3] + Libdl v1.11.0
  [37e2e46d] + LinearAlgebra v1.12.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [a63ad114] + Mmap v1.11.0
  [ca575930] + NetworkOptions v1.3.0
  [44cfe95a] + Pkg v1.12.1
  [de0858da] + Printf v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [f489334b] + StyledStrings v1.11.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [e66e0078] + CompilerSupportLibraries_jll v1.3.0+1
  [deac9b47] + LibCURL_jll v8.15.0+0
  [e37daf67] + LibGit2_jll v1.9.0+0
  [29816b5a] + LibSSH2_jll v1.11.3+1
  [14a3606d] + MozillaCACerts_jll v2025.11.4
  [4536629a] + OpenBLAS_jll v0.3.29+0
  [458c3c95] + OpenSSL_jll v3.5.4+0
  [83775a58] + Zlib_jll v1.3.1+2
  [8e850b90] + libblastrampoline_jll v5.15.0+0
  [8e850ede] + nghttp2_jll v1.64.0+1
  [3f19e933] + p7zip_jll v17.7.0+0
escape_velocity (generic function with 1 method)
Code
function postshock_temperature(u1; μ=mp, γ=5 / 3)
    2 *- 1) /+ 1)^2 * μ * u1^2 |> upreferred
end

function postshock_temperature(M::Mass, R::Length)
    v_esc = escape_velocity(M, R)
    kT = postshock_temperature(v_esc)
    T = uconvert(u"K", kT / Unitful.k)
    @show v_esc kT T
end

postshock_temperature(1u"Msun", 1e9u"cm")
postshock_temperature(1u"Msun", 1e6u"cm")
v_esc = 5.1519402170444485e6 m s⁻¹
kT = 8.324165125889762e-15 kg m² s⁻²
T = 6.029168257746727e8 K
v_esc = 1.629186545488269e8 m s⁻¹
kT = 8.324165125889762e-12 kg m² s⁻²
T = 6.029168257746727e11 K
6.029168257746727e11 K