Heat
In physics, heat, symbolized by Q, is energy transferred from one body or system to another due to a difference in temperature.  In thermodynamics, the quantity TdS is used as a representative measure of heat, which is the absolute temperature of an object multiplied by the differential quantity of a system's entropy measured at the boundary of the object. Heat can flow spontaneously from an object with a high temperature to an object with a lower temperature.  The transfer of heat from one object to another object with an equal or higher temperature can happen only with the aid of a heat pump.  High temperature bodies, which often result in high rates of heat transfer, can be created by chemical reactions (such as burning), nuclear reactions (such as fusion taking place inside the Sun), electromagnetic dissipation (as in electric stoves), or mechanical dissipation (such as friction). Heat can be transferred between objects by radiation, conduction and convection. Temperature is used as a measure of the internal energy or enthalpy, that is the level of elementary motion giving rise to heat transfer. Heat can only be transferred between objects, or areas within an object, with different temperatures (as given by the zeroth law of thermodynamics), and then, in the absence of work, only in the direction of the colder body (as per the second law of thermodynamics). The temperature and phase of a substance subject to heat transfer are determined by latent heat and heat capacity.  A related term is thermal energy, loosely defined as the energy of a body that increases with its temperature.

# Overview
The first law of thermodynamics states that the energy of a closed system is conserved.  Therefore, to change the energy of a system, energy must be transferred to or from the system. Heat and work are the only two mechanisms by which energy can be transferred to or from a control mass. Heat is the transfer of energy caused by the temperature difference. The unit for the amount of energy transferred by heat in the International System of Units SI is the joule (J), though the British Thermal Unit and the calorie are still occasionally used in the United States. The unit for the rate of heat transfer is the watt (W = J/s).
Heat transfer is a path function (process quantity), as opposed to a point function (state quantity). Heat flows between systems that are not in thermal equilibrium with each other; it spontaneously flows from the areas of high temperature to areas of low temperature.  When two bodies of different temperature come into thermal contact, they will exchange internal energy until their temperatures are equalized; that is, until they reach thermal equilibrium. The adjective hot is used as a relative term to compare the objects temperature to that of the surroundings (or that of the person using the term). The term heat is used to describe the flow of energy. In the absence of work interactions, the heat that is transferred to an object ends up getting stored in the object in the form of internal energy.
Specific heat is defined as the amount of energy that has to be transferred to or from one unit of mass or mole of a substance to change its temperature by one degree. Specific heat is a property, which means that it depends on the substance under consideration and its state as specified by its properties. Fuels, when burned, release much of the energy in the chemical bonds of their molecules. Upon changing from one phase to another, a pure substance releases or absorbs heat without its temperature changing. The amount of heat transfer during a phase change is known as latent heat and depends primarily on the substance and its state.

## Thermal energy
Thermal energy is a term often confused with that of heat.  Loosely speaking, when heat is added to a thermodynamic system its thermal energy increases and when heat is withdrawn its thermal energy decreases. In this point of view, objects that are hot are referred to as being in possession of a large amount of thermal energy, whereas cold objects possess little thermal energy. Thermal energy then is often mistakenly defined as being synonym for the word heat. This, however, is not the case: an object cannot possess heat, but only energy. The term "thermal energy" when used in conversation is often not used in a strictly correct sense, but is more likely to be only used as a descriptive word. In physics and thermodynamics, the words heat, internal energy, work, "enthalpy" (heat content), "entropy", "external forces", etc., which can be defined exactly, i.e. without recourse to internal atomic motions and vibrations, tend to be preferred and used more often than the term "thermal energy", which is difficult to define.

# History
In the history of science, the history of heat traces its origins from the first hominids to make fire and to speculate on its operation and meaning to modern day particle physicists who study the sub-atomic nature of heat.  In short, the phenomenon of heat and its definition evolved from mythological theories of fire, to heat, to terra pinguis, phlogiston, to fire air, to caloric, to the theory of heat, to the mechanical equivalent of heat, to thermo-dynamics (sometimes called energetics) to thermodynamics.    The history                                                                                                                                                                                                                            of heat, then, is a precursor for developments and theories in the history of thermodynamics.

# Notation
The total amount of energy transferred through heat transfer is conventionally abbreviated as Q.  The conventional sign convention is that when a body releases heat into its surroundings, Q  0 (+). Heat transfer rate, or heat flow per unit time, is denoted by:
It is measured in watts. Heat flux is defined as rate of heat transfer per unit cross-sectional area, and is denoted q, resulting in units of watts per square metre, though slightly different notation conventions can be used.

## Entropy
In 1854, German physicist Rudolf Clausius defined the second fundamental theorem (the second law of thermodynamics) in the mechanical theory of heat (thermodynamics): "if two transformations which, without necessitating any other permanent change, can mutually replace one another, be called equivalent, then the generations of the quantity of heat Q from work at the temperature T, has the equivalence-value:"
In 1865, he came to define this ratio as entropy symbolized by S, such that, for a closed, stationary system:
and thus, by reduction, quantities of heat Q (an inexact differential) are defined as quantities of TdS (an exact differential):
In other words, the entropy function S facilitates the quantification and measurement of heat flow through a thermodynamic boundary.

# Definitions
In modern terms, heat is concisely defined as energy in transit.  Scottish physicist James Clerk Maxwell, in his 1871 classic Theory of Heat, was one of the first to enunciate a modern definition of heat. In short, Maxwell outlined four stipulations on the definition of heat. One, it is something which may be transferred from one body to another, as per the second law of thermodynamics. Two, it can be spoken of as a measurable quantity, and thus treated mathematically like other measurable quantities. Three, it can not be treated as a substance; for it may be transformed into something which is not a substance, e.g. mechanical work. Lastly, it is one of the forms of energy. Similar such modern, succinct definitions of heat are as follows:
- In a thermodynamic sense, heat is never regarded as being stored within a body. Like work, it exists only as energy in transit from one body to another; in thermodynamic terminology, between a system and its surroundings. When energy in the form of heat is added to a system, it is stored not as heat, but as kinetic and potential energy of the atoms and molecules making up the system.
- The noun heat is defined only during the process of energy transfer by conduction or radiation.
- Heat is defined as any spontaneous flow of energy from one object to another, caused by a difference in temperature between two objects.
- Heat may be defined as energy in transit from a high-temperature object to a lower-temperature object.
- Heat as an interaction between two closed systems without exchange of work is a pure heat interaction when the two systems, initially isolated and in a stable equilibrium, are placed in contact. The energy exchanged between the two systems is then called heat.
- Heat is a form of energy possessed by a substance by virtue of the vibrational movement, i.e. kinetic energy, of its molecules or atoms.
- Heat is the transfer of energy between substances of different temperatures.

# Thermodynamics

## Internal energy
Heat is related to the internal energy  U  of the system and work  W  done by the system by the first law of thermodynamics:
which means that the energy of the system can change either via work or via heat flows across the boundary of the thermodynamic system. In more detail, Internal energy is the sum of all microscopic forms of energy of a system.  It is related to the molecular structure and the degree of molecular activity and may be viewed as the sum of kinetic and potential energies of the molecules; it comprises the following types of energies:
The transfer of heat to an ideal gas at constant pressure increases the internal energy and performs boundary work (i.e. allows a control volume of gas to become larger or smaller), provided the volume is not constrained. Returning to the first law equation and separating the work term into two types, "boundary work" and "other" (e.g. shaft work performed by a compressor fan), yields the following:
This combined quantity \Delta U + W_{boundary} is enthalpy, H, one of the thermodynamic potentials. Both enthalpy,  H , and internal energy,  U  are state functions. State functions return to their initial values upon completion of each cycle in cyclic processes such as that of a heat engine. In contrast, neither Q  nor  W  are properties of a system and need not sum to zero over the steps of a cycle. The infinitesimal expression for heat, \delta Q , forms an inexact differential for processes involving work. However, for processes involving no change in volume, applied magnetic field, or other external parameters, \delta Q , forms an exact differential. Likewise, for adiabatic processes (no heat transfer), the expression for work forms an exact differential, but for processes involving transfer of heat it forms an inexact differential.

## Heat capacity
For a simple compressible system such as an ideal gas inside a piston, the changes in enthalpy and internal energy can be related to the heat capacity at constant pressure and volume, respectively. Constrained to have constant volume, the heat, Q, required to change its temperature from an initial temperature, T0, to a final temperature, Tf is given by:
Removing the volume constraint and allowing the system to expand or contract at constant pressure:
For incompressible substances, such as solids and liquids, the distinction between the two types of heat capacity disappears, as no work is performed. Heat capacity is an extensive quantity and as such is dependent on the number of molecules in the system. It can be represented as the product of mass, m , and specific heat capacity, c_s \,\! according to:
-r is dependent on the number of moles and the molar heat capacity, c_n \,\! according to:
The molar and specific heat capacities are dependent upon the internal degrees of freedom of the system and not on any external properties such as volume and number of molecules.
The specific heats of monatomic gases (e.g., helium) are nearly constant with temperature. Diatomic gases such as hydrogen display some temperature dependence, and triatomic gases (e.g., carbon dioxide) still more.
In liquids at sufficiently low temperatures, quantum effects become significant. An example is the behavior of bosons such as helium-4. For such substances, the behavior of heat capacity with temperature is discontinuous at the Bose-Einstein condensation point.
The quantum behavior of solids is adequately characterized by the Debye model. At temperatures well below the characteristic Debye temperature of a solid lattice, its specific heat will be proportional to the cube of absolute temperature. For low-temperature metals, a second term is needed to account for the behavior of the conduction electrons, an example of Fermi-Dirac statistics.

## Changes of phase
The boiling point of water, at sea level and normal atmospheric pressure and temperature, will always be at nearly 100 C, no matter how much heat is added. The extra heat changes the phase of the water from liquid into water vapor. The heat added to change the phase of a substance in this way is said to be "hidden" and thus it is called latent heat (from the Latin latere meaning "to lie hidden"). Latent heat is the heat per unit mass necessary to change the state of a given substance, or:
and
Note that, as pressure increases, the L rises slightly. Here, M_o is the amount of mass initially in the new phase, and M is the amount of mass that ends up in the new phase. Also,L generally does not depend on the amount of mass that changes phase, so the equation can normally be written:
Sometimes L can be time-dependent if pressure and volume are changing with time, so that the integral can be written as:

# Heat transfer mechanisms
Heat tends to move from a high-temperature region to a low-temperature region. This heat transfer may occur by the mechanisms of conduction and radiation. In engineering, the term convective heat transfer is used to describe the combined effects of conduction and fluid flow and is regarded as a third mechanism of heat transfer.

## Conduction
Conduction is the most significant means of heat transfer in a solid. On a microscopic scale, conduction occurs as hot, rapidly moving or vibrating atoms and molecules interact with neighboring atoms and molecules, transferring some of their energy (heat) to these neighboring atoms. In insulators the heat flux is carried almost entirely by phonon vibrations.
The "electron fluid" of a conductive metallic solid conducts nearly all of the heat flux through the solid. Phonon flux is still present, but carries less than 1% of the energy. Electrons also conduct electric current through conductive solids, and the thermal and electrical conductivities of most metals have about the same ratio. A good electrical conductor, such as copper, usually also conducts heat well. The Peltier-Seebeck effect exhibits the propensity of electrons to conduct heat through an electrically conductive solid.  Thermoelectricity is caused by the relationship between electrons, heat fluxes and electrical currents.

## Convection
Convection is usually the dominant form of heat transfer in liquids and gases. This is a term used to characterize the combined effects of conduction and fluid flow. In convection, enthalpy transfer occurs by the movement of hot or cold portions of the fluid together with heat transfer by conduction. Commonly an increase in temperature produces a reduction in density. Hence, when water is heated on a stove, hot water from the bottom of the pan rises, displacing the colder more dense liquid which falls. Mixing and conduction result eventually in a nearly homogenous density and even temperature. Two types of convection are commonly distinguished, free convection, in which gravity and buoyancy forces drive the fluid movement, and forced convection, where a fan, stirrer, or other means is used to move the fluid. Buoyant convection is due to the effects of gravity, and hence does not occur in microgravity environments.

## Radiation
Radiation is the only form of heat transfer that can occur in the absence of any form of medium; thus it is the only means of heat transfer through a vacuum. Thermal radiation is a direct result of the movements of atoms and molecules in a material. Since these atoms and molecules are composed of charged particles (protons and electrons), their movements result in the emission of electromagnetic radiation, which carries energy away from the surface. At the same time, the surface is constantly bombarded by radiation from the surroundings, resulting in the transfer of energy to the surface. Since the amount of emitted radiation increases with increasing temperature, a net transfer of energy from higher temperatures to lower temperatures results.
The power that a black body emits at various frequencies is described by Planck's law. There is a frequency fmax at which the power emitted is a maximum. Wien's displacement law, and the fact that the frequency of light is inversely proportional to its wavelength in vacuum, mean that the peak frequency fmax is proportional to the absolute temperature T of the black body. The photosphere of the Sun, at a temperature of approximately 6000 K, emits radiation principally in the visible portion of the spectrum. The earth's atmosphere is partly transparent to visible light, and the light reaching the earth's surface is absorbed or reflected. The earth's surface emits the absorbed radiation, approximating the behavior of a black body at 300 K with spectral peak at fmax. At these lower frequencies, the atmosphere is largely opaque and radiation from the earth's surface is absorbed or scattered by the atmosphere. Though some radiation escapes into space, it is absorbed and subsequently re-emitted by atmospheric gases. It is this spectral selectivity of the atmosphere that is responsible for the planetary greenhouse effect.
The common household lightbulb has a spectrum overlapping the blackbody spectra of the sun and the earth. A portion of the photons emitted by a tungsten light bulb filament at 3000K are in the visible spectrum. However, most of the energy is associated with photons of longer wavelengths; these will not help a person see, but will still transfer heat to the environment, as can be deduced empirically by observing a household incandescent lightbulb. Whenever EM radiation is emitted and then absorbed, heat is transferred. This principle is used in microwave ovens, laser cutting, and RF hair removal.

## Other heat transfer mechanisms
- Latent heat: Transfer of heat through a physical change in the medium such as water-to-ice or water-to-steam involves significant energy and is exploited in many ways: steam engine, refrigerator etc. (see latent heat of fusion)
- Heat pipes: Using latent heat and capillary action to move heat, heat pipes can carry many times as much heat as a similar-sized copper rod. Originally invented for use in satellites, they are starting to have applications in personal computers.

# Heat dissipation
In cold climates, houses with their heating systems form dissipative systems. In spite of efforts to insulate such houses to reduce heat losses to their exteriors, considerable heat is lost, or dissipated, from them, which can make their interiors uncomfortably cool or cold. For the comfort of its inhabitants, the interior of a house must be maintained out of thermal equilibrium with its external surroundings. In effect, domestic residences are oases of warmth in a sea of cold and the thermal gradient between the inside and outside is often quite steep. This can lead to problems such as condensation and uncomfortable draughts (drafts) which, if left unaddressed, can cause structural damage to the property. This is why modern insulation techniques are required to reduce heat loss.
In such a house, a thermostat is a device capable of starting the heating system when the house's interior falls below a set temperature, and of stopping that same system when another (higher) set temperature has been achieved. Thus the thermostat controls the flow of energy into the house, that energy eventually being dissipated to the exterior.