Shapes & spaces

Euler gas dynamics Riemann problem calculator with shock and rarefaction states

Solve ideal-gas Euler Riemann waves and sample shock, contact and rarefaction states at positive time.

Your numbers

Valid JSON. Left/right [density,velocity,pressure]; gamma>1; ideal-gas Euler waves; vacuum rejected.
Valid JSON; preserve the shown array or object structure.
Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The Euler Riemann problem begins with two constant ideal-gas states separated at one location. Conservation of mass, momentum and energy determines the later wave pattern. Even this simple initial discontinuity can produce shocks, rarefaction fans and a contact discontinuity.

THE FORMULAIdealEulerprimitiveleft/right(rho,u,p),gamma>1. aK=sqrt(γp/rho). fK(p)shockifp>pK:(p-pK)*sqrt(AK/(p+BK)),A=2/[(γ+1)rho],B=(γ-1)/(γ+1)pK; rarefactionf=2a/(γ-1)*[(p/pK)^((γ-1)/(2γ))-1]. SolvefL+fR+uR-uL=0 p>0 bybracketedmethod. Vacuumif uR-uL>=2(aL+aR)/(γ-1),handleexplicitnotpositivefakep. u*=(uL+uR+fR-fL)/2. Star densities shockrho*(p*/pK+β)/(β*p*/pK+1),rare=rho*(p*/pK)^(1/γ). Samplex/t withshock speeds, fanheads/tails andcontact; fanclosedforms. Returnwaves andR-Hresiduals.

A worked example

With the prefilled inputs, starPressure = 0.3031301780506468. Left/right [density,velocity,pressure]; gamma>1; ideal-gas Euler waves; vacuum rejected.

Good to know

Self-similar exact ideal-gas Euler Riemann waves with numerically bracketed star pressure; contact at u*. Vacuum states rejected; no viscous diffusion or finite-volume time stepping.

A discontinuity that launches several waves

The Euler Riemann problem begins with two constant ideal-gas states separated at one location. Conservation of mass, momentum and energy determines the later wave pattern. Even this simple initial discontinuity can produce shocks, rarefaction fans and a contact discontinuity.

The exact solver refers to the analytical structure of that idealized problem, with a numerical root solve for its star pressure. It does not include viscosity, heat conduction or a finite computational tube with reflecting end walls.

Euler gas dynamics Riemann problem calculator with shock and rarefaction statesSod Riemann solution: density at t = 0.2left fancontactright shockρL* ≈ 0.426319; ρR* ≈ 0.265574; γ = 1.4
Scroll across to see the full diagram.
The density profile samples the analytical Sod rarefaction and constant star states, with jumps at the contact and right shock. Star pressure and velocity are0.303130178 and0.927452620; the two star densities are deliberately different.

Compare with the Viscous Burgers equation calculator on a periodic unit interval. Solvethreecoupledcompressibleconservationlaws withcontact/shock/rarefactionwaves; scalarBurgershasnosimultaneouspressure-densitycontactstructure.

Primitive states and gas parameters

Left/right [density,velocity,pressure]; gamma>1; ideal-gas Euler waves; vacuum rejected.Enter positive density and pressure together with velocity on each side. The ratio of specific heats must exceed one. Units must be consistent across both states; mixing pressure or velocity units changes the physical problem rather than merely its display.

Position samples are interpreted through their distance from the initial discontinuity divided by positive query time. A time of zero requires the initial discontinuous data instead of the self-similar division. The engine detects the vacuum-generating velocity separation and rejects that unsupported case before attempting a positive-pressure root. It supports gamma above one and at most two, positive query time and at most two hundred sample positions.

Finding the shared star pressure

Each initial state supplies a pressure-velocity relation: a shock expression for compression and a rarefaction expression for expansion. Their combination defines a scalar equation for the pressure shared across the contact discontinuity.

A bracketed root method keeps the pressure positive and provides a residual. An unguarded Newton step can leave the physical domain when states are extreme. The returned pressure-equation residual documents the bracketed scalar solve. This release does not return Rankine Hugoniot residuals or an explicit table of all wave speeds.

Classifying and sampling the waves

Comparing the star pressure with each side's initial pressure decides whether that side contains a shock or a rarefaction. The star velocity locates the contact, across which density may jump while pressure and velocity match.

Inside a rarefaction fan, density, pressure and velocity vary continuously according to self-similar formulas. A sampler that returns only four constant states misses the fan. Shock speeds and fan-head and fan-tail speeds must determine which formula applies at each query point.

The Sod shock-tube worked case

Take left density one, velocity zero and pressure one. On the right use density one eighth, velocity zero and pressure one tenth, with gamma equal to 1.4. This standard test produces a left rarefaction, a contact and a right shock.

The star pressure is about 0.303130178 and the star velocity about 0.927452620. The two star densities differ, approximately 0.426319428 and 0.265573712. That difference is essential: forcing equal densities across the contact would erase part of the exact solution.

Reading profiles and the pressure residual

The result gives star pressure, star velocity, both star densities, the shock-or-rarefaction classification on each side and requested samples of density, velocity, pressure and total energy. A contact is sampled at the shared star velocity, while rarefaction values use the continuous self-similar fan formulas.

The pressure-equation residual is the explicitly returned solve diagnostic. Rankine Hugoniot checks can be useful independent tests, but they are not a displayed output of this release. A static profile should mark or retain genuine discontinuities rather than smoothing them into an invented viscous layer or implying that finite-volume time stepping was performed. The star pressure is common to the states immediately on both sides of the contact, and the star velocity sets the contact speed. Density can jump across that contact even though pressure and velocity agree. Sampling positions at a positive time uses the similarity coordinate relative to the initial discontinuity. This calculation resolves the exact idealized wave pattern, not a particular numerical grid smearing of it.

Vacuum and model limits

Sufficiently separating initial velocities can generate vacuum. A valid solver must identify that pattern rather than clamp its pressure to a tiny positive number and continue as if two ordinary star states existed.

The ideal-gas equation of state is a model assumption. Real mixtures, variable gamma and additional physics need different equations. This calculator solves the specified one-dimensional self-similar problem and should not claim a complete engineering flow simulation. Self-similar exact ideal-gas Euler Riemann waves with numerically bracketed star pressure; contact at u*. Vacuum states rejected; no viscous diffusion or finite-volume time stepping.

A few questions, answered

What does exact mean if a root is solved numerically?

The wave structure and sampling formulas are exact for the idealized model, while the shared star pressure is found to a numerical tolerance.

Why are star densities different on the two sides?

A contact discontinuity preserves pressure and velocity but can carry a density jump.

Can extreme separating velocities create vacuum?

Yes; this release detects and rejects vacuum-generating data rather than returning a fake positive-pressure star state.

Does this include tube-end reflections?

No; it is the local self-similar Riemann solution before external boundaries are introduced.

Find your calculator

Start typing to explore the library.