[GRASS-SVN] r41568 - grass/trunk/raster/r.solute.transport

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 26 20:35:16 EDT 2010


Author: huhabla
Date: 2010-03-26 20:35:16 -0400 (Fri, 26 Mar 2010)
New Revision: 41568

Modified:
   grass/trunk/raster/r.solute.transport/main.c
   grass/trunk/raster/r.solute.transport/seguin_verify.py
   grass/trunk/raster/r.solute.transport/seguin_verify_well.py
Log:
Corrected input values in validation python scripts. 


Modified: grass/trunk/raster/r.solute.transport/main.c
===================================================================
--- grass/trunk/raster/r.solute.transport/main.c	2010-03-26 19:38:47 UTC (rev 41567)
+++ grass/trunk/raster/r.solute.transport/main.c	2010-03-27 00:35:16 UTC (rev 41568)
@@ -91,7 +91,7 @@
 
     param.q = G_define_standard_option(G_OPT_R_INPUT);
     param.q->key = "q";
-    param.q->guisection = _("Water flow");
+    param.q->guisection = "Water flow";
     param.q->required = NO;
     param.q->description = _("Groundwater sources and sinks in [m^3/s]");
 

Modified: grass/trunk/raster/r.solute.transport/seguin_verify.py
===================================================================
--- grass/trunk/raster/r.solute.transport/seguin_verify.py	2010-03-26 19:38:47 UTC (rev 41567)
+++ grass/trunk/raster/r.solute.transport/seguin_verify.py	2010-03-27 00:35:16 UTC (rev 41568)
@@ -7,9 +7,8 @@
 #	edition = "2. Auflage",
 #	year = "1996",
 #	series = "Handbuch zur Erkundung des Untergrundes von Deponien und Altlasten"
+#
 
-import sys
-import os
 import grass.script as grass
 
 # Overwrite existing maps
@@ -17,19 +16,19 @@
 
 grass.message(_("Set the region"))
 
-# The area is 2000m x 1000m with a cell size of 25m x 25m
-grass.run_command("g.region", res=25, res3=25, t=25, b=0, n=1000, s=0, w=0, e=2000)
+# The area is 2000m x 1000m with a cell size of 50m x 50m
+grass.run_command("g.region", res=50, res3=50, t=25, b=0, n=1000, s=0, w=0, e=2000)
 
 grass.message(_("Create all the input maps needed for groundwater flow computation"))
 
-# Initial condition of the piezometric head, we have a huge gradient from 280m to 50m
+# Initial condition of the piezometric head, we have a huge gradient from 275m to 50m
 # over a distance of 2000m
-grass.run_command("r.mapcalc", expression="phead_1=if(col() == 1 , 200, 50)")
-# Set the active cells and the dirichlet boundary condition
-grass.run_command("r.mapcalc", expression="status_1=if(col() == 1 || col() == 80 , 2, 1)")
+grass.run_command("r.mapcalc", expression="phead_1=if(col() == 1 , 275, 50)")
+# Set the active cells and the dirichlet boundary condition, the first and the last cells a dirichlet
+grass.run_command("r.mapcalc", expression="status_1=if(col() == 1 || col() == 40 , 2, 1)")
 # We have a no wells
 grass.run_command("r.mapcalc", expression="well_1=0")
-# The hydraulic conductivity
+# The hydraulic conductivity is 0.0001 m/s
 grass.run_command("r.mapcalc", expression="hydcond_1=0.0001")
 # The recharge, well we have no recharge at all
 grass.run_command("r.mapcalc", expression="recharge_1=0")
@@ -37,13 +36,13 @@
 grass.run_command("r.mapcalc", expression="top_conf_1=25")
 # Bottom of the aquifer starts at 0m
 grass.run_command("r.mapcalc", expression="bottom_1=0")
-# This porosity of sand aquifer
+# This porosity of sand aquifer is 0.17 in example 1.1
 grass.run_command("r.mapcalc", expression="poros_1=0.17")
 # The specific yield of a confined aquifer
 grass.run_command("r.mapcalc", expression="syield_1=0.0001")
 grass.run_command("r.mapcalc", expression="null_1=0.0")
 
-grass.message("First compute a steady state groundwater flow")
+grass.message("First compute a steady state groundwater flow with a mean velocity of 5.88 m/d or 6.8*10^5m/s")
 
 # Compute the steady state groundwater flow
 grass.run_command("r.gwflow", solver="cg", top="top_conf_1", bottom="bottom_1", phead="phead_1",\
@@ -51,22 +50,23 @@
  q="well_1", s="syield_1", recharge="recharge_1", output="gwresult_conf_1",\
  dt=8640000000000, type="confined")
 
+
 grass.message(_("generate the transport data"))
 
 # The initial concentration is zero
-grass.run_command("r.mapcalc", expression="c_1=if(col() == 20 && row() == 20 , 0.0, 0.0)")
+grass.run_command("r.mapcalc", expression="c_1=if(col() == 10 && row() == 10 , 0.0, 0.0)")
 # One inner sources (result of chemical reaction)
-grass.run_command("r.mapcalc", expression="cs_1=if(col() == 20 && row() == 20 , 0.0013888, 0.0)")
+grass.run_command("r.mapcalc", expression="cs_1=if(col() == 10 && row() == 10 , 0.0013888, 0.0)")
 # No pollution by well
 grass.run_command("r.mapcalc", expression="cin_1=0.0")
 # We have a transfer boundary condition
-grass.run_command("r.mapcalc", expression="tstatus_1=if(col() == 1 || col() == 80 , 3, 1)")
+grass.run_command("r.mapcalc", expression="tstatus_1=if(col() == 1 || col() == 40 , 3, 1)")
 # No diffusion coefficient known for the solution
 grass.run_command("r.mapcalc", expression="diff_1=0.0")
 # Normal retardation
 grass.run_command("r.mapcalc", expression="R_1=1.0")
 
-# Longitudinal and transversal dispersivity length
+# Longitudinal and transversal dispersivity length al = 100m, at = 10m
 AL=100
 AT=10
 
@@ -76,9 +76,16 @@
   hc_y="hydcond_1", rd="R_1", cs="cs_1", q="well_1", nf="poros_1", output="stresult_conf_1", dt=86400000,\
   diff_x="diff_1", diff_y="diff_1", cin="cin_1", c="c_1", al=AL, at=AT, vx="stresult_conf_vel_1_x", vy="stresult_conf_vel_1_y")
 
+# Get the maximum concentration
+range = grass.parse_command("r.info", "r", map="stresult_conf_1")
+# Normalize the result
+grass.run_command("r.mapcalc", expression="stresult_conf_1_norm = stresult_conf_1/" + str(range["max"]))
+#Create contour lines range from 0.7 to 0.1 in 0.1 steps
+grass.run_command("r.contour", input="stresult_conf_1_norm", output="stresult_conf_1_norm", minlevel=0.1, maxlevel=0.7, step=0.1)
+
 # The second computation uses different porosity for higher groundwater velocity
 
-# Used to compute a lower velocity
+# Used to compute a lower velocity, so the mean velocity is about 1 m/d or 1.15*10^-5 m/s
 grass.run_command("r.mapcalc", expression="poros_2=1")
 
 # Compute the solute transport using the above defined dispersivity coefficients for a timestep of 1000d
@@ -86,3 +93,10 @@
   top="top_conf_1", bottom="bottom_1", phead="gwresult_conf_1", status="tstatus_1", hc_x="hydcond_1",\
   hc_y="hydcond_1", rd="R_1", cs="cs_1", q="well_1", nf="poros_2", output="stresult_conf_2", dt=86400000,\
   diff_x="diff_1", diff_y="diff_1", cin="cin_1", c="c_1", al=AL, at=AT, vx="stresult_conf_vel_2_x", vy="stresult_conf_vel_2_y")
+
+# Get the maximum concentration
+range = grass.parse_command("r.info", "r", map="stresult_conf_2")
+# Normalize the result
+grass.run_command("r.mapcalc", expression="stresult_conf_2_norm = stresult_conf_2/" + str(range["max"]))
+#Create contour lines range from 0.7 to 0.1 in 0.1 steps
+grass.run_command("r.contour", input="stresult_conf_2_norm", output="stresult_conf_2_norm", minlevel=0.1, maxlevel=0.7, step=0.1)

Modified: grass/trunk/raster/r.solute.transport/seguin_verify_well.py
===================================================================
--- grass/trunk/raster/r.solute.transport/seguin_verify_well.py	2010-03-26 19:38:47 UTC (rev 41567)
+++ grass/trunk/raster/r.solute.transport/seguin_verify_well.py	2010-03-27 00:35:16 UTC (rev 41568)
@@ -9,8 +9,6 @@
 #	series = "Handbuch zur Erkundung des Untergrundes von Deponien und Altlasten"
 #
 
-import sys
-import os
 import grass.script as grass
 
 # Overwrite existing maps
@@ -18,18 +16,18 @@
 
 grass.message(_("Set the region"))
 
-# The area is 2000m x 1000m with a cell size of 25m x 25m
-grass.run_command("g.region", res=25, res3=25, t=25, b=0, n=1000, s=0, w=0, e=2000)
+# The area is 2000m x 1000m with a cell size of 50m x 50m
+grass.run_command("g.region", res=50, res3=50, t=25, b=0, n=1000, s=0, w=0, e=2000)
 
 grass.message(_("Create all the input maps needed for groundwater flow computation"))
 
-# Initial condition of the piezometric head, we have a huge gradient from 200m to 50m
+# Initial condition of the piezometric head, we have a huge gradient from 275m to 50m
 # over a distance of 2000m
-grass.run_command("r.mapcalc", expression="phead_1=if(col() == 1 , 200, 50)")
+grass.run_command("r.mapcalc", expression="phead_1=if(col() == 1 , 275, 50)")
 # Set the active cells and the dirichlet boundary condition
-grass.run_command("r.mapcalc", expression="status_1=if(col() == 1 || col() == 80 , 2, 1)")
+grass.run_command("r.mapcalc", expression="status_1=if(col() == 1 || col() == 40 , 2, 1)")
 # We have a single well with a small influent pumping rate
-grass.run_command("r.mapcalc", expression="well_1=if((row() == 20 && col() == 20), 0.000002818287, 0)")
+grass.run_command("r.mapcalc", expression="well_1=if((row() == 10 && col() == 10), 0.000002818287, 0)")
 # The hydraulic conductivity
 grass.run_command("r.mapcalc", expression="hydcond_1=0.0001")
 # The recharge, well we have no recharge at all
@@ -39,7 +37,7 @@
 # Bottom of the aquifer starts at 0m
 grass.run_command("r.mapcalc", expression="bottom_1=0")
 # This is the standard porosity of sand aquifer
-grass.run_command("r.mapcalc", expression="poros_1=0.11209524")
+grass.run_command("r.mapcalc", expression="poros_1=0.17")
 # The specific yield of a confined aquifer
 grass.run_command("r.mapcalc", expression="syield_1=0.0001")
 grass.run_command("r.mapcalc", expression="null_1=0.0")
@@ -55,13 +53,13 @@
 grass.message(_("generate the transport data"))
 
 # The initial concentration is zero
-grass.run_command("r.mapcalc", expression="c_1=if(col() == 20 && row() == 20 , 0.0, 0.0)")
+grass.run_command("r.mapcalc", expression="c_1=if(col() == 10 && row() == 10 , 0.0, 0.0)")
 # No inner sources or sinks (result of chemical reaction)
 grass.run_command("r.mapcalc", expression="cs_1=0.0")
 # The pollution is inserted by a well
-grass.run_command("r.mapcalc", expression="cin_1=if(col() == 20 && row() == 20 ," + str(0.2/3600-0/24.0) + ", 0.0)")
+grass.run_command("r.mapcalc", expression="cin_1=if(col() == 10 && row() == 10 ," + str(0.2/86400) + ", 0.0)")
 # We have a transfer boundary condition
-grass.run_command("r.mapcalc", expression="tstatus_1=if(col() == 1 || col() == 80 , 3, 1)")
+grass.run_command("r.mapcalc", expression="tstatus_1=if(col() == 1 || col() == 40 , 3, 1)")
 # No diffusion coefficient known for the solution
 grass.run_command("r.mapcalc", expression="diff_1=0.0")
 # Normal retardation
@@ -77,8 +75,14 @@
   hc_y="hydcond_1", rd="R_1", cs="cs_1", q="well_1", nf="poros_1", output="stresult_conf_1", dt=21600000,\
   diff_x="diff_1", diff_y="diff_1", cin="cin_1", c="c_1", al=AL, at=AT)
 
-# The second computation uses different dispersivities
+# Get the maximum concentration
+range = grass.parse_command("r.info", "r", map="stresult_conf_1")
+# Normalize the result
+grass.run_command("r.mapcalc", expression="stresult_conf_1_norm = stresult_conf_1/" + str(range["max"]))
+#Create contour lines range from 0.7 to 0.1 in 0.1 steps
+grass.run_command("r.contour", input="stresult_conf_1_norm", output="stresult_conf_1_norm", minlevel=0.1, maxlevel=0.7, step=0.1)
 
+# The second computation uses different dispersivity lengths
 AL=10
 AT=1
 
@@ -88,3 +92,10 @@
   hc_y="hydcond_1", rd="R_1", cs="cs_1", q="well_1", nf="poros_1", output="stresult_conf_2", dt=21600000,\
   diff_x="diff_1", diff_y="diff_1", cin="cin_1", c="c_1", al=AL, at=AT)
 
+
+# Get the maximum concentration
+range = grass.parse_command("r.info", "r", map="stresult_conf_2")
+# Normalize the result
+grass.run_command("r.mapcalc", expression="stresult_conf_2_norm = stresult_conf_2/" + str(range["max"]))
+#Create contour lines range from 0.7 to 0.1 in 0.1 steps
+grass.run_command("r.contour", input="stresult_conf_2_norm", output="stresult_conf_2_norm", minlevel=0.1, maxlevel=0.7, step=0.1)



More information about the grass-commit mailing list