Giving DEM as input is there any way to get drainage network?
I am newbie to GRASS and QGIS ,provide any working examples in GRASS GIS and QGIS with procedure.
The answer will depend on the requirements of your specific workflow and application but I can offer you advise on how a drainage network is generally extracted from a digital elevation model (DEM). The key to extracting a drainage network from a DEM is creating a flow accumulation raster, i.e. a raster for which each grid cell contains a value that is proportional to the upslope area that drains into the cell. Before you can create this raster from your DEM you will need to ensure that the DEM does not contain any artifact topographic depressions (bowl-like features that capture flow) or flat areas. The basis of surface flow modelling is that you can move any water (or accumulated area, which is used as a surrogate for water) out of a grid cell and into one or more downslope cells. Grid cells that are either part of depressions or flat areas don't have downslope neighbours and therefore pose a significant problem to the creation of a flow accumulation image. Usually people start by processing their DEM with a depression filling tool. Personally, I think depression filling is generally too disruptive to local flow paths and recommend instead depression breaching as a way of hydrologically correcting DEMs, but ultimately you need to apply one of these two methods.
Once you've hydrologically corrected your DEM you will need to calculate your flow-direction grid, and from that you flow-accumulation raster. Depending on the tool, the flow-direction grid may be calculated at the same time as the flow-accumulation step. Take a look at the flow-accumulation tool that you are using and see if it requires an input of a DEM or a flow-direction raster. Importantly, however, you will need to decide which of the several flow-accumulation algorithms you will use. There are plenty of available ways to accumulate flow, including the common algorithms of D8 (single-flow direction), D-infinity, FD8, FD-infinity, and many others. The main difference among these methods for modelling surface flow is in how they handle flow dispersion. You are mainly interested in extracting stream networks and by and far, at the resolution of a coarser DEM at least, once water gets in a channel it does not disperse very much (my Masters advisor who is an expert in the fluvial geomorphology of braided channels would be upset with me for saying that). Regardless, flow dispersion is important for modelling flow on hillslopes but much less so for extracting streams and if you are going to be doing any stream network analysis on your extracted streams (e.g. Horton-Strahler ordering of links in the network) you may need to ensure that there is no dispersion along the channel anyhow. That, combined with the fact that you can only use a flow algorithm that is available to you in the GIS you use, means that I would recommend (for this particular application) the use of the D8 flow algorithm (let it be known that there are many better algorithms than the D8 algorithm!).
Once you've created your flow-accumulation raster you are ready to extract your stream network. You'll notice that grid cells with high values of flow accumulation will be located along valley bottoms (makes sense, water drains from ridges towards the valley bottoms) and this is why we can extract a stream network from a flow-accumulation raster. The most basic way of extracting a stream network from a flow-accumulation raster is simply to apply a threshold, such that [streams] = [flow accumulation] > thresholdValue. The geomorphic significance here is that for a landscape and under specific climate conditions, there is a minimum amount of discharge required to maintain a stream channel, such that it doesn't fill in with the overland wash of sediment constantly being delivered to the channel from the hillslopes. In reality the threshold value that determines the location of the channel heads and therefore channel network extent will be related to many other factors such as local slope gradient and soil characteristics. Nonetheless, for practical purposes, at this point you will experiment with various threshold flow accumulation values that make the extent of the extracted stream network similar to what you may observe on some secondary data source such as the blue-lines on a map or a satellite image. Lower flow-accumulation thresholds will result in a more extensive stream network and vice versa. The actual thresholding can actually be performed in a Raster Calculator, although specific Drainage Network Extraction tools may offer further functionality such as the removal of exterior links in the network (headwater channels) that are shorter than some specified length.
I don't really use GRASS or QGIS very often, but in your last related question I suggested using the free and open-source GIS that I develop Whitebox Geospatial Analysis Tools (download here) for this task. As I mentioned in my last answer, most GIS will allow you to perform this task, but the specific workflow for Whitebox goes something like this:
Use Fill Depressions tool (or better, the Breach Depressions tool) to hydrologically condition your DEM. You'll find it in the Hydrological Tools -> DEM Pre-Processing Tools toolboxes.
Use the D8 Flow Pointer tool, found in the Hydrological Tools -> Flow Pointers toolboxes, to extract your flow direction raster.
Use the D8 and Rho8 Flow Accumulation tool, found in the Hydrological Tools -> Flow Accumulation toolboxes, to calculate your flow-accumulation grid. The output type can be the specific catchment area (SCA) and you do not need to log-transform the output (this is mainly for display purposes and can be replicated by changing the palette non-linearity settings in the raster's display properties).
Use the Extract Streams tool, found in the Stream Network Analysis toolbox, to extract your final drainage network. Again, this is a bit of an iterative process as you experiment with a range of suitable channelization thresholds (values of flow-accumulation found at channel head locations, i.e. the furthest upstream sites). Depending on your application you might also use the Remove Short Streams tool to further fine-tune your extracted network and there are also tools within the Stream Network Analysis toolbox for classifying your network (e.g. ordering links etc.), converting your network to a vector, extracting a long profile for your network, and many others.