This Paper presents the simulation tool CASPAR (Calculation of swash plate type axial piston pump and motor). A method for the simulation of the non-isothermal gap flow for self-adjusting gaps is presented. Based on the simulation of the flow through the lubrication gaps in swash plate type axial piston machines the calculation of the main losses due to friction and leakage flow is possible. The gap micro and macro geometry as well as the material determine the friction and leakage flow. To verify the simulation model, the instantaneous cylinder bore pressure and the drainage flow rate have been measured.