During eruption, lava domes and flows may become unstable and generate dang
erous explosions. Fossil lava-filled eruption conduits and ancient lava flo
ws are often characterized by complex internal variations of gas content. T
hese observations indicate a need for accurate predictions of the distribut
ion of gas content and bubble pressure in an eruption conduit. Bubbly magma
behaves as a compressible viscous liquid involving three different pressur
es: those of the gas and magma phases, and that of the exterior. To solve f
or these three different pressures, one must account for expansion in all d
irections and hence for both horizontal and vertical velocity components. W
e present a new two-dimensional finite element numerical code to solve for
the flow of bubbly magma. Even with small dissolved water concentrations, g
as overpressures may reach values larger than 1 MPa at a volcanic vent. For
constant viscosity the magnitude of gas overpressure does not depend on ma
gma viscosity and increases with the conduit radius and magma chamber press
ure. In the conduit and at the vent, there are large horizontal variations
of gas pressure and hence of exsolved water content. Such variations depend
on decompression rate and are sensitive to the "exit" boundary conditions
for the flow. For zero horizontal shear stress at the vent, relevant to lav
a flows spreading horizontally at the surface, the largest gas overpressure
s, and hence the smallest exsolved gas contents, are achieved at the condui
t walls. For zero horizontal velocity at the vent, corresponding to a plug-
like eruption through a preexisting lava dome or to spine growth, gas overp
ressures are largest at the center of the vent. The magnitude of gas overpr
essure is sensitive to changes of magma viscosity induced by degassing and
to shallow expansion conditions in conduits with depth-dependent radii.