GaPFlow.integrate#

Flux and source term contributions for numerical integration.

This module contains functions that construct flux and source term vectors for the time integration of the gap-averaged balance equations. These functions are called from GaPFlow.Problem instances.

Functions

diffusiveFlux(q, tau)

Compute diffusive (viscous) flux components.

hyperbolicFlux(q, p)

Compute hyperbolic (advective) fluxes for the conservation equations.

predictor_corrector(q, p, tau, direction)

Compute predictor–corrector fluxes for a 2D conservation law system.

source(q, h, stress, stress_lower, stress_upper)

Compute the source term for the gap-averaged balance equations.

GaPFlow.integrate.diffusiveFlux(q: NDArray[floating], tau: NDArray[floating]) → Tuple[NDArray[floating], NDArray[floating]]#

Compute diffusive (viscous) flux components.

Parameters:
  • q (ndarray) – Density array of shape (3, nx, ny).

  • tau (ndarray) – Gap-averaged viscous stress tensor components of shape (3, nx, ny).

Returns:

  • Dx (ndarray) – Diffusive flux along x-direction.

  • Dy (ndarray) – Diffusive flux along y-direction.

GaPFlow.integrate.hyperbolicFlux(q: NDArray[floating], p: NDArray[floating]) → Tuple[NDArray[floating], NDArray[floating]]#

Compute hyperbolic (advective) fluxes for the conservation equations.

Parameters:
  • q (ndarray) – Density array of shape (3, nx, ny).

  • p (ndarray) – Pressure field of shape (nx, ny).

Returns:

  • Fx (ndarray) – Flux components along the x-direction.

  • Fy (ndarray) – Flux components along the y-direction.

GaPFlow.integrate.predictor_corrector(q: NDArray[floating], p: NDArray[floating], tau: NDArray[floating], direction: int) → Tuple[NDArray[floating], NDArray[floating]]#

Compute predictor–corrector fluxes for a 2D conservation law system.

Combines hyperbolic (advective) and diffusive flux contributions, applying a directional shift to evaluate flux gradients.

Parameters:
  • q (ndarray) – Density array of shape (3, nx, ny).

  • p (ndarray) – Pressure field of shape (nx, ny).

  • tau (ndarray) – Gap-averaged viscous stress tensor components of shape (3, nx, ny).

  • direction (int) – Direction of finite difference shift: +1 (upwind) or -1 (downwind).

Returns:

  • flux_x (ndarray) – Flux contribution along the x-direction.

  • flux_y (ndarray) – Flux contribution along the y-direction.

GaPFlow.integrate.source(q: NDArray[floating], h: NDArray[floating], stress: NDArray[floating], stress_lower: NDArray[floating], stress_upper: NDArray[floating]) → NDArray[floating]#

Compute the source term for the gap-averaged balance equations.

See Eq. (11) in [1].

References

Parameters:
  • q (ndarray) – Density array of shape (3, nx, ny).

  • h (ndarray) – Geometry array of the same shape as q. Contains gap height and gradients.

  • stress (ndarray) – Gap-averaged viscous stress tensor components of shape (3, nx, ny).

  • stress_lower (ndarray) – Viscous stress tensor components at the lower wall of shape (6, nx, ny).

  • stress_upper (ndarray) – Viscous stress tensor components at the upper wall of shape (6, nx, ny).

Returns:

out – Computed source term of the same shape as q.

Return type:

ndarray