u/C-lize

▲ 1 r/CFD

Hello, i am trying to reimplement the diffusion solver in doyub kim's book. The code is quite long so i probably won't post it, but i see that the result has strange lines in it. They get very noticeable when the diffusion coefficient is high (possibly blew up). Just wondering if anyone come across this problem before.
The test is essentially:

def test_stable(self):
size = (160, 120, 150)
grid_spacing = (1 / size[0],) * 3
src = CellCenteredScalarGrid3(size, grid_spacing)
mp = src.bounding_box.mid_point()

def fill_func(x):
return cp.where(cp.linalg.norm(x - mp, axis=-1) < 0.2, 1.0, 0.0)

src.fill(fill_func)
data1 = src.get_data()[:, :, 75]
time_step = 0.1
diffusion_coef = (grid_spacing[0]) ** 2 / time_step / 12
diffusion_solver = GridBackwardEulerDiffusionSolver3()
target = diffusion_solver.solve(source=src,
diffusion_coefficient=1*diffusion_coef,
time_interval_in_seconds=time_step)
data2 = target.get_data()[:, :, 75]

https://preview.redd.it/rw93pkqe45zg1.png?width=1200&format=png&auto=webp&s=c6e31c2ca96ad3bf67062c44a344536c893c1e6e

https://preview.redd.it/sp8z5gpi45zg1.png?width=1200&format=png&auto=webp&s=1a6ab500f5da105e01c2bacdd30bba39db5e379a

reddit.com
u/C-lize — 10 days ago