# Can we simulate compressible flows by simple direct explicit calculation, without solving systems of linear equations (such as Poisson eq)?

Is this is plausible at all? It seems the most obvious/naive approach, so there's probably good reasons why it's not used - what are they?

Viscosity is not important.

Starting with inviscid Navier Stokes:

$$\frac{\partial \mathbf u}{\partial t} + \mathbf u \cdot \nabla \mathbf u + \frac{1}{\rho} \nabla p = \mathbf f$$

Conserve mass by tracking density as a state variable. We advect it and update it with the divergence of the velocity:

$$\frac{\partial \rho}{\partial t} = - \mathbf u \cdot \nabla \rho - \rho ( \nabla \cdot \mathbf u )$$

Next, calculate pressure from density:

$$p = \frac{1}{\alpha} ( \frac{\rho}{\rho_0} - 1 )$$

Now, we have pressure $p$ and we can use its gradient to calculate the change in $\mathbf u$ from the first Navier Stokes equation (rearranged from above) $$\frac{\partial \mathbf u}{\partial t} = - \mathbf u \cdot \nabla \mathbf u - \frac{1}{\rho} \nabla p + \mathbf f$$

This idea is similar to simulating the Shallow Water equations, where the velocity divergence is used to update the height of the water. The height is like a 2d density (mass per area). The weight of the fluid causes pressure. Differences in pressure (gradient) cause accelerations in the velocity field.

However, I don't seem to get any eddies/vorticity from simulating the Shallow Water equations, so I wonder if there's some fundamental problem with this idea...

## 2 Answers

Physically, vorticity can only be created (as opposed to transported, stretched or intensified after being created) either by the appearance of a boundary layer on a solid surface, or through the pressure gradient not being parallel to the density gradient. For the shallow water equation without viscosity neither mechanism is available, so congratulations, your code is making a correct prediction. Quite often though vorticity does appear on account of numerical viscosity. It appears in more or less the same place that vorticity would appear with real viscosity. It might or might not be relevant to the true situation

EDIT The non creation of vorticity is revealed by the evolution equation of vorticity for an inviscid compressible gas in two dimensions; $$\partial_t\omega+\mathbf{u}\cdot\nabla\omega+\omega\nabla\cdot\mathbf{u}+\frac{\nabla{p}\times\nabla{\rho}}{\rho^2}=0$$

• Thank you! I'm vconcerned about this, because I discretized the above and it came out equivalent to the shallow water equations - I'd like effects llke swirling cigarette smoke. Could you elaborate on "pressure gradient not being parallel to the density gradient" please? How does that cause vorticity? How does it arise in nature? What is missing from my equations? (I see they are parallel in my scheme and in the shallow water equations). Sorry, all these questions are probably too much to ask, but this sounds like the key! PS I'm using semi-lagrangian advection, which dissipates greatly. – hyperpallium May 9 '17 at 14:11
• Right, shallow water is just isentropic gas dynamics with $\gamma=2$. Flows in which the pressure is a function only of the density (in SW pressure is proportional to the square of the height and density is proportional to the height) are called barotropic. Now consider a flow for which this is not true and a small spherical element. Because the pressure force on any part of the surface passes through the center of the sphere, so does the total pressure force, which is in the direction of the pressure gradient.The pressure force acts along a line parallel to the gradient and through the c.g. – Philip Roe May 9 '17 at 16:06
• If the spheres c.g. does not also lie on this line, then the sphere will rotate. Surprisingly even tangential forces do not create vorticity, as can be seen by taking the curl of velocity equations. Vorticity is created only (except as above) at solid surfaces, and then diffuses into the general flow, or is carried there by a separating boundary layer. You seem interested in some kind of simulation for the movies or for video games. I am told that the greatest factor ibn the credibility of such a simulation is the behavior of vorticity, – Philip Roe May 9 '17 at 16:15
• Oops, in my first comment replace c.g. by geometric center – Philip Roe May 9 '17 at 16:23
• Thanks! I've studied your comments. I assume c.g. in the second is center of gravity? (makes sense). If "small spherical element" has same pressure throughout, then I see that external pressures act through its geometric center (I guess that's the definition of "element"). I see that if the center of gravity of that element is not at its geometric center, then a force through its center will produce torque and rotational acceleration. – hyperpallium May 10 '17 at 6:47

Of course you can apply some explicit scheme to discretize the equations. The explicit approach is just impractical for stiff problems due to stability constraints on the time step. See the Explicit and implicit methods page on Wikipedia for more details.