Finite element formulation of the lubrication and cavitation subproblem is based on the weak form of the governing equations. Detailed derivation of the weak form is given in [20]. In brief, the mass-balance equation (7) is multiplied by a test function δp and integrated over the lubrication domain S. The integral over S is then split into two parts corresponding to Sf and Sc , the pressure- gradient term is integrated by parts within Sf , and condition (11) of mass-flux balance at the cavitation boundary Σ is used. As a result, the following weak form of the mass-balance equation is obtained: