Jump to content

Preserve amount of smoke in sim.


bloomendale

Recommended Posts

Hi, i'm struggling with pyro/smoke solver and have one question:

Is it possible to to preserve the amount of smoke in sim?

If i add some density to density field, then it seems overall "sum" of all density values may increase in time (used gas reduse with sum option to calculate).

I added density only once, turned off dissipation, switched to Single Stage advection with single step type (cause MacCormack and bfecc may add some artificial density imo). But anyway density increases. Especially if i had high velocities in vel field.

Is it advection stage?

I initially tried to use divergence field to force smoke to expand depending on temp and amount of smoke in voxel (something like Gas Combustion does). I add to divergence field, projection stage modifies vel field, but i don't get just smoke expaniding - i get to much new density along with it.

Is it possible to avoid that?

Thanks in advance.

Edited by bloomendale
Link to comment
Share on other sites

Gas Advect field will never add density or anything else to your sim - because - Semi Lagrangian Advection it's an algorithm for transfer vel by vel , and all other fields in your simulation like density .Single stage algorithm much faster than BFECC and Mac Cormak but less stable. (isn't a good idea to use single stage).

Where you aded density onlu once (source volume node , fluid sorce node )?

If you want to add density only once you need to animate Scale Source Volume (source volume node) or don't use this node and put your data to Smoke object directly like an initial data.

For better understanding how divergence work - use Expand shelf tool.If you want to expand your object very fast you need to add Huge value to divergence field.

I prepared a small scene for you which will demonstrate how you can do whatt you wrote above.

Cheers :)

once_density_and_divergence.hip

Link to comment
Share on other sites

but i don't get just smoke expanding - i get to much new density along with it.

The non-divergent projection stage of simulation is meant to keep a fluid incompressible. "Expanding" fluid is analogous to creating more fluid. You're asking for varying compressibility within your fluid. The solver's capabilities amount to adding more fluid where it is "expanding" via the divergence field. Perhaps you aren't asking the right question.

I could only suggest subtracting the additional divergence field from your density at the end of the solve.

Edited by ikarus
Link to comment
Share on other sites

Thanks.

I have some understanding of what is going on so it's not i'm forgot to emit only once or something. it's something deeper.

1)But actually advection create density. I changed your file a bit. Look at LOOKATME data in smoke object - "sum" field - you'll see actual amount of density in sim. It will create 10%+ of density after 200 frame (default maccormack, bfeec is better here). And there is almost no velocity.

2) in the same example i copy density field to divergence field. This way i wanted to force projection to create some outgoing velocity to expand density. But it also creates new one along with expanding.

3ak_once_density_and_divergence.hipnc

Link to comment
Share on other sites

The non-divergent projection stage of simulation is meant to keep a fluid incompressible. "Expanding" fluid is analogous to creating more fluid. You're asking for varying compressibility within your fluid.

Thanks.

But what is the point to have Soot in gas combustion for example? You'll have to live with additional density any way - check or not this checkbox.

As for incopressibility - i don't see how my intrusion in divergence field BEFORE projection stage creates compressibility as result. Projection just creates velocity going from divergent voxels to "disperse" density.

More important is that i thought projection is working with vel field only (actually it is) so it can't add more density - only create more velocity.

And the main question: What node in smoke solver creates additional density when i add divergence? There is no such node. Divergence field is used only in projection stage which modifies only vel field (and pressure).

So advection seems to add this density.

Edited by bloomendale
Link to comment
Share on other sites

You need to understand - It doesn't add new density to your sim.You used density like a filed for divergence - now try to immagine it in loop Your Density is positive - your fluid will expand every frame through itself.If you will put Gasintermittent solve below gas calculate and will say use only once and set frame offset to 1 and multiply your source field by 10 or 20 for good effect you will see your density will no add.Divergence field will never add more denity to your sim.It only will expand if Div field positive or will contract if Div field is negative and nothing more. For better understanding I can recomended to you the Book Fluid Simulation for computer Graphics - Robert Bridson.

3ak_once_density_and_divergence.hipnc

Link to comment
Share on other sites

You need to understand - It doesn't add new density to your sim.You used density like a filed for divergence - now try to immagine it in loop Your Density is positive - your fluid will expand every frame through itself.If you will put Gasintermittent solve below gas calculate and will say use only once and set frame offset to 1 and multiply your source field by 10 or 20 for good effect you will see your density will no add.Divergence field will never add more denity to your sim.It only will expand if Div field positive or will contract if Div field is negative and nothing more. For better understanding I can recomended to you the Book Fluid Simulation for computer Graphics - Robert Bridson.

1) Using gas intermittent solver with Only once is something like enable solver with $SF==1. Anyway even so it still add density. Look at LOOKATME/sum on smoke object. Divergence field with value > 0 says Gas project non-divergent to create vel from this voxel, value < 0 - to this voxel. And Gas project non-divergent should (and does) modify ONLY vel field. Where is new density come from?

2) gas dissipate is cheat in this case) it just deletes some density.

Here is image explaining what i'm asking:

m_20121205-hcep-35kb.jpg

3ak_once_density_and_divergence2.hipnc

Link to comment
Share on other sites

if the density is a byproduct of divergent advection why cant you just subtract the divergence field from density?

houdini fluid solvers werent designed for CFD they were designed to emulate it with speed and control artists need, so accuracy isn't going to be exact :P

Edited by ikarus
Link to comment
Share on other sites

Divergence will never add density - never. :) It's only affects to Vel Field.

yes, i wrote exactly the same a few posts earlier)

It seems advection is what causes this new density.

I added simplidied smoke solve - just added density on first frame, added the same source to divergence, project and advect. And voila - tons of new density.

ikarus - i don't think there is such simple connection between divergence field and resulted density. So subtracting will not help imo.

3ak_once_density_and_divergence3.hipnc

Edited by bloomendale
Link to comment
Share on other sites

Your image explains it perfectly, you start off with 4 voxels of density, you want to expand outward. in the grid you think the advection should output you have 12 voxels of density. so you're "creating" density regardless if the original voxels are empty or not. Conservation of mass isn't fulfilled in your hypothesized result so I don't see why the output of the solver is a problem.

Link to comment
Share on other sites

My bad - i forgot to increase transparency)

in this 2d example i want to get ring of smoke with the same overall amount ( and lower opacity).

But i got what you said - solver don't try to preserve overall amount of density.

Still trying to solve my this)

Attempting to use density gradient (even blurred) as base for vel field gives strange result (and there is even bigger problem with uniform density chunks).

So if you have suggestions you're welcome)

Link to comment
Share on other sites

I wonder if there is something special about a field named density. What happens if you put another field in there and advect that. Does it still increase?

It doesn't matter imo. Any microsolver has GUI to explicitly set what fields to use and change.

Solver tries to maintain the same density in "density" field ("boo" in my example), not the overall amount of smoke.

3ak_once_density_and_divergence4.hipnc

Edited by bloomendale
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...