Human thermoregulation. As in other mammals, human thermoregulation is an important aspect of homeostasis. In thermoregulation, body heat is generated mostly in the deep organs, especially the liver, brain, and heart, and in contraction of skeletal muscles. Humans have been able to adapt to a great diversity of climates, including hot humid and hot arid. High temperatures pose serious stress for the human body, placing it in great danger of injury or even death. For humans, adaptation to varying climatic conditions includes both physiological mechanisms resulting from evolution and behavioural mechanisms resulting from conscious cultural adaptations.

There are four avenues of heat loss: convection, conduction, radiation, and evaporation. If skin temperature is greater than that of the surroundings, the body can lose heat by radiation and conduction. But, if the temperature of the surroundings is greater than that of the skin, the body actually gains heat by radiation and conduction. In such conditions, the most efficient means by which the body can rid itself of heat is by evaporation. So, when the surrounding temperature is higher than the skin temperature, anything that prevents adequate evaporation will cause the internal body temperature to rise. During sports activities, evaporation becomes the main avenue of heat loss. Humidity affects thermoregulation by limiting sweat evaporation and thus heat loss.

Humans cannot survive prolonged exposure to a wet-bulb temperature above . Such a temperature used to be thought not to occur on Earth's surface but has been recorded in some parts of the Indus Valley and Persian Gulf. Occurrence of conditions too hot and humid for human life is expected to increase in the future due to global warming.

Control system

The core temperature of a human is regulated and stabilized primarily by the hypothalamus, a region of the brain linking the endocrine system to the nervous system, and more specifically by the anterior hypothalamic nucleus and the adjacent preoptic area regions of the hypothalamus.  As core temperature varies from the set point, endocrine production initiates control mechanisms to increase or decrease energy production/dissipation as needed to return the temperature toward the set point (see figure).

In hot conditions

Eccrine sweat glands under the skin secrete sweat (a fluid containing mostly water with some dissolved ions), which travels up the sweat duct, through the sweat pore and onto the surface of the skin. This causes heat loss via evaporative cooling; however, a lot of essential water is lost.
The hair on the skin lie flat, preventing heat from being trapped by the layer of still air between the hair. This is caused by tiny muscles under the surface of the skin called arrector pili muscles relaxing so that their attached hair follicles are not erect. These flat hairs increase the flow of air next to the skin increasing heat loss by convection. When environmental temperature is above core body temperature, sweating is the only physiological way for humans to lose heat.
Arteriolar vasodilation occurs. The smooth muscle walls of the arterioles relax allowing increased blood flow through the artery. This redirects blood into the superficial capillaries in the skin increasing heat loss by convection and conduction.

In hot and humid conditions
In general, humans appear physiologically well adapted to hot dry conditions. However, effective thermoregulation is reduced in hot, humid environments such as the Red Sea and Persian Gulf (where moderately hot summer temperatures are accompanied by unusually high vapor pressures), tropical environments, and deep mines where the atmosphere can be water-saturated. In hot-humid conditions, clothing can impede efficient evaporation. In such environments, it helps to wear light clothing such as cotton, that is pervious to sweat but impervious to radiant heat from the sun. This minimizes the gaining of radiant heat, while allowing as much evaporation to occur as the environment will allow. Clothing such as plastic fabrics that are impermeable to sweat and thus do not facilitate heat loss through evaporation can actually contribute to heat stress.

In cold conditions
Heat is lost mainly through the hands and feet.
Sweat production is decreased.
The minute muscles under the surface of the skin called arrector pili muscles (attached to an individual hair follicle) contract (piloerection), lifting the hair follicle upright. This makes the hairs stand on end, which acts as an insulating layer, trapping heat. This is what also causes goose bumps since humans do not have very much hair and the contracted muscles can easily be seen.
Arterioles carrying blood to superficial capillaries under the surface of the skin can shrink (constrict), thereby rerouting blood away from the skin and towards the warmer core of the body. This prevents blood from losing heat to the surroundings and also prevents the core temperature dropping further. This process is called vasoconstriction. It is impossible to prevent all heat loss from the blood, only to reduce it. In extremely cold conditions, excessive vasoconstriction leads to numbness and pale skin. Frostbite occurs only when water within the cells begins to freeze.  This destroys the cell causing damage.
Muscles can also receive messages from the thermoregulatory center of the brain (the hypothalamus) to cause shivering. This increases heat production as respiration is an exothermic reaction in muscle cells. Shivering is more effective than exercise at producing heat because the animal (includes humans) remains still. This means that less heat is lost to the environment through convection. There are two types of shivering: low-intensity and high-intensity. During low-intensity shivering, animals shiver constantly at a low level for months during cold conditions. During high-intensity shivering, animals shiver violently for a relatively short time. Both processes consume energy, however high-intensity shivering uses glucose as a fuel source and low-intensity tends to use fats. This is a primary reason why animals store up food in the winter.
Brown adipocytes are also capable of producing heat via a process called non-shivering thermogenesis. In this process, triglycerides are burned into heat, thereby increasing body temperature.

Related factors

Fitness

The more physically fit a person is, the greater their ability to adjust to temperature variation. This includes adapting for heat (keeping cool) and for cold (keeping warm).

Age

Age can be a factor in a person's ability to adapt to temperature variations. Studies have shown that younger people adapt more efficiently to contact with cold surfaces than elderly people. Notably, a good level of fitness allowed the elderly people to cope better and offset somewhat the drop off to their ability to thermoregulate due to old age.

Body mass

A high body mass has been found to help with thermoregulation in regard to adapting for hot environments. This is considered on the basis that the levels of body fat were within healthy ranges i.e. the person's muscle-to-fat ratio was healthy. However, extra body fat has been shown to offer some benefit in terms of keeping warm, especially during immersion in cold water. For this reason long distance outdoor swimmers often have a generous layer of body fat. This is not necessarily always the case  though, and high levels of physical fitness can allow thinner swimmers to also perform effectively in cold water environments.

Uses of hypothermia
Adjusting the human body temperature downward has been used therapeutically, in particular, as a method of stabilizing a body following trauma.  It has been suggested that adjusting the adenosine A1 receptor of the hypothalamus may allow humans to enter a hibernation-like state of reduced body temperature, which could be useful for applications such as long-duration space flight.

Related testing
The thermoregulatory sweat test (TST) can be used to diagnose certain conditions that cause abnormal temperature regulation and defects in sweat production in the body.
To perform the test, the patient is placed in a chamber that slowly rises in temperature. Before the chamber is heated, the patient is coated with a special kind of indicator powder that will change in color when sweat is produced. This powder, when changing color, will be useful in visualizing which skin is sweating versus not sweating. Results of the patient's sweat pattern will be documented by digital photography, and abnormal TST patterns can indicate if there is dysfunction in the autonomic nervous system. Certain differentials can be made depending on the type of sweat pattern found from the TST (along with history and clinical presentation) including hyperhidrosis, small fiber and autonomic neuropathies, multiple system atrophy, Parkinson disease with autonomic dysfunction, and pure autonomic failure.

Related physiological processes, diseases and syndromes
Hypothermia
Hyperthermia
Heat stroke
Raynaud's phenomenon (Raynaud's disease)
Endocrine system disorders (hyperthyroidism, hypothyroidism)
Induced hypothermia
Erythromelalgia (hyperthermia)
Hypohidrotic ectodermal dysplasia
Thermogenesis
Poikilothermia

References 

Thermoregulation
Human homeostasis
Heat transfer