2.2.2. Photoionization codes
Photoionization codes are built to take into account all the major physical processes that govern the ionization and temperature structure of nebulae. In addition to photoionization, recombination, free-free radiation, collisional excitation they consider collisional ionization (this is important only in regions of coronal temperatures), charge exchange reactions, which are actually a non negligible cause of recombination for heavy elements, especially if the physical conditions are such that the population of residual hydrogen atoms in the ionized gas exceeds 10-3. Some codes are designed to study nebulae that are not in equilibrium and they may include such processes as mechanical heating and expansion cooling.
Most nebular studies use static photoionization codes, which assume that the gas is in ionization and thermal equilibrium. The most popular one is CLOUDY developed by Ferland and co-workers, for which an extensive documentation is available and which is widely in use (see Ferland 1998, and http://www.pa.uky.edu/~gary/cloudy/ for the latest release). Several dozens of independent photoionization codes suited for the study of PNe and H II regions have been constructed over the years. Some of them have been intercompared at several workshops (Péquignot 1986, Ferland et al. 1996 and Ferland & Savin 2001). The codes mainly differ in the numerical treatment of the transfer of the ionizing photons produced in the nebula: on the spot reabsorption, outward-only approximation (most codes presently), full treatment (either with classical techniques as in Rubin 1968 or Harrington 1968 or with Monte-Carlo techniques as in Och et al. 1998). They also differ in their capacity of handling different geometries. Most codes are built in plane parallel or spherical approximations, but a few are built in 3D (Gruenwald et al. 1997, Och et al. 1998). While 3D codes are better suited to represent the density distribution in real nebulae, their use is hampered by the fact that the number of free parameters is extremely large. Presently, simpler codes are usually sufficient to pinpoint difficulties in fitting observed nebulae within our present knowledge of the physical processes occuring in them and to settle error bars on abundance determinations.
When the timescale of stellar evolution becomes comparable to the timescale of recombination processes, the assumption of ionization equilibrium is no more valid. This for example occurs in PNe with massive ( > 0.64 M) nuclei, whose temperature and luminosity drop in a few hundred years while they evolve towards the white dwarf stage. In that case, the real ionization state of the gas is higher than would be predicted by a static photoionization model, and a recombining halo can appear. To deal with such situations, one needs time dependent photoionization codes, such as those of Tylenda (1979), or Marten & Szczerba (1997).
The nebular gas is actually shaped by the dynamical effect of the stellar winds from the ionizing stars. This induces shocks that produce strong collisional heating at the ionization front or at the interface between the main nebular shell of swept-up gas and the hot stellar wind bubble. On the other hand, expansion contributes to the cooling of the nebular gas. Several codes have been designed to treat simultaneously the hydrodynamical equations and the microphysical processes either in 1D (e.g. Schmidt-Voigt & Köppen 1987a and b , Marten & Schönberner 1991, Frank & Mellema 1994a, Rodriguez-Gaspar & Tenorio-Tagle 1998) or in 2D (Frank & Mellema 1994b, Mellema & Frank 1995, Mellema 1995). It may be that some of the problems found with static codes will find their solution with a proper dynamical description. However, so far, for computational reasons, the microphysics and transfer of radiation is introduced in a more simplified way in these codes. Also, it is much more difficult to investigate a given problem with such codes, since the present state of an object is the result of its entire history, which has to be modelled ab initio.