Jack12xl / a-toy-fluid-engine

try to reimplement Euler based fluid
MIT License
46 stars 3 forks source link

Mac Grid could still have bugs #8

Closed Jack12xl closed 3 years ago

Jack12xl commented 3 years ago

From here, the results from uniform grid and Mac grid differ a lot.

Jack12xl commented 3 years ago

By changing the boundary condition during calculating divergence, the results of uniform grid somehow match mac grid. Found a good explanation for this at https://www.karlsims.com/fluid-flow.html

Jack12xl commented 3 years ago

Specifically, the reason why the results of uniform and mac differs a lot lies in the boundary condition during divergence calculation. In line here, we originally set the outlier velocity along the dimension as negative velocity at the boundary. This would make divergence at the boundary bigger. The phenomenon is way more obvious when the jet is on boundary.

The current solution is to set the outlier velocity equal zero.