r.gwflow.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <h2>DESCRIPTION</h2>
  2. This numerical program calculates implicit transient, confined and
  3. unconfined groundwater flow in two dimensions based on
  4. raster maps and the current region settings.
  5. All initial and boundary conditions must be provided as
  6. raster maps. The unit in the location must be meters.
  7. <p>This module is sensitive to mask settings. All cells which are outside the mask
  8. are ignored and handled as no flow boundaries.
  9. <p><center>
  10. <img src="r_gwflow_concept.png" border="0"><br>
  11. <table border="0" width="700">
  12. <tr><td><center>
  13. <i>Workflow of r.gwflow</i>
  14. </center></td></tr>
  15. </table>
  16. </center>
  17. <p>
  18. <em>r.gwflow</em> calculates the piezometric head and optionally
  19. the water budget and the filter velocity field,
  20. based on the hydraulic conductivity and the piezometric head.
  21. The vector components can be visualized with paraview if they are exported
  22. with <em>r.out.vtk</em>.
  23. <br>
  24. <br>
  25. The groundwater flow will always be calculated transient.
  26. For stady state computation set the timestep
  27. to a large number (billions of seconds) or set the
  28. storativity/ effective porosity raster map to zero.
  29. <br>
  30. <br>
  31. The water budget is calculated for each non inactive cell. The
  32. sum of the budget for each non inactive cell must be near zero.
  33. This is an indicator of the quality of the numerical result.
  34. <h2>NOTES</h2>
  35. The groundwater flow calculation is based on Darcy's law and a numerical implicit
  36. finite volume discretization. The discretization results in a symmetric and positive definit
  37. linear equation system in form of <i>Ax = b</i>, which must be solved. The groundwater flow partial
  38. differential equation is of the following form:
  39. <p>(dh/dt)*S = div (K grad h) + q
  40. <p>In detail for 2 dimensions:
  41. <p>(dh/dt)*S = Kxx * (d^2h/dx^2) + Kyy * (d^2h/dy^2) + q
  42. <ul>
  43. <li>h -- the piezometric head im [m]</li>
  44. <li>dt -- the time step for transient calculation in [s]</li>
  45. <li>S -- the specific storage [1/m]</li>
  46. <li>Kxx -- the hydraulic conductivity tensor part in x direction in [m/s]</li>
  47. <li>Kyy -- the hydraulic conductivity tensor part in y direction in [m/s]</li>
  48. <li>q - inner source/sink in meter per second [1/s]</li>
  49. </ul>
  50. <p>Confined and unconfined groundwater flow is supported. Be aware that the storativity input parameter
  51. is handled differently in case of unconfined flow. Instead of the storativity, the effective porosity is expected.
  52. <p>To compute unconfined groundwater flow, a simple Picard based linearization scheme is used to
  53. solve the resulting non-linear equation system.
  54. <p>Two different boundary conditions are implemented,
  55. the Dirichlet and Neumann conditions. By default the calculation area is surrounded by homogeneous Neumann boundary conditions.
  56. The calculation and boundary status of single cells must be set with a status map,
  57. the following states are supportet:
  58. <ul>
  59. <li>0 == inactive - the cell with status 0 will not be calculated, active cells will have a no flow boundary to this cell</li>
  60. <li>1 == active - this cell is used for groundwater floaw calculation, inner sources and recharge can be defined for those cells</li>
  61. <li>2 == Dirichlet - cells of this type will have a fixed piezometric head value which do not change over the time </li>
  62. </ul>
  63. <br>
  64. <br>
  65. Note that all required raster maps are read into main memory. Additionally the
  66. linear equation system will be allocated, so the memory consumption of this
  67. module rapidely grow with the size of the input maps.
  68. <br>
  69. <br>
  70. The resulting linear equation system <i>Ax = b</i> can be solved with several solvers.
  71. An iterative solvers with sparse and quadratic matrices support is implemented.
  72. The conjugate gradients method with (pcg) and without (cg) precondition.
  73. Additionally a direct Cholesky solver is available. This direct solver
  74. only work with normal quadratic matrices, so be careful using them with large maps
  75. (maps of size 10.000 cells will need more than one gigabyte of RAM).
  76. Always prefer a sparse matrix solver.
  77. <h2>EXAMPLE</h2>
  78. Use this small script to create a working
  79. groundwater flow area and data. Make sure you are not in a lat/lon projection.
  80. It includes drainage and river input as well.
  81. <div class="code"><pre>
  82. # set the region accordingly
  83. g.region res=25 res3=25 t=100 b=0 n=1000 s=0 w=0 e=1000 -p3
  84. #now create the input raster maps for confined and unconfined aquifers
  85. r.mapcalc expression="phead = if(row() == 1 , 50, 40)"
  86. r.mapcalc expression="status = if(row() == 1 , 2, 1)"
  87. r.mapcalc expression="well = if(row() == 20 && col() == 20 , -0.01, 0)"
  88. r.mapcalc expression="hydcond = 0.00025"
  89. r.mapcalc expression="recharge = 0"
  90. r.mapcalc expression="top_conf = 20.0"
  91. r.mapcalc expression="top_unconf = 70.0"
  92. r.mapcalc expression="bottom = 0.0"
  93. r.mapcalc expression="null = 0.0"
  94. r.mapcalc expression="poros = 0.15"
  95. r.mapcalc expression="s = 0.0001"
  96. # The maps of the river
  97. r.mapcalc expression="river_bed = if(col() == 35 , 48, null())"
  98. r.mapcalc expression="river_head = if(col() == 35 , 49, null())"
  99. r.mapcalc expression="river_leak = if(col() == 35 , 0.0001, null())"
  100. # The maps of the drainage
  101. r.mapcalc expression="drain_bed = if(col() == 5 , 48, null())"
  102. r.mapcalc expression="drain_leak = if(col() == 5 , 0.01, null())"
  103. #confined groundwater flow with cg solver and sparse matrix, river and drain
  104. #do not work with this confined aquifer (top == 20m)
  105. r.gwflow solver=cg top=top_conf bottom=bottom phead=phead status=status \
  106. hc_x=hydcond hc_y=hydcond q=well s=s recharge=recharge output=gwresult_conf \
  107. dt=8640000 type=confined vx=gwresult_conf_velocity_x vy=gwresult_conf_velocity_y budget=budget_conf
  108. #unconfined groundwater flow with cg solver and sparse matrix, river and drain are enabled
  109. # We use the effective porosity as storativity parameter
  110. r.gwflow solver=cg top=top_unconf bottom=bottom phead=phead \
  111. status=status hc_x=hydcond hc_y=hydcond q=well s=poros recharge=recharge \
  112. river_bed=river_bed river_head=river_head river_leak=river_leak \
  113. drain_bed=drain_bed drain_leak=drain_leak \
  114. output=gwresult_unconf dt=8640000 type=unconfined vx=gwresult_unconf_velocity_x \
  115. budget=budget_unconf vy=gwresult_unconf_velocity_y
  116. # The data can be visulaized with paraview when exported with r.out.vtk
  117. r.out.vtk -p in=gwresult_conf,status vector=gwresult_conf_velocity_x,gwresult_conf_velocity_y,null \
  118. out=/tmp/gwdata_conf2d.vtk
  119. r.out.vtk -p elevation=gwresult_unconf in=gwresult_unconf,status vector=gwresult_unconf_velocity_x,gwresult_unconf_velocity_y,null \
  120. out=/tmp/gwdata_unconf2d.vtk
  121. #now load the data into paraview
  122. paraview --data=/tmp/gwdata_conf2d.vtk &amp;
  123. paraview --data=/tmp/gwdata_unconf2d.vtk &amp;
  124. </pre></div>
  125. <h2>SEE ALSO</h2>
  126. <em>
  127. <a href="r.solute.transport.html">r.solute.transport</a>,
  128. <a href="r3.gwflow.html">r3.gwflow</a>,
  129. <a href="r.out.vtk.html">r.out.vtk</a>
  130. </em>
  131. <h2>AUTHOR</h2>
  132. S&ouml;ren Gebbert
  133. <p>This work is based on the Diploma Thesis of S&ouml;ren Gebbert available
  134. <a href="https://grass.osgeo.org/gdp/hydrology/gebbert2007_diplom_stroemung_grass_gis.pdf">here</a>
  135. at Technical University Berlin in Germany.
  136. <p><i>Last changed: $Date$</i>