If the height of the sample is X and it can drain from the top and the bottom, then the length of the drainage path is X/2. The longest path a molecule of water would have to travel in order to drain is X/2. This would be for water in the middle of the sample. If it was above the middle, it would drain up. If it was below the middle, it would drain down. So h=X/2. If the sample was only drained on one side, then h=X.