In very general terms, the viscous stresses in a fluid are defined as those resulting from the relative velocity of different fluid particles. As such, the viscous stresses must depend on spatial gradients of the flow velocity. If the velocity gradients are small, then to a first approximation the viscous stresses depend only on the first derivatives of the velocity. (For Newtonian fluids, this is also a linear dependence.) In Cartesian coordinates, the general relationship can then be written as
where  is a viscosity tensor that maps the velocity gradient tensor  onto the viscous stress tensor . Since the indices in this expression can vary from 1 to 3, there are 81 "viscosity coefficients"  in total. However, assuming that the viscosity rank-2 tensor is isotropic reduces these 81 coefficients to three independent parameters , , :
and furthermore, it is assumed that no viscous forces may arise when the fluid is undergoing simple rigid-body rotation, thus , leaving only two independent parameters. The most usual decomposition is in terms of the standard (scalar) viscosity  and the bulk viscosity  such that  and . In vector notation this appears as:
where  is the unit tensor. This equation can be thought of as a generalized form of Newton's law of viscosity.
The bulk viscosity (also called volume viscosity) expresses a type of internal friction that resists the shearless compression or expansion of a fluid. Knowledge of  is frequently not necessary in fluid dynamics problems. For example, an incompressible fluid satisfies  and so the term containing  drops out. Moreover,  is often assumed to be negligible for gases since it is  in a monatomic ideal gas. One situation in which  can be important is the calculation of energy loss in sound and shock waves, described by Stokes' law of sound attenuation, since these phenomena involve rapid expansions and compressions.
The defining equations for viscosity are not fundamental laws of nature, so their usefulness, as well as methods for measuring or calculating the viscosity, must be established using separate means. A potential issue is that viscosity depends, in principle, on the full microscopic state of the fluid, which encompasses the positions and momenta of every particle in the system. Such highly detailed information is typically not available in realistic systems. However, under certain conditions most of this information can be shown to be negligible. In particular, for Newtonian fluids near equilibrium and far from boundaries (bulk state), the viscosity depends only space- and time-dependent macroscopic fields (such as temperature and density) defining local equilibrium.
Nevertheless, viscosity may still carry a non-negligible dependence on several system properties, such as temperature, pressure, and the amplitude and frequency of any external forcing. Therefore, precision measurements of viscosity are only defined
with respect to a specific fluid state. To standardize comparisons among experiments and theoretical models, viscosity data is sometimes extrapolated to ideal limiting cases, such as the zero shear limit, or (for gases) the zero density limit.