scalar_transport

The dream.scalar_transport module solves the linear scalar convection–diffusion equation using Hybridised Discontinuous Galerkin (HDG) or Discontinuous Galerkin (DG) methods in space, combined with a range of implicit, explicit, and IMEX time integration schemes. The main entry point is ScalarTransportSolver.

Note

We currently only support a linear formulation.

Solver Architecture

ScalarTransportSolver is composed of three interchangeable sub-objects selected via solver.fem, solver.riemann_solver, and solver.time. The finite element method (fem) additionally owns the numerical time integration scheme via its scheme property, while solver.time controls the outer solution loop (transient, stationary, or pseudo-time-stepping).

Scalar Transport Equation

A transport equation expresses a conservation principle by describing how a scalar quantity \(u\) evolves in space and time due to the combined effects of convection and diffusion. The governing (linear, scalar) convection–diffusion equation reads

\[ \frac{\partial u}{\partial t} + \nabla \cdot (\vec{b}\,u) - \nabla \cdot (\kappa\,\nabla u) = 0 \quad \text{in } \Omega \times (0, t_{\mathrm{end}}], \]

where \(\vec{b}\) is the advecting velocity field (set via convection_velocity; its spatial dimension is inferred from the mesh) and \(\kappa \geq 0\) is the scalar diffusivity (set via diffusion_coefficient).

Setting is_inviscid to True enforces \(\kappa = 0\), reducing the problem to a pure convection (hyperbolic) equation.

Discretisation

Hybridised Discontinuous Galerkin (HDG)

The HDG method partitions the domain into elements and introduces an additional skeleton (or trace) unknown \(\hat{u}\) living on the mesh facets \(\facets\). The global system couples only skeleton unknowns; the element-interior unknowns are eliminated locally via static condensation. This leads to a significantly smaller global system compared to standard DG, making HDG attractive for implicit time integration at low polynomial orders.

The discrete problem finds \((u_h, \hat{u}_h) \in U_h \times \hat{U}_h\) such that

\[ (\partial_t u_h, v) + B_c(\{u_h,\hat{u}_h\},\{v,\hat{v}\}) + B_d(\{u_h,\hat{u}_h\},\{v,\hat{v}\}) = 0 \]

for all \((v, \hat{v}) \in U_h \times \hat{U}_h\). The convective bilinear form is

\[ B_c = -\int_K \vec{b}\,u_h \cdot \nabla v\,\mathrm{d}x + \int_{\partial K} \hat{f}^*\,v\,\mathrm{d}s - \int_{\partial K \setminus \partial\Omega} \hat{f}^*\,\hat{v}\,\mathrm{d}s, \]

and the diffusive bilinear form is

\[ B_d = \int_K \kappa\,\nabla u_h \cdot \nabla v\,\mathrm{d}x - \int_{\partial K} \kappa\,\nabla u_h \cdot \vec{n}\,(v - \hat{v})\,\mathrm{d}s - \int_{\partial K \setminus \partial\Omega} \kappa\,(u_h - \hat{u}_h)\,\vec{n}\cdot\nabla v\,\mathrm{d}s + \int_{\partial K \setminus \partial\Omega} \kappa\,\tau\,(u_h - \hat{u}_h)\,(v - \hat{v})\,\mathrm{d}s. \]

Here \(\hat{f}^*\) is the convective numerical flux determined by the RiemannSolver, and \(\tau\) is the interior penalty coefficient (see HDG for details).

Discontinuous Galerkin (DG)

The DG method uses element-wise polynomial spaces without skeleton unknowns. Inter-element communication is handled entirely through the numerical flux chosen by the Riemann solver. DG is straightforward to use with explicit time integrators, though implicit solves may be more expensive since no static condensation is available.

Riemann Solver

The LaxFriedrich Riemann solver defines the numerical flux at element interfaces as

\[ \hat{f}^*(u^-, u^+) = \tfrac{1}{2}(\vec{b}\cdot\vec{n})(u^- + u^+) - \tfrac{\lambda}{2}(u^+ - u^-), \]

where \(\lambda = |\vec{b}\cdot\vec{n}|\) is the maximum wave speed and \(u^\pm\) are the one-sided traces from the two neighbouring elements.

Boundary and Initial Conditions

Boundary and initial conditions are attached to the solver via BoundaryConditions and DomainConditions:

Class

Description

FarField

Inflow value \(u_\infty\)
via upwind criterion

Periodic

Periodic coupling across
matched boundary pairs

Initial

Initial condition \(u(\cdot, 0) = u_0\)
over domain regions

Time Integration

The outer solution loop is selected via solver.time (e.g. 'transient', 'stationary'), and the numerical time integration scheme is chosen via solver.fem.scheme (see the time module for the full time infrastructure).

Implicit schemes (unconditionally stable — recommended for diffusion-dominated problems or large time steps):

Scheme

Order

Key

ImplicitEuler

1

'implicit_euler'

BDF2

2

'bdf2'

SDIRK22

2

'sdirk22'

SDIRK33

3

'sdirk33'

Explicit schemes (require CFL condition \(\Delta t \leq C\,h / |\vec{b}|\)):

Scheme

Order

Key

ExplicitEuler

1

'explicit_euler'

SSPRK3

3

'ssprk3'

CRK4

4

'crk4'

API Reference

solver

Scalar transport solver configuration.

spatial

Definitions of the spatial discretizations for the scalar transport equation.

time

Definitions of the temporal discretizations for the scalar transport equation.

riemann_solver

Definitions of riemann solvers for a scalar transport equation.

config

Definitions of boundary/domain conditions for a scalar transport equation.

Examples