Building envelope
A building envelope is the physical separator between the conditioned and unconditioned environment of a building including the resistance to air, water, heat, light, and noise transfer. Discussion. The building envelope (or the more modern term, building enclosure) is all of the elements of the outer shell that maintain a dry, heated, or cooled indoor environment and facilitate its climate control. Building envelope design is a specialized area of architectural and engineering practice that draws from all areas of building science and indoor climate control. The many functions of the building envelope can be separated into three categories : The control function is at the core of good performance, and in practice focuses, in order of importance, on rain control, air control, heat control, and vapor control. Water and water vapor control. Control of rain is most fundamental, and there are numerous strategies to this end, namely, perfect barriers, drained screens, and mass / storage systems. One of the main purposes of a roof is to resist water. Two broad categories of roofs are flat and pitched. Flat roofs actually slope up to 10° or 15° but are built to resist standing water. Pitched roofs are designed to  shed water but not resist standing water which can occur during wind-driven rain or ice damming. Typically residential, pitched roofs are covered with an underlayment material beneath the roof covering material as a second line of defense. Domestic roof construction may also be ventilated to help remove moisture from leakage and condensation. Walls do not get as severe water exposure as roofs but still leak water. Types of wall systems with regard to water penetration are "barrier", "drainage" and "surface-sealed walls". Barrier walls are designed to allow water to be absorbed but not penetrate the wall, and include  concrete and some masonry walls. Drainage walls allow water that leaks into the wall to drain out such as cavity walls. Drainage walls may also be ventilated to aid drying such as rainscreen and pressure equalization wall systems. Sealed-surface walls do not allow any water penetration at the exterior surface of the siding material. Generally most materials will not remain sealed over the long term and this system is very limited, but ordinary residential construction often treats walls as sealed-surface systems relying on the siding and an underlayment layer sometimes called housewrap. Moisture can enter basements through the  walls or floor. Basement waterproofing and drainage keep the walls dry and a moisture barrier is needed under the floor. Air control. Control of air flow is important to ensure indoor air quality, control energy consumption, avoid condensation (and thus help ensure durability), and to provide comfort. Control of air movement includes flow through the enclosure (the assembly of materials that perform this function is termed the air barrier system) or through components of the building envelope (interstitial) itself, as well as into and out of the interior space, (which can affect building insulation performance greatly). Hence, air control includes  the control of windwashing (cold air passing through insulation) and convective loops which are air movements within a wall or ceiling that may result in 10% to 20% of the heat loss alone. The physical components of the envelope include the foundation, roof, walls, doors, windows, ceiling, and their related barriers and insulation. The dimensions, performance and compatibility of materials, fabrication process and details, connections and interactions are the main factors that determine the effectiveness and durability of the building enclosure system. Common measures of the effectiveness of a building envelope include physical protection from weather and climate (comfort), indoor  air quality (hygiene and public health), durability and energy efficiency. In order to achieve these objectives, all building enclosure systems must include a solid structure, a drainage plane, an air barrier, a thermal barrier, and may include a vapor barrier. Moisture control (e.g. damp proofing) is essential in all climates, but cold climates and hot-humid climates are especially demanding. Air sealing can improve the energy efficiency of a building by minimizing the amount of energy needed to heat or cool the building. This is especially pertinent in cold-climate buildings where space heating consumes the largest amount of energy . A blower door test can be used to test the quality of the air sealing of the building envelope. Smoke pencils can be used to detect gaps and caulking and weather-stripping can be used to improve air sealing. HVAC systems can ensure that a building’s air intake is both adequate, safe, and energy efficient. Thermal envelope. The thermal envelope, or heat flow control layer, is part of a building envelope but may be in a different location such as in a ceiling. The difference can be illustrated by the fact that an insulated attic floor is the primary  thermal control layer between the inside of the house and the exterior while the entire roof (from the surface of the roofing material to the interior paint finish on the ceiling) is part of the building envelope. Building envelope thermography involves using an infrared camera to view temperature anomalies on the interior and exterior surfaces of the structure. Analysis of infrared images can be useful in identifying moisture issues from water intrusion, or interstitial condensation. Other types of anomalies that can be detected are thermal bridging, continuity of insulation and air leakage, however this requires a temperature differential between the  inside and outside ambient temperatures.