Jump to content

How do pyro collisions work?


evanrudefx

Recommended Posts

Hello,

Could anyone explain exactly how pyro collisions work? In some cases, it doesn't seem like collisions with the smoke solver are "real" when using moving colliders. It seems like 2 things happen when using an animated static object: 

1. Takes the velocity from the collider and advects the smoke with it
2. Delete any density that goes inside collision object (can be disabled)

Look at my gif. If I disable velocity from the collision nothings happens. The density just gets deleted. In the example I turned off correct collisions for better visualization. If the collisions were "real", I would expect the density to move when the collider moves, then stop once the collider stops since no velocity from the collider is being applied. 

Any ideas?

 

smoke_collision_test.hip

Edited by ejr32123
Link to comment
Share on other sites

I guess I don't get what the problem is? You could add drag.

Your example shows the default, smoke existing in the vacuum of space. Why would you expect it to slow down in a frictionless environment?

Link to comment
Share on other sites

There really isn't a "problem" it is more so trying to understand how collisions work. I am not trying to achieve a look or do some effect. I am just wondering how collisions work. Just trying to see if what I think is correct about collisions:

1. Takes the velocity from the collider and advects the smoke with it
2. Delete any density that goes inside collision object

Edited by ejr32123
Link to comment
Share on other sites

Hi Evan,
Here is what I think:
1. Afaik, you are right. Important field here is the collisionvel. In the second example, in SOPs, you set the collider's velocity to 0 ... so although in SOPs, the object is "moving", DOP sees its velocity as 0. So the "collisionvel" field is not affected by SOPs.
2. You are also right. If you keep the default "Correct collisions" on, then the "unaffected" density gets erased inside the collider.

I created this script "Find all parms referencing this parm" to dig deeper into DOPs. If you have any questions, I will gladly explain how to work with the tool. The blog post is rather minimal:
http://lex.ikoon.cz/find-all-parms-referencing-this-parm/

 

The script found the "collisionvel" here inside the Pyro Solver:

NODE: gasenforceboundary1   // PARM: Collsion Value   // RAW: collisionvel
NODE: buildcollisionmask   // PARM: Collision Velocity Field   // RAW: collisionvel
NODE: clean_collisionvel   // PARM: Dest Field   // RAW: collisionvel
NODE: clean_collisionvel   // PARM: Source Field   // RAW: collisionvel

 

The "Correct Collision" is referenced by these:

NODE: smokesolver_build2   // PARM: Correct Collisions   // RAW: ch("../correctcollision")
NODE: enable_correct_collisions   // PARM: Default Switch Value   // RAW: ch("../correctcollision")
NODE: clamp_inside   // PARM: Field   // RAW: `chs("../correctcollisionfields")`
NODE: color_correct_collisions   // PARM: Enable Solvers   // RAW: ch("../correctcollision")
 

And the "Velocity Scale" (collisionsource1) is referenced just by this node (Trail SOP)

NODE: compute_velocity   // PARM: Velocity Scale   // RAW: ch("../velscale")

  • Thanks 2
Link to comment
Share on other sites

Btw you can also add Visualiser to the "collisionvel" field (it is not visualized by default)

- unlock the /obj/smoke_no_vel/dopnet1/pyro/smokeconfigureobject2
- find the "collision_velocity" node
- add a "Vector Field Visualization" node

Connect and set it, something like this:

image.thumb.png.c557733448ca173c5c5436ac625b6576.png

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

Hth, few more notices:

- now I found this great answer:
   https://www.sidefx.com/forum/topic/55015/#post-246795
- collision field is just a scalar field
- btw have you seen this great explanation? At 29:00 Jeff talks about divergence https://vimeo.com/42988999

 

The "make_divergence_free" part of smoke solver is three steps
( 2.A or 2.B or 2.C, depends on the method you choose)

make_divergence_free.thumb.PNG.e0f781b03753138c17e6e437f9e55c37.PNG

 

1. Gas Enforce Boundary
http://www.sidefx.com/docs/houdini/nodes/dop/gasenforceboundary.html

1.PNG.02eb71e44a3d191c7feae5a7fe2ddefa.PNG

 

2.A  Gas Project Non Divergent
https://www.sidefx.com/docs/houdini/nodes/dop/gasprojectnondivergent.html

2a.PNG.ea1f933258f5babe0905334411c2af38.PNG


2.B or 2.C Gas Project Non Divergent Multigrid (or its OpenCL version enabled)
https://www.sidefx.com/docs/houdini/nodes/dop/gasprojectnondivergentmultigrid.html
 

2bc.PNG.96ef33d2203d4a88114dd031142d2ace.PNG


3. Gas Feedback
http://www.sidefx.com/docs/houdini/nodes/dop/gasfeedback.html

3.PNG.a61dbacc2e5025c46b0efaa58f413b89.PNG

 

Edited by ikoon
  • Like 3
Link to comment
Share on other sites

So, one more notice about the creation of the collitionvel field:

Inside the Smoke Solver, there is the Gas Build Collision Mask node.

From the docs:
The Gas Build Collision Mask DOP builds a collision field that represents where affector objects overlap with the fluid field. It generates a signed distance field which is negative inside colliding objects and positive outside. It also generates a collision velocity field that stores the velocity of the affector object closest to each point.

http://www.sidefx.com/docs/houdini/nodes/dop/gasbuildcollisionmask.html

buildmask.PNG.4669c92631839747bd6d97373bbe670b.PNG

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...