A detailed chemistry solver on adaptive curvilinear meshes and its application to rotating detonation simulations