Hrm, before switching into Software Engineering, I had to learn all about those engines in Mechanical Engineering thermodynamics courses. Engines were easier to understand than fridges for some reason, I think. Not particularly good memories.
Refrigerators are weird. I think I almost understood the idea once, but it was pretty flipping wierd. Like you squeeze 40-degree gas into 42-degree liquid, but then you take the pressure away and it evaporates into 35-degree gas or something, because that excess energy is all like, "we can't be this hot at this pressure if we haven't become a gas yet". Because reasons, I don't know.
Anyway, I ended up doing math because at least at that stage it was easier. The sort of clarity of definitions and domain-range input-output sorting-out on the theory side of math is sort of like basics of programming, from what little I know of that.