[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:32 UTC 2009
The following commit has been merged in the upstream branch:
commit b74a1abf8aff7b6ad4b9fcf608fa6f77c5a0e30e
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Jul 16 13:10:40 2008 +1000
gfs_domain_cfl() should now take source terms into account
darcs-hash:20080716031040-d4795-2a8f472f133d3db2ca9b09895d652ec0d32ac197.gz
diff --git a/src/domain.c b/src/domain.c
index d133170..c4989da 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -2171,13 +2171,29 @@ typedef struct {
GfsVariable ** v;
} CflData;
-static void minimum_mac_cfl (FttCellFace * face, gdouble * cfl)
+static void minimum_mac_cfl (FttCellFace * face, CflData * p)
{
gdouble un = GFS_STATE (face->cell)->f[face->d].un;
if (un != 0.) {
gdouble cflu = ftt_cell_size (face->cell)/fabs (un);
- if (cflu*cflu < *cfl)
- *cfl = cflu*cflu;
+ if (cflu*cflu < p->cfl)
+ p->cfl = cflu*cflu;
+ }
+ FttComponent c = face->d/2;
+ if (p->v[c]->sources) {
+ gdouble g = 0.;
+ GSList * i = GTS_SLIST_CONTAINER (p->v[c]->sources)->items;
+ while (i) {
+ GfsSourceGeneric * s = i->data;
+ if (s->face_value)
+ g += (* s->face_value) (s, face, p->v[c]);
+ i = i->next;
+ }
+ if (g != 0.) {
+ gdouble cflg = 2.*ftt_cell_size (face->cell)/fabs (g);
+ if (cflg < p->cfl)
+ p->cfl = cflg;
+ }
}
}
@@ -2226,9 +2242,9 @@ gdouble gfs_domain_cfl (GfsDomain * domain,
g_return_val_if_fail (domain != NULL, 0.);
p.cfl = G_MAXDOUBLE;
- gfs_domain_face_traverse (domain, FTT_XYZ, FTT_PRE_ORDER, flags, max_depth,
- (FttFaceTraverseFunc) minimum_mac_cfl, &p.cfl);
p.v = gfs_domain_velocity (domain);
+ gfs_domain_face_traverse (domain, FTT_XYZ, FTT_PRE_ORDER, flags, max_depth,
+ (FttFaceTraverseFunc) minimum_mac_cfl, &p);
gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, flags, max_depth,
(FttCellTraverseFunc) minimum_cfl, &p);
gfs_all_reduce (domain, p.cfl, MPI_DOUBLE, MPI_MIN);
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list