[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 7e3625d7ddd3cd89304f6ea1c5291f2ec76cd31f
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Jul 18 20:00:35 2008 +1000

    Several important fixes for L-dimensioning
    
    darcs-hash:20080718100035-d4795-d02932e236aba1f8307efb75d5c3554a2424ae9c.gz

diff --git a/src/function.h b/src/function.h
index 3513155..64a992d 100644
--- a/src/function.h
+++ b/src/function.h
@@ -30,7 +30,8 @@ static double dd (const gchar * name, FttComponent c) {
   if (v == NULL)
     return 0.;
   g_return_val_if_fail (_cell != NULL, 0.);
-  return gfs_center_gradient (_cell, c, v->i)/ftt_cell_size (_cell);
+  return gfs_dimensional_value (v, gfs_center_gradient (_cell, c, v->i)/
+				(_sim->physical_params.L*ftt_cell_size (_cell)));
 }
 
 static double dx (const gchar * name) { return dd (name, FTT_X); }
diff --git a/src/output.c b/src/output.c
index bfb4218..a5275e9 100644
--- a/src/output.c
+++ b/src/output.c
@@ -946,6 +946,7 @@ static gboolean gfs_output_solid_force_event (GfsEvent * event,
     GfsDomain * domain = GFS_DOMAIN (sim);
     FILE * fp = GFS_OUTPUT (event)->file->fp;
     FttVector pf, vf, pm, vm;
+    gdouble L = sim->physical_params.L;
 
     if (GFS_OUTPUT (event)->first_call)
       fputs ("# 1: T (2,3,4): Pressure force (5,6,7): Viscous force "
@@ -954,8 +955,8 @@ static gboolean gfs_output_solid_force_event (GfsEvent * event,
     gfs_domain_solid_force (domain, &pf, &vf, &pm, &vm);
     fprintf (fp, "%g %g %g %g %g %g %g %g %g %g %g %g %g\n",
 	     sim->time.t,
-	     pf.x, pf.y, pf.z,
-	     vf.x, vf.y, vf.z,
+	     pf.x*L, pf.y*L, pf.z*L,
+	     vf.x*L, vf.y*L, vf.z*L,
 	     pm.x, pm.y, pm.z,
 	     vm.x, vm.y, vm.z);
     return TRUE;
@@ -1131,8 +1132,9 @@ static gboolean gfs_output_location_event (GfsEvent * event,
 	
 	fprintf (fp, "%g %g %g %g", sim->time.t, p.x, p.y, p.z);
 	while (i) {
-	  if (GFS_VARIABLE1 (i->data)->name)
-	    fprintf (fp, " %g", gfs_interpolate (cell, pm, i->data));
+	  GfsVariable * v = i->data;
+	  if (v->name)
+	    fprintf (fp, " %g", gfs_dimensional_value (v, gfs_interpolate (cell, pm, v)));
 	  i = i->next;
 	}
 	fputc ('\n', fp);
@@ -2788,7 +2790,7 @@ static gboolean gfs_output_streamline_event (GfsEvent * event,
 					 0., 0.,
 					 TRUE,
 					 NULL, NULL);
-
+    /* fixme: mapping is not taken into account */
     gfs_streamline_write (stream, GFS_OUTPUT (event)->file->fp);
     fflush (GFS_OUTPUT (event)->file->fp);
     gfs_streamline_destroy (stream);
@@ -2892,6 +2894,7 @@ static gboolean gfs_output_particle_event (GfsEvent * event,
     fprintf (fp, "%g %g %g %g\n", sim->time.t, pm.x, pm.y, pm.z);
     ret = TRUE;
   }
+  /* fixme: mapping is most probably incorrect */
   gfs_domain_advect_point (GFS_DOMAIN (sim), l->p, sim->advection_params.dt);
   return ret;
 }
diff --git a/src/simulation.c b/src/simulation.c
index a94e19c..e77a807 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -824,15 +824,23 @@ static void simulation_init (GfsSimulation * object)
     { NULL, NULL, NULL}
   };
 
-  gfs_domain_add_variable (domain, "P", "Approximate projection pressure")->centered = TRUE;
-  gfs_domain_add_variable (domain, "Pmac", "MAC projection pressure")->centered = TRUE;
-  gfs_variable_set_vector (gfs_domain_add_variable (domain, "U", 
-						    "x-component of the velocity"), FTT_X);
-  gfs_variable_set_vector (gfs_domain_add_variable (domain, "V",
-						    "y-component of the velocity"), FTT_Y);
+  GfsVariable * v;
+  v = gfs_domain_add_variable (domain, "P",    "Approximate projection pressure");
+  v->centered = TRUE;
+  v->units = 2.;
+  v = gfs_domain_add_variable (domain, "Pmac", "MAC projection pressure");
+  v->centered = TRUE;  
+  v->units = 2.;
+  v = gfs_domain_add_variable (domain, "U",    "x-component of the velocity");
+  gfs_variable_set_vector (v, FTT_X);
+  v->units = 1.;
+  v = gfs_domain_add_variable (domain, "V",    "y-component of the velocity");
+  gfs_variable_set_vector (v, FTT_Y);
+  v->units = 1.;
 #if (!FTT_2D)
-  gfs_variable_set_vector (gfs_domain_add_variable (domain, "W",
-						    "z-component of the velocity"), FTT_Z);
+  v = gfs_domain_add_variable (domain, "W",    "z-component of the velocity");
+  gfs_variable_set_vector (v, FTT_Z);
+  v->units = 1.;
 #endif /* FTT_3D */
 
   GfsDerivedVariableInfo * dv = derived_variable;
diff --git a/test/poisson/circle/res-7.ref b/test/poisson/circle/res-7.ref
index bba5624..1f679e2 100644
--- a/test/poisson/circle/res-7.ref
+++ b/test/poisson/circle/res-7.ref
@@ -1,11 +1,11 @@
 0 0.00000000 1.777e+02 0
-1 0.33000000 2.362e+01 7.5
-2 0.61000000 1.191e+00 12
-3 0.90000000 5.505e-02 15
-4 1.18000000 3.880e-03 15
-5 1.46000000 3.184e-04 14
-6 1.75000000 2.607e-05 14
-7 2.03000000 2.106e-06 14
-8 2.31000000 1.696e-07 13
-9 2.59000000 1.367e-08 13
-10 2.89000000 1.143e-09 13
+1 0.34000000 2.362e+01 7.5
+2 0.64000000 1.191e+00 12
+3 0.93000000 5.505e-02 15
+4 1.23000000 3.880e-03 15
+5 1.53000000 3.184e-04 14
+6 1.82000000 2.607e-05 14
+7 2.11000000 2.106e-06 14
+8 2.41000000 1.694e-07 13
+9 2.71000000 1.368e-08 13
+10 3.01000000 1.110e-09 13

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list