Jump to content
• Advertisement

# Position Based Fluids smoke and fire

This topic is 787 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

How do you simulate smoke and fire using position based fluids? I kind of understand how the pressure constraint works.

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
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?

#### Share this post

##### Share on other sites

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.

#### Share this post

##### Share on other sites
Okay thanks, that should explain how positions are corrected.

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites

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

Edited by h4tt3n

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5
• Advertisement

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633709
• Total Posts
3013481
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!