Basing on governing Maxwell and energy equation of rail gun considering armature movement in two dimension, The total domain to be solved is divided into two subdomains: moving (armature) part and static (rail) part, finite element formulations of two subdomains are built independently, then using the interface condition of two subdomains, formulations are connected by coupled equation which is derived out by penalty method. Shifted physical quantity is used to simulate movement. The final magnetic-thermal coupled fields finite element formulations of rail gun are established by these methods. Numerical calculation results compared by theoretical and other numerical results verify that penalty method is an effective way to deal with electric sliding contact problem associating with Shifted physical quantity method.