Aims: This work is a follow-up of a recent article by Ercolano et al. that shows that, in some cases, the spatial dispersion of the ionizing stars in a given nebula may significantly affect its emission spectrum. The authors found that the dispersion of the ionizing stars is accompanied by a decrease in the ionization parameter, which at least partly explains the variations in the nebular spectrum. However, they did not research how other effects associated to the dispersion of the stars may contribute to those variations. Furthermore, they made use of a unique and simplified set of stellar populations. The scope of the present article is to assess whether the variation in the ionization parameter is the dominant effect in the dependence of the nebular spectrum on the distribution of its ionizing stars. We examined this possibility for various regimes of metallicity and age. We also investigated a way to model the distribution of the ionizing sources so as to bypass expensive calculations.
Methods: We wrote a code able to generate random stellar populations and to compute the emission spectra of their associated nebulae through the widespread photoionization code cloudy. This code can process two kinds of spatial distributions of the stars: one where all the stars are concentrated at one point, and one where their separation is such that their Strömgren spheres do not overlap.
Results: We found that, in most regimes of stellar population ages and gas metallicities, the dependence of the ionization parameter on the distribution of the stars is the dominant factor in the variation of the main nebular diagnostics with this distribution. We derived a method to mimic those effects with a single calculation that makes use of the common assumptions of a central source and a spherical nebula, in the case of constant density objects. This represents a computation time saving by a factor of at least several dozen in the case of H ii regions ionized by massive clusters.