Methods and systems using model based and iterative calculations of mass flow throughout an internal combustion engine system. A secondary air injection valve is provided to selectively allow intake air to pass to the exhaust side of the engine system to aid in exothermic reaction with exhaust gasses exiting the engine for various purposes. The iterative calculations of mass flow include estimation of the mass flow through the secondary air injection valve.