arXiv Science⌕ Search

arXiv · 2611.31162

Shaderous: A Browser-based Hydrodynamics Code for Physics Research and Teaching

Abstract

Shaderous is a three-dimensional code for compressible gas dynamics and magnetohydrodynamics that runs in WebGPU compute shaders in a web browser on any vendor's GPU. It combines an unsplit MUSCL-Hancock scheme and HLLC fluxes with a multigrid Poisson solver, block-structured adaptive mesh refinement with per-block timesteps, constrained transport with HLLD fluxes, point masses with sinks, gray radiation transport with the M1 closure, implicit pressure for low Mach numbers, tabulated equations of state from degenerate electrons to rock and iron, cooling, viscosity, conduction, resistivity, mixtures of gases, and nuclear burning by a neural network trained on a 13-isotope reaction network. A setup is shared as a link and runs on a student's own laptop or phone, so the code suits teaching at every level. A run is limited to one GPU: the largest adaptive mesh so far held about 175 million cells on an NVIDIA H200. It therefore suits parameter studies, run as sweeps from the command line, rather than the largest single simulations. Three aspects of the design are, as far as we can find, new. First, the hydrodynamic solver stores no face flux. The two cells that share a face compute bit-identical fluxes, so cells at boundaries between levels and between timesteps recompute their neighbors' fluxes instead of keeping a flux register. Mass, momentum and energy are conserved to round-off on the adaptive mesh, and compensated sums keep the divergence of the magnetic field at round-off. Second, the whole step runs on the GPU: the timestep and the assignment of blocks to time bins are reduced there, and ghost cells are computed as they are loaded rather than exchanged. Third, the code computes in single precision yet reproduces a range of astrophysical systems accurately, from stars and atmospheres in hydrostatic balance to shocks, gravitational collapse and magnetized flows, in 206 validation tests.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

James Guillochon. 2026-11-23. Shaderous: A Browser-based Hydrodynamics Code for Physics Research and Teaching. https://arxiv.science/abs/2611.31162

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

On the Nonlinear Dependence of Underground Muon Rate on Atmospheric Temperature Observed at Daya Bay

The underground cosmic-ray muon rate is seasonally modulated by atmospheric temperature. It can be explained by the theories of Barrett, Gaisser, and others. However, the Daya Bay Neutrino Experiment observes a nonlinear temperature dependence. When deriving the temperature dependence of the muon rate, existing theories consider only the impact of the local temperature on muon production at the production layer. In this work, we use a more general solution to the cascade equations that fully depicts how the entire temperature profile influences the final muon rate. The corresponding new definitions of the effective temperature weight and temperature dependence coefficient are also presented. We have examined the results using the numerical tool MCEq with real atmospheric temperature inputs. A linear modulation is recovered and verified. This work can help explain the nonlinear effect observed at Daya Bay and provide a more refined theoretical framework for calculating the temperature coefficient in other experiments.

astro-ph.IM↗

Error Propagation from Integral Moments and Spectral Derivatives of Stokes Profiles to Magnetic Observables

We aim to derive convenient analytic estimations of magnetic inference errors, which can be used to inform and facilitate the creation of the science-traceability matrix of a polarimetric instrument. In order to do this, we study the general problem of the propagation of Poissonian noise in polarized light signals to derived data products of the Stokes profiles, namely integral moments of arbitrary orders and spectral derivatives of the intensity. In particular, we derive the errors on the longitudinal and transversal projections of the magnetic field inferred from the weak-field approximation (WFA) of the Zeeman effect. The propagated errors on magnetic inference are traced back to the signal-to-noise ratio (SNR) of the observations. The results can be used to quantify the contributions of different environmental and instrumental conditions (spectral line width, spectral resolution, line spread function, stray light) to the overall error on the inferred quantities. Our tests indicate that the integral-moment method of inference is comparable to the local derivative in a predictable way.

astro-ph.IM↗

The Lukashian Calendar: A universal calendar mechanism using variable-duration years and days for any human colony or settlement

Existing calendars, in particular the Gregorian calendar, have a complex structure which includes many adjustments in the form of leap days and leap seconds in order to remain synchronized to the position of a planet in the Solar System. In addition, mean solar days can deviate up to 16 minutes from true solar days on Earth. On other planets, this discrepancy can be far greater: on Mars, it can be up to 51 minutes. Numerous Martian proposals ranging from Aitken (1936) to Gangale (1986) to Silin (2025) mimic the Gregorian calendar and do not address these issues. Moreover, many do not include a system for telling the time of day, or stretch the second beyond the standard SI second. This paper proposes a calendar mechanism that uses years and days with a variable duration, in order to accurately represent true solar years and days. In this mechanism, time of day is expressed as a proportion, rather than a number of fixed units, such as hours and minutes. This results in a simple and consistent structure that can universally be applied to any planet, moon or space station with a human presence. Furthermore, it allows analog missions on Earth to use the same calendar mechanism as future missions in space. This paper will outline the principles and details of this mechanism, using Earth and Mars as illustrative examples. Also discussed is the implementation of the mechanism on actual computers, which have a Unix time system clock based on discrete milliseconds.

astro-ph.IM↗