Thermodynamics of miracidial survival and metabolism