Why did the Union face the Confederates in a comparatively static position for almost 10 months at Petersburg? Why didn't they get out and go around the Confederates? At a minimum, this would have gotten the Confederates out of the trenches and into a more exposed position where the Union could let their superior numbers and supplies come to bear.
Go around them in which direction? South? That would put Lee between the Army of the Potomac and Washington. West? That would put Lee between the Army of the Potomac and their base of supplies. Northwest? That would relieve the pressure on Lee's supply lines as well as Richmond.
Grant besieged Petersburg because that was the best place to be. Petersburg was where all of Lee's supplies from the Deep South passed through, and City Point offered Grant a secure base on the James. The lines were gradually extended Southwest, forcing Lee to resort to first disembarking supplies from the Weldon & Petersburg Railroad further south and moving the rest to Petersburg by wagon, and ultimately receiving supplies on only one line, the Southside Railroad. When that line was exposed after the defeat at Five Forks, Lee had no choice but to evacuate Petersburg and Richmond, which led to the retreat that culminated in his surrender at Appomattox Court House.