machine-learning-and-simulation icon indicating copy to clipboard operation
machine-learning-and-simulation copied to clipboard

Spatial Discretization is incorrect for FFT application

Open Ceyron opened this issue 3 years ago • 0 comments
trafficstars

In these three small simulation scripts:

  • https://github.com/Ceyron/machine-learning-and-simulation/blob/main/english/simulation_scripts/kolmogorov_turbulence.jl
  • https://github.com/Ceyron/machine-learning-and-simulation/blob/main/english/simulation_scripts/stable_fluids_fft.jl
  • https://github.com/Ceyron/machine-learning-and-simulation/blob/main/english/simulation_scripts/stable_fluids_fft_3d.jl

the Fast Fourier Transformation (FFT) was used slightly incorrectly. When setting up the spatial mesh, points on both ends of the boundary are included. That introduces noise and aliasing because the domain is no longer its original size, but slightly larger. See also PR #6.

The fix proposed in PR #6 should also work here, but it would require some additional changes to the code in order to make subsequent operations work as well. Most importantly, the interpolation part of the semi-lagrangian advection scheme would require slight rethinking.

Ceyron avatar Jun 05 '22 09:06 Ceyron