Module ConservationLaws

The ConservationLaws module defines the systems of partial differential equations which are solved by StableSpectralElements.jl.

Overview

The equations to be solved are defined by subtypes of AbstractConservationLaw on which functions such as physical_flux and numerical_flux are dispatched. Whereas first-order problems (i.e. subtypes of AbstractConservationLaw{d, FirstOrder}) remove the dependence of the flux tensor on the solution gradient in order to obtain systems of the form

\[\partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t)) = \underline{0},\]

second-order problems (i.e. subtypes of AbstractConservationLaw{d, SecondOrder}) are treated by StableSpectralElements.jl as first-order systems of the form

\[\begin{aligned} \underline{\bm{Q}}(\bm{x},t) - \bm{\nabla}_{\bm{x}} \underline{U}(\bm{x},t) &= \underline{0},\\ \partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t), \underline{\bm{Q}}(\bm{x},t)) &= \underline{0}. \end{aligned}\]

Currently, the linear advection and advection-diffusion equations (LinearAdvectionEquation and LinearAdvectionDiffusionEquation), the inviscid and viscous Burgers' equations (InviscidBurgersEquation and ViscousBurgersEquation), and the compressible Euler equations (EulerEquations) are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined.

Reference

StableSpectralElements.ConservationLaws.EulerEquationsType
EulerEquations{d}(γ::Float64) where {d}

Define an Euler system governing compressible, adiabatic fluid flow, taking the form

\[\frac{\partial}{\partial t}\left[\begin{array}{c} \rho(\bm{x}, t) \\ \rho(\bm{x}, t) V_1(\bm{x}, t) \\ \vdots \\ \rho(\bm{x}, t) V_d(\bm{x}, t) \\ E(\bm{x}, t) \end{array}\right]+\sum_{m=1}^d \frac{\partial}{\partial x_m}\left[\begin{array}{c} \rho(\bm{x}, t) V_m(\bm{x}, t) \\ \rho(\bm{x}, t) V_1(\bm{x}, t) V_m(\bm{x}, t)+P(\bm{x}, t) \delta_{1 m} \\ \vdots \\ \rho(\bm{x}, t) V_d(\bm{x}, t) V_m(\bm{x}, t)+P(\bm{x}, t) \delta_{d m} \\ V_m(\bm{x}, t)(E(\bm{x}, t)+P(\bm{x}, t)) \end{array}\right]=\underline{0},\]

where $\rho(\bm{x},t) \in \mathbb{R}$ is the fluid density, $\bm{V}(\bm{x},t) \in \mathbb{R}^d$ is the flow velocity, $E(\bm{x},t) \in \mathbb{R}$ is the total energy per unit volume, and the pressure is given for an ideal gas with constant specific heat as

\[P(\bm{x},t) = (\gamma - 1)\Big(E(\bm{x},t) - \frac{1}{2}\rho(\bm{x},t) \lVert \bm{V}(\bm{x},t)\rVert^2\Big).\]

The specific heat ratio is specified as a parameter $\gamma$, which must be greater than unity.

source
StableSpectralElements.ConservationLaws.EulerPeriodicTestType
EulerPeriodicTest(conservation_law::EulerEquations{d},
                  strength = 0.2, L = 2.0)

Periodic wave test case for EulerEquations{d} on the domain $\Omega = [0,L]^d$, based on the following paper:

  • G.-S. Jiang and C.-W. Shu (1996). Efficient implementation of weighted ENO schemes. Journal of Computational Physics 126(1): 202-228.
source
StableSpectralElements.ConservationLaws.InviscidBurgersEquationType
InviscidBurgersEquation(a::NTuple{d,Float64}) where {d}

Define an inviscid Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 \big) = 0,\]

where $\bm{a} \in \R^d$. A specialized constructor InviscidBurgersEquation() is provided for the one-dimensional case with a = (1.0,).

source
StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquationType
LinearAdvectionDiffusionEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a linear advection-diffusion equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$ and diffusion coefficient $b \in \R^+$. A specialized constructor LinearAdvectionDiffusionEquation(a::Float64, b::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.LinearAdvectionEquationType
LinearAdvectionEquation(a::NTuple{d,Float64}) where {d}

Define a linear advection equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) \big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$. A specialized constructor LinearAdvectionEquation(a::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.ViscousBurgersEquationType
ViscousBurgersEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a viscous Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

where $\bm{a} \in \R^d$ and $b \in \R^+$. A specialized constructor ViscousBurgersEquation(b::Float64) is provided for the one-dimensional case with a = (1.0,).

source