Re: Instability in compressible fluid simulation with cold star

15 views
Skip to first unread message

Daniel Lecoanet

unread,
Sep 8, 2025, 2:02:03 PM (23 hours ago) Sep 8
to Dedalus Users
Hi Will,

That is the expected behavior. Nonlinear numerical simulations require some sort of regularization to prevent energy from building up on the grid scale. Some numerical algorithms artificially damp small-scale features, but spectral methods do not. So in order to run nonlinear simulations in Dedalus, you typically need to solve equations which include diffusion in them explicitly, i.e., viscosity in your case. If you look at the list of papers using Dedalus on our website, you’ll note several solving the continuity & momentum equations for a compressible fluid; they all include viscosity (and thermal diffusivity).

Daniel

On Aug 28, 2025, at 12:54 PM, William Surgent <wsur...@gmail.com> wrote:

Hello Dedalus experts, 

I’m looking for some help with an unusual bug in my simulation that I have been struggling with for some weeks now. I’m solving the continuity equation and the momentum equation for a compressible fluid. I assume a cold star with a polytope equation of state and solve the equations in the ballbasis with stress-free and impenetrable boundary conditions. 

I’ve found that my simulation is unstable if I do not introduce some viscosity. Below I have linked some example videos of outputs of the simulation going unstable for different grid sizes with no viscosity (interestingly, when my grid is small (Nphi = 32, Ntheta = 16, Nr = 24), the simulation remains stable, but I suspect it simply isn’t resolving the features that would normally trigger the instability).

Now, when I introduce a viscosity term into my momentum equation, I can get stability by dialing up the value of nu. I have linked a set of movies showing what happens when I dial up nu (basically, once nu=~1e-5-1e-4, I get numerical stability).

Additionally, I’ve noticed if I give some random initial velocity in the ball, the viscosity needs to be increased further to ~1e-4-1e-3 in order to have stability. 

Any recommendations/thoughts about what could be going wrong would be greatly appreciated.

Link to set of simulation outputs for various grids and viscosities: https://drive.google.com/drive/folders/1qOc_0dwbKjm0mIopx5O13vFHu8RaMX2_?usp=share_link 

All the best and thank you!

Will 

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/cbdcae09-e5ff-4654-9273-c3679d9c82c9n%40googlegroups.com.

William Surgent

unread,
Sep 8, 2025, 2:27:05 PM (23 hours ago) Sep 8
to Dedalus Users
Great, thank you Daniel, that makes sense. I was also wondering if there's any general expectation for how much viscosity is typically needed for stability in a given simulation, or if the approach is just to use as little as possible to keep things stable?
Reply all
Reply to author
Forward
0 new messages