| 1 |
<h2>DESCRIPTION</h2> |
| 2 |
|
| 3 |
Module <em>r3.flow</em> computes 3D flow lines and 3D flow accumulation. |
| 4 |
It accepts either three 3D raster maps representing the vector field or one 3D raster map. |
| 5 |
In case of one map, it computes on-the-fly gradient field. |
| 6 |
|
| 7 |
<h3>Flow lines</h3> |
| 8 |
|
| 9 |
Flow lines are computed either from points (seeds) provided in <b>seed_points</b> vector map, |
| 10 |
or if there are no seeds, it creates seeds in a regular grid in the center of voxels (3D raster cells). |
| 11 |
Parameter <b>skip</b> then controls the step between the regularly distributed seeds. |
| 12 |
If skip is not provided, r3.flow decides optimal skip for each dimension based on current 3D region |
| 13 |
as one tenth of the number of columns, rows, and depths. |
| 14 |
Flow lines can be computed in upstream direction (in the direction of gradient or vector field), |
| 15 |
in downstream direction or in both directions. |
| 16 |
|
| 17 |
<h3>Flow accumulation</h3> |
| 18 |
Flow accumulation is computed as the number of flow lines traversing each voxel. |
| 19 |
Since the flow lines are computed for each voxel, the flow accumulation computation |
| 20 |
can be more demanding. |
| 21 |
Parameter skip does not influence the flow accumulation computation, parameter direction does. |
| 22 |
|
| 23 |
<h3>Flow line integration</h3> |
| 24 |
Flow line integration can be influenced by several parameters. |
| 25 |
Option <b>step</b> controls the integration step and influences the precision and computational time. |
| 26 |
The unit of step can be defined either in terms of the size of the voxel (3D raster cell), |
| 27 |
length in map units, or as elapsed time. |
| 28 |
Option <b>limit</b> specifies the maximum number of steps of each flow line. |
| 29 |
|
| 30 |
<h3>Attributes</h3> |
| 31 |
Without using flag <b>a</b>, no attribute table is created and each flow line |
| 32 |
is represented by one vector line with one category. With <b>a</b> flag, an attribute table is created |
| 33 |
and each category (record) represents one segment of a flowline, so that attributes |
| 34 |
specific for segments can be written. In case of <b>vector_field</b> input, only velocity is written, |
| 35 |
in case of <b>input</b> option, also values of the input 3D raster are written. |
| 36 |
Option <b>sampled</b> allows sampling (query) given 3D raster by flow lines (computed from different 3D raster) and |
| 37 |
write the values of the given 3D raster as attributes of the flow line segments. |
| 38 |
Note that using <b>a</b> flag results in longer computation time, so consider increasing |
| 39 |
<b>step</b> and <b>max_error</b> parameter. |
| 40 |
|
| 41 |
<h2>NOTES</h2> |
| 42 |
|
| 43 |
r3.flow uses Runge-Kutta with adaptive step size |
| 44 |
(<a href="https://en.wikipedia.org/wiki/Cash-Karp_method">Cash-Karp method</a>). |
| 45 |
|
| 46 |
<h2>EXAMPLES</h2> |
| 47 |
|
| 48 |
First we create input data using |
| 49 |
<a href="r3.gwflow.html#example-1">example 1</a> from |
| 50 |
<a href="r3.gwflow.html">r3.gwflow manual page</a>: |
| 51 |
|
| 52 |
<div class="code"><pre> |
| 53 |
# set the region accordingly |
| 54 |
g.region res=25 res3=25 t=100 b=0 n=1000 s=0 w=0 e=1000 -p3 |
| 55 |
|
| 56 |
# now create the input raster maps for a confined aquifer |
| 57 |
r3.mapcalc expression="phead = if(row() == 1 && depth() == 4, 50, 40)" |
| 58 |
r3.mapcalc expression="status = if(row() == 1 && depth() == 4, 2, 1)" |
| 59 |
r3.mapcalc expression="well = if(row() == 20 && col() == 20 && depth() == 2, -0.25, 0)" |
| 60 |
r3.mapcalc expression="hydcond = 0.00025" |
| 61 |
r3.mapcalc expression="syield = 0.0001" |
| 62 |
r.mapcalc expression="recharge = 0.0" |
| 63 |
|
| 64 |
r3.gwflow solver=cg phead=phead status=status hc_x=hydcond hc_y=hydcond \ |
| 65 |
hc_z=hydcond q=well s=syield r=recharge output=gwresult dt=8640000 vx=vx vy=vy vz=vz budget=budget |
| 66 |
</pre></div> |
| 67 |
|
| 68 |
Then we compute flow lines in both directions and downstream flowaccumulation. |
| 69 |
|
| 70 |
<div class="code"><pre> |
| 71 |
r3.flow vector_field=vx,vy,vz flowline=gw_flowlines skip=5,5,2 direction=both |
| 72 |
r3.flow vector_field=vx,vy,vz flowaccumulation=gw_flowacc |
| 73 |
</pre></div> |
| 74 |
|
| 75 |
We can visualize the result in 3D view: |
| 76 |
<p> |
| 77 |
<img src="r3flow_flowlines.png"> |
| 78 |
|
| 79 |
<p> |
| 80 |
We can store velocity values (and values of the input 3D raster map if we use option <b>input</b>) for each segment of flow line |
| 81 |
in an attribute table. |
| 82 |
<div class="code"><pre> |
| 83 |
r3.flow -a vector_field=vx,vy,vz flowline=gw_flowlines skip=5,5,2 direction=both |
| 84 |
v.colors map=flowlines_color@user1 use=attr column=velocity color=bcyr |
| 85 |
</pre></div> |
| 86 |
|
| 87 |
Again, we visualize the result in 3D view and we check 'use color for thematic rendering' on 3D view vector page. |
| 88 |
<p> |
| 89 |
<img src="r3flow_flowlines_color.png"> |
| 90 |
|
| 91 |
<h2>SEE ALSO</h2> |
| 92 |
|
| 93 |
<em> |
| 94 |
<a href="r.flow.html">r.flow</a>, |
| 95 |
<a href="r3.gradient.html">r3.gradient</a>, |
| 96 |
<a href="r3.gwflow.html">r3.gwflow</a> |
| 97 |
</em> |
| 98 |
|
| 99 |
<h2>AUTHOR</h2> |
| 100 |
|
| 101 |
Anna Petrasova, <a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a>, developed during GSoC 2014. |