Here's how the second law applies:
* Entropy increase in the surroundings: While a crystal forms, the system releases heat to the surroundings. This heat increases the entropy of the surroundings, which outweighs the decrease in entropy within the crystal itself. The net change in entropy for the entire system (crystal + surroundings) is positive, satisfying the second law.
* Spontaneous crystallization: The process of crystal formation is often spontaneous because it leads to a lower free energy state. This happens due to the release of heat during crystallization, which decreases the enthalpy (internal energy) of the system. The decrease in enthalpy, coupled with the increase in entropy of the surroundings, results in a net decrease in Gibbs free energy, making crystallization thermodynamically favorable.
* Crystal size and entropy: The entropy change associated with crystal formation is dependent on the size of the crystal. Smaller crystals have a higher surface area to volume ratio, leading to a greater contribution from surface entropy, which is associated with disorder. This is why larger crystals are more thermodynamically stable, as they have a lower surface area to volume ratio.
In essence, while crystal formation leads to an increase in order within the crystal itself, it also causes an increase in disorder within the surroundings. The overall entropy change for the entire system remains positive, adhering to the second law of thermodynamics.
Furthermore, the formation of crystals is often driven by a reduction in free energy, which is a consequence of the enthalpy decrease due to the release of heat and the entropy increase in the surroundings.