sarbian / SmokeScreen

BSD 2-Clause "Simplified" License
16 stars 14 forks source link

Dev #3

Closed eggrobin closed 10 years ago

eggrobin commented 10 years ago

Modeled the smoke as noninteracting spherical smoke bubbles (the particles) that fill up with atmospheric air as they grow. When colliding, they are deflected sideways randomly so that the "pressure" doesn't increase. EDIT: the proportion of the normal velocity which gets turned to random sideways velocity is 1 - stickiness, see last comment. Added support for drag, buoyancy and weight of said bubbles. You might want to change the defaults.

Note that with drag support, no damping should be used. Hotrockets will look weird with this (damping, drifting smoke). I tried making my own .mu file, and while it is okay for testing the general principles, things look pretty ugly. Note however that the smoke correctly runs along the trench and rises (the drag coefficient and initial velocity of the smoke balloons needs to be tuned, it just looks like there's a giant barbecue underneath the rocket in this screenshot). screenshot3 Do you have an unity project that I could tweak in order to facilitate debugging?

eggrobin commented 10 years ago

Made dragCoefficient a cfg setting. Also, got some nicer results by random cfg tweaking, see below. I think someone with actual skill might be able to make this look good. A nice side-effect is that with an initialDensity greater than that of the surrounding air, the smoke falls. This can be used for the condensation clouds of cryogenic propellants, see first screenshot below (the smoke rising in that screenshot is due to the deflection, the velocity was not set to 0).

Random thought: a nice option would be particles that do not grow exponentially (i.e. do not use grow), but grow like underexpanded exhaust, i.e., to meet the atmospheric pressure (expansion representing adiabatically expanding gas rather than isobaric smoke dilution).

Screenshots: Heavier than air, e.g., cryogenic condensation; remember to set speed to something small to prevent smoke from flying up as in the screenshot... screenshot5

SRB launch: screenshot14 screenshot15 screenshot17 screenshot26

eggrobin commented 10 years ago

The stickiness defines how much particles accumulate on collision (by reducing the random tangential outflow). This alleviates the issue of smoke rising in blobs from the sides of the flame trench. Screenshots (this is looking pretty good, but of course someone with Unity skills will have to take it from there): screenshot35 screenshot36 screenshot41