The title should be updated to note this is from 2006.
Has there been anything like this published in the past 20 years but for compressible fluids? I have wanted to make a simple atmospheric model for years but have been unable to because of the complexity and probably my lack of complete understanding.
Fluid dynamicist here. The word "compressible" has multiple meanings and this might be confusing you. You don't need compressible flows in the sense of high Mach numbers. There are other models where the flow is variable density, but thermodynamic and hydrodynamic pressure are decoupled to remove the pressure waves that make high Mach number flows hard. There's also the Boussinesq approximation for buoyancy when the density varies only a small amount. I'm not particularly familiar with atmospheric models, but I'm sure they don't use the high Mach number form. "Incompressible" methods are common for the second class of model I mentioned, though how to use them so might not be obvious.
Treat this as a "what do I need to do to make fluid flow that looks okayish in graphics" post rather than "how do I implement physics accurate CFD for industrial/scientific purposes" post.
Lots of points in there like
> "Air is an example of a compressible fluid; you squish it and it gets smaller. Water is an example of an incompressible fluid; you squish it and it pushes back, and doesn't get any smaller" (this only really depends on the Mach number, Ma>~0.3 and you are in compressible territory for any fluid. Incompressibility usually means we assume the divergence of velocity of zero)
> "Incompressible fluids are simpler to simulate because their density and pressure is always constant." (This is only true if you choose to adopt a grad P = 0 approximation)
are incorrect from a physics perspective.
If you look at what real incompressible Navier-Stokes solvers do [1], it's mathematically totally different from what this post shows. In fact, the part that this post omits (handle the pressure gradient term by first approximate time stepping the velocity term by ignoring the pressure term and then correct by solving a Poisson equation for the pressure residual, and then correct the velocity) is the most expensive step in incompressible solvers by far.
This is an ok introduction to CFD in that you discretize a problem, but it is not insightful and not scientific in its approach. The author routinely admits he doens't know how certain portions of the code work.
In addition, replicating Jameson et al. (AIAA 1981-1259) [1], is a worthwhile, more advanced follow up, great if you want to get into serious CFD development eventually.
I don't know about the CFD, but I really enjoyed reading this blog back in my iOS days. Friday Q&A was especially good. He would take some part of Obj-C or Cocoa and build a simple version from scratch.
10 comments
[ 3.1 ms ] story [ 23.9 ms ] threadHas there been anything like this published in the past 20 years but for compressible fluids? I have wanted to make a simple atmospheric model for years but have been unable to because of the complexity and probably my lack of complete understanding.
Lots of points in there like
> "Air is an example of a compressible fluid; you squish it and it gets smaller. Water is an example of an incompressible fluid; you squish it and it pushes back, and doesn't get any smaller" (this only really depends on the Mach number, Ma>~0.3 and you are in compressible territory for any fluid. Incompressibility usually means we assume the divergence of velocity of zero)
> "Incompressible fluids are simpler to simulate because their density and pressure is always constant." (This is only true if you choose to adopt a grad P = 0 approximation)
are incorrect from a physics perspective.
If you look at what real incompressible Navier-Stokes solvers do [1], it's mathematically totally different from what this post shows. In fact, the part that this post omits (handle the pressure gradient term by first approximate time stepping the velocity term by ignoring the pressure term and then correct by solving a Poisson equation for the pressure residual, and then correct the velocity) is the most expensive step in incompressible solvers by far.
[1] https://en.wikipedia.org/wiki/Projection_method_(fluid_dynam...
This is a much better approach to CFD / Navier-Stokes and will help you understand the various phenomenon along the way. https://lorenabarba.com/blog/cfd-python-12-steps-to-navier-s...
In addition, replicating Jameson et al. (AIAA 1981-1259) [1], is a worthwhile, more advanced follow up, great if you want to get into serious CFD development eventually.
[1] http://aero-comlab.stanford.edu/Papers/jameson.aiaa.1981-125...
The earliest jaw-dropping water effect I saw (and somewhat understood at 14) was the awesome credits scene from the Iguana's Earthquake demo[0].
The code[1] contains the following explanation (ancient DOS chars fixed with chatGPT)
[0] https://www.pouet.net/prod.php?which=364[1] https://hornet.org/code/demosrc/demos/hq_water.zip