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