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

Better definition of CFL condition. Now able to cope with changes of kernel.

parent d1dfe28b
Branches
Tags
2 merge requests!136Master,!90Improved multi-timestep SPH
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
1.f /* Value taken from (Price,2008), not used in legacy gadget mode */ 1.f /* Value taken from (Price,2008), not used in legacy gadget mode */
/* Time integration constants. */ /* Time integration constants. */
#define const_cfl 0.2f #define const_cfl 0.1f
#define const_ln_max_h_change \ #define const_ln_max_h_change \
0.231111721f /* Particle can't change volume by more than a factor of \ 0.231111721f /* Particle can't change volume by more than a factor of \
2=1.26^3 over one time step */ 2=1.26^3 over one time step */
......
...@@ -34,7 +34,7 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep( ...@@ -34,7 +34,7 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
const float dt_accel = sqrtf(2.f); // MATTHIEU const float dt_accel = sqrtf(2.f); // MATTHIEU
/* CFL condition */ /* CFL condition */
const float dt_cfl = 2.f * const_cfl * p->h / p->v_sig; const float dt_cfl = 2.f * const_cfl * kernel_gamma * p->h / p->v_sig;
return fminf(dt_cfl, dt_accel); return fminf(dt_cfl, dt_accel);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment