Rafi12,
Can you explain what you mean by handling porosity "analytically"? There are numerous ways to identify porosity based on amount, size, distribution, etc. Based on the size and distribution, you can assume an equivalent flaw size, and then use fracture mechanics to calculate the stress at which your component will fail. I have even seen techniques where a flaw (round porosity or thin crack) is modeled in FEA, and the resultant stress intensity used as a predictor of failure, rather than the nominal stress at various portions of the casting.