Standalone, zero-allocation planetary neutral exosphere models, PlasmaPopulations.jl-style neutral species and VDFs, EUV shadow / optical-depth / Chapman / ray attenuation, conservative one-way and two-way charge–neutral interaction kernels, structured neutral field containers, and adaptive dual-cell box quadrature for space and planetary plasma simulations.
-
Neutral Species, VDFs & Populations (
PlasmaPopulations.jlStyle):isbitsNeutralSpecies(with chemical/nuclide formula parsing for atoms and planetary molecules),AbstractNeutralVDF(ColdNeutral,Maxwellian,BiMaxwellianNeutralwithpdf,mean,cov, and zero-allocationrand), and composableNeutralPopulations. -
1D Radial, 3D Asymmetric & Time-Dependent Profiles: Allocation-free,
ForwardDiff-compatibleAbstractNeutralProfileimplementations—ExponentialProfile,PowerLawProfile,ChamberlainProfile, callable 1D/2D/3DExosphereProfile,DayNightProfile,PlumeProfile,CompositeProfile,TabulatedRadialProfile, andTimeDependentProfile—paired with composable kinematics (ZeroVelocity,ConstantVelocity,CorotationVelocity,RadialOutflowVelocity) and temperature models (ConstantTemperature,DayNightTemperature). -
Multi-Species GPU-Ready Exosphere & EUV Attenuation: Combine
NeutralPopulationtuples into anisbits, GPU-readyExosphereModel(or use legacyNeutralComponentCodevectors viabuild_exosphere_model) withNoAttenuation, cylindrical shadowing (ShadowCylinder), curved-atmosphereOpticalDepth/ Smith & Smith (1972)chapman_function, or 3D/dynamic line-of-sightRayOpticalDepth. -
Zero-Overhead One-Way & Self-Consistent Two-Way Coupling: Compile-time coupling traits (
OneWayCouplingvs.TwoWayCoupling), conservative Eulerian exchange channels (Photoionization,ElectronImpactIonization,ResonantChargeExchange,NonResonantChargeExchange,ElasticCollision,Recombination), kinetic/Hybrid-PIC collision & ENA helpers, and structuredGriddedNeutralField(CartesianNeutralGrid,SphericalNeutralGrid,NeutralSourceBufferwith conservative CIC deposition,NeutralParticleBuffer). -
Adaptive Octree Dual-Cell Quadrature:
integrate_exosphere_box!adaptively subdivides 2D or 3D cells near sharp scale heights and inner planetary boundaries ($r < r_{\text{cut}}$ ) with analytic$\sinh(b)/b$ finite-cell corrections. -
Optional Package Extensions: Zero-cost weak-dependency extensions for
Unitful.jl(dimensionalUnitScale,UnitfulProfile,strip_units),Adapt.jl(GPU array migration), andPlasmaPopulations.jl(Particle/Population/VDFbridges).
using Pkg
Pkg.add("Exosphere")Or for local development:
using Pkg
Pkg.develop(path = "/path/to/Exosphere.jl")using Exosphere
using StaticArrays
sp_o = NeutralSpecies(; m = 16.0)
sp_h = NeutralSpecies(; m = 1.0)
pop_o = NeutralPopulation(
sp_o,
ExponentialProfile(100.0, 1.0, 0.2);
velocity = CorotationVelocity((0.0, 0.0, 0.01)),
temperature = ConstantTemperature(0.01),
)
pop_h = NeutralPopulation(
sp_h,
PowerLawProfile(10.0, 1.0, 2.0),
Maxwellian(sp_h; T = 0.02),
)
od = OpticalDepth(; cross_sections = (0.05, 0.01), chapman = true)
exo = ExosphereModel(pop_o, pop_h; planet_radius = 1.0, optical_depth = od)
@assert isbits(exo)
x = SVector(1.5, 0.0, 0.0)
ion = PlasmaState(5.0, SVector(-2.0, 0.0, 0.0), 0.1, 16.0)
channels = (Photoionization(1.0e-6), ResonantChargeExchange(2.0e-3))
# One-way coupling: neutral feedback deposition compiles away to zero instructions
plasma_src = couple_point!(exo, x, channels, ion; species = 1)grid = CartesianNeutralGrid((-2.0, -2.0, -2.0), (0.5, 0.5, 0.5), (9, 9, 9))
field = GriddedNeutralField(grid, 2; masses = (16.0, 1.0), two_way = true)
sample_to_grid!(field, exo)
reset_sources!(field)
plasma_src = couple_point!(field, x, channels, ion; species = 1)
# External neutral solver reads neutral_sources(field) (dn, dmom, dE)o_comp = NeutralComponentCode(:exponential, 100.0, 0.2, 0.0, 0.01, "O")
h_comp = NeutralComponentCode(:powerlaw, 10.0, 0.0, 2.0, 0.01, "H")
exo_legacy = build_exosphere_model(;
planet_radius = 1.0,
components = [o_comp, h_comp],
optical_depth = OpticalDepth(; cross_sections = [0.05, 0.01], chapman = true),
inner_radius = 1.0,
)
sumN = zeros(n_components(exo_legacy))
sumNA = zeros(n_components(exo_legacy))
vol = integrate_exosphere_box!(sumN, sumNA, exo_legacy, x, SVector(0.2, 0.2, 0.2), 0, 1.0)examples/planetary_exosphere_euv.jl: Generates a 3-panel visualization of a 3-component Mars-like exosphere (O,H,He) with Chapman EUV optical-depth attenuation and volumetric photoionization production rates (requiresCairoMakie):
julia --project=/path/to/env-with-CairoMakie examples/planetary_exosphere_euv.jlRun the full unit, conservation, AD, extension, Aqua.jl, and ExplicitImports.jl test suite:
julia --project=Exosphere.jl -e 'using Pkg; Pkg.test()'Benchmarks are defined in benchmark/benchmarks.jl using BenchmarkTools.jl and tracked across revisions with AirspeedVelocity.jl:
cd Exosphere.jl && benchpkg Exosphere --rev=main,dirtyExosphere.jl is licensed under the MIT License.