Abstract:Some Key Research Fields of Chinese Soil Physics in the New Era: Progresses and Perspectives pointed out that one of the reasons for the lack of original research on soil physics in China is that Chinese scholars engaged in soil physics research lack a strong mathematical foundation. This makes it difficult to achieve breakthroughs in the numerical simulation of soil physical processes. The key equation for numerical simulation of soil physical processes is the Richards equation. Although there are many papers on solving the Richards equation using the finite element method, most are highly theoretical and lack practicality, posing significant challenges for researchers with limited mathematical and physical backgrounds in understanding and programming implementation. Therefore, this paper aims to present a programming framework incorporating detailed derivation steps for solving the one-dimensional Richards equation using the finite element method. The weak form of the Richards equation was derived by establishing the weighted residual equation. Subsequently, the weak form equation was transformed into a nonlinear algebraic equation by employing Jacobian transformation and Gaussian numerical integration. Finally, the nonlinear algebraic equation was solved using the Newton-Raphson method with boundary condition substitution. The corresponding code developed based on this programming framework demonstrated simulation results validated by experimental data from soil infiltration tests. The programming framework and code provided in this paper enable researchers with limited mathematical and physical backgrounds to efficiently implement numerical simulation of the one-dimensional Richards equation using the finite element method. This effort aims to facilitate potential breakthroughs in numerical modeling of soil physical processes in China, thereby contributing positively to future advancements in this field.