Convective-flux operators and TVD limiter functions.
Public API¶
| Symbol | Type | Summary |
|---|---|---|
clam | function | Compute the CLAM TVD correction in normalized-variable space. |
construct_convflux_bc | function | Construct boundary-face upwind corrections and source terms. |
construct_convflux_upwind | function | Construct a first-order upwind convective-flux operator. |
construct_convflux_upwind_int | function | Construct the internal-face upwind advection operator. |
minmod | function | Compute the Minmod TVD correction in normalized-variable space. |
muscl | function | Compute the MUSCL TVD correction in normalized-variable space. |
osher | function | Compute the Osher TVD correction in normalized-variable space. |
smart | function | Compute the SMART TVD correction in normalized-variable space. |
stoic | function | Compute the STOIC TVD correction in normalized-variable space. |
upwind | function | Return zero correction (first-order upwind limiter). |
vanleer | function | Compute the van-Leer TVD correction in normalized-variable space. |
clam(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the CLAM TVD correction in normalized-variable space.
construct_convflux_bc(shape, x_f, x_c = None, bc = (None, None), v = 1.0, axis = 0, shapes_d = (None, None), format = 'csc')¶
Construct boundary-face upwind corrections and source terms.
Parameters¶
shape(tuple[int, ...]) Cell-centered field shape.x_f(array_like) Face coordinates alongaxis.x_c(array_like, optional) Cell-center coordinates.bc(tuple[dict | None, dict | None], optional) Left and right boundary-condition dictionaries with keysa,b, andd.v(float or array_like, optional) Face velocity field.axis(int, optional) Convection axis.shapes_d(tuple[tuple | None, tuple | None], optional) Optional source-vector shapes for inhomogeneous boundary terms.format({‘csc’, ‘csr’}, optional) Sparse format for returned operator matrices.
Returns¶
tuple(conv_matrix_bc, conv_bc)whenshapes_dis not supplied, or(conv_matrix_left, conv_bc_left, conv_matrix_right, conv_bc_right)otherwise.
construct_convflux_upwind(shape, x_f, x_c = None, bc = (None, None), v = 1.0, axis = 0, shapes_d = (None, None), format = 'csc')¶
Construct a first-order upwind convective-flux operator.
Parameters¶
shape(tuple[int, ...] or int) Cell-centered field shape.x_f(array_like) Face coordinates alongaxis.x_c(array_like, optional) Cell-center coordinates. If omitted, arithmetic midpoints are used.bc(tuple[dict | None, dict | None], optional) Left and right boundary-condition dictionaries with keysa,b, andd.v(float or array_like, optional) Face velocity field. Scalars and broadcastable arrays are accepted.axis(int, optional) Convection axis.shapes_d(tuple[tuple | None, tuple | None], optional) Optional source-vector shapes for boundary inhomogeneities.format({‘csc’, ‘csr’}, optional) Sparse format for returned operator matrices.
Returns¶
tupleWithoutshapes_d:(conv_matrix, conv_bc). Withshapes_d:(conv_matrix, conv_bc_left, conv_bc_right).
construct_convflux_upwind_int(shape, v = 1.0, axis = 0, format = 'csc')¶
Construct the internal-face upwind advection operator.
Parameters¶
shape(tuple[int, ...]) Cell-centered field shape.v(float or array_like, optional) Face velocity field.axis(int, optional) Convection axis.format({‘csc’, ‘csr’}, optional) Sparse format of the returned matrix.
Returns¶
scipy.sparse.csc_array or scipy.sparse.csr_arraySparse matrix mapping cell-centered values to interior face fluxes.
minmod(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the Minmod TVD correction in normalized-variable space.
muscl(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the MUSCL TVD correction in normalized-variable space.
osher(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the Osher TVD correction in normalized-variable space.
smart(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the SMART TVD correction in normalized-variable space.
stoic(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the STOIC TVD correction in normalized-variable space.
upwind(normalized_c_c, normalized_x_c, normalized_x_d)¶
Return zero correction (first-order upwind limiter).
vanleer(normalized_c_c, normalized_x_c, normalized_x_d)¶
Compute the van-Leer TVD correction in normalized-variable space.