The hydraulics and Surge & Swab (SS) model implemented in Oliasoft WellDesign is a steady state model. It calculates the pressure drop inside the pipe and in the annulus from given inputs. The model incorporates pipe eccentricity, rotation and cuttings transport. There are a wealth of published cuttings transport models, and a few are available in Oliasoft WellDesign. With the results from a torque and drag analysis available, the effect of a buckled string is also taken into account in the pressure drop calculations. Any common rheology model can be used, as well as sets of viscometer data for a given fluid at different temperatures and pressures.
The algorithms for calculating hydraulics and SS is based upon the work found in  and . The calculation is done by finding all geometrical points of interest. Locations where something change geometrically, ie. radius, inclination or eccentricity, is found and then a pressure drop calculation between each point is done using the fluid present in that section of the well. The calculation is done inside the drill pipe and inside the annulus. The drill bit is handled explicitly, and a common approach, as described in eg.  is used. This paper also discusses the coefficient of discharge used in the formula.
The temperature profile is also input to the calculation and should be simulated a priori to the hydraulics or SS.
Drilling muds comes in a huge variety, thus a generalized implementation of the mud properties is used. The density is calculated as a function of the pressure and temperature at location of interest as well as the rheology parameters. The Oliasoft WellDesign application performs calculation using the Herschel-Bulkley description of the mud shear stress as a function of the shear rate:
Where is the yield stress, is the consistency index and n is the flow behavior index. (1) also covers the special rheology cases:
Newtonian fluid - linear approximation of the shear stress; and
Bingham Plastic fluid - linear approximation of shear stress, but with yield stress; and
Power Law fluid - exponential behavior of the shear stress. Only shear thinning fluids are used in drilling;
A variety of temperature profiles can be used by the calculation, from a simple linear geothermal profile, tabulated temperature data or temperature simulations of circulating fluids.
The thermal expansion coefficient and pressure compressibility coefficient is used to determine the density of the mud. It is assumed that the mud is in its linear regime with respect to its compressibility , and thermal expansion , ie. they are constants with respect to pressure and temperature :
where the subscript 0 denotes the reference density, temperature and pressure.
The calculation process for the pressure drop in the well is an iterative process. All regions with fixed geometry are treated separately and in succession as the result from one step is input to the next step. No general analytic solution for the equations exist, so a numeric process has been develop to converge on the correct pressure drop. When the pressure drop throughout the pipe and annulus has been found, all other engineering values can be calculated, eg. the (ECD).
There are several empirical equations and constants involved in the calculation. The algorithms typically have a convergence criteria , thus 6 or 7 valid digits are presented for all empirical constants if this is found in the literature where they appear.
Article  describes how to calculate the pressure drop in an annulus given that the drill string is free to move in the well bore, thus it depends on eccentricity, rotation and buckled state. The eccentricity is determined from the Torque & Drag (T&D) soft string model. The calculation uses the Herschel-Bulkley equation for the rheology, thus it is a general description usable for any fluid. To calculate the pressure drop in the annulus along a section of length , where the geometry is unchanged, the below sets of equations needs to be solved simultaneously. First the fluid shear stress at the wall is is found from the mud flow equation, :
whereis the pipe radius and is the radius of the hole. Then the Reynolds number for a yield power law fluid is calculated:
where the superficial velocityis calculated form the flow rate and the local geometry. The absolute pressure also be known at this point, which gives the correct density of the mud.
The "generalized flow index",, is a generalization of the "flow index", also found in the power law rheology model. When the ``flow index'' is replaced with its generalized counterpart the friction factor equation is the same.depends upon theand the yield strengthof the fluid:
From the generalized flow index the transitions from laminar to transitional and transitional to turbulent flow can be calculated:
These equations both have empirical constants (see discussion in ), which were determined in the general flow index ranges denoted for each Reynolds limit. The formulas are not extrapolated outside their valid range, and if the is outside this range the standard equations (20) and (21) (also recommended by API 10A and RP13D) is used. The empirical constants for the annulus was also determined using a configuration where , but for any useful application this has been slightly extended to allow .
Using these limits, the flow regime can be determined, and a different set of equations apply depending on the flow type. The friction factor for the flow at this velocity is calculated:
Laminar flow: (10) Turbulent flow: (11)
Transitional flow is calculated as an extrapolation between the friction factor for laminar flow and turbulent flow:
The empirical constant K in equation (10) and (11) is found from:
Finally the pressure loss for the section can be calculated from the friction factor, :
if the drill string sf not buckled. This applies to any type of buckling (sinusoidal, partial helical or fully helical, see ). If the string is buckled the empirical correction for the pressure loss is calculated as:
where is the tension in the drill string, is the sinusoidal buckling limit, and is the rotation frequency.
Flow in pipe (circular conduit) is calculated in a similar way. The formulas used are found in . The following equation replaces the corresponding equations from the previous section. First the generalized flow index, is calculated as:
The Reynolds number limits for laminar to transitional and from transitional to turbulent flow in a pipe is given by:
With the given flow in the pipe, the fluid shear stress can be calculated from the following equation:
With the now known shear stress in the fluid, its Reynolds number is given by:
Setting , the flow friction factor in the pipe can be calculated from equation (10), (11) or (12), using the results from equations (19) and (23). The pressure drop for the section is then calculated from equation (17) with .
The minimum required inputs for doing a mud flow calculation are flow rate and pressure. These can be given by 4 different combination:
Flow from pump, pressure at pump -The exit pressure of the pump and the corresponding volumetric flow rate from the pump is user input.
Flow at annulus exit, pressure at exit - The exit pressure of the annulus and corresponding flow rate (default mode, where pressure is 1 atm.) If pressure is bigger than 1 atm, this mode can be used as MPD calculations.
Flow from pump, pressure at annulus exit - Use this option if performing MPD calculations.
Flow at annulus exit, pressure at pump - Use this option if performing MPD calculations.
Analysis using option 3 or 4, where the pressure is not known at the given flow rate location, the flowing pressure is an unknown parameter in the calculation, and will thus be calculated.
In all situations (except for "Fixed depth'' circulation) the pipe is moving relative to the annulus. This means that the mud velocity has to be calculated relative to its location. Inside the pipe the mud velocity is calculated relative to the pipe, which introduces a fixed offset, between apparent velocity and the velocity calculated from mud volume flow and cross section at any MD.
In the annulus the pipe movement causes a non-symmetric shear stress profile in the transverse direction in the mud since the wall of the bore is static. This is not considered in the published literature, since for all scenarios except surge and swab, the mud velocity is much bigger than the pipe velocity, thus the approximation is sound. Since this is not the case in SS, Oliasoft WellDesign has introduced an approximation to the superficial velocity of the mud in the annulus. The flow velocity profile is proportional to . Integrating this renders the following approximation to the superficial flow velocity:
where is the distance along the trajectory to point MD, is the frictional pressure loss down to this MD, is the gravitational constant and is the TVD between the (RKB) and this MD.
The pressure drop is calculated according to the standard in the industry. The pressure drop coefficient is most probably manufacturer specific, see eg.  for a discussion of its value. The following values are calculated:
where is the pressure drop through the nozzles of the drill bit, is the so--called "hydraulic horse power'', is the average mud velocity in the nozzles, is the impact force of the mud as it exits the nozzles, is the so--called "hydraulic horse power intensity'', and is the drill bit radius.
The gel break pressure is calculated from the gel strength (yield stress, yield strength), . It is calculated for each geometry section , where the geometry is constant. The gel breaking pressure is the sum of all these sections inside the pipe and back up through the annulus:
where and is the length of section where the geometry is constant, for pipe and annulus respectively, and is the bottom of the well.
In surge and swab, it is the pipe movement that causes the mud to flow (not the pumps). In most cases it will flow in the same direction in both pipe and annulus. The algorithms will search for the initial conditions at the drill bit (drill pipe bottom), determining the pressure and the split of the flow between the pipe and the annulus. The pressure profile is then calculated from the found initial conditions, using the equations in sections 3.1 and 3.2.
Oliasoft WellDesign has developed an algorithm that finds the limits, in terms of drill pipe velocity with respect to avoiding going beyond the fracture pressure (loss of circulation) and below the pore pressure (ingress of fluids) in the annulus. The" Surge to frac'' and the "Swab to pore'' analysis modes can be performed with an open or a closed drill bit (or drill pipe end). The calculation uses the above presented pressure drop calculations when doing this search.
The transport of cuttings in the annulus is calculated using  and . It is based upon finding the slip speed of the cuttings, and if the mud velocity is too slow to transport the cuttings, a cuttings bed will form, until the mud velocity is high enough (mud velocity increases with increasing cuttings bed cross sectional area). Below a certain inclination the cuttings bed will not be stable. In such a case the cross sectional fraction of cuttings will accumulate until the mud velocity is high enough to transport the cuttings. This will necessarily cause a high increase in the mud pressure drop in the annulus.
The cuttings volumetric flow rate, is given by:
where is the rate of penetration.
In , an empirical equation for determining the mud's ability to transport the cuttings away from the drill bit was found from lab tests, determining an otherwise unsolvable problem on how to determine the cuttings to mud volumetric fraction, :
Reference  gives a complete cuttings transport calculation, but too many of the empirical constants are based on too low statistics to be trusted, in addition it is only applicable for and . Thus, equation (32) is the only one used in the implementation.
In  an additional 2 special numerical constants were constructed, which were analyzed from several earlier lab tests:
There is a big discontinuity in when passed 3. This has not been resolved, thus has an artificial low limit of 3. When the above values are determined the following sets of equations must be solved simultaneously:
where is inclination angle, is the cuttings average diameter, is slip velocity, cuttings velocity, minimum transport velocity. is the cuttings bed cross sectional area and is the relative cross section in the annulus occupied by the cuttings. If the mud velocity is too low, , the cuttings bed area is calculated, if not .
These hydraulic analysis modes are available:
Fixed depth - Perform circulation of the mud with the drill string at a specified depth. Gives access to detailed data, throughout the trajectory. Analysis can be done with or without hole cleaning.
Drilling - Perform circulation of the mud while doing the drilling. The drill string is moved step wise downward, and a "Fixed depth" calculation is performed at each new depth. Summary data is compiled.
Variable rate of penetration - At a fixed depth a range of penetration rates are analyzed. A "Fixed depth" analysis is performed at each rate, from which summary data is compiled as a function of the penetration rate.
Variable pump rate - At a fixed depth a range of pump rates are analyzed. A "Fixed depth" analysis is performed at each pump rate, from which summary data is compiled as a function of pump rate.
Gel break - Gel break pressure is calculated at a series of depths from top to bottom, in a series similar to "Drilling" mode. Only data related to the required breaking pressure is calculated.
These surge and swab analysis modes are available:
Surge at depth - This analysis is similar to the hydraulics "Fixed depth" analysis. At a specified depth the result of pushing the drill string into the well bore (an infinitesimal short distance) is analyzed.
Swab at depth - This analysis is similar to the hydraulics "Fixed depth" analysis. At a specified depth the result of pulling the drill string out of the well bore (an infinitesimal short distance) is analyzed.
Surge - The analysis of pushing the drill string into the wellbore from top to bottom is analyzed. The drill string is moved step wise downward and a "Surge at depth" analysis is performed at each depth. Summary data is compiled.
Swab - The analysis of pulling the drill string out of the well bore from bottom to top is analyzed. The drill string is moved step wise upward and a "Swab at dept" analysis is performed at each depth. Summary data is compiled.
Surge to frac at depth - A "Surge at depth'' analysis is performed, and a search for the surge velocity that renders the minimum allowed distance between the pressure profile of the mud and the fracture pressure profile of the formation, at any point in the trajectory.
Swab to pore at depth - A "Swab at depth" analysis is performed, and a search for the swab velocity that renders the minimum allowed distance between the pressure profile of the mud and the pore pressure profile of the formation, at any point in the trajectory.
Surge to frac - Similar to the "Surge'', but for each step downwards a "Surge to frac at depth" calculation is performed. A velocity profile is available in the summary result.
Swab to pore - Similar to the "Swab", but for each step upwards a "Swab to pore at depth" calculation is performed. A velocity profile is available in the summary result.
 Bernt Aadnoy, Iain Cooper, Stefan Miska, Robert F. Mitchell, and Michael L. Payne. Advanced Drilling and Well Technology. Society of Petroleum Engineers, 2009. ISBN: 978-1-55563-145-1.
 Oney Erge nd et al. The effects of drillstring eccentricity, rotation and buckling configurations on annular frictional pressure losses while circulating yield power law fluids. Society of Petroleum Engineers, 30(3), 2015. SPE-167950-PA doi:https://doi.org/10.2118/167950-PA.
 Leon Robinson. Drill bit pressure loss. American association of drilling engineers, 2010. AADE-10-F-HO-26.
 Oliasoft Truls M. Larsen. Technical specification torque and drag " soft string model". Online PDF.
 Rudi Rubiandini. Equation for estimating mud minimum rate for cuttings transport in an inclined-until-horizontal well. Society of Petroleum Engineers, SPE/IADC Middle East Drilling Technology Conference, 8-10 November, Abu Dhabi, United Arab Emirates, 1999. SPE-1172519-MS doi:https://doi.org/10.2118/57541-MS.
 T.I. Larsen, A.A. Pilehvari, and J.J. Azar. Development of a new cuttings transport model for high angle wellbores including horizontal wells. Society of petroleum engineers, 12(2), 1997. SPE-25872-PA doi: https://doi.org/10.2118/25872-PA.