One of the most pleasant surprises for the 49ers defense in the offseason and training camp was Tank Carradine.

After three mostly unproductive seasons with San Francisco, the second-round pick of 2013 out of Florida State finally had found his place in a revamped 49ers defensive scheme. After shuttling between the defensive line and outside linebacker in the 3-4 setup, Carradine made an impact as a 4-3 defensive end, especially against the run. New defensive coordinator Robert Saleh said Carradine was “damn near an elite” player in that role.

“He’s pretty freaking good at it,” Saleh said. “That’s where Tank’s strength is.”

And, through the first three games of the season, Carradine was listed at No. 1 on the depth chart at his position, ahead of this year’s No. 1 pick, Solomon Thomas.

But in the loss to the Rams this past Thursday night, Carradine suffered a high ankle sprain. The injury is serious enough that it may keep him off the field for four to six weeks – or the rest of the season.

“Any time you’ve got a high ankle sprain, it’s going to be a while,” said 49ers head coach Kyle Shanahan, according to Nick Wagoner of ESPN.com. “So we’re not exactly sure how long it’s going to be. We’ll have to decide that probably Monday.”

The 49ers could put Carradine on injured reserve, Shanahan said.

Now the 0-3 49ers – who take on the Cardinals in Arizona this Sunday – will hope that Thomas (who’s actually played more snaps than Carradine this season) can improve while taking on more playing time.

Shanahan says Thomas will continue to get snaps at defensive tackle and defensive end. In three games, with one start, Thomas has been in on seven tackles — three for losses — but has yet to get his first sack.

Shanahan, though, says the stats don’t really show how Thomas is performing. The 49ers like his ability to play inside and outside and the push he’s getting against offensive blockers.

“I’m very excited with Solomon,” said Shanahan. “I’m very excited that he’s on our team, and I think he’s going to be a hell of a player for us.”

Sunday’s game in Arizona is set to kick off at 1:05 p.m.