2.7. Spherically symmetric PDE

This example illustrates how to solve a PDE in a spherically symmetric geometry.

spherical grid

Out:

  0%|          | 0/0.1 [00:00<?, ?it/s]
Initializing:   0%|          | 0/0.1 [00:00<?, ?it/s]
  0%|          | 0/0.1 [00:02<?, ?it/s]
  7%|7         | 0.007/0.1 [00:03<00:42, 461.65s/it]
 15%|#5        | 0.015/0.1 [00:03<00:20, 243.27s/it]
 29%|##9       | 0.029/0.1 [00:03<00:08, 125.84s/it]
 29%|##9       | 0.029/0.1 [00:03<00:08, 125.86s/it]
100%|##########| 0.1/0.1 [00:03<00:00, 36.50s/it]
100%|##########| 0.1/0.1 [00:03<00:00, 36.50s/it]

from pde import DiffusionPDE, ScalarField, SphericalSymGrid

grid = SphericalSymGrid(radius=[1, 5], shape=128)  # generate grid
state = ScalarField.random_uniform(grid)  # generate initial condition

eq = DiffusionPDE(0.1)  # define the PDE
result = eq.solve(state, t_range=0.1, dt=0.001)

result.plot(kind="image")

Total running time of the script: ( 0 minutes 4.052 seconds)

Gallery generated by Sphinx-Gallery