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
60084daa
Commit
60084daa
authored
May 11, 2018
by
Josh Borrow
Browse files
Added timestep limiter for maximal u change
parent
09d36187
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hydro/PressureEnergy/hydro.h
View file @
60084daa
...
...
@@ -283,7 +283,12 @@ __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
);
return
dt_cfl
;
/* 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
;
return
fminf
(
dt_cfl
,
dt_u_change
);
}
/**
...
...
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