Skip to content
Snippets Groups Projects
Commit 62e0011a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'energy_conservation' into 'master'

Time integration mistake ?

Noticed this time integration mistake whilst working on the gravity code. Could this explain the non-conservation of energy ?

See merge request !196
parents 794a9482 c7378f2c
Branches
Tags
1 merge request!196Time integration mistake ?
......@@ -251,8 +251,8 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
p->entropy *= 0.5f;
/* Do not 'overcool' when timestep increases */
if (p->entropy + 0.5f * p->entropy_dt * dt < 0.5f * p->entropy)
p->entropy_dt = -0.5f * p->entropy / dt;
if (p->entropy + p->entropy_dt * half_dt < 0.5f * p->entropy)
p->entropy_dt = -0.5f * p->entropy / half_dt;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment