Provided by: grass-doc_7.6.1-3build1_all

**NAME**

r3.flow- Computes 3D flow lines and 3D flow accumulation.

**KEYWORDS**

raster3d, hydrology, voxel

**SYNOPSIS**

r3.flowr3.flow--helpr3.flow[-a] [input=name] [vector_field=name[,name,...]] [seed_points=name] [flowline=name] [flowaccumulation=name] [sampled=name] [unit=string] [step=float] [limit=integer] [max_error=float] [skip=integer[,integer,...]] [direction=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]Flags:-aCreate and fill attribute table--overwriteAllow output files to overwrite existing files--helpPrint usage summary--verboseVerbose module output--quietQuiet module output--uiForce launching GUI dialogParameters:input=nameName of input 3D raster mapvector_field=name[,name,...] Names of three 3D raster maps describing x, y, z components of vector fieldseed_points=nameName of vector map with points from which flow lines are generated If no map is provided, flow lines are generated from each cell of the input 3D rasterflowline=nameName for vector map of flow linesflowaccumulation=nameName for output flowaccumulation 3D rastersampled=nameName for 3D raster sampled by flowlines Values of this 3D raster will be stored as attributes of flowlines segmentsunit=stringUnit of integration step Default unit is cell Options:time,length,cellDefault:celltime: elapsed timelength: length in map unitscell: length in cells (voxels)step=floatIntegration step in selected unit Default step is 0.25 cell Default:0.25limit=integerMaximum number of steps Default:2000max_error=floatMaximum error of integration Influences step, increase maximum error to allow bigger steps Default:1e-5skip=integer[,integer,...] Number of cells between flow lines in x, y and z directiondirection=stringCompute flowlines upstream, downstream or in both direction. Options:up,down,bothDefault:down

**DESCRIPTION**

Moduler3.flowcomputes 3D flow lines and 3D flow accumulation. It accepts either three 3D raster maps representing the vector field or one 3D raster map. In case of one map, it computes on-the-fly gradient field.FlowlinesFlow lines are computed either from points (seeds) provided inseed_pointsvector map, or if there are no seeds, it creates seeds in a regular grid in the center of voxels (3D raster cells). Parameterskipthen controls the step between the regularly distributed seeds. If skip is not provided, r3.flow decides optimal skip for each dimension based on current 3D region as one tenth of the number of columns, rows, and depths. Flow lines can be computed in upstream direction (in the direction of gradient or vector field), in downstream direction or in both directions.FlowaccumulationFlow accumulation is computed as the number of flow lines traversing each voxel. Since the flow lines are computed for each voxel, the flow accumulation computation can be more demanding. Parameter skip does not influence the flow accumulation computation, parameter direction does.FlowlineintegrationFlow line integration can be influenced by several parameters. Optionstepcontrols the integration step and influences the precision and computational time. The unit of step can be defined either in terms of the size of the voxel (3D raster cell), length in map units, or as elapsed time. Optionlimitspecifies the maximum number of steps of each flow line.AttributesWithout using flaga, no attribute table is created and each flow line is represented by one vector line with one category. Withaflag, an attribute table is created and each category (record) represents one segment of a flowline, so that attributes specific for segments can be written. In case ofvector_fieldinput, only velocity is written, in case ofinputoption, also values of the input 3D raster are written. Optionsampledallows sampling (query) given 3D raster by flow lines (computed from different 3D raster) and write the values of the given 3D raster as attributes of the flow line segments. Note that usingaflag results in longer computation time, so consider increasingstepandmax_errorparameter.

**NOTES**

r3.flow uses Runge-Kutta with adaptive step size (Cash-Karp method).

**EXAMPLES**

First we create input data using example 1 from r3.gwflow manual page: # set the region accordingly g.region res=25 res3=25 t=100 b=0 n=1000 s=0 w=0 e=1000 -p3 # now create the input raster maps for a confined aquifer r3.mapcalc expression="phead = if(row() == 1 && depth() == 4, 50, 40)" r3.mapcalc expression="status = if(row() == 1 && depth() == 4, 2, 1)" r3.mapcalc expression="well = if(row() == 20 && col() == 20 && depth() == 2, -0.25, 0)" r3.mapcalc expression="hydcond = 0.00025" r3.mapcalc expression="syield = 0.0001" r.mapcalc expression="recharge = 0.0" r3.gwflow solver=cg phead=phead status=status hc_x=hydcond hc_y=hydcond \ hc_z=hydcond q=well s=syield r=recharge output=gwresult dt=8640000 vx=vx vy=vy vz=vz budget=budget Then we compute flow lines in both directions and downstream flowaccumulation. r3.flow vector_field=vx,vy,vz flowline=gw_flowlines skip=5,5,2 direction=both r3.flow vector_field=vx,vy,vz flowaccumulation=gw_flowacc We can visualize the result in 3D view: We can store velocity values (and values of the input 3D raster map if we use optioninput) for each segment of flow line in an attribute table. r3.flow -a vector_field=vx,vy,vz flowline=gw_flowlines skip=5,5,2 direction=both v.colors map=flowlines_color@user1 use=attr column=velocity color=bcyr Again, we visualize the result in 3D view and we check ’use color for thematic rendering’ on 3D view vector page.

**SEE** **ALSO**

r.flow,r3.gradient,r3.gwflow

**AUTHORS**

Anna Petrasova, NCSU OSGeoREL, developed during GSoC 2014.Lastchanged:$Date:2016-07-0719:18:24+0200(Thu,07Jul2016)$

**SOURCE** **CODE**

Available at: r3.flow source code (history) Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index © 2003-2019 GRASS Development Team, GRASS GIS 7.6.1 Reference Manual