The distribution of residential buildings is closely related to local climate conditions. This paper takes Xi’an region as its representative city to study the thermal conditions of various shapes of cluster distribution by utilizing energy consumption simulation. By sequentially changing the dimensions of each unit building in the cluster, it sets up models of mathematical examples which meet the requirements of different seasons. Based on the annual minimal energy consumption of buildings, the paper quantitatively expounds the influence of cluster distribution on buildings’ energy consumption. This study finally works out a recommendation for the cluster distribution in Xi’an region, i.e. the annual comprehensive energy consumption of buildings is at its minimum when buildings facing both south and north are “L”-shaped enclosures and when they have no westward extension and their length ratio between eastward extended exterior walls and southward level exterior walls is 0.5:1.