Magma genesis and transport link mantle convection with surface volcanism and hence with the long-term chemical and morphological evolution of the Earth's; crust. Modeling the dynamics of magma–mantle interaction in tectonic settings remains a challenge, however, because of the complexity of multi-component thermodynamics and melt segregation in a permeable, compactible, and actively deforming mantle matrix. Here I describe a flexible approach to formulating the thermochemistry of such models based on the Enthalpy Method, a technique commonly used in simulations of alloy solidification. This approach allows for melting and freezing based on a familiar binary phase diagram, consistent with conservation of energy and two-phase compaction and flow. I present an extension of the Enthalpy Method to more than two thermodynamic components. Simulation of a one-dimensional upwelling and melting column provides a benchmark for the method. Two-dimensional simulations of the melting region that feeds magma to a rapidly spreading mid-ocean ridge demonstrate the utility of the Enthalpy Method. These calculations provide a new estimate of the efficiency of magmatic focusing along the base of the oceanic lithosphere. Modeled focusing efficiency varies with mantle permeability and resistance to compaction. To yield 5–7 km of oceanic crust with ∼20% melting of a homogeneous, sub-ridge mantle, a focusing efficiency of greater than 70% is required. This, in turn, suggests that matrix permeability and bulk viscosity are at the high end of previously estimated values.