TransWikia.com

How avoid square shape with Laplacian operator in reaction diffusion calculations?

Computational Science Asked on August 28, 2021

I have used different variants of the Laplacian operator (div grad) using 4, 8, 12, 20 and 24 of the closest points. I get problems due to the chosen coordinate system and the discretization of the Laplacian operator. See images originating from circular symmetric seeds:

Different Laplacian implementation in reaction diffusion

It is implemented as https://www.shadertoy.com/view/3sGXWG .

The Laplacian stencils are

Laplacian stencils

where red points are used in upper left in the first image,

red + green in upper middle,

red + green + blue in upper right,

red + green + blue + orange in lower left box.

red + green + blue + orange + black in lower middle

red + green in is used on lower right with whighting according to Steven Roberts answer.

The equations don’t show the problem but they are

$$
frac{partial red}{partial t} = nabla^2 red (red + 4 green)
frac{partial green}{partial t} = nabla^2 green (red + 4 green)
red := 0.99 red + 0.01 green
green := green + 0.05 green(1 – green) – 0.03 red – 0.001
red < 0: red := max(green, 0)
green < 0: green:= max(red, 0)
$$

How can I keep spherical symmetry?

One Answer

There are finite difference stencils specifically designed to have rotational symmetry. For example, instead of the standard second order stencil $$ frac{1}{h^2} begin{bmatrix} & 1 & 1 & -4 & 1 & 1 & end{bmatrix} $$ you can use $$ frac{1}{6 h^2} begin{bmatrix} 1 & 4 & 1 4 & -20 & 4 1 & 4 & 1 end{bmatrix} $$

I first came across this in

Hundsdorfer, Willem, and Jan G. Verwer. Numerical solution of time-dependent advection-diffusion-reaction equations. Vol. 33. Springer Science & Business Media, 2013.

on page 301, but I'm sure it's in other sources as well.

When I tried this out in your shadertoy, it unfortunately didn't resolve your issue, and the pattern looked similar to the ones you provided. I think the real issue is that the circle produced when you click is not a perfect circle, but an approximation on the finite difference grid. This initial condition is axially symmetric but not radially symmetric. Refining the mesh would help, but you cannot exactly represent a circle on a Cartesian grid. My guess is that these slight approximation errors eventually cause the non-symmetric artifacts.

Answered by Steven Roberts on August 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP