[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:45 UTC 2009
The following commit has been merged in the upstream branch:
commit ada9cd63a23eba38392f9a58efd5fb14a67e5c4c
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Nov 1 13:24:50 2006 +1100
Bug fix for VOF advection with periodic boundary conditions
darcs-hash:20061101022450-d4795-15180cc4e05b2fb35e083107ca6ae0b7e565c541.gz
diff --git a/src/vof.c b/src/vof.c
index aea1ad8..e2e31e6 100644
--- a/src/vof.c
+++ b/src/vof.c
@@ -547,28 +547,20 @@ static gdouble fine_fraction (FttCellFace * face, VofParms * p, gdouble un)
if (f == 0. || f == 1.)
return f;
else {
- FttCell * cell = face->cell;
- FttDirection d = face->d;
-
- if (GFS_CELL_IS_BOUNDARY (cell)) {
- cell = face->neighbor;
- d = FTT_OPPOSITE_DIRECTION (d);
- }
-
FttComponent c;
FttVector m;
- gdouble alpha = GFS_VARIABLE (cell, p->alpha->i);
+ gdouble alpha = GFS_VARIABLE (face->cell, p->alpha->i);
for (c = 0; c < FTT_DIMENSION; c++)
- (&m.x)[c] = GFS_VARIABLE (cell, p->m[c]->i);
- if (d % 2 != 0) {
- (&m.x)[d/2] = - (&m.x)[d/2];
- alpha += (&m.x)[d/2];
+ (&m.x)[c] = GFS_VARIABLE (face->cell, p->m[c]->i);
+ if (face->d % 2 != 0) {
+ (&m.x)[face->d/2] = - (&m.x)[face->d/2];
+ alpha += (&m.x)[face->d/2];
}
FttVector q[2] = {{0., 0., 0.},{1., 1., 1.}};
- (&q[0].x)[d/2] = 1. - un; (&q[1].x)[d/2] = 1.;
+ (&q[0].x)[face->d/2] = 1. - un; (&q[1].x)[face->d/2] = 1.;
return plane_volume_shifted (m, alpha, q);
}
}
@@ -672,8 +664,15 @@ void gfs_tracer_vof_advection (GfsDomain * domain,
par->fv = gfs_temporary_variable (domain);
for (c = 0; c < FTT_DIMENSION; c++) {
p.c = (cstart + c) % FTT_DIMENSION;
+
gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
(FttCellTraverseFunc) vof_plane, &p);
+ /* fixme: this does not work for all types of boundary conditions */
+ FttComponent i;
+ for (i = 0; i < FTT_DIMENSION; i++)
+ gfs_domain_bc (domain, FTT_TRAVERSE_LEAFS, -1, p.m[i]);
+ gfs_domain_bc (domain, FTT_TRAVERSE_LEAFS, -1, p.alpha);
+
gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
(FttCellTraverseFunc) gfs_cell_reset, par->fv);
gfs_domain_face_traverse (domain, p.c,
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list