Steady adiabatic filtration of real gases is studied. Thermodynamical states of real gases are presented by Legendrian surfaces in 5-dimensional thermodynamical contact space. The relation between phase transitions and singularities of projection of the Legendrian surfaces on the plane of intensive variables is shown. The constructive method of finding solutions of the Dirichlet filtration problem together with analysis of critical phenomena is presented. Case of van der Waals gas is discussed in details.