Liquid is passed through an evaporator. As the liquid transitions to gas it absorbs energy (heat). The gas is then compressed and passes through a condenser that changes it back into a liquid to go around again. That releases energy (heat) but it’s outside the passenger compartment so that’s fine. Freon was used because it worked well and was nontoxic and non-flammable (it was used in fridges). But nothing is perfect; it escapes and is bad for the ozone so there are alternatives now.
Latest Answers