Functions for mineral-melt calculations