From Abraham Kurvilla:
" 'Now I know' was often used in the OT to describe a solemn declaration Ex. 18.11; Judges 17.13; 1 Sam. 24.20; 1 Ki. 17.24; Ps. 20.6)."
So God was not learning, here.
From John Walton:
"We are not to conclude from this wording that God had gained cognitive knowledge that he previously lacked; rather, his 'knowing' is the result of Abraham’s demonstration that he took God seriously ('feared God'). All of Abraham's previous acts of faith included some benefit for him [Abraham] to gain. Consequently, it was difficult to discern whether Abraham’s relationship with God was based on expected benefits or was simply a reflection of his esteem for God. In the ancient religious system from which Abraham had been called, relationship with the gods was a mutual benefit arrangement. People took care of the gods, and the gods took care of the people. God had promised to take care of Abraham, but he wanted more from Abraham than participation in a mutual-benefit system. God has no needs and hoped for a relationship that was not based on expectation of benefit. In this account Abraham demonstrated that his obedience and faith were not dependent on anticipated gain—he had nothing to gain and everything to lose. God knew what Abraham would do, as he always does, yet he still takes delight in our expressions of love, faith, worship, and honor."