This work is concerned with a numerical simulation of the thermal behaviour of an electrolysis cell for the production of the aluminium. Aluminium is produced by an electrolytic reduction of alumina dissolved in a bath of molten cryolite. In this reduction process, called Hall-Héroult process, the metal is produced at about 965 °C. A frozen bath layer, called ledge, arises in the boundary region and protects the side walls of the cell from corrosive electrolyte. This ledge may change the magnetohydrodynamical equilibrium of the cell and reduce the heat loss through the walls. The ledge is thus playing a significant role in both the thermal and magnetohydrodynamical behaviour of the cell. A precise knowledge of the ledge is thus an imporant ingredient in the optimization process of the cell. The temperature field and the ledge shape in a whole smelter are obtained by simultaneously solving the system of equations formed by: a non-linear convection-diffusion heat equation, which can be considered as a Stephan problem in enthalpy and temperature in the domain of the cell occupied by fluids and ledge, Navier-Stokes equations with a free interface in the fluid domains and Maxwell equations in the whole space. The source term of the heat equation results from the Joule effect due to the electrical current crossing the cell. A Chernoff scheme is used to numerically solve Stephan problem. Three dimensional numerical calculations showing ledge shape, temperature and velocity fields as well as electrical potential for an operating cell are obtained. The effect of thermal field on the electrical current and the effect of fluid motions on the ledge shape in the aluminium cells are presented.