  (abridged) Aims: Three-dimensional numerical simulations of penetrative
compressible convection with uniform horizontal shear are used to study dynamo
action and the generation of large-scale magnetic fields. Methods: We consider
cases where the magnetic Reynolds number is either marginal or moderately
supercritical with respect to small-scale dynamo action in the absence of shear
and rotation. The effects of magnetic helicity fluxes are studied by comparing
results for the magnetic field with open and closed boundaries. Results:
Without shear no large-scale dynamos are found even if the ingredients
necessary for the alpha-effect (rotation and stratification) are present in the
system. When uniform horizontal shear is added, a large-scale magnetic field
develops, provided the boundaries are open. In this case the mean magnetic
field contains a significant fraction of the total field. For those runs where
the magnetic Reynolds number is between 60 and 250, small-scale dynamo is
expected to be excited, but the field distribution is found to be similar to
cases with smaller magnetic Reynolds number where the small-scale dynamo is not
excited. In the case of closed (perfectly conducting) boundaries, magnetic
helicity fluxes are suppressed and no large-scale fields are found. Similarly,
poor large-scale field development is seen when vertical shear is used in
combination with periodic boundary conditions in the horizontal directions. If,
however, open (normal-field) boundary conditions are used in the x-direction, a
large-scale field develops. These results support the notion that shear not
only helps to generate the field, but it also plays a crucial role in driving
magnetic helicity fluxes out of the system along the isocontours of shear,
thereby allowing efficient dynamo action.
