Where in the code of the robot's foot-ground contact mechanics calculation formula is it located in the Gazebo system?

I have been searching in the physics directory of gazebo for several days. I have read the relevant codes of ODEPhysics and BulletPhysics, but I haven’t found the direct code for ground contact or the formulas for friction and collision calculation. I sincerely hope you can offer some help. Thank you very much.