Optimal Analysis of Contaminant Invasion in an Unconfined Aquifer System