The essential organs contained within the thoracic cavity are the lungs, the heart, part of the esophagus, the trachea, the thymus gland and the thoracic duct. There are lymph nodes within the thoracic cavity, as well as numerous blood vessels and nerves. There are three compartments within the thoracic cavity: two pulmonary cavities and the mediastinum.
The mediastinum contains the esophagus, the trachea, the thymus, lymph nodes and the heart. The esophagus is a tube that connects the pharynx to the stomach, and is part of the digestive system. The thoracic duct is to the left of the esophagus. The thymus is a lymph gland that is located in front of the heart, behind the sternum. This gland is part of the immune system and produces T cells until a person reaches puberty. The thymus shrinks after puberty, though it still functions. The heart is comprised of four chambers: the right and left ventricles and the right and left atria. The heart functions as a pump, moving oxygenated blood throughout the body. The pulmonary cavities contain the lungs. Each lung is surrounded by a pleural sac, or membrane. The lungs supply oxygen to the blood, and they are the vital respiration organs.