Numerical computation of internal and external flows, volume 1: Fundamentals of numerical discretization