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

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


The following commit has been merged in the upstream branch:
commit e4e14ce53c8c347cc99425c2884459c5f879ba73
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed Oct 18 14:27:32 2006 +1000

    GfsSourceTension takes an extra 'sigma' argument
    
    darcs-hash:20061018042732-d4795-db3df412a811e32482a700b62f341db0351a9993.gz

diff --git a/src/poisson.c b/src/poisson.c
index c494bad..605f588 100644
--- a/src/poisson.c
+++ b/src/poisson.c
@@ -451,8 +451,8 @@ static void tension_coeff (FttCellFace * face, gpointer * data)
 {
   gdouble * lambda2 = data[0];
   GfsStateVector * s = GFS_STATE (face->cell);
-  gdouble v = lambda2[face->d/2];
   GfsSourceTension * t = data[1];
+  gdouble v = lambda2[face->d/2]*t->sigma;
   GfsVariable * alpha = data[2];
   gdouble c1 = GFS_VARIABLE (face->cell, t->c->i);
   gdouble c2 = GFS_VARIABLE (face->neighbor, t->c->i);
diff --git a/src/tension.c b/src/tension.c
index 8b4964e..dba6f9e 100644
--- a/src/tension.c
+++ b/src/tension.c
@@ -193,12 +193,20 @@ static void gfs_source_tension_read (GtsObject ** o, GtsFile * fp)
     return;
   }
   gts_file_next_token (fp);
+
+  if (fp->type != GTS_INT && fp->type != GTS_FLOAT) {
+    gts_file_error (fp, "expecting a number (sigma)");
+    return;
+  }
+  s->sigma = atof (fp->token->str);
+  gts_file_next_token (fp);
 }
 
 static void gfs_source_tension_write (GtsObject * o, FILE * fp)
 {
+  GfsSourceTension * s = GFS_SOURCE_TENSION (o);
   (* GTS_OBJECT_CLASS (gfs_source_tension_class ())->parent_class->write) (o, fp);
-  fprintf (fp, " %s %s", GFS_SOURCE_TENSION (o)->c->name, GFS_SOURCE_TENSION (o)->k->name);
+  fprintf (fp, " %s %s %g", s->c->name, s->k->name, s->sigma);
 }
 
 typedef struct {
@@ -226,7 +234,7 @@ static gdouble gfs_source_tension_stability (GfsSourceGeneric * s,
 					     GfsSimulation * sim)
 {
   GfsSourceTension * t = GFS_SOURCE_TENSION (s);
-  gdouble h, sigma = 1.;
+  gdouble h;
   StabilityParams p = { G_MAXDOUBLE, -G_MAXDOUBLE, 0 };
 
   p.alpha = sim->physical_params.alpha;
@@ -236,10 +244,10 @@ static gdouble gfs_source_tension_stability (GfsSourceGeneric * s,
   h = ftt_level_size (p.depth);
   if (p.alpha) {
     gdouble rhom = (1./p.amin + 1./p.amax)/2.;
-    return sqrt (rhom*h*h*h/(2.*M_PI*sigma));
+    return sqrt (rhom*h*h*h/(2.*M_PI*t->sigma));
   }
   else
-    return sqrt (h*h*h/(2.*M_PI*sigma));
+    return sqrt (h*h*h/(2.*M_PI*t->sigma));
 }
 
 static void gfs_source_tension_class_init (GfsSourceGenericClass * klass)
diff --git a/src/tension.h b/src/tension.h
index 4942a80..8299356 100644
--- a/src/tension.h
+++ b/src/tension.h
@@ -58,6 +58,7 @@ struct _GfsSourceTension {
   
   /*< public >*/
   GfsVariable * c, * k;
+  gdouble sigma;
 };
 
 #define GFS_SOURCE_TENSION(obj)            GTS_OBJECT_CAST (obj,\
diff --git a/test/capwave/capwave.gfs b/test/capwave/capwave.gfs
index af74acf..49dc601 100644
--- a/test/capwave/capwave.gfs
+++ b/test/capwave/capwave.gfs
@@ -49,7 +49,7 @@
   Refine LEVEL
   VariableTracer {} T { scheme = vof }
   VariableCurvature {} K T
-  SourceTension {} T K
+  SourceTension {} T K 1
   AdvectionParams { scheme = none }
   SourceDiffusion {} U 0.0182571749236
   SourceDiffusion {} V 0.0182571749236

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list