While the nature of the punishment of the cleansing fire of purgatory is not a defined doctrine, the common teaching on the pains of purgatory consists of two things: 1) pains of loss and 2) pains of sense.
The pain of loss suffered by the souls in purgatory is the pain of being temporarily excluded from the beatific vision. Dr. Ludwig Ott in Fundamentals of Catholic Dogma says, “The poor souls are conscious that they are children and friends of God and long for the most intimate unification with him. Thus the temporary separation is all the more painful to them" (484). For the more a thing is desired the more painful is its absence (St. Thomas Aquinas).
The pain of sense suffered by the souls in purgatory involves the pain of purification. The nature of this cleansing has traditionally been assumed to mean a literal fire, but the only proposition the Church has dogmatically defined on this issue is that the purification involves some kind of pain. However, the Catechism teaches that the fires of hell and purgatory are not “a kind of vengeance inflicted by God from without, but as following from the very nature of sin" (CCC 1472).
The document Indulgentiarum Doctrina says: “It is a divinely revealed truth that sins bring punishments inflicted by God’s sanctity and justice. These must be expiated either on this earth through the sorrows, miseries and calamities of this life and above all through death, or else in the life beyond through fire and torments or ‘purifying’ punishments" (2).