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

Correct Formula for Potential Energy #2227

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ function Trixi.analyze(::Val{:energy_potential}, du, u_euler, t,
u_gravity_local = Trixi.get_node_vars(u_gravity, equations_gravity, dg, i, j,
element)
# OBS! subtraction is specific to Jeans instability test where rho0 = 1.5e7
return (u_euler_local[1] - 1.5e7) * u_gravity_local[1]
# For formula of potential energy see
# "Galactic Dynamics" by Binney and Tremaine, 2nd ed., equation (2.18)
return 0.5 * (u_euler_local[1] - 1.5e7) * u_gravity_local[1]
DanielDoehring marked this conversation as resolved.
Show resolved Hide resolved
end
return e_potential
end
Expand Down
Loading