Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
56e86960
Commit
56e86960
authored
May 21, 2018
by
Josh Borrow
Browse files
Added back the u_dt timestep limiter
parent
56f0c397
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hydro/PressureEnergy/hydro.h
View file @
56e86960
...
...
@@ -153,9 +153,10 @@ hydro_get_comoving_soundspeed(const struct part *restrict p) {
/* Compute the sound speed -- see theory section for justification */
/* IDEAL GAS ONLY -- P-U does not work with generic EoS. */
const
float
square_rooted
=
sqrtf
(
hydro_gamma
*
p
->
rho
/
p
->
pressure_bar
);
const
float
square_rooted
=
sqrtf
(
hydro_gamma
*
p
->
pressure_bar
/
p
->
rho
);
return
square_rooted
;
return
p
->
u
*
hydro_gamma_minus_one
*
square_rooted
;
}
/**
...
...
@@ -287,7 +288,6 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
const
float
dt_cfl
=
2
.
f
*
kernel_gamma
*
CFL_condition
*
cosmo
->
a
*
p
->
h
/
(
cosmo
->
a_factor_sound_speed
*
p
->
force
.
v_sig
);
/* Limit maximum change in u */
const
float
dt_u_change
=
(
p
->
u_dt
!=
0
.
0
f
)
?
fabsf
(
const_max_u_change
*
p
->
u
/
p
->
u_dt
)
:
FLT_MAX
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment