Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

pymrm.convect

Back to modules overview

Convective-flux operators and TVD limiter functions.

View module source on GitHub

Public API

SymbolTypeSummary
clamfunctionCompute the CLAM TVD correction in normalized-variable space.
construct_convflux_bcfunctionConstruct boundary-face upwind corrections and source terms.
construct_convflux_upwindfunctionConstruct a first-order upwind convective-flux operator.
construct_convflux_upwind_intfunctionConstruct the internal-face upwind advection operator.
minmodfunctionCompute the Minmod TVD correction in normalized-variable space.
musclfunctionCompute the MUSCL TVD correction in normalized-variable space.
osherfunctionCompute the Osher TVD correction in normalized-variable space.
smartfunctionCompute the SMART TVD correction in normalized-variable space.
stoicfunctionCompute the STOIC TVD correction in normalized-variable space.
upwindfunctionReturn zero correction (first-order upwind limiter).
vanleerfunctionCompute the van-Leer TVD correction in normalized-variable space.

clam(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the CLAM TVD correction in normalized-variable space.

View source on GitHub

construct_convflux_bc(shape, x_f, x_c = None, bc = (None, None), v = 1.0, axis = 0, shapes_d = (None, None), format = 'csc')

Open dedicated reference page

Construct boundary-face upwind corrections and source terms.

Parameters

Returns

View source on GitHub

construct_convflux_upwind(shape, x_f, x_c = None, bc = (None, None), v = 1.0, axis = 0, shapes_d = (None, None), format = 'csc')

Open dedicated reference page

Construct a first-order upwind convective-flux operator.

Parameters

Returns

View source on GitHub

construct_convflux_upwind_int(shape, v = 1.0, axis = 0, format = 'csc')

Open dedicated reference page

Construct the internal-face upwind advection operator.

Parameters

Returns

View source on GitHub

minmod(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the Minmod TVD correction in normalized-variable space.

View source on GitHub

muscl(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the MUSCL TVD correction in normalized-variable space.

Uniform grid: 2 c_c up to 1/4, c_c + 1/4 up to 3/4, then 1.

View source on GitHub

osher(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the Osher TVD correction in normalized-variable space.

View source on GitHub

smart(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the SMART TVD correction in normalized-variable space.

View source on GitHub

stoic(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the STOIC TVD correction in normalized-variable space.

Piecewise: the SMART line c_f = k c_c up to its intersection with the central-difference line, then central differencing up to c_c = x_c, then QUICK, then c_f = 1. On a uniform grid (x_c = 1/2, x_d = 3/4) this is 3 c_c, (1 + c_c)/2, 3/8 + 3 c_c/4 and 1, with breaks at 1/5, 1/2 and 5/6.

View source on GitHub

upwind(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Return zero correction (first-order upwind limiter).

View source on GitHub

vanleer(normalized_c_c, normalized_x_c, normalized_x_d)

Open dedicated reference page

Compute the van-Leer TVD correction in normalized-variable space.

The curve is the parabola through (0, 0), (x_c, x_d) and (1, 1). It rises above c_f = 1 when x_d - x_c > x_c (1 - x_c), for example next to a boundary where the upstream point is a face half a cell away (x_c = 1/3, x_d = 2/3); the correction is capped at 1 - c_c to stay bounded. The cap acts only above c_c = x_c and does not reduce the order.

View source on GitHub