Interactive Inlet Shock Visualizer

Interactive oblique-shock / expansion visualization with a schlieren-style view. Use the presets to jump to a compelling state.

Open standalone

About this project

This is a browser-based, interactive inlet/duct flow visualization driven by a coarse 2D compressible Euler solver. You control the freestream Mach number M₁ and the inlet turn angle θ, then watch how compression waves and shocks form and interact with a simplified inlet/duct/cowl geometry.

The scalar views (ρ/ρ₁, p/p₁, and M) come from sampling the simulated flow field. The Schlieren view is a “CFD-style” visualization computed from the density gradient (a stand-in for optical schlieren photography): sharp gradients show up as bright features.

What it shows

  • Ramp turning: a turn angle imposes a change in flow direction that produces shock structures (or weaker compressions) downstream.
  • Wall interaction: the ramp/duct/cowl are treated as solid reflective boundaries, so waves reflect and reshape as they propagate.
  • Inlet capture vs spillage (qualitative): depending on M₁ and θ, some features convect into the duct while others run outside.
  • Unsteady settling: the solver advances continuously; the field “spins up” from the inflow state toward a quasi-steady pattern.

What it hopes to accomplish

  • Provide an intuitive, fast way to explore how inlet turning and geometry influence shock topology and schlieren appearance.
  • Give a physically grounded alternative to purely analytic/painted shocks: downstream structures emerge from the PDE solver rather than being drawn as overlays.
  • Offer a compact, single-file demo that runs anywhere (no build step, no external dependencies) and can be iterated quickly.

What it is not

  • Not high-fidelity CFD: this is an inviscid Euler model (no viscosity, no boundary layers, no turbulence model, no heat transfer).
  • Not a validated design tool: results are qualitative; they are not calibrated to a specific experiment, mesh study, or uncertainty quantification.
  • Not a perfect boundary treatment: the outer boundaries use simple conditions plus damping to reduce reflections; some artifacts can still exist.
  • Not high order: the numerical method is intentionally simple/coarse for real-time speed, so shocks are thicker and small features are smeared.
  • Not 3D: sidewall effects and full inlet three-dimensionality are not represented.

Controls glossary (what it changes / what to look for)

  • Freestream Mach, M₁: Sets the inflow speed. Higher M₁ generally makes shocks stronger and sharper (larger jumps in ρ/ρ₁ and p/p₁).
  • Turn angle, θ: Sets the inlet/ramp turning angle. Increasing θ tends to move/strengthen the main compression structure and changes how much of the wave system interacts with the duct/cowl.
  • View: ρ/ρ₁ (density ratio), p/p₁ (pressure ratio), M (Mach), and Schlieren (density-gradient visualization).
  • γ: Changes the ratio of specific heats in the model, affecting wave speeds and shock strengths for the same M₁ and θ.
  • Duct (solid walls): Toggles the upper cowl/duct boundary. When enabled, waves reflect from the walls and internal patterns change.
  • Schlieren sensitivity: Chooses which density-gradient component is emphasized (∂/∂x, ∂/∂y, or |∇|).
  • Schlieren gain: Contrast tuning for the Schlieren image (higher gain reveals weaker waves but can saturate bright regions).
  • Texture: Adds a small procedural grain to reduce banding and mimic CFD/optical texture (used in Schlieren and Density views).
  • Streamlines: Draws streamlines integrated from the simulated velocity field as a visualization aid.
  • Fixed color range: Keeps the mapping range fixed for comparability across parameter changes; disable for auto-scaled contrast.