63 Whenever God says that He does not know, He professes ignorance indeed, but is not under the defect of ignorance. It is not because of the infirmity of ignorance that He does not know, but because it is not yet the time to speak, or the divine Plan to act. Thus He says to Abraham, The cry of Sodom and Gomorrha is full, and their sin is very grievous. Therefore I will go down now, and see if they have done altogether according to the cry of it: and if not, I will know. Here we perceive God not knowing that which notwithstanding He knows. He knows that their sins are very grievous, but He comes down again to see whether they have done altogether, and to know if they have not. We observe, then, that He is not ignorant, although He does not know, but that, when the time comes for action, He knows. This knowledge is not, therefore, a change from ignorance, but the coming of the fullness of time. He waits still to know, but we cannot suppose that He does not know: therefore His not knowing what He knows, and His knowing what He does not know, is nothing else than a divine economy in word and deed.
Source: On the Trinity (New Advent)