Response of primary dendrite spacing to varying temperature gradient during directional solidification