Simulating complex fluids with smoothed particle hydrodynamics