-
Notifications
You must be signed in to change notification settings - Fork 104
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
DGMulti
non-conservative terms appear to be broken
#1774
Comments
This might explain some of the odd CI test failures with |
Do you have found an example showcasing issues? This Alfven-wave test using OrdinaryDiffEq
using Trixi
###############################################################################
# semidiscretization of the compressible ideal GLM-MHD equations
equations = IdealGlmMhdEquations2D(1.4)
surface_flux = (flux_lax_friedrichs, flux_nonconservative_powell)
volume_flux = (flux_hindenlang_gassner, flux_nonconservative_powell)
solver = DGMulti(polydeg = 3, element_type = Quad(), approximation_type = GaussSBP(),
surface_integral = SurfaceIntegralWeakForm(surface_flux),
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
initial_refinement_level = 3
N = 2^initial_refinement_level
cells_per_dimension = (N, N)
mesh = DGMultiMesh(solver, cells_per_dimension, periodicity = true,
coordinates_min = (0.0, 0.0), coordinates_max = (sqrt(2), sqrt(2)))
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test, solver)
###############################################################################
# ODE solvers, callbacks etc.
tspan = (0.0, 2.0)
ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()
analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
uEltype = real(solver))
alive_callback = AliveCallback(alive_interval = 10)
cfl = 0.8
stepsize_callback = StepsizeCallback(cfl = cfl)
glm_speed_callback = GlmSpeedCallback(glm_scale = 0.5, cfl = cfl)
callbacks = CallbackSet(summary_callback,
analysis_callback,
alive_callback,
stepsize_callback,
glm_speed_callback)
###############################################################################
# run the simulation
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1e-5, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary
looks fine:
|
I think this is because the non-conservative part of the ideal MHD equations is the divergence cleaning term. This can be incorrectly scaled without incurring a catastrophic error (it just amounts to a change in the cleaning speed). If you try |
Nevermind; the scaling appears to be taken care of in https://github.com/jlchan/Trixi.jl/blob/a28a5600dfb2d41345287917742211ba274cf584/src/solvers/dgmulti/flux_differencing.jl#L487-L488 and https://github.com/jlchan/Trixi.jl/blob/a28a5600dfb2d41345287917742211ba274cf584/src/solvers/dgmulti/flux_differencing.jl#L544. I overlooked this when filing the issue. Closing this issue. |
I think the
DGMulti
treatment of all non-conservative terms is incorrect. InVolumeIntegralFluxDifferencing
, I noticed that while conservative flux contributions are expected to be scaled by a factor of 2, non-conservative fluxes are not. This is not properly accounted for byDGMulti
inhadamard_sum
(which is used in the volume integral calculation).The boundary terms incorporate the additional scaling of the non-conservative terms properly, but there may still be some issues related to the surface integral terms - if I fix the factor of 2 scaling issue in the volume integral, things still crash.
The text was updated successfully, but these errors were encountered: