The injection of high-speed cryogenic pellets made of frozen hydrogen-isotopes, represents to date the most effective method to fuel magnetically confined thermonuclear fusion plasmas. Moreover, the injection of very large pellets composed of cryogenic solid of some suitable impurity (typically a noble-gas such as H2, Ne, or H2/Ne, D2/Ne mixtures), shattered in relatively small fragments just before entering the plasma, seems to be the most promising method to reduce the damage risks for the plasma-facing components in case of a plasma disruption. This technology, known as "Shattered Pellet Injection" (SPI), allows to spread out the plasma energy and mitigate possible damage to the in-vessel components, as well as to densify the plasma to suppress the formation of runaway electrons, and/or dissipate their energy. Several techniques to produce and launch cryogenic pellets have been investigated in the past decades. "Pipe gun" injectors are reliable and relatively simple devices are still commonly used today. They make use of single- or two-stage pneumatic light-gas guns to accelerate the pellet at high speeds. In these injectors, the cryogenic pellets are formed “in situ” (i.e., inside the launching barrel), by de-sublimating them directly from the gas phase, i.e., at temperatures and pressures below those of the triple point. The simplest case is pure deuterium pellets (T < 18.7 K, P < 171.3 hPa). The production of good quality solid deuterium, capable of withstanding the mechanical stress during the acceleration of the pellets, is a key issue. To this end the phase transition of deuterium from gas to solid (and vice versa) is modeled with extensive molecular-dynamics (MD) simulations. Moreover, the solid growth from the gas phase is simulated in an ample range of temperatures and pressures, to find the best compromise between growth velocity and mechanical properties of the resulting solid system.