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₁), and increases the complexity/spacing of reflections.
- 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:
ρ/ρ₁ shows density ratio (good for “CFD contour” look),
p/p₁ shows pressure ratio (often highlights shocks clearly),
M shows local Mach number,
Schlieren shows a contrast-enhanced density-gradient image (good for wave visualization).
- γ (air): Changes the ratio of specific heats in the model. This affects wave speeds and shock strengths for the same M₁ and θ; subtle but noticeable in compression intensity and downstream structure.
- Duct (solid walls): Toggles the upper cowl/duct geometry as a solid boundary. When enabled, shocks/waves reflect from the walls and you should see different internal patterns versus the “open” case.
- Schlieren sensitivity (only in Schlieren view): Chooses which density-gradient component is emphasized:
∂/∂x highlights features with strong streamwise gradients,
∂/∂y highlights vertical gradients,
|∇| highlights overall gradient magnitude.
- Schlieren gain (only in Schlieren view): Contrast/compression tuning for the Schlieren image. Higher gain makes weak waves more visible but can also saturate bright regions.
- Texture (only in Schlieren + Density Ratio): Adds a small procedural “numerical texture” to reduce banding and mimic CFD/optical grain. Set to 0 for the cleanest contours.
- Streamlines: Draws approximate streamlines over the field. This is a visualization aid (not a separate solver); it can help show turning and capture/spillage qualitatively.
- Fixed color range: When enabled, uses a fixed mapping range so colors are comparable across parameter changes; when disabled, the range auto-scales to the current frame (more contrast, less comparability).