A penalisation approach to simulate root compressors