A rotating detonation engine (RDE) is a highly promising detonation-based propulsion system and has been widely researched in recent decades. In this study, BYCFoam, the latest gaseous version of the BYRFoam family, is developed specifically for RDE simulations. It is based on the standard compressible flow solver rhoCentralFoam in OpenFOAM and incorporates several enhancements: improved reconstruction variables and flux schemes; detailed chemistry and transport properties; the utilization of an adaptive mesh refinement (AMR) and dynamic load balancing (DLB). A series of comprehensive numerical tests are conducted, including the shock-tube problem, shock-wave diffraction, homogeneous ignition delay, premixed flame, planar detonation, detonation cellular structure and rotating detonation combustor (RDC). The results demonstrate that BYCFoam can accurately and efficiently simulate the deflagration and detonation processes. This solver enhances the capability of the BYRFoam family for the in-depth exploration of RDE in future research.