The simulation above is intended to show how the process of sound wave resonance in air columns works. When a sound wave travels down an air column and reaches the other end, some of the wave reflects back. This occurs whether the other end of the tube is closed or open. If the end is closed, the wave inverts (because it has hit a more rigid medium). This inversion is equivalent to a 1/2 wavelength shift of the wave. If the end is open (less rigid medium), the wave reflects back upright (no phase shift). The reflected wave reflects again when it reaches the original end of the tube, and the process repeats itself.
This simulation tracks the original sound wave and its first five reflections. The original wave and its reflection will always form a standing wave. The original wave always starts from an open end. If the opposite end is also open, a displacement anti-node will form there. If the opposite end is closed, a displacement node will form there. The further reflection pairs (one moving right and its reflection moving left) will also form standing waves. If all of these standing waves overlap constructively, then resonance will occur and the sound will be amplified.
The simulation starts with just the standing waves produced by the first three pairs of sound waves in the tube. If these three green colored standing waves are made to perfectly overlap, then resonance will occur and their sum (shown in the lower tube) will have a large amplitude that fills the tube. This resonance occurs when the length of the tube and the wavelength of the sound wave match up in just the proper proportions. This happens anytime the original open end of the tube is located perfectly at a displacement anti-node of the first standing wave formed. When this occurs, you can see that all the standing waves will align perfectly, creating the resonance.
Use the checkboxes to examine the waves forming the standing waves. If you check just the three boxes in the first column, you can see the original wave moving to the right (blue), the original reflection moving to the left (orange), and the sum of just those two waves (green). Whether the far end of the tube is open or closed the original wave and its reflection will form a standing wave. If all the additional standing waves from further reflections overlap, resonance will occur.