This thesis deals with the problem of ion confinement in thermonuclear fusion devices. It is a topic of general interest, as it helps to understand via numerical simulations the ion confinement properties in complex geometries, in order to predict their behavior and maximize the performance of future fusion reactors. The main work carried out in this thesis is the improvement and exploitation of an existing simulation code called ISDEP. This code solves the so-called ion collisional transport in arbitrary plasma geometry, improving in this sense other existing codes. Additionally, it presents outstanding portability and scalability in distributed computing architectures, such as Grid or Volunteer Computing. The main physical results can be divided into two blocks. First, the study of 3D ion transport in ITER is presented. ITER is the largest fusion reactor (under construction) and most of the simulations so far assume the axis-symmetry of the device. Unfortunately, this symmetry is only an approximation because of the discrete number of magnetic coils used. ISDEP has shown, using a simple model of the 3D magnetic field, how the ion confinement is affected by this symmetry breaking. Secondly, ISDEP has been applied successfully to the study of fast ion dynamics in fusion plasmas. The fast ions, with energies much larger than the thermal energy, are a product of the device's heating system. Thus, a numerical predictive tool can be used to improve the heating efficiency. ISDEP has been combined with the FAFNER2 code to study such ions in stellarator (TJ-II, LHD) and tokamak (ITER) geometries. It has also been validated by experimental results. In particular, comparisons with the CNPA diagstic in the TJ-II stellarator are remarkable.