A pore-resolved interface tracking algorithm for simulating multiphase flow in arbitrarily structured porous media