Observations have established that the diffuse intergalactic medium (IGM) a
t z similar to 3 is enriched to similar to 10(-2.5) solar metallicity and t
hat the hot gas in large clusters of galaxies (ICM) is enriched to 1/3-1/2
Z(circle dot) at z = 0. Metals in the IGM may have been removed from galaxi
es (in which they presumably form) during dynamical encounters between gala
xies, by ram-pressure stripping, by supernova-driven winds, or as radiation
-pressure-driven dust efflux. This study develops a method of investigating
the chemical enrichment of the IGM and of galaxies, using already complete
d cosmological simulations. To these simulations we add dust and (gaseous)
metals, assuming instantaneous recycling and distributing the dust and meta
ls in the gas according to three simple parameterized prescriptions, one fo
r each enrichment mechanism. These prescriptions are formulated to capture
the basic ejection physics, and calibrated when possible with empirical dat
a. Our method allows exploration of a large number of models, yet for each
model yields a specific (not statistical) realization of the cosmic metal d
istribution that can be compared in detail to observations. Our results ind
icate that dynamical removal of metals from greater than or similar to 10(8
.5) M-circle dot galaxies cannot account for the observed metallicity of lo
w column density Ly alpha absorbers and that dynamical removal from greater
than or similar to 10(10.5) M-circle dot galaxies cannot account for the I
CM metallicities. Dynamical removal also fails to produce a strong enough m
ass-metallicity relation in galaxies. In contrast, either wind or radiation
-pressure ejection of metals from relatively large galaxies can plausibly a
ccount for all three sets of observations (though it is unclear whether met
als can be distributed uniformly enough in the low-density regions without
overly disturbing the IGM and whether clusters can be enriched quite as muc
h as observed). We investigate in detail how our results change with variat
ions in our assumed parameters and how results for the different ejection p
rocesses compare.