What is fluid mechanics? As its name suggests it is the branch of applied mechanics concerned with the statics and dynamics of fluids - both liquids and gases. The analysis of the behaviour of fluids is based on the fundamental laws of mechanics which relate continuity of mass and energy with force and momentum together with the familiar solid mechanics properties.
There are two aspects of fluid mechanics which make it different to solid mechanics:
We normally recognise three states of matter: solid; liquid and gas. However, liquid and gas are both fluids: in contrast to solids they lack the ability to resist deformation. Because a fluid cannot resist the deformation force, it moves, it flows under the action of the force. Its shape will change continuously as long as the force is applied. A solid can resist a deformation force while at rest, this force may cause some displacement but the solid does not continue to move indefinitely.
The deformation is caused by shearing forces which act tangentially to a surface. Referring to the figure below, we see the force F acting tangentially on a rectangular (solid lined) element ABDC. This is a shearing force and produces the (dashed lined) rhombus element A'B'DC.

We can then say:
and conversely this definition implies the very important point that:
When a fluid is in motion shear stresses are developed if the particles of the fluid move relative to one another. When this happens adjacent particles have different velocities. If fluid velocity is the same at every point then there is no shear stress produced: the particles have zero relative velocity.
Consider the flow in a pipe in which water is flowing. At the pipe wall the velocity of the water will be zero. The velocity will increase as we move toward the centre of the pipe. This change in velocity across the direction of flow is known as velocity profile and shown graphically in the figure below:

Because particles of fluid next to each other are moving with different velocities there are shear forces in the moving fluid i.e. shear forces are normally present in a moving fluid. On the other hand, if a fluid is a long way from the boundary and all the particles are travelling with the same velocity, the velocity profile would look something like this:

and there will be no shear forces present as all particles have zero relative velocity. In practice we are concerned with flow past solid boundaries; aeroplanes, cars, pipe walls, river channels etc. and shear forces will be present.
How can we make use of these observations? We can start by considering a 3d rectangular element of fluid, like that in the figure below.

The shearing force F acts on the area on the top of the element.
This area is given by
. We can thus calculate
the shear stress which is equal to force per unit area
i.e.

The deformation which this shear stress causes is measured by the size of the angle f and is know as shear strain.
It has been found experimentally that the rate of shear stress (shear stress per unit time, t/time) is directly proportional to the shear stress.
If the particle at point E (in the above figure) moves under the shear stress to point E' and it takes time t to get there, it has moved the distance x. For small deformations we can write


where
is the velocity of the particle
at E.
Using the experimental result that shear stress is proportional to rate of shear strain then

The term
is the change in velocity with
y, or the velocity gradient, and may be written in the differential
form
. The constant of proportionality
is known as the dynamic viscosity,
, of
the fluid, giving

In the above we have discussed the differences between the behaviour of solids and fluids under an applied force. Summarising, we have;
As you will have seen when looking at properties of solids, when the elastic limit is reached they seem to flow. They become plastic. They still do not meet the definition of true fluids as they will only flow after a certain minimum shear stress is attained.
Even among fluids which are accepted as fluids there can be wide differences in behaviour under stress. Fluids obeying Newton's law where the value of m is constant are known as Newtonian fluids. If m is constant the shear stress is linearly dependent on velocity gradient. This is true for most common fluids.
Fluids in which the value of m is not constant are known as non-Newtonian fluids. There are several categories of these, and they are outlined briefly below.
These categories are based on the relationship between shear stress and the velocity gradient (rate of shear strain) in the fluid. These relationships can be seen in the graph below for several categories

Each of these lines can be represented by the equation

where A, B and n are constants. For Newtonian fluids A = 0, B
= m and n = 1.
Below are brief description of the physical properties of the several categories:
There is also one more - which is not real, it does not exist - known as the ideal fluid. This is a fluid which is assumed to have no viscosity. This is a useful concept when theoretical solutions are being considered - it does help achieve some practically useful solutions.
Although liquids and gasses behave in much the same way and share many similar characteristics, they also possess distinct characteristics of their own. Specifically
The molecules of gasses are only weakly kept in position by molecular cohesion (as they are so far apart). As adjacent layers move by each other there is a continuous exchange of molecules. Molecules of a slower layer move to faster layers causing a drag, while molecules moving the other way exert an acceleration force. Mathematical considerations of this momentum exchange can lead to Newton law of viscosity.
If temperature of a gas increases the momentum exchange between layers will increase thus increasing viscosity.
Viscosity will also change with pressure - but under normal conditions this change is negligible in gasses.
There is some molecular interchange between adjacent layers in liquids - but as the molecules are so much closer than in gasses the cohesive forces hold the molecules in place much more rigidly. This cohesion plays an important roll in the viscosity of liquids.
Increasing the temperature of a fluid reduces the cohesive forces and increases the molecular interchange. Reducing cohesive forces reduces shear stress, while increasing molecular interchange increases shear stress. Because of this complex interrelation the effect of temperature on viscosity has something of the form:

where
is the viscosity at temperature
TC, and
is the viscosity at temperature
0C. A and B are constants for a particular fluid.
High pressure can also change the viscosity of a liquid. As pressure increases the relative movement of molecules requires more energy hence viscosity increases.