Deep in the crust, magmas can be seen as a mixture of two phases: a matrix made of crystals and a melt percolating within. Using two-phase flow theory is it possible to build numerical models allowing to simulate the dynamics of deep magma? Here I present such a model, its numerical implementation in the OpenFOAM framework and discuss some preliminary results of the simulations.