I am trying to follow Robert Bridson's Fluid Simulation Notes (https://www.cs.ubc.ca/~rbridson/fluidsimulation/fluids_notes.pdf) to implement my own eulerian fluid simulator for the first time.
I was previously using a Gauss-Seidel pressure solver for my fluid. But it turns out it had many limitations, eg: it was slow to converge, and boundaries were not well managed at higher resolution grids.
So according to the notes, I tried to implement MICCG0 = Modified Incomplete Cholesky Conjugate Gradient, Level Zero for solving the pressure as it was promised to solve it way faster and more accurately.
I am running into some fatal issues following the pseudocode given in his book.
The liquid just when reaches/tries to touch a solid boundary the solver breaks down, all pressure values become -Nan(ind) and the error shows up in the advection step, where the x_prev = x - v * dt step (Semi langragian advection) is impossible to carry out! (because the velocities also become Nan after the projection step)
If anyone has implemented this in the past, I would be grateful if you could share me some code of your solver, it might greatly benefit me in solving my problem. Anyone else wanting to take a look is welcome too.
My repo: https://github.com/KrrishDhiman/Buoyancy-Simulator/blob/main/main.cpp (all the code in this file)
My main question: How should Neumann Boundary Conditions be integrated into MIC(0) preconditioning for the Poisson equation in fluid simulation to prevent pressure blowing up?
I followed my pressure solver code from the pseudocode given on followed from pg 34, fig 4.1 and the preconditioner code from a few pages later, fig 4.2 and how to apply the preconditioner from fig 4.3.