[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:34 UTC 2009
The following commit has been merged in the upstream branch:
commit 6aa73e36f8fd5cae1c0b778e98bfc6e16e17808f
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Sep 5 10:09:04 2007 +1000
Added assertions alpha > 0.
Alpha (1/rho) is user defined and could take negative values if care is not
taken.
darcs-hash:20070905000904-d4795-ff18a7a64621b2c7b7afeceef6fcd5016d402454.gz
diff --git a/src/poisson.c b/src/poisson.c
index 7c6a6c0..c278ddd 100644
--- a/src/poisson.c
+++ b/src/poisson.c
@@ -371,13 +371,13 @@ static void poisson_alpha_coeff (FttCellFace * face,
gpointer * data)
{
gdouble * lambda2 = data[0];
- GfsFunction * alpha = data[1];
- gdouble v = lambda2[face->d/2];
+ gdouble alpha = gfs_function_face_value (data[1], face);
+ gdouble v = lambda2[face->d/2]*alpha;
GfsStateVector * s = GFS_STATE (face->cell);
+ g_assert (v > 0.);
if (GFS_IS_MIXED (face->cell))
v *= s->solid->s[face->d];
- v *= gfs_function_face_value (alpha, face);
s->f[face->d].v = v;
switch (ftt_face_type (face)) {
@@ -469,7 +469,7 @@ static void tension_coeff (FttCellFace * face, gpointer * data)
GfsStateVector * s = GFS_STATE (face->cell);
GfsSourceTensionGeneric * t = data[1];
gdouble v = lambda2[face->d/2]*t->sigma;
- GfsFunction * alpha = data[2];
+ gdouble alpha = data[2] ? gfs_function_face_value (data[2], face) : 1.;
GfsVariable * kappa = GFS_SOURCE_TENSION (data[1])->k;
gdouble k1 = GFS_VARIABLE (face->cell, kappa->i);
gdouble k2 = GFS_VARIABLE (face->neighbor, kappa->i);
@@ -497,8 +497,8 @@ static void tension_coeff (FttCellFace * face, gpointer * data)
}
g_assert (v <= 1e6);
- if (alpha)
- v *= gfs_function_face_value (alpha, face);
+ g_assert (alpha > 0.);
+ v *= alpha;
if (GFS_IS_MIXED (face->cell))
v *= s->solid->s[face->d];
s->f[face->d].v = v;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list