Skip to content

Conversation

@mitxela
Copy link

@mitxela mitxela commented Jan 16, 2025

In the FLIP demo, when transferring velocities to particles, solid cells should not be considered valid.

Particles in contact with the left wall were constantly pushed downwards, this fixes that. It doesn't really matter except that it means the fluid doesn't come to rest. It still doesn't fully settle as there are some other effects on the other edges, not sure if it's worth trying to fix these though.

PS Thank you for making these tutorials, they're excellent.

@emlyn
Copy link

emlyn commented Jan 19, 2025

Good find, I was wondering what was causing the movement down the left hand side.

It's true there is another effect on the right hand edge (and also the top, but that's not so noticeable, unless you change the gravity direction) that causes what looks like bubbles/boiling. It seems to be dependent on resolution: if you find the line var res = 100; and change that to 150 it gets really bad, while at lower numbers like 50 it's unnoticeable.

@metarapi
Copy link

It's true there is another effect on the right hand edge (and also the top, but that's not so noticeable, unless you change the gravity direction) that causes what looks like bubbles/boiling. It seems to be dependent on resolution: if you find the line var res = 100; and change that to 150 it gets really bad, while at lower numbers like 50 it's unnoticeable.

I can see it looks like chain reactions.

At first I though it could be that the push apart logic is causing this because it's updating the particle positions sequentially. So I tried to accumulate all the positional updates in a buffer and then apply them at the end. Didn't help.

However, reducing the dt or increasing simHeight does help.

The positional/velocity updates are too large with regards to the simulation size it seems - since it's simHeigth which determines the particleRadius through h.

Copy link

@blueedgetechno blueedgetechno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an extra j == f.fNumY - 1 case at line 744 fixes the boiling effect issue on gravity changes. Essentially adding a top wall.

if (i == 0 || i == f.fNumX-1 || j == 0 || j == f.fNumY-1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants