vehu yoshev petach-ha'ohel kechom hayom - and he was sitting at the door of the tent in the heat of the day
Since Avraham was weakened by the circumcision he took advantage of the heat of the sun to act as therapy for his wounds. This is why he was outside at a time when normal healthy people stay inside to take advantage of the shade.
The basis for the sun providing therapy is derived from Malachi 3:20 "for the sun brings healing on its wings."
The passage is a reference to the fourth hour in the morning which is the time most people sit down to a meal. Avraham was waiting for visitors to share his meal with him.
The words "he was sitting at the door of the tent" is an allusion to the spiritual counterpart of the Jewish people in the celestial regions soothing Avraham's mind when he became aware of its existence in those regions at this time. This is deuced by the wording vayera elav Hashem. We have a tradition that the patriarchs were never addressed directly by the four-lettered Name of G-d - YKVK. (Shemot 6:3) If nonetheless, we encounter this Name of G-d here in connection with a vision Avraham was granted, we must conclude that this Name was revealed to him only indirectly. The words "at the door of the tent," are a hint that he had not yet been able to enter that "tent."