To produce a well safely, the wellbore pressure during drilling must be in a range that prevents collapse yet avoids fracturing. This range is often called "the operating window". Exceeding the limits of this range can trigger wellbore instability or initiate well control incidents. Pressure prediction requires an understanding of the hydrodynamics processes that occur in a borehole while drilling. Describing these processes is complicated by many factors: the mud rheology is usually non-Newtonian, the flow mode can be laminar or turbulent, and the drillstring can rotate and be positioned eccentrically. Known semi-analytical approaches cannot account for the full range of fluid flows that can arise during drilling. These techniques don't take into account all factors. Accurate numerical simulation of the flow of drilling fluids is a means to describe the fluid behavior in detail. For numerical solutions of hydrodynamics equations a unique algorithm based on a finite-volume method and a new model of turbulence for non-Newtonian fluids was developed. The model considers string rotation and eccentricity of the drillstring. Newtonian and non-Newtonian fluids as described by the Herschel-Bulkley rheological model have been implemented. Data obtained via systematic parameter studies of the flow in a borehole are available for fast determination of parameters like pressure drop, velocity field, and stresses corresponding to any drilling condition. Applying the new model for the annulus flow and comparing the results to the parallel plate flow approximation enabled us to quantify the error made due to the approximated solution for non-Newtonian fluid rheology. The difference between the solutions grows as the annular gap increases. This situation is a function of the rheological parameters. Secondary flow effects can only be seen when applying the new solution method.