A new numerical model has been developed that makes it possible to describe the process of formation of a dyke of a combined composition on the basis of the dynamics of a viscous compressible fluid. The numerical thermo-mechanical model shows the processes of magma mingling and taking into account multiphase interaction of melts which are different in composition and properties. The models suggest a mechanism for uplifting of high-density mafic enclaves in a chamber/dyke filled with salic magma by gravitational floating in the enclosing granite magma that has been cooled and lost volatile components. The performed simulation shows that the main parameter controlling the shape and size of the ascending bodies is the difference in densities. The viscosity contrast determines whether interpenetration and hybridization of magmas occur. The limiting ratio of felsic material in the mixture, which is capable of uplifting denser mafic enclaves, is estimated. The duration of melt uplifting in combined dykes is estimated with respect to the viscosity parameters. At a typical rate of 2-3 km per year, it amounts to almost 12 months.