  We study the effect of cosmic ray (CR) acceleration in the massive compact
star cluster Westerlund 1 in light of its recent detection in $\gamma$-rays.
Recent observations reveal a $1/r$ radial distribution of the CR energy
density. Here we theoretically investigate whether or not this profile can help
to distinguish between (1) continuous CR acceleration in the star cluster
stellar wind-driven shocks and (2) discrete CR acceleration in multiple
supernovae shocks -- which are often debated in the literature. Using idealized
two-fluid simulations and exploring different acceleration sites and diffusion
coefficients, we obtain the CR energy density profile and luminosity to find
the best match for the $\gamma$-ray observations. We find that the inferred CR
energy density profiles from observations of $\gamma$-ray luminosity and mass
can be much different from the true radial profile. CR acceleration at either
the cluster core region or the wind termination shock can explain the
observations, if the diffusion coefficient is $\kappa_{\rm cr}\sim 10^{27}$
cm$^2$ s$^{-1}$ and a fraction of $\approx 10\%-20\%$ of the shock
power/post-shock pressure is deposited into the CR component. We also study the
possibility of discrete supernovae (SN) explosions being responsible for CR
acceleration and find that with an injection rate of 1 SN in every $\sim 0.03$
Myr, one can explain the observed $\gamma$-ray profile. This multiple SN
scenario is consistent with X-ray observations only if the thermal conductivity
is close to the Spitzer value.
