Onset of thermal chemical convection with crystallization and its geological implications