Numerical studies of impurities in fusion plasmas