Skip to content
Snippets Groups Projects
Commit 670c4abb authored by calpe's avatar calpe
Browse files

Add parameter cfl_coef_group.

parent 3194c26b
No related branches found
No related tags found
1 merge request!9Merged with fluiddyn/fluidsim
......@@ -25,6 +25,13 @@
"""
@classmethod
def _complete_params_with_default(cls, params):
super(TimeSteppingPseudoSpectralStrat, cls)._complete_params_with_default(params)
# Add parameter coefficient CFL GROUP VELOCITY
params.time_stepping._set_attrib("cfl_coef_group", None)
def _init_compute_time_step(self):
"""
Initialization compute time step solver ns2d.strat.
......@@ -33,7 +40,12 @@
# Coefficients dt
self.coef_deltat_dispersion_relation = 1.0
self.coef_group = 1.0
if self.params.time_stepping.cfl_coef_group:
self.coef_group = self.params.time_stepping.cfl_coef_group
else:
self.coef_group = 1.0
self.coef_phase = 1.0
has_vars = self.sim.state.has_vars
......@@ -141,7 +153,16 @@
else:
deltat_CFL = self.deltat_max
# maybe_new_dt = min(
# deltat_CFL,
# self.deltat_dispersion_relation,
# self.deltat_group_vel,
# self.deltat_phase_vel,
# self.deltat_max,
# )
# Removed phase velocity (considered not relevant)
maybe_new_dt = min(
deltat_CFL,
self.deltat_dispersion_relation,
self.deltat_group_vel,
......@@ -144,8 +165,7 @@
maybe_new_dt = min(
deltat_CFL,
self.deltat_dispersion_relation,
self.deltat_group_vel,
self.deltat_phase_vel,
self.deltat_max,
)
......@@ -149,6 +169,7 @@
self.deltat_max,
)
if self.params.forcing.enable:
maybe_new_dt = min(maybe_new_dt, self.deltat_f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment