Carbon coagulation in a nonstationary detonation-product flow