Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cluster] Negative pressure #86

Open
mfournier01 opened this issue Sep 1, 2023 · 1 comment
Open

[Cluster] Negative pressure #86

mfournier01 opened this issue Sep 1, 2023 · 1 comment

Comments

@mfournier01
Copy link
Collaborator

Hey,

I'm currently starting my PhD project and am setting up a simulation starting from the cluster.in environment. I've slightly modified the default set up so that I start with a perturbed density field (basically a clumpy atmosphere). When I let the simulation run, everything goes fine (the gas is cooling down, and start collapsing due to gravity).

However at some point the pressure reach negative values in some cells for a reason I could not identify. I added some couts in the code to check for the values of the variables involved in the computation of the pressure, and it look like the energy density is balancing the kinetic term so that they cancel out (w_p being defined in the code as gm1*(u_e - e_k)) and the result is slightly negative.

Any idea where this could come from ? I work with periodic boundary conditions by the way.

Thanks a lot !

@BenWibking
Copy link
Contributor

BenWibking commented Sep 1, 2023

This is a standard problem with kinetic energy dominated fluid flows. Since the equations are solved in conservation law form using the total energy, the numerical solution of the equations does not guarantee that the internal energy (and therefore the pressure) is positive.

There are a few solutions. A common one is to fall back to a positivity-preserving method for the cells that end up with a negative pressure, e.g., a positivity-preserving Riemann solver with piecewise-constant reconstruction and forward Euler time integration. This is what the "first-order flux correction option" does, except that it does not change the time integration. You can enable that and that should help. The code for that is here:

// Apply first order flux correction, i.e., use first order reconstruction and a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants