Simulating the most external plasma region of a tokamak, the scrape-off layer (SOL), is of crucial importance in the way toward a fusion reactor as heat load on the vessel wall, impurity generation, overall plasma confinement, all depend on the plasma dynamics in this region. In the last few years a numerical code, GBS, has been developed for solving the drift-reduced Braginskii equations (DRBE), which describe turbulence in the tokamak SOL. In the present work, we re-formulate the DRBE in a general form that enables to treat diverted configuration with X-point. We check their validity, as well as their numerical implementation in GBS, in the limited configuration.