first, it's not a good idea to go over the whole grid for each well at the beginning of a time step, second the Jacibian matrix of the linearization only needs to be recreated if the well completions have changed...