Protonephridia consists of many flame cells. Flame cells are functionally similar with kidney.
Their function is to regulate the osmotic pressure and maintain its ionic balance.