In this hands-on tutorial, we will use the open-source code CLOUDY, a spectral synthesis code designed to simulate conditions in interstellar matter under a broad range of conditions.
You should have Cloudy up and running on your laptop. If not, please follow these instructions:
https://github.com/alejandrobll/Saas-Fee-School/blob/main/Cloudy-hands-on/GettingStarted.ipynb
Finishing the proposed exercises will ensure you have the know-how required to:
1) Model the physical conditions of matter coupled with radiation within a broad range of astronomical conditions (e.g., Nebuale, ISM, CGM, IGM).
2) Generate cooling/heating tables that may be useful to include complicated modelling into numerical simulations of galaxy formation.
3) Understand and calculate under which conditions self-shielding becomes essential.
What does CLOUDY?
For a given shape and intensity of an incoming radiation field, CLOUDY provides a set of outputs (e.g., ionization state, cooling rate, heating rate, the intensity of the transmitted and diffuse radiation) as a function of the material's properties (e.g., chemical compositions, grain sizes).
Therefore, CLOUDY needs to understand the following:
1) The energy striking a unit area of the cloud (incoming intensity). This can be given as energy flux [erg / cm^2 / s] or photon flux (1/cm^2 / s). Alternatively, we can pass the total luminosity in [erg/s]. See documentation
2) The properties of the cloud (e.g., chemical composition, size of dust grains, temperature, the thickness of the cloud)
3) What do we need to calculate (when does the calculation stop?) Convergence? After column density exceeds some value? Etc.
All these parameters are controlled by an input set of commands.
(1) can be controlled with, e.g.,
table power law -1 //well-behaved power law with index -1
phi(H) 18.5 //log of the flux of H-ionizing photons in cgs
(2) can be controlled with, e.g.,
hden 10.0 // Number of hydrogen atoms per cm^3
abundances PRIM // Primordial composition
(3) can be controlled with, e.g.,
iterate to convergence // iterate until optical depth converges
save overview last "test.ovc" //save overview file
save continuum last "test.cont" //save overview file
Example parameter file in action (See Sec. 2.4 of QuickStart.pdf)
blackbody, T=1e5 K // Temperature in LK
luminosity total 38 // log10(luminsosity in erg/s)
radius 18 // log10(radius in cm)
hden 5 // log10(hydrogen number density / cm^3)
sphere // the gas cloud encircles the central source
abundances planetary nebula // pre-calculated abundances table
iterate // iterate until optical depth converges
print last iteration // we are only interested in the values of the last iteration
save overview "pn.ovr" last // save the overview file for the last interation
save continuum "pn.con" units microns last // save continuum of last iteration in desired units
No stop condition given, so the code will stop once the gas temperature drops below 4000 K, the default's lowest temperature
You are given three problems to solve using CLOUDY. Given the limited time, we advise focusing on one.
1) Understanding Cooling/Heating function with Cloudy (Primordial composition, solar metallicity, etc.). This may be useful for those working with hydrodynamical galaxy formation simulations.
https://github.com/alejandrobll/Saas-Fee-School/blob/main/Cloudy-hands-on/CoolingFunctions.ipynb
2) Understanding the onset of self-shielding. This is useful for everyone. It teaches when radiative transfer effects become essential and under which regime numerical simulations/models developed assuming optically-thin clouds lose applicability.
https://github.com/alejandrobll/Saas-Fee-School/blob/main/Cloudy-hands-on/Self-Shielding.ipynb
3) Understanding the interplay between the shape and intensity of the incoming radiation on the ionization state of a cloud. This is particularly useful to interpret observations and understand what can be learnt about the local radiation field from the ionization state.
https://github.com/alejandrobll/Saas-Fee-School/blob/main/Cloudy-hands-on/UVBShape.ipynb
This exercise aims to become familiar with CLOUDY by studying the cooling rate arising from the collisional ionization of a hydrogen gas cloud as a function of density and temperature.
1) Write a CLOUDY input parameter file to calculate the cooling rate of a pure hydrogen gas cloud in thermal equilibrium as a function of the cloud temperature and density.
Sample the temperature in the range, $4 \le \rm log_{10} (T / K) \le 8$, using a grid spacing $\rm \Delta log(T)=0.05$. Sample the density in the range $-4 \le \rm log_{10} (n_{H} / cm^{-3}) \le 0$, using a grid spacing $\rm \Delta log (n_{H})=1$.
Although not strictly necessary, running CLOUDY on the desired grid is convenient using the grid
command. Check the documentation for details (Hazy1.pdf, Chapter 18).
2) Plot the cooling rate for each density as a function of temperature. What features do you see in the cooling curve? Discuss the physics behind the features observed in the plot
3) Does the cooling rate depend on density? Consider now the so-called cooling function $\Lambda(T)=\mathcal{C}(n_{\rm H}, T)/n_{H}^2$. Does the cooling function depend on density? Does the shape of the cooling curve depend on density?
1) Modify the CLOUDY input file used to solve the previous exercise to calculate the cooling rate arising from the collisional ionization of primordial hydrogen + helium(*) mixture. Can you identify the new features in the cooling curve arising from Helium? Does the cooling function, $\Lambda$, depend on density?
2) On top of the total cooling function, $\Lambda$, plot the contribution of Hydrogen and Helium. What determines the peak in the cooling rate at around $3\times 10^4 \ K$ and $10^5 \ K$?
(*) Note that in CLOUDY, the abundances are always specified by number relative to hydrogen, not by mass or relative to silicon. Therefore, the abundance of helium should be set using the command element abundance helium -1
(see hazy1.pdf, Chapter 7)
NOTE: Although we propose to use CLOUDY to calculate the cooling function in the two previous exercises, the cooling function can be calculated numerically using fitting functions and assuming ionization equilibrium. The same applies to gas subject to an external ionizing radiation field.
1) Modify the CLOUDY input file used to solve the previous exercise to calculate the cooling and heating rates arising from the collisional ionization of a primordial hydrogen + helium mixture subject to the external present-day Haardt \& Madau (2012)(*) ultraviolet background radiation.
2) Plot, as usual, the cooling rate as a function of temperature for each density. Can you identify the new features in the cooling curve arising from the presence of the external UVB? Does the cooling function, $\Lambda$, depend now on density? If so, why?
3) Similarly to the cooling rate, plot the heating rate as a function of temperature for each density.
4) Study the regimes where cooling and heating dominates. Why does cooling dominate over heating at high densities? Why heating dominates over cooling at low densities?
5) What would happen if a gas cloud is exposed to the external UVB? How will the final temperature of the cloud depend on its initial temperature?
(*) You can specify the spectrum of the incoming radiation to be that of the HM2012 by using the command: table hm12 redshift 0
.