Skip to content

IonosphereElectrodynamics.jl2D Spherical M–I Coupling Solver

Zero-allocation ionospheric Ohm's law solver, conductance models, and analytic dipole field-line mapping for space plasma simulations.

Overview ​

IonosphereElectrodynamics.jl is a standalone, pure-Julia solver for two-dimensional spherical magnetosphere–ionosphere (M–I) electrostatic coupling. It solves the height-integrated ionospheric Ohm's law on both hemispheres in dipole Solar Magnetic (SMG) coordinates:

and maps electric potentials, electric fields (  ), and   convection velocities along analytic dipole field lines between the ionospheric shell and magnetospheric boundaries.

Quick Example ​

julia
using IonosphereElectrodynamics
using StaticArrays

cond = AuroralConductance(
    MoenBrekkeEUVConductance(; f107 = 150.0, sun_dir = (1.0, 0.0, 0.0));
    sigma_P_max = 15.0,
    hall_ratio = 1.5,
    fac_scale = 1.0e-6,
)
cfg = IonosphereConfig(;
    n_theta_hem = 33,
    n_phi = 64,
    lat_boundary_deg = 20.0,
    conductance = cond,
    tol = 1.0e-8,
)

r_planet = 6.371e6
sol = IonosphereSolver(
    cfg;
    r_iono = 1.017 * r_planet,
    dipole_moment = (0.0, 0.0, -3.0e-5 * r_planet^3),
)

th_r1, th_r2, sig = deg2rad(18.0), deg2rad(24.0), deg2rad(2.5)
jr = [
    let th_hem = sol.theta[i] <= 0.5 * pi ? sol.theta[i] : pi - sol.theta[i]
        r1 = exp(-0.5 * ((th_hem - th_r1) / sig)^2)
        r2 = exp(-0.5 * ((th_hem - th_r2) / sig)^2)
        (1.2e-6 * r1 - 0.6e-6 * r2) * sin(sol.phi[j])
    end for i in 1:sol.n_theta, j in 1:sol.n_phi
]

converged = solve_ionosphere!(sol, jr)
cpcp = cross_polar_cap_potential(sol)

view = ionosphere_field_view(sol)
x = SVector(0.0, 0.2 * r_planet, 3.0 * r_planet)
b0 = dipole_B0(sol.frame, x)
e_vec = eval_ionosphere_E(view, x; B0 = b0)
u_exb = eval_ionosphere_u_exb(view, x, b0)

println("converged = ", converged)
println(
    "CPCP      = (north = ", round(cpcp.north * 1.0e-3; sigdigits = 4),
    " kV, south = ", round(cpcp.south * 1.0e-3; sigdigits = 4), " kV)",
)
println("E         = ", round.(e_vec .* 1.0e3; sigdigits = 4), " mV/m")
println("u_exb     = ", round.(u_exb; sigdigits = 4), " m/s")
converged = true
CPCP      = (north = 259.2 kV, south = 259.2 kV)
E         = [-0.9017, 10.61, -1.063] mV/m
u_exb     = [-4838.0, -407.1, 40.8] m/s