Three-dimensional modeling of rotating detonation in a ramjet engine