text: The convection–diffusion equation can be derived in a straightforward way from the continuity equation, which states that the rate of change for a scalar quantity in a differential control volume is given by flow and diffusion into and out of that part of the system along with any generation or consumption inside the control volume:
  where  is the total flux and  is a net volumetric source for . There are two sources of flux in this situation. First, diffusive flux arises due to diffusion. This is typically approximated by Fick's first law:
  i.e., the flux of the diffusing material (relative to the bulk motion) in any part of the system is proportional to the local concentration gradient. Second, when there is overall convection or flow, there is an associated flux called advective flux:
  The total flux (in a stationary coordinate system) is given by the sum of these two:
  Plugging into the continuity equation: