Three-dimensional time-varying optimization of groundwater remediation