add smelting function

Change-Id: If546b348399bb9f1747028fdc73a34f89f44cfa4