[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:53:16 UTC 2009


The following commit has been merged in the upstream branch:
commit 1499a9caedab9d3ec37b7bba356c356e15f32a09
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Mon Jul 3 14:14:40 2006 +1000

    Check for ensuring that solid fractions are positive
    
    Round-off errors could cause the solid fractions to be a small negative value. This could cause problems for
    algorithms assuming (correctly) that volume fraction is always positive.
    
    darcs-hash:20060703041440-d4795-f9804133806f77530ece9fa674730fb75168a1ea.gz

diff --git a/src/solid.c b/src/solid.c
index bf17223..a691a8e 100644
--- a/src/solid.c
+++ b/src/solid.c
@@ -164,7 +164,7 @@ static void face_fractions (CellFace * f, GfsSolidVector * solid, FttVector * h)
       solid->s[etod[i]] = 0.;
   }
 
-  a = solid->a/(2.*h->x*h->y);
+  a = solid->a < 0. ? 0. : solid->a/(2.*h->x*h->y);
   if (a > 1e-4) {
     solid->cm.x /= 3.*solid->a;
     solid->cm.y /= 3.*solid->a;

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list