## 2 Urban Pipeline Gas Leak Sensor Placement Method
### Study on Gas Diffusion in Soil  
This study employs a one-dimensional continuous-source diffusion model based on [PERSON]'s second law to simulate the leakage behavior of methane gas, focusing on the diffusion process from pipeline leakage points into sandy soil and a parallel pipeline system. [PERSON]'s second law describes the diffusion of substances under non-steady-state conditions with the following equation:  
\[\frac{\partial C}{\partial t}=D\frac{\partial^{2}C}{\partial x^{2}} \tag{11}\]  
where \(C\) represents the concentration of methane, \(D\) is the diffusion coefficient that describes the ability of methane to diffuse in a given medium, and \(t\) and \(x\) are the time and spatial variables, respectively. Figure 3 delineates two primary propagation paths of methane from the leakage source to the detection point. Firstly, methane may leak from the underground gas pipeline into the surrounding soil. If there are cracks, joints, or openings in the adjacent parallel pipeline, the leaked methane can migrate through the soil and enter this pipeline system due to pressure and diffusion gradients. Once inside the parallel pipeline, the methane will travel along it and eventually diffuse upward into the inspection manhole. Within the manhole, catalytic combustion sensors detect and confirm the gas leak. Additionally, methane may directly diffuse from the soil surface into the air, where open-path laser sensors located outdoors monitor the gas, particularly suitable for open areas. Figure 3: Leak detection diagram. The volumetric flow rate \(Q\) of methane escaping from the hole is calculated using the following formula:  
\[Q=k\times i\times A \tag{12}\]  
where \(k\) is the gas permeability of the soil (m/s), \(i\) is the gas gradient, and \(A\) is the cross-sectional area through which the gas passes (m\({}^{2}\)). These parameters must be experimentally defined for each specific soil type. In this study, the diffusion coefficient for methane in dry sandy soils ranges from 1 \(\times\) 10\({}^{-5}\) cm\({}^{2}\)/s to 2 \(\times\) 10\({}^{-5}\) cm\({}^{2}\)/s, reflecting the high air-filled porosity in these soils, which allows easier methane diffusion. However, in wet sandy soils, the diffusion coefficient of methane is significantly lower, typically ranging from 1 \(\times\) 10\({}^{-7}\) cm\({}^{2}\)/s to 5 \(\times\) 10\({}^{-6}\) cm\({}^{2}\)/s, as the presence of water reduces the air-filled porosity and increases tortuosity, which hinders gas movement. The model's time span ranges from 1 s to 10,000 s, divided into 100 time intervals, to observe changes in diffusion distance over time. The methane concentration threshold is set at 0.001 mol/m\({}^{3}\); to determine the diffusion distance where the gas concentration falls below this value. The concentration \(C(x,t)\) at distance \(x\) and time \(t\) is calculated using the following formula:  
\[C(x,t)=\frac{Q}{A}\times\frac{1}{D}\times\frac{P}{RT}\times t \tag{13}\]  
where \(C(x,t)\) represents the concentration of methane at distance \(x\) and time \(t\), calculated based on the volumetric flow rate \(Q\) (m\({}^{3}\)/s), the diffusion coefficient \(D\) (m\({}^{2}\)/s), and the gas's molar volume under specific conditions. The flow rate \(Q\) determines the volume of methane passing through a unit area per second, while the diffusion coefficient \(D\) describes how quickly methane spreads through the medium. The molar volume, related to pressure \(P\) (Pa), temperature \(T\) (K), and the ideal gas constant \(R\) (J/(mol\(\cdot\)K)), influences the amount of methane in the given volume and affects the resulting concentration. Time \(t\) (s) is also a crucial factor, as the concentration varies over time as methane diffuses from the source. Using the binary search algorithm, the distance at which the concentration drops below the set threshold within each time interval is calculated to evaluate the actual range of gas diffusion.