ppmpy.reconstruction module#
Routines for doing the reconstruction of the interface states from cell-average data.
- class HSEPPMInterpolant(grid, p, rho, g, *, limit=True, chi_flat=None, leave_as_perturbation=False)[source]#
Bases:
PPMInterpolant
PPM interpolation for pressure that subtracts off HSE
- Parameters:
grid (FVGrid) – the grid object.
p (ndarray) – the pressure defined on the grid.
rho (ndarray) – the density defined on the grid.
g (ndarray) – the gravitational acceleration defined on the grid
limit (bool, optional) – use limiting?
chi_flat (ndarray, optional) – the flattening coefficient.
- construct_parabola()[source]#
compute the coefficients of a parabolic interpolant for the pressure in each zone by subtracting off HSE. This will give am, the parabola value on the left edge of a zone, ap, the parabola value on the right edge of the zone, and a6, a measure of the curvature of the parabola.
- class PPMInterpolant(grid, a, *, limit=True, chi_flat=None)[source]#
Bases:
object
Given a fluid variable a defined on the FVGrid grid, perform the PPM reconstruction
- Parameters:
grid (FVGrid) – the grid object.
a (ndarray) – the data for a single component defined on the grid.
limit (bool, optional) – do we use limiting?
chi_flat (ndarray, optional) – the flattening coefficient.
- construct_parabola()[source]#
compute the coefficients of a parabolic interpolant for the data in each zone. This will give am, the parabola value on the left edge of a zone, ap, the parabola value on the right edge of the zone, and a6, a measure of the curvature of the parabola.
- draw_parabola(gp, *, scale=None)[source]#
Draw the parabolas in each zone on the axes ax.
- Parameters:
gp (GridPlot) – the grid plot object
scale (float, optional) – normalization factor (default is maximum data value)
- integrate(sigma)[source]#
integrate under the parabola to the left edge (Im) and right edge (Ip) for a fraction sigma = lambda * dt / dx, where lambda is the characteristic speed. If sigma is not moving toward the edge, then we us the limit of the parabola in that direction.
- Parameters:
sigma (ndarray) – the dimensionless wavespeed (lambda dt / dx)
- Returns:
Im (ndarray) – the integral under the parabola from the left edge through a distance sigma.
Ip (ndarray) – the integral under the parabola from the right edge through a distance sigma.
- flattening_coefficient(grid, p, u)[source]#
Compute the flattening coefficient, chi, for a shock. This works by looking for compression and a steep pressure profile. chi = 1 means no flattening. This follows Saltzman (1994).
- Parameters:
grid (FVGrid) – the grid object.
p (ndarray) – the pressure defined on the grid.
u (ndarray) – the velocity defined on the grid
- Return type:
ndarray