Every explanation that I read says:
"When a crystal (solid state) forms from a liquid, heat is being produced."
This seems rather weird, why would the production of something as ordered as ice crystals also produce heat as they are being assembled?
I understand that there is an explanation in thermodynamics that goes as follows:
The change from liquid to solid is a process that makes a less ordered system in to a more ordered system (potential violation of the Second law). But nature avoided that with the fact that the Gibbs free energy during a phase change stays constant, so:
$$G_{solid} = G_{liquid}$$
$$dG=dH-TdS=0$$
$$dH=TdS$$
$$H_{{liquid}}-H_{{solid}}=T({S_{liquid}}-{S_{solid}})$$
and as stated above $S_{liquid} > S_{solid}$
$$dH_{freezing}=TdS_{freezing}=\delta Q > 0 $$
So, heat is being produced and given to the environment because $dG=0$.
I am interested in the more microscopic explanation of this process. Can this be explained with statistical (quantum) mechanics? What is the mechanism that produces heat when crystal structures are being formed?
Addendum:
It is possible to lower the temperature of water below the freezing temperature (at given pressure) and for it to still not go through a phase transition. That happens if there are no starting points of nucleation, or no sudden impacts and if the water is very pure.
Lets imagine liquid water at $\vartheta=-10°C$ (metastable state) and now we insert one ice crystal to initiate crystallization.
The water now almost immediately goes to the freezing temperature $\vartheta = 0°C$, now stable state (that is dictated by the phase diagram), and ice is being formed.
Now how did the water heat up for $ 10°C$ from the metastable state to the stable state? I presume that the ice formation produced latent heat to heat it up.