This is a Python code that solves 1D hyperbolic conservation laws on nonuniform grids using the state redistribution method. State redistribution is an algorithm that solves the small cell problem on cut cell grids. That is, arbitrarily small cells on embedded boundary grids result in overly restrictive maximum stable time steps when using explicit time stepping algorithms. Similar in spirit to flux redistribution by Collela [1], state redistribution relaxes this time step restriction using a simple postprocessing operation. Of course, this algorithm is most interesting in two and three dimensions, but this one-dimensional code illustrates the important aspects of the algorithm.
High order approximation (p = 5) of an advecting pulse on a highly nonunform grid. The DG solution on each element is plotted with a different colour.
This simple code can be installed quickly by cloning the repository, navigating into the PyDGSRD1D
directory and running pip install -e .
The goal of this work is to use explicit Runge Kutta time steppers on highly nonuniform grids using the time step restriction
where is the cell size, and is the maximum wavespeed in the numerical solution. In the following grid, the majority of cells on the grid have size and only three have size with . That is, could potentially be quite small.
State redistribution will allow the use of a time step that is proportional not . The main idea of state redistribution is to temporarily merge, or coarsen, the numerical solution into neighborhoods located on the small cells. Then, the solution on these neighborhoods is refined back onto the base, nonuniform, grid. In the next section, we describe the different ways of determining these merging neighborhoods in one dimension (the preprocessing stage).
A number of examples are available in the examples
directory to illustrate how to use the code.
For help running the code, or any other questions, send me an email at
giuliani AT cims DOT nyu DOT edu
[1] Colella, Phillip, et al. "A Cartesian grid embedded boundary method for hyperbolic conservation laws." Journal of Computational Physics 211.1 (2006): 347-366.
[2] Giuliani, Andrew. "A two-dimensional stabilized discontinuous Galerkin method on curvilinear embedded boundary grids". https://arxiv.org/abs/2102.01857