# A Novel Adaptive Transient Model of Gas Invasion Risk Management While Drilling
## 5 Conclusions  
Based on the circulating gas-liquid-solid three-phase flow heat transfer model, established under high-temperature and high-pressure drilling gas invasion conditions in deep wells, a PID controller for BHP was established in combination with automatic control theory to realize the automatic regulation and control of wellbore pressure. Based on this, fuzzy control rules were introduced to realize the adaptive rectification of PID control parameters to establish a fuzzy PID controller for BHP, and the introduction of a neural network module, combined with the online learning capability of the neural network, establishes the fuzzy neural network PID controller for BHP. Finally, the performance of three different controllers in BHP control and gas invasion treatment is compared and analyzed, and the following conclusions are drawn:  
(1) As the core scientific contribution of this study, the introduction of a fuzzy inference machine and the construction of a fuzzy neural network module to achieve adaptive tuning of PID control parameters and online optimization of fuzzy control rules effectively improves the efficiency and responsiveness of the downhole pressure controller. Moreover, due to the online optimization of control rules, the generalization capability of the fuzzy neural network PID controller for different control systems of the BHP is significantly improved. (2) The BHP fuzzy neural network PID controller can adjust the control parameters and control rules according to the real-time changes of the annular multiphase flow system and the BHP control deviation, so the efficiency of BHP regulation is significantly improved compared with the classical PID control. In this case, the classical PID controller takes 53 s to regulate the BHP within the safety pressure window, while the fuzzy neural network  
Figure 13: Gas influx quality vs. time for PID, fuzzy PID, and fuzzy neural network PID controller. PID controller takes only 32 s, which is 38% more efficient. Meanwhile, the classical PID controller takes 73 s to regulate the BHP to the target pressure, while the fuzzy neural network PID controller takes only 50 s, which is 32% more efficient. (3) Since the BHP fuzzy neural network PID controller can adjust the wellhead throttle opening and BHP more quickly, it can suppress the gas invasion rate more efficiently and reduce the total gas invasion and BHP fluctuation, which effectively improves its ability to handle gas invasion. In this case, the total amount of gas invasion during a gas invasion treatment by the fuzzy neural network PID controller was 16.63 kg, and the total amount of gas invasion during a gas invasion treatment by the classical PID controller was 45.09 kg, compared with the 63% improvement in the treatment capability of gas invasion by the fuzzy neural network PID controller for the BHP. Despite the promising results, some limitations of the current study should be acknowledged and will guide future work. Firstly, the integration of the FNN-PID controller with a detailed non-isothermal three-phase transient model introduces a significant computational load, which may limit real-time applicability. Future work will consider the development of reduced-order models or surrogate-assisted control strategies to improve the computational efficiency. Secondly, the current model assumes a vertical wellbore geometry and fixed drilling conditions; extending the model to complex well types, such as deviated or horizontal wells, will be essential for broader applicability. Lastly, while this study is based on simulation data, integrating the proposed control framework with real-time field data (e.g., from pressure-while-drilling or temperature sensors) is a promising direction for enabling intelligent, adaptive BHP management in real-world drilling environments. Conceptualization, Y.Z. and Z.Z. ; methodology, Y.Z. and X.Y. ; software, X.Y. ; validation, X.Y. and W.Z. ; formal analysis, Y.Z. ; investigation, X.Y. and W.Z. ; resources, Z.Z. ; data curation, Y.Z. and X.Y.