AbstractIn developing a 3D or laterally averaged 2D model for free‐surface flows using the finite difference method, the water depth is generally discretized either with the z‐co‐ordinate (z‐levels) or a transformed co‐ordinate (e.g. the so‐called σ‐co‐ordinate or σ‐levels). In a z‐level model, the water depth is discretized without any transformation, while in a σ‐level model, the water depth is discretized after a so‐called σ‐transformation that converts the water column to a unit, so that the free surface will be 0 (or 1) and the bottom will be ‐1 (or 0) in the stretched co‐ordinate system. Both discretization methods have their own advantages and drawbacks. It is generally not conclusive that one discretization method always works better than the other. The biggest problem for the z‐level model normally stems from the fact that it cannot fit the topography properly, while a σ‐level model does not have this kind of a topography‐fitting problem.To solve the topography‐fitting problem in a laterally averaged, 2D model using z‐levels, a piecewise linear bottom is proposed in this paper. Since the resulting computational cells are not necessarily rectangular looking at the x–z plane, flux‐based finite difference equations are used in the model to solve the governing equations. In addition to the piecewise linear bottom, the model can also be run with full cells or partial cells (both full cell and partial cell options yield a staircase bottom that does not fit the real bottom topography). Two frictionless wave cases were chosen to evaluate the responses of the model to different treatments of the topography. One wave case is a boundary value problem, while the other is an initial value problem. To verify that the piecewise linear bottom does not cause increased diffusions for areas with steep bottom slopes, a barotropic case in a symmetric triangular basin was tested. The model was also applied to a real estuary using various topography treatments. The model results demonstrate that fitting the topography is important for the initial value problem. For the boundary value problem, topography‐fitting may not be very critical if the vertical spacing is appropriate. Copyright © 2004 John Wiley & Sons, Ltd.