Jump to content

Flip Fluid vorticity


JuriBryan

Recommended Posts

Hi everyone.

I have a question regarding vorticity for particle fluids in houdini.

I know that Igor and most other naiad artist use it all the time to render their sims with frost, krakatoa and Houdini, but I can't find a way to extract the vorticity out of Houdini Dops that actually works with out flickering.

Right now I am creating a new field using the GasMatchField node, then I run the GasAnalysis node with vel as my source field.

I calculate the curl of vel and store the results in my newly created field ,vorticity, then I use a GasFieldToParticle node to get the values onto my particles for shading and rendering.

The result is a flickering "something" that is not usable for anything.

Any Tips on how to calculate the vorticity correctly would help immensely!

vorticity.hipnc

Cheers,

Juri

PS: is it just me or is the DOP VOP Force really really slow?

Link to comment
Share on other sites

It sounds like you override the vorticity on the particles on every frame, to get around the flickering you might want to try to accumulate it over time using the FLIP method. Peak inside the solver how SESI does it. (instead of overriding it all, add a percentage per substep)

Yes VOP's in DOPs tends to be slow. I try to use it for prototyping and when I want to use ramps. Most other things can be done with microsolvers. The new linearcombination DOP is great.

Link to comment
Share on other sites

wait, so the flip solver is already calculation vorticity?

if so, why can't I see it in the details view of the solver/fluid object?

and would I simply pre multiply the input source by 0.25 or something like that on the GasFieldToParticle node to get the percentage you are talking about?

Thanks for the fast reply!

Link to comment
Share on other sites

Unless it's in 12.5 Houdini doesn't calculate vorticity...

I'd have a field where you are going to have your final vorticity (so what you'll be exporting) and a different field for when you are calculating curl. Then you can take the max from them each frame so you're not just overwriting it. You'll then (or probably before) want to subtract a little so it fades. You'll stop flickering this way.

I just made you a quick scene doing what I'm describing on points. You seem to be able to work out what you want in microsolvers, so you should just be able to apply the same idea. Don't do it in vops on points, it's MUCH MUCH quicker to do it in fields and splat it over, like you're doing now.

Hope that helps

Christian

pointsFade.hip

Edited by ChristianW
Link to comment
Share on other sites

I think you should just keep on doing what you are doing, but only adjust how you project/update the vorticity to the particles. The general idea of the FLIP projection method is to take your previous value from the particles and blend it with the current and then store it back on the particles.

Link to comment
Share on other sites

okay.... So I am at a total loss right now.

I get Christian's idea, and it makes total sense, but it seams that I am still to new to micro solvers as tho to implement it working into Dops.

Or should I be implementing the method in sops after the simulation?

I am really kinda at a dead end... if anybody has the time to modify my file or maybe upload one that has vorticity working I would highly appreciate it.

Micro solvers is something I really want to get good at but right now they are simply confusing me:)

Cheers,

and thanks again for all the help so far!

Link to comment
Share on other sites

I'll have a go after lunch, unless Nicky Nimby wants to put his money where his mouth is and do it before then.

It should be done in microsolvers, not post sim, although you could if you wanted to I guess.

Link to comment
Share on other sites

Here you go. You were doing it wrong in your test scene.

Match field is to create an empty field that matches the "resolution" of another field, then you have to add data to it.

So this is getting the curl vector, then the magnitude (the length) of the vector, which is what you want to colour by. Then at the stamp stage I'm pre-multiplying last frames magnitude by 0.8 (so 80%) before then taking the max of the current frame and last frame to get the effect you're after.

Play with the visualizer range in the flip object to mess with the amount you want. I'd probably add a vopsop after import and add a ramp in there to control the look prior to render.

Hope that helps

Christian

micro_vorticity.hip

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

No worries, microsolvers are hard at first to get your head around (mainly how the data flows differently than SOPs), but soon you'll be thinking 10 steps ahead on how you're going to hook it all up...

Glad I could be of help.

Christian

Link to comment
Share on other sites

  • 8 months later...

You can calculate the gradient of the vector components and plug the values into the curl equation:

cb77a0a122723f78710d07bf0fbd4a0c.png

 

ie. let g = gradient of v,   curl(v) = {gzy- gyz, gxz- gzx, gyx- gxy}
 

gradient operations are available in sop and dop contexts

Edited by ikarus
Link to comment
Share on other sites

this is interesting! how would you calculate velocity at sop level? I know the formula is curl(v) but where would you actually be able to calculate curl? in a vopsop? or through vex?

Have a look at the Whitewater Source SOP, it does what Raymond says with Volume Analysis SOPs and a VOPSOP.

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...