Trapped residual gas mass is an important physical factor that influences combustion phasing and variation, fuel consumption, and air mass prediction for fuel control. There are currently no mass-production sensors available to directly measure in-cylinder residual gas mass, so prediction models must be utilized for control. Residual gas content of the cylinder can be difficult to directly model for control purposes because it involves complex flows during gas exchange that are driven by fluctuating pressures in the intake and exhaust systems. Capturing these effects in an accurate manner generally requires high model complexity and computational effort outside of the capability of most production intent engine controllers. This paper presents a semi-physics-based control oriented residual gas mass (RGM) prediction method. The RGM model is based on Bernoulli’s principle and considers engine operating conditions, valve timing and geometry, and piston motion effects. Moreover, to more accurately estimate the burned gas back flow, this model captures gas wave dynamic effects in intake and exhaust manifold pressures. The model is described in detail and its prediction accuracy is compared to that of a high fidelity simulation that utilizes experimentally measured crank angle resolved intake, exhaust, and cylinder pressures as boundary conditions. The new model is incorporated into a rapid-prototype control system for real-time operation during transient and steady-state engine operation. The results show that the proposed RGM model provides real-time predictions within 1.9-2.3% RGF, creating relative estimation errors in the range of 10-24%, and is capable of running real-time for engine control.