Retention of liquid contaminants in layered soils