Jump to content

Q: Building Gas Fields, Masks, Custom Forces


Recommended Posts

Hi people, been lurking around here and gathering all the knowledge you are sharing, so thanks to each of you contributing to the forum.

Lately I've been trying to understand another side of Smoke simulations and ways of controlling them. Before posting this I've gone through the most popular posts on the forum like "getting rid of mushroom" and others where there is tons of knowledge to pick up, I've also read the documentation on Microsolvers (Analysis, Match Field,...) multiple times in hope to understand which nodes to use and how to properly set them up.

Could somebody point me to any resource to understand the workflow on building custom fields, how to use Gas Analysis, how it's related to Gas Match Field and some other aspects of these MS. I've been trying to understand what the documentation is saying and it's still a bit blurry to me compared to how other nodes are so well explained.

A few days ago I've only read a quick post about building one but it doesn't explain much, it's more in the likes of "click this and click that, done".

Apart from cracking open the Pyro Solver and individual Gas Microsolvers, where have you people picked up the knowledge  / workflow on building custom fields. For what I've noticed people making tutorials and forum posts tend to steer away from anything that isn't Gas Turbulence, Shredding, Disturbance. Even a quick clarification on Gas Analysis / Calculate and it's common uses from you experienced people would be a massive help.

Many Thanks!

 

  • Like 1
Link to comment
Share on other sites

Gas match field will let you create a new field and gas analysis will do a specific calculation, such as find the gradient or curvature.  It's similar to the vdb analysis.  Then gas calculate lets you do math operations, such as combining fields by adding or multiplying, etc.  So if you had a FLIP sim, you could use a gas match field to create a new field, using the flip surface field as reference.  Then you could calculate the gradient of the surface, and store it in that newly created field.  Make sure to pick the right class of field for the new field, based on the operation you'll do with the gas analysis.  Ie: to store a gradient calculation, it needs to be vector. Now you have a vector field, based on the gradient of the flip surface.  You can use a gas calculate or gas linear combination (preferable for simple operations) to add that field to vel.

Also, there's a masterclass called 'building fluid solvers" or something like that. definitely worth checking out.

Edited by loudsubs
  • Like 2
Link to comment
Share on other sites

Hi, the mentioned masterclass is probably this:
https://vimeo.com/42988999

 

I also like this tutorial:
https://vimeo.com/119694897
 

Matt Estela has great tutorials:
http://www.tokeru.com/cgwiki/index.php?title=HoudiniDops#
http://www.tokeru.com/cgwiki/index.php?title=Smoke_and_Pyro
 

I don't know if there is any new video tutorial, which describes the low-level principles. I learn by digging into the "shelf" solutions
https://forums.odforce.net/topic/41800-gas-analysis/?do=findComment&comment=199863
https://forums.odforce.net/topic/42101-how-do-pyro-collisions-work/?do=findComment&comment=201007
 

Btw, when I am digging, I use this script "Find all parms referencing this parm".
http://lex.ikoon.cz/find-all-parms-referencing-this-parm/

 

Here is an attachment, microsolvers_dev.rar with lots of experiments, just for an inspiration. Unfortunately lots of it is outdated (it is from the year 2011)
https://forums.odforce.net/topic/13748-learning-microsolvers/?do=findComment&comment=101666

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

Hi @ikoon & @loudsubs

Thanks a lot for both of your replies. Where on earth have you been all this time, that's probably the most useful script that exists, thanks so much for sending out the links. I've watched the masterclass and a few other videos, some of which you posted are still new so I'll surely adding them to my watch later list.

Would you mind if I continue this topic a bit further? Both clarifications helped to understand the whole thing quite a lot.

So let's say in your example, you have a Gradient built from the surface of your FLIP sim, where / how would that vector field be used? Would this just be a case of filling the Gas Calculate > Dest Field with vel and your Source Field with the name of the field created and using a specific Calculation method? Even the quote from that fluid masterclass : "advect velocity by velocity" is messing with my head at this point.

I'm only aware of a method where you feed a certain field to control where for example GAS Turbulence affects the simulation but even that is not really intuitive because in order to use a mask in a simulation you need to put the name of the field into Gas Turbulence > Bindings > Density Field and I'm finding it a bit hard to understand why that should be placed there in order to work. An example for that would be a dotproduct of the gradient and velocity to mask only the top part of the smoke (if it's moving up), but again, I've read about it but there isn't much of an explanation why certain things are done the way they are.

Second question would be; to understand Curl, Gradient, Laplacian a bit more than just the document explanation: "The simple case of a scalar field results in a vector field which points in the direction of increasing scalar values." would it be worth just watching a few Khan Academy videos on physics to really get a grasp of all these aspects? 

I'm pretty comfortable with most of the aspects of Houdini, but understanding a few things above was my goal for the past year of researching.

Thanks again!

 

Link to comment
Share on other sites

Hi char, I would also like to know more about these deep things, so I hope other users will also contribute. My know-how is unfortunately not enough to explain these things. But if you have time and mood to "dig", then the gasvortexconfinement is really nice combination of Gas Match Fields, Analysis (Curl then Length then Gradient, then Normalize) and then Gas Cross, Gas Combinations, Gas VOP. It "applies" calculated result to the vel.

From the docs about gasvortexconfinement:

The Gas Vortex Confinement DOP applies vortex confinement to a velocity field. This is a force which amplifies existing vortices with the intent of undoing the diffusion that occurs during the diffusion stages of the fluid solver.


You can also look at videos from 3Blue1Brown or Khan Academy, so you know how these nodes together "find" and amplify the Vortex direction:

https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/curl-grant-videos/v/2d-curl-intuition
https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/curl-grant-videos/v/3d-curl-intuition-part-1

 

gasvortexconfinement.thumb.PNG.6a695f0133543bcbe75edc1661846b19.PNG

 

  • Like 2
Link to comment
Share on other sites

Hoping this topic picks up and more people engage in the conversation as well @ikoon

That's interesting, haven't really been looking into vortex confinement too much so seeing this is encouraging enough to try and dissect it later. I'm guessing a\ll that (curl, grad,...) is essentially a representation of Rotation, Magnitude, Direction and then normalization in a simulation, correct me if I'm wrong.

Been watching Khan videos on Gradients and Curl yesterday, really wish I found his content earlier, loads of gems right there.

The examples from 2011 are still quite relevant in H16.5, all opens up normally and I did have a quick peek just now, so recommending it to anyone learning like me.

  • Like 1
Link to comment
Share on other sites

6 hours ago, char said:

So let's say in your example, you have a Gradient built from the surface of your FLIP sim, where / how would that vector field be used? Would this just be a case of filling the Gas Calculate > Dest Field with vel and your Source Field with the name of the field created and using a specific Calculation method? Even the quote from that fluid masterclass : "advect velocity by velocity" is messing with my head at this point.

Yeah that's pretty much it, make a simple scene and test it.  Think of it like doing vector math in a vopsop.  the gradient fiield is a vector, and you can add it to the vel field which is another vector.  You can also mulltiply a vector field by a scalar field, (ie: temperature).  That is how buoyancy works in a smoke sim, there is a bouyancy direction (a vector), and it gets multiplied by a scalar field, temperature, which controls the magnitude.

 

Quote

I'm only aware of a method where you feed a certain field to control where for example GAS Turbulence affects the simulation but even that is not really intuitive because in order to use a mask in a simulation you need to put the name of the field into Gas Turbulence > Bindings > Density Field and I'm finding it a bit hard to understand why that should be placed there in order to work. An example for that would be a dotproduct of the gradient and velocity to mask only the top part of the smoke (if it's moving up), but again, I've read about it but there isn't much of an explanation why certain things are done the way they are.

The control field parm of some of the shaping tools is indeed a mask, almost like a group field in sops.  It wants a scalar field like density or temperature, or something custom like fit length of a curl field (which you could get with a couple gas analysis nodes and a gas vop) You dont really need to mess with the bindings tab often.

You can do some of these operations with vdbs in sops (vdb analysis), and then lookup the volume values on points that are sitting in the same position using a pointvop and volume sample.  This can be a good way to inspect the numbers more if youre trying to figure what exactly the calculation is doing

Link to comment
Share on other sites

That's some great explanations there, thanks for that. I've been testing a few nodes now and it's  a bit clearer how certain calculations are done. Now I just need to figure out where and when this could be implemented in a simulation.

Link to comment
Share on other sites

Hi char, btw did you go through the DOP Examples, which are shipped with Houdini?

Some of them are obsolete. Now I loaded this one (GasTargetForce.hda), it uses abandoned method (Source Volume DOP, now we use the new Volume Source DOP).

But as regards microsolver principles, implementations and inspiration, those examples should serve well:
C:\Program Files\Side Effects Software\Houdini 17.5.258\houdini\help\examples\nodes\dop\gastargetforce\GasTargetForce.hda

  • Like 1
Link to comment
Share on other sites

Hi @ikoon

Which ones are we talking about, I'm only aware of the Example Files provided in the Help Documents for most of the nodes which come with Houdini and can be loaded through F1 Help menu. These Example Files?

So guessing I need to find the folder you mentioned and load them in manually due to them being .hda files?

Link to comment
Share on other sites

I'm going to guess you could implement the techniques from earlier versions of Houdini and use them in 16.5 or 17 (new volume worfklows) with the knowledge we have, shouldn't be too hard as I was still able to open Microsolvers_rnd from 2014 the other day without any problems in Houdini 16.5.

Going to explore the examples a bit more, wasn't aware there are more than just the ones in the documents.

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