  Clusters of galaxies can potentially produce cosmic rays (CRs) up to
very-high energies via large-scale shocks and turbulent acceleration. Due to
their unique magnetic-field configuration, CRs with energy $\leq 10^{17}$ eV
can be trapped within these structures over cosmological time scales, and
generate secondary particles, including neutrinos and gamma rays, through
interactions with the background gas and photons. In this work, we compute the
contribution from clusters of galaxies to the diffuse neutrino background. We
employ three-dimensional cosmological magnetohydrodynamical simulations of
structure formation to model the turbulent intergalactic medium. We use the
distribution of clusters within this cosmological volume to extract the
properties of this population, including mass, magnetic field, temperature, and
density. We propagate CRs in this environment using multi-dimensional Monte
Carlo simulations across different redshifts (from $z \sim 5$ to $z =0$),
considering all relevant photohadronic, photonuclear, and hadronuclear
interaction processes. We find that, for CRs injected with a spectral index
$\alpha = 1.5 - 2.7$ and cutoff energy $E_\text{max} = 10^{16} - 5\times10^{17}
\; \text{eV}$, clusters contribute to a sizeable fraction to the diffuse flux
observed by the IceCube Neutrino Observatory, but most of the contribution
comes from clusters with $M \gtrsim 10^{14} \; M_{\odot}$ and redshift $ z
\lesssim 0.3$. If we include the cosmological evolution of the CR sources, this
flux can be even higher.
