Velocity Verlet Integration for SPH Fluids

1k Views Asked by At

I am trying to implement a SPH (Smoothed Particle Hydrodynamics) based fluid solver and would like to use a second order integration method, for updating velocities and positions of the fluid particles. Some resources suggest using the velocity Verlet method, which to my knowledge, is as follows:

  1. $v^{n+1/2}=v^n+\frac{\Delta t}{2}a^n$
  2. $x^{n+1}=x^{n}+\Delta t v^{n+1/2}$
  3. $a_{n+1} = f(...)$
  4. $v^{n+1}=v^{n+1/2}+\frac{\Delta t}{2}a^{n+1}$

Where $a^0 = f(x^0, v^0)$ is computed beforehand. I would like to know how to proceed in step 3. To compute the acceleration both, the particle position and velocity, are needed. I guess position and velocity at time $n+1$ are required, but how am I am supposed to obtain $v^{n+1}$? I am sorry if this a silly question, but I found the resources I have found so far a little irritating...

Thank you in advance.