With the advanced multi-particle code DYNAMION it is possible to calculate beam dynamics in linear accelerators and transport lines under space charge conditions with high accuracy. Special features as data from the real topology of RFQ electrodes, drift tubes, quadrupole lenses, misalignment and fabrication errors and consideration of field measurements lead to reliable results of the beam dynamics simulations. Recently the DYNAMION code is applied to the upgrade and optimization of the GSI UNILAC as an injector for the Facility for Antiproton and Ion Research at Darmstadt (FAIR). An operation of the FAIR requires for the increase of the beam- intensity and -brilliance coming from the UNILAC (up to a factor of 5). End-to-end simulations for the whole linac (from ion source output to the synchrotron entrance) allow for the study and optimization of the overall machine performance as well as for calculation of the expected impact of different upgrade measures, proposed to improve the beam brilliance. The results of the beam dynamics simulations by means of the DYNAMION code are compared with the recent measurements, obtained after upgrade of the High Current Injector (HSI) in 2009.