The paper considers the numerical simulation of spatial flows of real media in safety valves on the basis of the problem of an arbitrary discontinuity breakdown with complex equations of state. The solution is constructed by means of the developed numerical method, which is a modification of the classical scheme by S. K. Godunov and includes various complex equations of state of matter. The Van der Waals equations of state were used to model the flow of real gases, and the Mie-Grüneisen equation was used to describe the flow of a real weakly compressible fluid. It is shown that the proposed numerical schemes allow for modeling fluid and gas dynamic processes in real fluids and gases with shock waves and contact discontinuities and can be used both in areas of classical medium behavior and in areas with non-classical behavior.