Due to the pressure gradient increasing downstream, the boundary layer separation phenomena may occur on the divergent channel flow wall. Still, several methods have been applied to control or postponed the separation. Exerting a magnetic field on the fluid flow is one solution. In the present research, we aim to investigate the impact of magnetic fields on the separation location in a divergent channel numerically. Hence, the finite volume method using the OpenFOAM CFD toolbox is employed, and a code for 2-D divergent channel flow under a non-uniform magnetic field is developed. The obtained results have been validated in comparison with previous studies. The results are presented for a test case of the channel with divergence half-angle equals 2.5°, 30 cm length, and 2 cm inlet height. It is demonstrated when Ha increases from 0 to 2, the separation points for liquid lithium fluid flow with Re = 208.33 are postponed from 12.93 cm to 23.18 cm. Moreover, it is shown that the separation phenomena disappear entirely for the Ha value of more than 3.