1‐D numerical modelling of shallow flows with variable horizontal density