Swiatek wins first match since US Open as Tomljanovic retires
The world number one was leading 7-5, 2-2 in a tight encounter when the Australian quit, shortly after clutching her knee in pain.
"It was a great match and it's unfortunate that something happened - I hope she's going to recover quickly," said Swiatek.
The Pole won her third Grand Slam title, and second of the year, at Flushing Meadows last month with a straight-sets victory over Tunisia's Ons Jabeur in the final.
"I've had a three-week break from playing matches, and after such an intense time it seems like a lot," she said.
"I felt like I need to get back to the rhythm, and it wasn't easy."
Swiatek edged a close first set with a break in the 12th game.
Tomljanovic, who reached both the Wimbledon and US Open quarter-finals this season, came back from a break down early in the second set before retiring.
Swiatek will face either American Caty McNally or Czech home hope Karolina Muchova in the quarter-finals.