Rapid and precise calculations of energy and particle flux for detailed-balance photovoltaic applications