Position Based Fluids smoke and fire

Started by
7 comments, last by GameLad 7 years, 6 months ago
How do you simulate smoke and fire using position based fluids? I kind of understand how the pressure constraint works.
Advertisement

Well the way it is described in the paper. If you haven't implemented any kind of fluids so far, I suggest you to start with grid based simulations.

I've already implemented one small grid based solver using semi lagrangian advection. The Navier-Stokes equations in that instance are closely followed during discretization. They equation is split and solved according to diffusion, advection of velocities and incompressiblity is enforced by subtracting the gradient of the vector field from the current vector field (or adding, I forget the details).

Position based fluids is linked to SPH. I get some of the math behind it, I've implemented a simple distance constraint to get familiar with the PDB framework. PBF only has one constraint (minus the collision constraints created at each step). The pressure constraint enforces incompressiblity.

I'm new to lagrangian and PBD dynamics, I'm looking for a simple answer on whats possible in order to save some time.

Is smoke and fire possible in PBF? I can't find any references on Google about this.

And one more silly question about implementating PBF. Like I said I'm new to particle methods. How do you maintain the distance between particles using the radius? Does finding the delta position, and applying that correction automatically prevent particles from penetrating each other? Or do smoothing kernels take the radius into account?

Smoothing kernels are always build around some fixed radius/distance which is in SPH mostly a multiple of the particle radius - so that more than one particle can be included in the calculation.

Okay thanks, that should explain how positions are corrected.
To fully answer my own question, and to help anyone who may have a similar question. The answer is yes it is possible. Look for Unified Particle Physics for Real-Time Applications.
So decided to not use Position Based Fluids, I switched to SPH.

I have a working SPH simulation in 2D. When the particles are in motion everything works fine. But once the simulation comes to a rest particles at the bottom begin to oscillate violently and eventually penetrate the boundary particles. I have tried dampening the simulation with two types of viscosity, XSPH and Artificial viscosity. They only helped slightly. Smaller time steps don't help either. Obviously pressures are building at the bottom. Is there another way to do fix this apart from viscosity and smaller timesteps?

After trying different things I don't think the boundary is the issue because if I increase/decrease the boundary inter particle spacing, nothing happens.

The oscillations happen mainly horizontally.

It's very difficult for us to say without having seen any of your code. It's all in the kernels and in tweaking variables. Also, I have reduced instability along the edges in my simulations by "softening" them up; rather than force the particles to stay inside the container by manipulating their position directly, treat the edge as a spring that will allow the fluid to expand a little beyond it when pressure builds up.

Cheers,

Mike

I forgot to update this thread, I managed to find the problem, I forgot to set external forces to zero at the beginning of every step. Here is the result.



I'm using a different boundary method that uses a precalculated weight to create a pressure force that prevents particles from penetrating.

Thanks for the help, much appreciated.

This topic is closed to new replies.

Advertisement