Thermal modeling and adaptive control of scan welding