Numerical simulation of wave mode transition in rotating detonation engine with OpenFOAM