Heat transfer to liquid lithium in the presence of a transverse magnetic field and a gravity field was analyzed in a square cross-section duct. The duct had conducting vanadium walls. Magnetohydrodynamic equations in three dimensions in the Cartesian coordinate system were solved. First, the Nusselt number was calculated with no magnetic field and a gravity field. Second, the Nusselt number was calculated for the case of a transverse magnetic field acting on the fluid. Third, the Nusselt number was calculated for the case of a transverse magnetic field and a gravity field acting on the fluid. Only one face of the channel was heated. It was found that the Nusselt number is not sensitive to application of a gravity field and is sensitive to application of a transverse magnetic field and it decreases when a transverse magnetic field is applied. It is observed that when the intensity of the transverse magnetic field reaches 0.11 T, further reduction in the value of the Nusselt number almost stops.