[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:31 UTC 2009
The following commit has been merged in the upstream branch:
commit cb1917c15d412bb5966a43e8c022d0f9de43eee5
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Mon Aug 29 10:39:24 2005 +1000
CFL is applicable only if some advection scheme is used
darcs-hash:20050829003924-fbd8f-e8283bf40cbe2a76f8e02fb3d0dd194a44b2021d.gz
diff --git a/src/simulation.c b/src/simulation.c
index d42ed0c..25ec457 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -939,13 +939,17 @@ void gfs_simulation_write (GfsSimulation * sim,
static gdouble min_cfl (GfsSimulation * sim)
{
- gdouble cfl = sim->advection_params.cfl;
+ gdouble cfl = (sim->advection_params.scheme == GFS_NONE ?
+ G_MAXDOUBLE :
+ sim->advection_params.cfl);
GSList * i = GFS_DOMAIN (sim)->variables;
while (i) {
GfsVariable * v = i->data;
- if (GFS_IS_VARIABLE_TRACER (v) && GFS_VARIABLE_TRACER (v)->advection.cfl < cfl)
+ if (GFS_IS_VARIABLE_TRACER (v) &&
+ GFS_VARIABLE_TRACER (v)->advection.scheme != GFS_NONE &&
+ GFS_VARIABLE_TRACER (v)->advection.cfl < cfl)
cfl = GFS_VARIABLE_TRACER (v)->advection.cfl;
i = i->next;
}
@@ -967,14 +971,16 @@ static gdouble min_cfl (GfsSimulation * sim)
*/
void gfs_simulation_set_timestep (GfsSimulation * sim)
{
- gdouble t;
+ gdouble t, cfl;
GSList * i;
g_return_if_fail (sim != NULL);
t = sim->time.t;
- sim->advection_params.dt =
- min_cfl (sim)*gfs_domain_cfl (GFS_DOMAIN (sim), FTT_TRAVERSE_LEAFS, -1);
+ if ((cfl = min_cfl (sim)) < G_MAXDOUBLE)
+ sim->advection_params.dt = cfl*gfs_domain_cfl (GFS_DOMAIN (sim), FTT_TRAVERSE_LEAFS, -1);
+ else
+ sim->advection_params.dt = G_MAXDOUBLE;
if (sim->advection_params.dt > sim->time.dtmax)
sim->advection_params.dt = sim->time.dtmax;
sim->tnext = t + sim->advection_params.dt;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list