This work is aimed at the analysis of pellet injection experiments by means of a magnetohydrodynamic code that computes the processes of pellet ablation, expansion, ionization, and magnetic confinement of the ablated substance. In particular, experimental pellet injection scenarios stemming from the tokamak ASDEX-Upgrade (D2 pellets) and the stellarator W7-AS (carbon pellets) are analyzed by means of this time-dependent quasithree-dimensional MHD pellet code. Pellet penetration depths measured in ASDEX-Upgrade at LFS (lowfield-side) and HFS (high-field-side) pellet injection, are compared with computational results.It was found that the penetration depths of deuterium pellets observed in about twenty randomly selected LFS and HFS injection scenarios could accurately be reproduced by a single code in which drift effects were intentionally ignored. This may be understood as an indication of the negligible effect drift exerts on the ablation process. At the same time, the distribution of the ablated and partially ionized substance may very well be affected by the drift of the ionized particles in the direction of the decreasing magnetic field.With the help of the Dα radiation patterns observed, the magnitudes of the heat fluxes affecting the pellet and the ablation cloud were estimated. The calculations show that the thermal heat fluxes (electron and ion) acting along the magnetic field lines are not sufficient to explain the size of the radiating filaments observed.The effect of extra-thermal electrons on the ablation history of pellets injected in W7-AS is demonstrated: the particle end energy fluxes causing measured pellet ablation profiles are determined.Based on a statistically well-designed computational data set, an empirical scaling of the penetration depths in terms of the background plasma parameters was attempted. It is shown that the form of the temperature profile of the background plasma cannot be ignored while deriving scaling laws; the specification of the central or the bulk temperature alone is insufficient.Quantitative data are provided for the magnitudes of various additional processes such as the anomalous thermal conduction across the field lines or the grad(B)-induced drift of the shielding cloud surrounding the pellet.The modelling of supersonic gas jets, a fuelling method that appears to be an alternative to pellet injection, is also considered. Since the massive stream of a cold gas represents a disturbance for the recipient plasma similar to that of a pellet, its dynamics can be described by the same means as the evolution of pellet clouds.