A Method for Estimating Grid-Induced Errors in Finite-Difference and Finite-Volume Methods