Andrew,
Well timed, in that Kyle Augustson and I were just spending a bunch of time today talking about optimal solutions to fully compressible equations. It's something We've been interested in for a while.
There are aspects of your equations that aren't entirely clear to me. You have a variable "p" that's used in the continuity equation as well as the momentum equation, but no actual separate pressure evolution equation (or energy equation more generally). Are these isothermal fully compressible equations, where you assume the temperature is a constant?
Generally, from our experience, I'd strongly recommend solving a log(density) continuity equation. This has a variety of benefits, including protecting the density rho from crossing through zero (which it cannot physically do). There are also numerical benefits, and in particular your grad(p)/p nonlinear RHS term would become a grad(ln_rho) term which could be handled linearly on the LHS.
Broadly, you have very little on the LHS to help keep these equations stiffly-stable. This may not matter if you're operating a very high-Mach flow. But based on d0 being ~1e-9 in your boundary forcing, I'm guessing you're actually at fairly low Mach. In that landscape, stabilizing the equations via stiffly stable IMEX solving becomes key. You can see a variety of examples of how to handle this in work done by Evan Anders and others (e.g., Anders & Brown 2017 PRL, Anders et al 2023 Nature, Powrs et al 2024 PRL, etc. plus early work by various of us in Lecoanet et al 2014 ApJ, Lecoanet et al 2016 MNRAS).
You can also see current "best-in-class" implementations in:
https://github.com/bpbrown/fully_compressible
There, we're focused on convection problems, but the core approaches in the entropy/enthalpy equations (
FC_poly_h-s_2.5d.py) seem likely to be some for the best for a variety of reasons, including that these now effectively include log thermodynamics for both density and temperature (enthalpy). We're working on describing some of those benefits and approaches now.
You're already doing one of the most important things that we've learned (the hard way), which is that your continuity equation also includes the tau polynomials from the velocity equations. So well done there. Generally, especially for low Mach number, I'd work to move terms from the RHS to the LHS to provide stiff stability and permit you to timestep on a velocity CFL timescale rather than being strongly constrained by fast (but dynamically unimportant) linear sound waves
--Ben