When dealing with dynamic issues, we often encounter problems of hydraulic shock (water hammer) and cavitation causing distortion of the surrounding material, destruction of material, accompanied by sounds and vibrations. These dynamic behavior of the liquids is due to the presence of gases in the liquid, especially air, vapor and possibly other gases in smaller quantities. The density of such a liquid is assumed to be a function of a liquid elastic modulus depending on pressure or it is defined as the density of a multiphase mixture of incompressible liquid and compressible gases (vapour, air) depending on pressure too. The article is focused on specification of mathematical models of multiphase flow for piping (one dimensional) hydraulic systems and spatial (three dimensional) hydraulic elements and systems. The electrohydraulic analogue (Matlab-SimHydraulics) method and finite volume method (Ansys-Fluent) are used for illustrative fluid dynamics tasks.