The function of pulmonary circulation is to exchange carbon dioxide for oxygen in the blood. It is the passage of blood from the heart to the capillaries of the lungs, where the gases are exchanged, and back to the heart to be pumped around the body.
The blood from the body returns through the veins to the right atrium. This blood lacks oxygen and is full of waste products. The right atrium pumps it to the right ventricle through a valve that makes sure blood flows in only one direction. The right ventricle then pumps the blood through the pulmonary artery to the lungs. After being oxygenated, the blood travels through the pulmonary veins back to the heart where it enters the left atrium. The left atrium pumps it into the left ventricle through another valve, which then pumps the blood out to the body.
Pulmonary circulation is the only part of the circulation system where arteries carry blood depleted of oxygen and veins carry oxygenated blood.
Before birth pulmonary circulation is bypassed, and there is a hole that allows blood entering the right atrium to pass directly to the left atrium. At birth the lungs expand, drawing blood through the pulmonary arteries. In time the hole between the atria closes.