Natural gas is one of the most widely used energy carriers due to low production costs, clean combustion and high efficiency. For different reasons for natural gas pipelines,the failure of the pipelines ,which leads to leakage in them, arises. random emissions of gas from a pipeline may lead to human accidents and economic losses. Therefore, it is important to know how useful it can be to distribute gas in the surrounding environment and to study the concentration of it and determine the alarm area. in this project, natural gas flow due to the failure of pipe lines in both air and porous media is investigated. also ,the effective states in increasing the gas concentration in each of these environments will be investigated. the effect of these factors on the extent of the explosion area is investigated. in order to ensure their numerical method, with the help of the gas company of isfahan ,a real leakage sample was tested, and its result was compared with numerical solution. factors such as pipeline pressure,hole diameter,wind speed, and soil porosity coefficient are factors that affect our problem.the results of this simulation show that by increasing the pressure of the pipeline (60, 250, 1050 psi) and the diameter of the leakage hole (20, 50, 100 mm) will increase the height of the explosion area. then the effect of wind on gas jet concentration is investigated. it is concluded that the increase in wind speed will reduce the height of the explosion area. finally , by simulating the project in porous media, it is concluded that increasing the soil porosity coefficient (0.1, 0.4, 0.7, 1) increases of the explosion area. Keywords: Failure of the pipelines ,Concentration of natural gas ,Explosioarea ,Diffusion in porous media ,Soil porosity coefficient.