dopfield - how to extract data

   2339   2   2
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Hi,

I need to extract data from SPH Fluid sim, density, and use it as force(gravity) magnitude.

I have a general idea how to approach it, but no luck in proper implementation

I assume I have to use dopfield() expression and turn my detail data into attribute. Or maybe I can use this expression directly in Gravity/UniformForce node ?

Pls help. Maybe there is some HIP example scene with similar case, couldnt find one.

thx!

ps.
As u can see Im trying to make bubbles. I was thinking also of another method. Since SPH sovler is computing neighbour list in every frame/iter, then maybe I could use this data insteda of density. Or is it the same ?

Attachments:
bubles.hipnc (1.1 MB)

Michal Tas Maciejewski @ www.vfxtricks.com
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Since this is SPH and it's just particles, you can either add a POP solver to process the points or just add a SOP Solver DOP which I used.

I think what you are asking for is to add additional upward direction force (0, 1, 0) based on the density of the points.

I did this in a VOP sop inside the SOP Solver DOP. The SOP Solver DOP's left most DOP Import SOP fetches the data type called “Geometry” by default which is your particles. You can then manipulate any attribute on the points you want and the SOP Solver DOP simply dumps the modified Geometry back in to the DOP object.

Any attribute is fair game and you can even cull or add points inside the SOP solver. If you are adding points, be very careful that they are initialized with all the correct attributes and that they are spaced far enough apart as again this is SPH and you don't want to create explosions. Using an attribute transfer SOP to initialize values from neighbouring points is one common way of doing this.

Hope this helps.

Attachments:
bubles_751_jw.hipnc (749.2 KB)

There's at least one school like the old school!
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Exactly, works like a charm.
So thats how i can modify per point simulation, with POP Solver.

That will do, I think i can adjust this method to apply drag to certain drops.

Thanks Jeff
Michal Tas Maciejewski @ www.vfxtricks.com
  • Quick Links