Although zhuge liang's "Romance of the Three Kingdoms" portrayed Zhuge Liang as a god who knew astronomy and geography and could even "borrow" the East Wind, literary creation could not be overshadowed by historical facts, that is, Zhuge Liang was ultimately unable to break through Cao Wei's defense line and realize his long-cherished wish to restore the Central Plains.

Therefore, from the perspective of literary creation, when Zhuge Liang borrowed arrows from the grass boat, it was the rising period of Liu Bei's camp, and at this stage Zhuge Liang calculated with his mythical ability that there was fog on the river, which was fictionalized in the context of Sun Liu's victory in the Battle of Chibi, so this fiction not only did not violate the basic main line of history, but could add Zhuge Liang's aura of god and man.
However, by the time the valley was burned, it was Zhuge Liang's last Northern Expedition, and no effective results were achieved, and shortly thereafter, Zhuge Liang died of illness. Therefore, in this historical background, the author wants to continue to mythologize Zhuge Liang, but he cannot write Sima Yi to death, what to do? Zhuge Liang had to be portrayed as a tragic hero, and with the help of Providence, Zhuge Liang was about to burn Sima Yi to death, and was saved by an unexpected rain. In this way, it is possible to achieve at the same time the emotional appeal of not violating the basic historical facts (sima yi's father and son died without the later Jin dynasty) and Sima Yi being a defeated general under Zhuge Liang.
Of course, after talking about the reasons for literary creation, let's assume that these two battles are true (the straw boat borrowed arrows really happened, and the protagonist is Sun Quan), and analyze why Zhuge Liang calculated that there was fog on the river from the perspective of the battlefield, but he could not calculate that there was rain in the valley above.
China has been an agricultural country since ancient times, in the long-term agricultural process, our people have summed up a set of meteorological forecasting theory, engaged in this work of the person named "Zhanhou family". The Chronicle of the Three Kingdoms once recorded: "Zhang Yu of Sima Shu County, the rear of Shizhou, also knew that Zhan Hou was waiting, and the genius was too much." Pei Songzhi also recorded the process of predicting the weather by Guan Rui: "On the sixteenth day, in the full star, there is already water vapor, and the water vapor is launched in The Chen, which must also be done." The place where the grass boat borrowing arrow occurred was in Xichao Lake, one hundred and ten miles southwest of Hanshan County, Anhui, and fog on the lake surface was the norm, and for Zhuge Liang, who had been "ploughing in Nanyang" all year round, it was not unusual to have the ability to occupy hou, so it was understandable to predict in advance that there was fog on the river surface.
Then why didn't the upper valley predict it? First of all, it is a matter of time, Zhuge Liang's ambush of the upper valley is a long-term process, he can not accurately know on which day Sima Yi will enter the upper valley, so he cannot judge the weather of the day in advance. The second is the geographical location problem, the upper valley is located in the territory of Mei County, Shaanxi, and the history books record that the time when Zhuge Liang's army arrived in Mei County was in April, so the imaginary upper valley ambush time must be before July after April (Zhuge Liang died of illness in August). According to the average humidity in MeiXian county after April, it is just in the rising humidity period, but because it has not yet reached the rainy season, it will not form rainfall (temperate monsoon climate, summer will be rainy).
Zhuge Liang may be able to calculate that the spring in Meixian County is dry and rainless, suitable for fire attack, but he forgot a little, the upper valley mouth is narrow, and attacking with fire in this place will inevitably lead to a rapid rise in temperature in the canyon, producing a large number of gray cores, resulting in water vapor condensation to form rapid rainfall (convective rain).