Skip to content

AstroBarker/iced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iced

Imex ConvEction Diffusion (in Python 3.x)

Implements a simple convection diffusion model -- the viscous Burger's equation. The purpose here is to prototype strong stability preserving (SSP) implicit-explicit (IMEX) additive Runge-Kutta (ARK) methods. The spatial discretizations are not given that much attention. For the hyperbolic term, I use a finite volume approach with WENO reconstructions modified from here. The diffusion term is simply finite differenced. We implement fully coupled IMEX evolution using the linear-nonlinear (LNL) SSP IMEX methods presented in Conde et al.. They present optimal SSP tableau pairs that have higher linear order than nonlinear order.

The viscious Burger's equation in one spatial dimension is $$\frac{\partial u}{\partial t} + \frac{1}{2} \frac{\partial u^2}{\partial x} = \nu \frac{\partial^2 u}{\partial x^2}$$ or, compactly, $$u' = F(u) + G(u)$$

where $F(u)$ is the "slow" evolving hyperbolic flux component that will be evolved explicitly and $G(u)$ is the diffusive component that will be evolved implicitly. An ARK iteration takes the form

$$u^{(i)} = u^{n} + \Delta t \sum_{j=1}^{i-1} a_{ij} F(u^{j}) + \Delta t \sum_{j=1}^{i} \tilde{a}_{ij} G(u^{j})$$ for $i = 1...s$, and then

$$u^{n+1} = u^{n} + \Delta t \sum_{i=1}^{s} b_{i} F(u^{i}) + \Delta t \sum_{i=1}^{s} \tilde{b}_{i} G(u^{i})$$

Here, the tableau matrix for the explicit part (from $a_{ij}$) is strictly lower triangular and the tableau matrix for the implicit part is lower triangular, forming a diagonally implicit Runge-Kutta (DIRK) method for the implicit update. We keep the $b$ vectors identical in the tableaus here which helps reduce coupling error.

The code is not particularly fast (it's Python) but it does what it needs to do.

Literature References

GARK methods

Generalizing the ARK methods here leads to GARK (G for generalized) methods.See Sandu and Gunther These are further generalized to multirate GARK methods:

Code Style

Code linting and formatting is done with ruff. Rules are listed in ruff.toml. To check all python in the current directory, you may ruff .. To format a given file according to ruff.toml, run ruff format file.py.

About

IMEX Convection Diffusion in Python 3.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages