arXiv:0705.0127v2 [astro-ph] 2 Aug 2007 v oe ag nebeo atce odsrb ud yas- by fluid, a mass, describe as 1977; to such particles properties of signing (Lucy in- ensemble which large method a Lagrangian (SPH) vokes a is 1977) Hydrodynamics Monaghan & Gingold Particle Smoothed Introduction 1. o osbewt urn optn eore) u hyst they but i resources), which computing multi- task current of (a with dimensions treatment possible 3 full not in the transfer di by-pass radiative use to codes Mayer order 2005; SPH-RT in al. These assumptions et 2007). Viau Bate 2005; al. & al. et Whitehouse et 2003; Whitehouse Woolfson 2006; & 2004, (Oxley codes SPH in Monaghan 1991; 1990, Benz 2005). see 1992, reviews (for estimated averages are local derivatives) their (and pressure and density e words. Key rdbsdcds n ade pia ets0 depths equation optical barotropic handles simple and codes, a grid-based with simulation SPH standard a et h e loih erdcsterslso rvosa previous of results the reproduces algorithm new th the (iii) and tests temperature, initial uniform and perturbation etereaches centre pootla)cr.Terslsmmccoeytedetaile the closely 1 a mimic of results The core. (protostellar) nt ( unity P iuain fsa formation. star of simulations SPH irtoa ere ffedmo H of meth freedom The of cooling. degrees and vibrational heating particle’s the regulates then Methods. Aims. e-mail: Results. ut oeua ie,H lines, molecular dust, 1 rcesams stemly( isothermally almost proceeds eevdFbur,20;acpe ... accepted 2007; February, Received 2 edo Send i coe 7 2018 27, October srnm Astrophysics & Astronomy oec particle, each to , colo hsc srnm,Cardi Astronomy, & Physics of School eateto hsc n srnm,TeUiest fShe of University The Astronomy, and Physics of Department aitv rnfr(T a nyrcnl enincluded been recently only has (RT) transfer Radiative . eitoueadts e n ihye highly and new a test and introduce We M 2 ρ ff [email protected] C rn eussto requests print euetenwmto osmlt h olpeo M 1 a of collapse the simulate to method new the use We ∼ ⊙ h ehdue h est,tmeaueadgravitational and temperature density, the uses method The lu,wihiiilyhsuiomdniyadtemperature and density uniform has initially which cloud, tr:frain–Mtos ueia aitv transfer Radiative – numerical Methods: – formation Stars: 7 × T C 10 ∼ − 13 00K oeua yrgnsat odsoit n h seco the and dissociate to starts hydrogen molecular K, 2000 i nesv hroyai aibe like variables thermodynamic Intensive . cm g − .Stamatellos D. : aitv rnfradteeeg equation energy the and transfer Radiative on-readfe-repoessadeeto scatteri electron and processes free-free and bound-free , − 3 .Tefis oefrsat forms core first The ). T nSHsmltoso trformation star of simulations SPH in .Stamatellos D. aucitn.sphrt no. manuscript ∝ 2 ρ m i)H (ii) ; 0 . i 08 position, , f asn20) h lu trshaigfs hnteopt the when fast heating starts cloud The 2005). Larson cf. ; ff nvriy h aae Cardi Parade, The 5 University, 2 iscainadH and dissociation τ < ffi ff in ehdfrtetn h hra n aitv e radiative and thermal the treating for method cient 1 rn simplifying erent .P Whitworth P. A. , ∼ < r i 10 n velocity, and , mohn ftmeaueflcutosi ttc uniform static, a in fluctuations temperature of smoothing e 11 ρ . C acltoso auaa&Iusk 20) eas simula also We (2000). Inutsuka & Masunaga of calculations d dcpue tmnmlcmuainlcs h e the – cost computational minimal at – captures od tosand uthors ∼ fsae h ehdi ayt mlmn,cnb ple obo to applied be can implement, to easy is method The state. of 4 using ffi ABSTRACT × o l,HcsBidn,HusedRa,She Road, Hounsfield Building, Hicks eld, ill oiain ii pct hne u oiemnl melting mantle ice to due changes opacity (iii) ionisation; 10 ⊙ s lu fiiilyuiomdniyadtmeaue tfirst At temperature. and density uniform initially of cloud − / 9 rkonaayi ouin.Tecmuainlcs scomp is cost computational The solutions. analytic known or 1 i)teclas fa1 a of collapse the (ii) , adpatc oueabrtoi qaino tt,ie op to i.e. state, of equation barotropic a use to practice dard 2005 al. expe et Stamatellos quite 2005; computationally Whitworth durin & is snapshot (Stamatellos simulation single sive a a on of evolution transfer trea radiative the the 3D even full Indeed, of expensive. ment computationally be to tend 98.Tefr of form The 1998). r ytm vnfrtesm ytm h est n tem- and density the system, same the for e Even for equation system. barotropic temperatur hig ery single and a than density by the approximated densities be of higher cannot evolution the to Thus, radiation ones. opticall cooling mass remain their protostars to low-mass geomet thin example, environment, for its mass; on histo and sensitively thermal the depends that fact protostar the a for account to unable is state 2000). Inutsuka & proto Masunaga 1992; isolated Myhill single, & a Boss th (e.g. of of computations collapse by symmetric revealed as spherically gas, forming star of namics Hydrodynamics – P cm g oeta fec atcet siaeama pia depth, optical mean a estimate to particle each of potential .Bisbas T. , ff = F43A ae,UK Wales, 3AA, CF24 , oeotn nSHsmltoso trfrain ti stan- is it formation, star of simulations SPH in often, More hsi o nielstain a aorpceuto of equation barotropic A (a) situation. ideal an not is This − 3 P n taiyicessi as hntetmeauea the at temperature the When mass. in increases steadily and ( g i)etra raito;ad()temlinertia. thermal (v) and irradiation; external (iv) ng; ρ dclas eis edn otefraino h second the of formation the to leading begins, collapse nd eg onl 94 htot ta.19;Bate 1995; al. et Whitworth 1994; Bonnell (e.g. ) 1 n .Goodwin S. and , P . M 2 ( ρ scoe ommctethermody- the mimic to chosen is ) ⊙ ff oaigcod ihan with cloud, rotating csiflecn h nryeuto in equation energy the influencing ects cldpht h lu etereaches centre cloud the to depth ical 2 ffi l 37H UK 7RH, S3 eld ff cso i h oainland rotational the (i) of ects est pee nalthese all In sphere. density e()tecollapse the (i) te ulmto of sublimation , hpril-and particle- th m h collapse the ,

c = S 2018 ESO density 2 rbeto arable which yof ry star v- n- h- ry ut ). t- y g e e 2 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation perature evolution away from the centre of the cloud does not Specifically, each SPH particle is treated as if it were em- follow the corresponding evolution at the centre of the cloud bedded in a spherically-symmetric pseudo-cloud (its personal (Whitehouse & Bate 2006). (b) A barotropic equation of state pseudo-cloud). The density and temperature profiles of the is unable to capture thermal inertia effects (i.e. situations where pseudo-cloud are modelled with a polytrope of index n = 2, the evolution is controlled by the thermal timescale, rather than but the pseudo-cloud is not assumed to be in hydrostatic bal- the dynamical one). Such effects appear to be critical at the ance. (We will show later that the choice of n is not critical.) stage when fragmentation occurs (e.g. Boss et al. 2000). The position of the SPH particle within its pseudo-cloud is One of the ultimate goals of star formation simulations is to not specified; instead we take a mass-weighted average over track the thermal history of star-forming gas. Strictly speaking, all possible positions (see Figs. 1 & 2). For any given po- this requires a computational method which can treat properly, sition of the SPH particle within the pseudo-cloud, the cen- in 3 dimensions, the time-dependent radiation transport which tral density, ρC , and scale-length, RO , are chosen to reproduce controls the energy equation. However, this is computationally the density and gravitational potential at the position of the very expensive, significantly more expensive than the hydro- SPH particle. Similarly, the pseudo-cloud’s central tempera- dynamics. We have therefore developed a new algorithm which ture, TC is chosen to match the temperature at the position of enables us to distinguish the thermal behavioursof protostars of the SPH particle. (Because the pseudo-cloud is not necessar- different mass, in different environments, with different metal- ily in hydrostatic equilibrium, we cannot – in general – write T = 4πGm¯ ρ R2 /(n + 1)k , wherem ¯ is the mean gas-particle licities, and to capture thermal inertia effects, without treating C C O B in detail the associated radiation transport. The method uses the mass and kB is Boltzmann’s constant.) density, temperature and gravitational potential of each SPH The , τi, is then calculated by integrating out particle (which are all calculated using the standard SPH for- along a radial line from the given position to the edge of the malism) to estimate a characteristic optical depth for each par- pseudo-cloud, i.e. through the cooler and more diffuse outer ticle. This optical depth then regulates how each particle heats parts of the pseudo-cloud. In this way, τi samples the different and cools. opacity regimes that are likely to surround the SPH particle. The paper is organized as follows. In Section 2, we present This accountsfor thefact that, evenif the opacity at theposition the new algorithm we have developed to treat the energy equa- of the SPH particle is low, its cooling radiation may be trapped tion within SPH, also describing the aspects of SPH that are re- by cooler more opaque material in the surroundings. quired for a complete picture of the new method. In Section 3 Finally,τ ¯i is obtained by taking a mass-weighted average we outline the properties we adopt for the gas and dust in a over all possible positions within the pseudo-cloud. star-forming cloud, i.e. the composition, energy equation,equa- tion of state, and opacity. In Section 4, we present a simulation 2.1. Basic SPH equations of the collapse of a 1M⊙ molecular cloud; we describe in de- tail the different stages of the collapse, and compare our re- We use the dragon SPH code (Goodwinet al. 2004a,b). dragon sults with those of Masunaga & Inutsuka (2000). In Section 5, uses variable smoothing lengths, hi, adjusted so that the num- N = three additional tests are presented: (i) the collapse of a 1.2M⊙ ber of neighbours is exactly NEIB 50; it is important to have molecular cloud (Boss & Myhill 1992; Whitehouse & Bate a constant number of neighbours to minimise numerical dif- 2006), (ii) the collapse of a rotating 1.2M⊙ molecular cloud, fusion (Attwood et al. 2007). An octal tree is used to collate with an m = 2 density perturbation (Boss & Bodenheimer neighbour lists and calculate gravitational accelerations, which 1979; Whitehouse & Bate 2006), and (iii) the smoothing of are kernel-softened using particle smoothing lengths. Standard temperature fluctuations in a static, uniform-density sphere artificial viscosity is invoked in converging regions, and multi- (Spiegel 1957). Finally, in Section 6, we summarise the method ple particle time-steps are used. and the tests performed,and discuss the applicability of the new The density at the position of SPH particle i is given by a algorithm to simulations of astrophysical systems. sum over its neighbours, j,

m j ri j ρ = , i 3 W (1)  h hi j ! 2. The method Xj  i j    The key to the new method is to use an SPH particle’s density, where m j is the mass of particle j, hi j = (hi + h j)/2, and W(s) is the dimensionless smoothing kernel. ρi, temperature, Ti, and gravitational potential, ψi, to estimate The equation of motion for SPH particle i is a mean optical depth,τ ¯i, for the SPH particle. This mean op- tical depth then regulates the SPH particle’s radiative heating dvi Pi P j ri j ri j dvi and cooling; in other words, it determines the extent to which = m + +Π W′ + . (2)  j  2 2 i j 4  dt ρ ρ h r hi j ! dt GRAV the SPH particle is shielded from external radiation, and the Xj,i   i j  i j i j      extent to which the SPH particle’s cooling radiation is trapped.     Here, Pi and P j are the pressures at the positions of particles (The gravitational potential is used here, purely because grav- ′ i and j respectively; ri j ≡ ri − r j ; ri j ≡ |ri j| ; and W (s) ≡ ity is the only particle parameter which is already calculated by dW/ds. Artificial viscosity is represented by the term the SPH code but is not a local function of state. Therefore it 2 should, in some very general sense, represent the larger-scale (−αci jµi j + βµi j) Πi j = , (3) environment surrounding the SPH particle.) ρi j D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 3

1/2 pseudo−cloud with α = 1, β = 2, ci j ≡ (ci + c j)/2 (where ci = (Pi/ρi) is the isothermal sound speed of particle i), ρi j ≡ (ρi + ρ j)/2,

hij vij·rij , · < , (r2 +0.1h2 ) if vi j ri j 0 µi j = ij ij (4) SPH particle  ξ R  0 , if vi j · ri j ≥ 0 ,  psc  R i  ξ and vi j ≡ vi − v j. b possible positions of the SPH particle The second term on the righthand side of Eqn. (2) is the inside its pseudo−cloud gravitational acceleration experienced by particle i, given by (dashed−circles)

dvi Gm jri j ⋆ ri j = − W , (5) R M  3  i i dt GRAV r hi j ! Xj,i  i j 

  Fig. 1. Schematic representation of the pseudo-cloud around an where SPH particle.The location of the SPH particle inside its pseudo- s′=s cloud is not specified. W⋆(s) = W(s′)4 π s′2 ds′ . (6) Zs′=0 Here θ(ξ) is the Lane-Emden Function for index n Similarly the gravitational potential at the position of particle i (Chandrasekhar 1939), is given by dθ φ(ξ) = − ξ ξ + θ(ξ) , (12) m j ⋆⋆ ri j B B ψi = − G W , (7) dξ ( r h !)  Xj,i i j i j and ξB is the dimensionless boundary of the polytrope (i.e. the where argument of the smallest zero of θ(ξ)) If we fix n (and hence the forms of θ(ξ) and φ(ξ)), and we ′=∞ s pick an arbitrary value for ξ (modulo that it must be within the W⋆⋆(s) = W⋆(s) + s W(s′)4 π s′ ds′ . (8) ′ Zs =s pseudo-cloud, i.e. ξ < ξB ), then we obtain −n In Eqns. (5) and (7), the sums are over all particles except i; ρC = ρi θ (ξ) , (13) ⋆ ⋆⋆ the terms W (s) in Eqn. (6) and W (s) in Eqn. (8) represent 1/2 − ψ θn(ξ) kernel softening. In practice, the calculation of these gravita- R = i . (14) O 4 π G ρ φ(ξ) tional terms is rendered more efficient by using a tree struc- " i # ture to identify distant clusters of particles whose effect can be treated collectively with a multipole expansion; this reduces an N2 process to an Nℓn[N] process, where N is the total number of SPH particles. The energy equation for particle i is

dui 1 Pi P j vi j · ri j ′ ri j dui = m j + +Πi j W + . (9) dt 2   2 2  4 h ! dt Xj  ρi ρ j hi j ri j i j  RAD           Here ui is the internal energy per unit mass. The first term on the righthand side represents compressional and viscous heat- ing. The second term on the righthand side is the net radiative heating rate; this paper is primarily concerned with the evalua- tion of this term.

2.2. Calibrating the pseudo-cloud

Suppose that SPH particle i is embedded at radius R = ξR0 , in a pseudo-cloud with central density ρC , scale-length RO , and polytropic index n (see Figs. 1 & 2). ξ is thus a dimensionless radius, and ρC and RO are chosen so as to reproduce – at this radius – the actual density and gravitational potential of the SPH particle, i.e. Fig. 2. Density and temperature profiles for a polytropic n ρC θ (ξ) = ρi , (10) pseudo-cloud with n = 2. The SPH particle could be located − π ρ 2 φ ξ = ψ . anywhere in the cloud (solid and dashed line circles). 4 G C RO ( ) i (11) 4 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

In an analogous manner we chose the central temperature At first sight it might appear that the double integral in Eqn. of the pseudo-cloud so as to reproduce – at radius R = ξRO – (21) will have to be evaluated on-the-fly for every SPH particle, the actual temperature of the SPH particle (see Fig. 2), at every time-step. In fact, we can define a pseudo-mean mass opacity T θ(ξ) = T , (15) C i τ¯ − i 1 κ¯i = , (22) TC = Ti θ (ξ) . (16) Σ¯ i

The column-density on a radial line from this radius to the which – once n has been fixed – is simply a function of ρi and boundary of the pseudo-cloud is then given by Ti. It can therefore be evaluated in advance, once and for all time, and stored in a dense look-up table for subsequent refer- ′= ξ ξB n ′ ′ ence and interpolation. For the point (ρ, T) in the table, Σi(ξ) = ρC θ (ξ ) RO dξ Zξ′=ξ −1 = ′= ξ ξB ξ ξB 2 dθ 1/2 ξ′=ξ κ¯ (ρ, T) = − ζ ξ (ξ ) × − ψ ρ B R n B B = i i n ′ ′ " dξ # Zξ=0 Zξ′=ξ n θ (ξ ) dξ . (17) "4 π G φ(ξ) θ (ξ)# Z ′= 1/2 ξ ξ θ(ξ′) n θ(ξ′) θ n+2(ξ) κ ρ , T dξ′ ξ2dξ. (23) To obtain the pseudo-mean column-density, we take a mass- R " θ(ξ) # " θ(ξ) #! " φ(ξ) # weighted average of Σi(ξ) over all possible dimensionless radii, The physical interpretation of this pseudo-mean opacity, ξ, i.e. κ¯R (ρ, T), is fundamental to the method. Although formally −1 ξ=ξ κ¯ (ρ, T) only depends on the local density and temperature, dθ B R Σ¯ = − ξ2 ξ Σ ξ θn ξ ξ2 ξ when it is multiplied by the pseudo-mean column-density, Σ¯ , i B ( B ) i( ) ( ) d i " dξ # Zξ=0 it gives a pseudo-mean optical depth,τ ¯i, which allows for the 1/2 − ψi ρi fact that radiation absorbed or emitted by particle i has to pass = ζn , (18)  4 π G  through surrounding material which will in general have differ- ent density and temperature, and hence different opacity. For where − ξ2 dθ (ξ ) is the total dimensionless mass of the poly- B dξ B example, an SPH particle whose local Rosseland-mean opacity, θhn ξ ξ2 ξ i ξ trope, ( ) d is the dimensionless mass element between κR (ρ, T), is low because its density and temperature fall in the and ξ + dξ, and opacity gap, will have a larger pseudo-mean opacity,κ ¯R (ρ, T); this simply reflects the fact that this SPH particle may still be −1 ξ=ξ ξ′=ξ n 1/2 dθ B B θ (ξ) ζ = −ξ2 (ξ ) θn(ξ′)dξ′ ξ2dξ. (19) well insulated by cooler material in its surroundings which has n B B " dξ # Zξ=0 Zξ′=ξ " φ(ξ) # much higher opacity because it contains dust. As an indication of how insensitive the results are to the 2.3. Radiative heating and cooling choice of n, we note that ζ1 = 0.376, ζ1.5 = 0.372, ζ2 = 0.368, ζ = 0.364, and ζ = 0.360 . Since for protostars 2.5 3 The net radiative heating for SPH particle i is given by which are close to equilibrium – for example those undergoing 4 4 quasistatic (i.e. Kelvin-Helmholtz) contraction – the polytropic du 4 σSB (T (ri) − T ) i = O i , (24) exponent is likely to fall in the range 4/3 to 5/3, we adopt ¯ 2 −1 dt RAD Σ κ¯ (ρi, Ti) + κ (ρi, Ti) i R P n = 2 (corresponding to a polytropic exponent of 3/2). where σ is the Stefan-Boltzmann constant,κ ¯ (ρ, T) is the We calculate the pseudo-mean optical depth in the same SB R pseudo-mean opacity defined in Section 2.2, and κ (ρ, T) is the way as the pseudo-mean column-density. If the Rosseland- P Planck-mean opacity. mean opacity is a function of density and temperature only, 4 The positive term in Eqn. (24) – the one involving T (ri) κ (ρ, T), the radial optical depth from radius R = ξR to the O R O – represents radiative heating due to the background radiation boundary of the pseudo-cloud is field with effective temperature TO (ri). This term ensures that ξ′=ξ B the SPH particle does not cool radiatively below T (ri). In a = n ′ ′ n ′ ′ O τi(ξ) κR ρC θ (ξ ), TC θ(ξ ) ρC θ (ξ ) RO dξ simulation which includes stars – either pre-existing, or formed Zξ′=ξ  as an outcome of the simulation; and with luminosities L⋆ and − ψ ρ θn(ξ) 1/2 = i i × positions r⋆ – we set " 4 π G φ(ξ) # L⋆ ξ′=ξ ′ n ′ ′ n T 4(r) = (10K)4 + . (25) B θ(ξ ) θ(ξ ) θ(ξ ) ′ O (16 π σ |r − r |2 ) κ ρi , Ti dξ , (20) X⋆ SB ⋆ Zξ′=ξ " θ(ξ) # " θ(ξ) #! " θ(ξ) # 4 The negativeterm in Eqn. (24) – the one involving Ti – rep- and the mass-weighted pseudo-mean optical depth is 4 ≫ 4 resents radiative cooling of SPH particle i. If Ti TO (ri), we −1 = ′= can neglect the heating term and consider two limiting regimes: 1/2 ξ ξB ξ ξB 2 dθ − ψi ρi (i) If Σ¯ 2 κ¯ (ρ , T ) ≪ κ−1(ρ , T ), we are in the optically thin τ¯ = − ξ (ξ ) × i R i i P i i i B B " dξ #  4 π G  Zξ=0 Zξ′=ξ cooling regime and Eqn. (24) approximates to ′ n ′ n 1/2 θ(ξ ) θ(ξ ) n ′ ′ θ (ξ) 2 dui 4 κR ρi , Ti θ (ξ )dξ ξ dξ. (21) ≃ − 4 σSB Ti κP (ρi, Ti) , (26) " θ(ξ) # " θ(ξ) #! " φ(ξ) # dt RAD

D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 5 in exact agreement with the definition of the Planck-mean 2.5. Method implementation opacity. 2 −1 The method is easy to implement. In practice we do the follow- (ii) If Σ¯ κ¯ (ρi, Ti) ≫ κ (ρi, Ti), we are in the optically i R P ing, for each SPH particle i, at each timestep: thick cooling regime and Eqn. (24) approximates to du 4 σ T 4 ca T 4 1. Calculate the pseudo-mean column-density Σ¯ from the i ≃ − SB i = − SB i , (27) i ¯ 2 ¯ density, ρ and gravitational potential, ψ , using Eqn. (18). dt RAD Σ κ¯ (ρ , T ) Σ τ¯ i i i R i i i i (In a simulation which includes stars, we must neglect their where c is the speed of , a is the density SB contribution to ψ .) constant, and we have obtained the second expression by sub- i 2. Calculate the pseudo-mean opacity,κ ¯ (ρ , T ) and the stituting 4σ = ca and Σ¯ κ¯ (ρ , T ) = τ¯ . R i i SB SB i R i i i Planck-mean opacity, κ (ρ , T ), by interpolation on a look- To see that this is just the diffusion approximation, suppose P i i up table1. that the pseudo-cloud has pseudo-mass M¯ i and pseudo-radius 1/2 3. Calculate the compressive plus viscous heating rate, R¯i ∼ (3M¯ i/4πΣ¯ i) . Eqn. (27) then reduces to dui/dt|HYDRO , using Eqn. (29), and the radiative heating rate, dui U¯ rad,i du /dt| , using Eqn. (24). ∼ − , (28) i RAD dt M¯ t¯ 4. Calculate the equilibrium temperature, Teq,i, using RAD i diff,i Eqn. (30) and the thermalization timescale, t , using where U¯ ∼ 4πR¯ 3a T 4/3 is the total radiant energy in the therm,i rad,i i SB i Eqn. (31). pseudo-cloud and t ∼ R¯ τ¯ /c is the timescale on which radia- rad,i i i 5. Update the internal energy, u , using Eqn. (32); and hence tion diffuses out of the pseudo-cloud (cf. Masunaga & Inutsuka i also advance the temperature, T . 1999; Whitworth & Stamatellos 2006). i

2.6. Limitations of the method 2.4. Quasi-implicit scheme Although the method is very efficient, it evidently has limita- In order to avoid very short time-steps, we use the following tions, in particular: scheme to update the internal energy, ui. From SPH we know the net compressive plus viscous heating rate, 1. Because the diffusion approximation is applied here glob-

dui 1 Pi P j vi j · ri j ′ ri j ally (to the whole pseudo-cloud), the method cannot cap- = m j + +Πi j W . (29) dt 2  2 2  4 h ! ture in detail the local nature of radiative heating and cool- HYDRO Xj  ρi ρ j hi j ri j i j     ing in the optically thick regime (i.e. the fact that in reality    We can therefore calculate (a) the equilibrium temperature Teq,i fluid elements exchange heat directly with other fluid ele- for each particle from ments, within a few photon mean-free-paths). 4 σ T 4(r ) − T 4 2. Because the pseudo-cloud Ansatz predicates a spherical du SB O i eq,i i + = 0; (30) polytropic cloud, the method works best for configurations ¯ 2 h −1 i dt HYDRO Σ κ¯ (ρi, Teq,i) + κ (ρi, Teq,i) i R P which approximate to spherical symmetry. For example in

(b) the equilibrium internal energy, ueq,i = u(ρi, Teq,i); and (c) simulations of disc fragmentation it handles the conden- the thermalization timescale, sations better than the background disc. Notwithstanding −1 this, even in an unperturbed disc the method is reasonably dui dui ttherm,i = ueq,i − ui + . (31) accurate, as shown by its performance of the Hubeny test ( dt HYDRO dt RAD ) (Stamatellos & Whitworth, in preparation). n o We then advance ui through a time step ∆t by putting − ∆t − ∆t 3. Gas and dust properties ui(t+∆t) = ui(t) exp + ueq,i 1 − exp . (32) "ttherm,i # ( "ttherm,i #) 3.1. Gas-phase chemical abundances If ∆t ≪ ttherm,i, we are in a situation where thermal inertia effects are important, and Eqn. (32) approximates to Although metals make essential contributions to the opacity, ∆t they make very little contribution to the equation of state. ui(t + ∆t) ≃ ui(t) + ueq,i − ui(t) ; (33) Therefore, for the purpose of treating the gas-phase chemistry, t h i therm,i we assume that the gas is 70% hydrogen and 30% helium by i.e. in one dynamical timestep, ∆t, the gas can only relax a little mass: X = 0.7, Y = 0.3, Z = 0. At low temperatures, hydrogen towards thermal equilibrium. is molecular, but as the temperature increases it becomes disso- On the other hand, if ∆t ≫ ttherm,i, Eqn. (32) approximates ciated and then ionised. At low temperatures, helium is neutral to atomic, but as the temperature increass it becomes ionised, first + ++ ui(t + ∆t) ≃ ueq,i ; (34) to He ,andthento He . The relative abundancesof these con- stituents depend on the density, ρi, and the temperature, Ti, and i.e. thermal processes are occurringmuch faster than dynamical are calculated using Saha equations (e.g. Black & Bodenheimer ones, and the gas is always close to thermal equilibrium. Using the above procedure we capture thermal inertia effects, whilst 1 Tabulated pseudo-mean opacities and internal energies (see next avoiding the use of very small timesteps. Section) can be obtained by contacting [email protected] 6 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

1975), with the simplifying assumption that the dissociation of o H2 is complete before ionization of H begins; and similarly, that the ionization of Heo is complete before the ionization of He+ begins.

Fig. 4. The variation of the specific internal energy with den- sity and temperature. Isopycnic curves are plotted from ρ = 10−18 gcm−3 to ρ = 1gcm−3, every two orders of magnitude (from top to bottom). The rotational degrees of freedom of H2 are excited around 100 to 200K, H2 starts to be dissociated around 1, 000 to 10, 000K, and Ho starts to be ionised around Fig. 3. The variation of the mean molecular weight with den- 4, 000 to 40, 000 K. sity and temperature. Isopycnic curves are plotted from ρ = 10−18 gcm−3 to ρ = 1gcm−3, every two orders of magnitude (bottom to top). where

3 kB Ti uH2 = X(1 − y) + ci(Ti) , (38) 3.2. The equation of state "2 # 2mH

3kB Ti o If we define y = nH /2nH2 to be the degree of dissociation of uH = Xy (1 + x) , (39) 2mH hydrogen, x = n + /n o to be the degree of ionization of hy- H H 3k T + o B i drogen, z1 = nHe /nHe to be the degree of single ionisation of uHe = Y (1 + z1 + z1z2) , (40) 8mH helium, and z2 = nHe++ /nHe+ to be the degree of double ionisa- D tion of helium, then the mean molecular weight is given by H2DISS uH2DISS = Xy , (41) 2 mH X Y −1 = = + + + + + IHION µi µ(ρi, Ti) (1 y 2xy) (1 z1 z1z2) . (35) uHION = Xxy , (42)  2 4  mH I Note that (x, y, z1, z2) must be evaluated afresh for each SPH HeION uHeION = Y z1 (1 − z2) , (43) particle; the index i has been dropped purely for simplicity. The 4 mH variation of the mean molecular weight with density and tem- IHe+ION uHe+ION = Y z1 z2 , (44) perature is shown in Fig. 3. 4 mH For densities up to ∼ 0.03gcm−3 the ideal gas approxima- tion holds, and hence the gas pressure is Here, DH2DISS = 4.5eV is the dissociation energy of H2; IHION = 13.6eV, IHeION = 24.6eV and IHe+ION = 54.4eV ρ k T o o + i B i are the ionisation energies of H , He and He , respectively; Pi = . (36) µi mH and the function

T 2 T 2 exp(T /T ) = ROT + VIB VIB i , 3.3. Specific internal energy of the gas ci(Ti) f (Ti) 2 (45) Ti ! Ti ! exp(TVIB /Ti) − 1 The specific internal energy (energy per unit mass) of an   SPH particle i is the sum of contributions from molecular, with TROT = 85.4K and TVIB = 6100K accounts for the rota- atomic and ionised hydrogen, atomic, singly ionised and dou- tional and vibrational degrees of freedom of H2. The function bly ionised helium, and the associated dissociation and ionisa- f (Ti) depends on the relative abundances of ortho- and para- tion energies, H2; we assume a fixed ortho-to-para ratio of 3:1. The variation of the specific internal energy with density and temperature is

+ ui = uH2 +uH+uHe +uH2DISS +uHION +uHeION +uHe ION, (37) shown in Fig. 4. D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 7

3.4. Opacity In the present work we do not distinguish between the Rosseland-mean and Planck-mean opacities; we use the parametrisation proposed by Bell & Lin (1994) for both, i.e.

a b κR (ρ, T) = κP (ρ, T) = κ0 ρ T . (46)

Here (κ0 , a, b) are constants which depend on the dominant physical process contributing to the opacity in different regimes of density and temperature (see Table 1 and Fig. 5). The opacity at low temperatures is dominated by icy dust grains. At T ∼ 150 K the ices evaporate and the opacity is due to metal grains up to T ∼ 1, 000 K, when the metal grains start to evaporate. The opacity drops considerably in the tempera- ture range from T ∼ 1, 000 K to T ∼ 2, 000 K, as it is too hot for dust to exist, and too cool for H− to contribute, so the opacity is mainly due to molecules; this region of low opacity Fig. 5. The variation of the local Rosseland-mean opacity with is sometimes referred to as the opacity gap. The opacity starts density and temperature. Isopycnic curves are plotted from to increase again above T ∼ 2, 000K duetoH− absorption and ρ = 10−18 gcm−3 to ρ = 1gcm−3, every two orders of mag- then decreases again above T ∼ 104 K, when free-free transi- nitude (from bottom to top). The opacity gap is evident at tem- tions take over. At very high temperatures, electron scattering peratures ∼ 1, 000 to 3, 000 K, over a wide range of densities. delivers an approximately constant opacity. At low temperatures, T < 2, 000K, the Bell & Lin parametrisation agrees well with the Rosseland-mean dust opacity calculated by Preibisch et al. (1993). Similarly, at high temperatures, T > 2, 000K, it agrees well with the Rosseland- mean gas opacities calculated by Alexander & Ferguson (1994) and Iglesias & Rogers (1996). Eqn. (46) gives local Rosseland- and Planck-mean opaci- ties. To calculate the pseudo-mean opacity used in Eqn. (24), we have to convolve this opacity with polytropic density and temperature profiles according to Eqn. (23). In Fig. 6 we present the pseudo-mean opacity computed in this way, using a polytropic index n = 2. We reiterate that the choice of n affects the computed pseudo-mean opacities only weakly.

Table 1. Opacity law parameters (from Bell & Lin 1994)

Dominant opacity component κ0 a b Fig. 6. The variation with density and temperature of the or physical process pseudo-mean opacity. Isopycnic curves are plotted as in Fig. 5. For comparison the local opacity at density ρ = 10−6 g cm−3 is 1 Ice grains 2 × 10−4 0 2 2 Evaporation of ice grains 2 × 1016 0 -7 also plotted (dashed line). 3 Metal grains 0.1 0 1/2 4 Evaporation of metal grains 2 × 1081 1 -24 −8 5 Molecules 10 2/3 3 investigated by Masunaga & Inutsuka (2000) using a code that − −36 6 H absorption 10 1/3 10 treats the hydrodynamics in 1 dimension (i.e. assuming spher- 7 bf and ff transitions 1.5 × 1020 1 -5/2 ical symmetry) and the radiative transfer exactly in 3 dimen- 8 Electron scattering 0.348 0 0 sions (i.e. by solving the angle-dependent and frequency de- pendent radiation transfer equation). It therefore constitutes a stiff test for our new method to reproduce their results. For the simulation presented here we use 2 × 105 SPH particles. 4. The collapse of a 1-M⊙ molecular cloud The first test of our new methodfor treating the energyequation 4.1. Cloud collapse and the formation of the first and in SPH is to simulate the collapse of a 1 M⊙ molecular cloud, second cores which initially is spherical with radius R = 104 AU and uni- −19 −3 form density ρ0 = 1.41 × 10 gcm . We set the background The evolution of the cloud is followed up to density ρ ∼ −3 −3 4 radiation temperature to TO (r) = 5K This problem has been 10 gcm and temperature T ∼ 10 K, i.e. a difference from 8 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

Fig. 7. Evolution of the central density and central temperature of the collapsing cloud (thick red line). For comparison, the dashed black line shows the Masunaga & Inutsuka (2000) simulation, and the dotted black lines delineate the different opacity regimes (see Fig. 5). The thin solid lines are the loci for different degrees of H2 dissociation (bottom set of blue lines, y = 0.01, 0.2, 0.4, 0.6, and 0.8 , respectively) and of Ho ionisation (top green line, x = 0.01). The results of our model are very close to the simulation of Masunaga & Inutsuka (2000). Differences at high densities are attributable to our using different opacities.

5 Fig. 8. Evolution of the central density with time, given in units of the initial free fall time tffo = 1.781 × 10 yr. The times of the formationof the fist and second core are also marked. The red squares correspond to the Masunaga & Inutsuka (2000) simulation. D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 9 the initial conditions of about 16 orders of magnitude in den- Table 2. Colour code, elapsed time (t, measured from the be- sity, and 3 orders of magnitude in temperature. ginning of the simulation and in units of the initial freefall −12 −3 As long as the density is below ∼ 10 gcm , the time), central density (ρC ), and central temperature (TC ), for temperature increases slowly with increasing density. For the instants illustrated in Figs. 9 to 12. 10−18 gcm−3 ∼< ρ ∼< 10−13 gcm−3 we can approximate this with −3 Label Colour t/tffo ρ/g cm T/K ρ 0.08 ≃ 1 - 5.22 × 10−2 3.16 × 10−19 5.0 T 5K −18 −3 (47) "10 gcm # 2 black 8.43 × 10−1 1.68 × 10−18 5.7 × −16 (cf. Larson 1973; Low & Lynden-Bell 1976; Masunaga & 3 green 1.03038936 5.93 10 8.0 4 cyan 1.04755301 1.09 × 10−10 140 Inutsuka 2000; Larson 2005). 5 magenta 1.04940519 1.59 × 10−9 440 The cloud core starts heating more rapidly when it becomes 6 black 1.05153974 1.00 × 10−7 1270 optically thick. This continues until the the temperature reaches 7 green 1.05155811 3.30 × 10−4 5530 − − T ∼ 100K at density ρ ∼ 3 × 10 11 gcm 3, when the rotational 8 red 1.05155816 2.31 × 10−3 10210 degrees of freedom of H2 start to get excited, and hence the temperature increases more slowly with density (see the kink around T ∼ 100K in Fig. 7). As the temperature increases Masunaga & Inutsuka (2000) for the same purpose (see their further, the thermal pressure starts to decelerate the contrac- Fig. 1 and their Table 1). tion, and the first core is formed (Larson 1969; Masunaga et al. Fig. 9 shows the run of temperature against density at the 1998; Masunaga & Inutsuka 2000; Whitehouse & Bate 2006) instants defined in Table 2. During the early stages of the col- = at t 1.048 tffo, where tffo is the free-fall time at the start of lapse the variation of temperature with density mimics the evo- = 1/2 = × 5 collapse, i.e. tffo 3π/(32 G ρ0) 1.781 10 yr (see lution of the central temperature and density (see the green Fig. 8).   points in Fig. 9; points representing previous instants are over- The first core grows in mass, contracts, and heats up un- lapped). At later stages, the regions around the centre start heat- til the temperature reaches T ∼ 2, 000K, when H2 starts to ing at lower densities, as in the simulation of Whitehouse & dissociate. Consequently the compressional energy delivered Bate (2006). by contraction does not all go to heat the core; instead some In Figs. 10 through 12 we present the density, temperature of it goes into dissociating H2, and the second collapse starts. and radial infall velocity profiles at different instants during the This second collapse proceeds until almost all of the molecular evolution of the cloud. These profiles are very similar to those hydrogen at the centre has been dissociated. When the den- reported by Masunaga & Inutsuka (2000). The velocity profiles ∼ −3 −3 sity reaches ρ 10 gcm and the temperature rises above (Fig. 12) clearly show the formation of an accretion shock at T ∼ 10, 000K, the collapse again decelerates and the second core (i.e. the protostar) is formed (Larson 1969; Masunaga & Inutsuka 2000) at t = 1.052 tffo. At first, the second core pul- sates (see Fig 8 and Larson 1969), but eventually it settles down into quasistatic contraction. Due to computational constraints, the evolution is not followed further. The evolution of the core in our simulation is very similar to that obtained by Masunaga & Inutsuka (2000), as shown in > −6 −3 Fig.7. Differences at densities ∼ 5×10 gcm are attributable to the different opacities we use. The timescales in our simu- lation are also very similar to those obtained by Masunaga & Inutsuka (2000), as is shown in Fig. 8, where the evolution of the density at the centre of the cloud is plotted against time. The times computed from our simulation fit well with the times from the Masunaga & Inutsuka (2000) simulation if we syn- chronise the two simulations at density ρ = 4.34×10−13 gcm−3, to avoid discrepancies due to small differences in the initial conditions at the onset of the collapse. Fig. 9. The run of temperature against density at different in- stants during the cloud evolution (instants 2 to 8 in Table 2). 4.2. Snapshots during the cloud collapse The region around the centre of the cloud heats at lower densi- In order to describe the evolution away from the centre of the ties than the centre of the cloud. The density increases as time cloud, and to make a more detailed comparison with the re- evolves (black, green, cyan, magenta, black, green, red). For sults of the Masunaga & Inutsuka (2000) simulation, we fo- reference, we also plot the evolution of the temperature and cus on eight representative instants during the cloud evolution. density at the centre of the cloud in our simulation (lower solid Critical parameters at these instants are listed in Table 2. The black line) and in the Masunaga & Inutsuka (2000) simulation central densities have been chosen so as to match those used by (dashed black line). 10 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

the boundary of the first core at radius R ∼ 3 to 5AU. There is also an accretion shock at the boundary of the second core, initially at a radius of R ∼ 0.003AU, but later expanding to R ∼ 0.01AU (cf. Larson 1969).

4.3. Convergence We repeat this simulation using different numbers of SPH par- ticles, N, to check for convergence. We use N ≃ 2 × 104, 5 × 104, 105, and 2 × 105 (Fig. 13). The run of central temperature against central density is almost identical for different numbers of particles, and the results are fully converged up to densities ρ ∼ 0.003gcm−3 with N ∼> 105. Currently available supercom- puting facilities allow SPH simulations of star formation with upto3×107 particles, and so the convergencecondition quoted above can easily be met. Fig. 10. Density profiles at different instants during the cloud evolution (instants 2 to 8 in Table 2). The colour coding is the same as in Fig. 9.

Fig. 13. The run of central temperature against central den- sity during the evolution of a 1 M molecular cloud, simu- Fig. 11. Temperature profiles at different instants during the ⊙ lated using different numbers of SPH particles: N ≃ 2 × cloud evolution (instants 2 to 8 in Table 2). The colour cod- 104 (green), 5 × 104 (blue), 105 (cyan), and 2 × 105 (red). ing is the same as in Fig. 9. > 5 The results converge for N ∼ 10 . The black dashed line repre- sents the Masunaga & Inutsuka (2000) simulation.

5. Additional tests 5.1. Boss & Myhill (1992) The second test of our new method is to simulate the evo- lution of a 1.2M⊙ cloud with uniform initial density ρ = 1.7 × 10−19 gcm−3, uniform initial temperature T = 10K, and initial radius R = 1.5 × 1017 cm, as originally investigated by Boss & Myhill (1992). This problem has recently been revis- ited by Whitehouse & Bate (2006), using SPH with flux-limited diffusion. In our simulation we have N ≃ 1.5 × 105 SPH par- ticles. The evolution of the cloud is very similar to the evolu- tion already described in Section 4. Fig. 14 compares the run Fig. 12. Radial infall velocity profiles at different instants dur- of central temperature against central density which we obtain, ing the cloud evolution (instants 2 to 8 in Table 2). The colour with that obtained by Whitehouse & Bate (2006). There are coding is the same as in Fig. 9. three small differences. (i) In our simulation, the cloud starts D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 11

Fig. 14. Evolution of the central density and central tempera- Fig. 15. Evolution of the density and temperature at the densest ture for the Boss & Myhill (1992) test problem. The dashed part of a collapsing, rotating molecular cloud. The dashed line line corresponds to the Whitehouse & Bate (2006) simulation, corresponds to the Whitehouse & Bate (2006) simulation of the and the dotted lines define the different opacity regimes (see same problem. The results of our simulation are very close to Fig. 5). The results of our model are very close to the simu- those of Whitehouse & Bate (2006). Differences at densities > −6 −3 lation of Whitehouse & Bate (2006). Differences at densities ρ ∼ 5 × 10 gcm are attributable to different opacities. > −6 −3 ∼ 5 × 10 gcm are attributable to the use of different opaci- ties. the xy-plane at three instants during the evolution. The com- heating before it becomes optically thick (as reported also by ponents of the binary system are connected by a bar which Masunaga & Inutsuka (2000) in a similar test). In contrast, the subsequently fragments. If the collapse were isothermal, this Whitehouse & Bate (2006) cloud remains strictly isothermal bar should not show any tendency to fragment (e.g. Truelove during this phase. (ii) In the Whitehouse & Bate (2006) sim- et al. 1998; Klein et al. 1999; Kitsionas & Whitworth 2002). ulation the centre of the cloud heats up more rapidly at den- However, Bate & Burkert (1997) show that if the gas is allowed sities ρ ∼ 10−11 to 10−6 gcm−3, i.e. at lower densities than to heat, but the heating happens at sufficiently high densities, in our simulation. However, Masunaga & Inutsuka (2000) in ρ ∼> 0.3 × 10−13 gcm−3, then the bar does fragment. In our sim- a similar test also find lower temperatures than Whitehouse & ulation, the gas in the bar starts to heat up rapidly only when Bate (2006) in this regime. (iii) There are differences at densi- the density reaches ρ ∼ 7 × 10−13 gcm−3. Therefore the frag- ties ρ ∼> 5 × 10−6 gcm−3, which are attributable to the use of mentation of the bar is consistent with the predictions of Bate different opacities. These differences are small and the overall & Burkert (1997). However, we note that Whitehouse & Bate evolution of the cloud is similar in the two simulations. (2006) do not report any bar fragmentation.

5.2. Boss & Bodenheimer (1979) 5.3. Thermal relaxation The third test of our new method is to simulate the evolu- Finally, we test the time-dependence of our new method by tion of a rotating 1.2M⊙ cloud; the cloud initially rotates as simulating the relaxation of temperature fluctuations in a static a solid body with angular velocity Ω= 1.6 × 10−12 rads−1, and sphere with uniform density ρ = 10−19g cm−3 and radius R = so the ratio of rotational-to-gravitational energy is β = 0.26; 10, 000AU. We assume an equilibrium temperature of TO = the density includes an m = 2 perturbation, i.e. ρ = 1.44 × 10 K and an initial temperature perturbation of the form ∆T = 10−17 gcm−3[1 + 0.5 cos(2φ)], where φ is the azimuthal angle ∆TO sin(kr)/kr (Masunaga et al. 1998; Spiegel 1957), where in the plane perpendicular to the axis of rotation; the initial ra- ∆TO = 0.15K is the amplitude of the perturbation and k = dius of the cloud is R = 3.2 × 1016 cm and the temperature π/(2500 AU) is its characteristic wavenumber. Masunaga et al. is initially uniform at T = 12K; this problem was originally (1998) have shown that at subsequent times the temperature investigated by Boss & Bodenheimer (1979), and has recently should be been revisited by Whitehouse & Bate (2006). In our simulation 5 N ≃ . × sin(kr) − we have 1 5 10 SPH particles. Fig. 15 compares the T(r, t) = T + ∆T e ω(k)t , (48) evolution of the density and temperature of the densest part of O O kr the cloud in our simulation, with that obtained by Whitehouse & Bate (2006). The differences are again only small. where The result of the collapse is a binary with separation S ∼ κO −1 κO 500AU. In Fig. 16 we plot the density and the temperature on ω(k) = γ 1 − cot (49)  k  k  12 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

Fig. 16. Three instants from our simulation of the Boss & Bodenheimer test problem, at t1 = 0.02315 Myr, t2 = 0.02343Myr, and t3 = 0.025Myr (left to right). We plot the logarithmic density (top) and the logarithmic temperature (bottom), on the xy-plane, i.e. the plane perpendicular to the rotation axis. The central densities and central temperatures of the southern condensation are −12 −3 −10 −3 −3 −3 ρ1S = 1.2 × 10 gcm , T1S = 25K, ρ2S = 1.6 × 10 gcm , T2S = 150 K, ρ3S = 3.8 × 10 gcm , T3S = 10800K. The −13 −3 corresponding central densities and central temperatures of the northern condensation are ρ1N = 1.7 × 10 gcm , T1N = 18K, −12 −3 −10 −3 ρ2N = 2.4 × 10 gcm , T2N = 35K, ρ3N = 6.3 × 10 gcm , T3N = 780 K. is the relaxation rate, theoretical values (calculated from Eq. 49) are also plotted (red line and squares). 3 16 σSB κ T γ = O 0 , (50) ρ cV 6. Summary

κO is the opacity at the equilibrium temperature, and cV is the We have developed a new method to treat the influence of ra- heat capacity of the material. diative transfer on the energy equation in SPH simulations of In Figs. 17 to 20 we present the radial temperature pro- star formation. The method uses the density, temperature and files at different instants during the relaxation towards equi- gravitational potential of each particle to make an educated es- librium for spheres having different optical depths, τ = timate of the mean optical depth which regulates its heating and 0.1, 1, 10, and 100. The simulation results approximate well cooling. It can treat both the optically thin and optically thick to Eqn. (48). regimes. The relaxation rates are also reproduced well. In Fig. 21 The energy equation takes account of heating by compres- we present the dispersion relation, i.e. the relaxation rate ω(k) sion or cooling by expansion (i.e. PdV work); viscous dis- for different values of the ratio κO /k. We plot the relaxation sipation; external irradiation; and radiative cooling. In situ- rates for all the SPH particles that represent the uniform den- ations where the thermal timescale is much longer than the sity sphere, calculated at seven different snapshots during the dynamical timescale, the resulting thermal inertia effects are temperature relaxation (dots that saturate to form lines). The captured properly. Conversely, where the thermal timescale is D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation 13

Fig. 17. Thermal relaxation of a static, uniform sphere of opti- Fig. 19. Same as Fig. 17 but for a sphere of optical depth τ = cal depth τ = 0.1; seven instants are plotted, showing the tem- 10. perature relaxing to its equilibrium value Teq = 10K.

Fig. 20. Same as Fig. 17 but for a sphere of optical depth τ = Fig. 18. Same as Fig. 17, but for a sphere of optical depth τ = 1. 100.

To test the SPH-RT method we have examined the collapse much shorter than the dynamicaltimescale, we avoid very short ofa1M⊙ molecular cloud of initially uniform density and uni- timesteps, essentially by assuming thermal equilibrium. form temperature. The collapse proceeds almost isothermally The equation of state and the internal energy take account until the density in the centre rises above ρ ∼ 10−13 gcm−3. of (i) the rotational and vibrational degrees of freedom of H2, Then the temperature rises rapidly, the thermal pressure decel- and (ii) the different chemical states of hydrogen and helium erates the collapse, and the first core is formed. The first core (cf. Black & Bodenheimer 1975; Boley et al. 2007) grows in mass, and contracts quasistatically. When its temper- A simple parametrisation of the frequency averaged opac- ature reaches T ∼ 2, 000K, the H2 starts dissociating and the ity is used (Bell & Lin 1994), which reproduces the basic fea- second collapse starts, resulting in the formation of the second tures of more sophisticated opacity models (e.g. Preibisch et al. core, i.e. the protostar. Our method reproduces well the results 1993; Alexander & Ferguson 1994). This parametrisation ac- of the detailed simulation of Masunaga & Inutsuka (2000): the counts for the effects of dust sublimation, molecules, H−, free- first and the second cores form at similar densities, having sim- free transitions, and electron scattering ilar sizes, and at similar times after the start of the collapse. 14 D. Stamatellos et al.: Radiative transfer and the energy equation in SPH simulations of star formation

Bell, K. R., & Lin, D. N. C. 1994, ApJ, 427, 987 Benz, W. 1990, Numerical Modelling of Nonlinear Stellar Pulsations Problems and Prospects, 269 Benz, W. 1991, LNP Vol. 373: Late Stages of Stellar Evolution. Computational Methods in Astrophysical Hydrodynamics, 259 Black, D. C., & Bodenheimer, P. 1975, ApJ, 199, 619 Boley, A. C., Hartquist, T. W., Durisen, R. H., & Michael, S. 2007, ApJ, 656, L89 Bonnell, I. A. 1994, MNRAS, 269, 837 Boss, A. P., & Bodenheimer, P. 1979, ApJ, 234, 289 Boss, A. P., & Myhill, E. A. 1992, ApJS, 83, 311 Boss, A. P., Fisher, R. T., Klein, R. I., & McKee, C. F. 2000, ApJ, 528, 325 Chandrasekhar, S. 1939, Chicago, Ill., The University of Chicago Press Gingold, R. A.& Monaghan, J. J., 1977, MNRAS, 181, 375 Fig. 21. Dispersion relation for the thermal relaxation mode. Goodwin, S. P., Whitworth, A. P., & Ward-Thompson, D. 2004a, The relaxation rates (in units of γ) of all SPH particles at seven A&A, 414, 633 Goodwin, S. P., Whitworth, A. P., & Ward-Thompson, D. 2004b, different instants are plotted against the ratio κO /k (dots that saturate to form lines). The theoretical values (calculated from A&A, 423, 169 Eq. 49) are also plotted (red line and squares). Hubber, D. A., Goodwin, S. P., & Whitworth, A. P. 2006, A&A, 450, 881 Hubeny, I. 1990, ApJ, 351, 632 We have also performed the Boss & Myhill (1992) and Iglesias, C. A., & Rogers, F. J. 1996, ApJ, 464, 943 Boss & Bodenheimer (1979) tests, and obtained results very Kitsionas, S., & Whitworth, A. P. 2002, MNRAS, 330, 129 similar to those of Whitehouse & Bate (2006). Finally, we Klein, R. I., Fisher, R. T., McKee, C. F., & Truelove, J. K. 1999, ASSL have performed the thermal relaxation test of Masunaga et al. Vol. 240: Numerical Astrophysics, 131 Larson, R. B. 1969, MNRAS, 145, 271 (1998). The geometries treated in this paper establish the fi- Larson, R. B. 1973, Fundamentals of Cosmic Physics, 1, 1 delity of the method in treating both spherical and flattened Larson, R. B. 2005, MNRAS, 359, 211 geometries. Furthermore, the method also performs well on the Low, C., & Lynden-Bell, D. 1976, MNRAS, 176, 367 Hubeny (1990) test, which deals with equilibrium discs, and Lucy, L. B. 1977, AJ, 82, 1013 hence it can also be applied to disc simulations. We will dis- Masunaga, H., Miyama, S. M., & Inutsuka, S.-I. 1998, ApJ, 495, 346 cuss the Hubeny (1990) test, and applications of this method Masunaga, H., & Inutsuka, S.-I. 1999, ApJ, 510, 822 to discs in a forthcoming paper (Stamatellos & Whitworth, in Masunaga, H., & Inutsuka, S.-I. 2000, ApJ, 531, 350 preparation). Mayer, L., Lufkin, G., Quinn, T., & Wadsley, J. 2007, ApJ, 661, L77 The new SPH-RT method performsvery well, and most im- Monaghan, J. J. 1992, ARA&A, 30, 543 portantly it is very efficient. The computational time is almost Monaghan, J. J. 2005, Reports of Progress in Physics, 68, 1703 the same as (only ∼ 3% longer than) an SPH simulation us- Oxley, S. & Woolfson, M. M. 2003, MNRAS, 343, 900 Preibisch, T., Ossenkopf, V., Yorke, H. W., & Henning, T. 1993, A&A, ing a barotropic equation of state. The method is inherently 279, 577 three dimensional, and so it can be used to treat a variety of as- Spiegel, E. A. 1957, ApJ, 126, 202 trophysical systems, where the radiative processes and thermal Stamatellos, D., & Whitworth, A. P. 2005, A&A, 439, 153 inertia effects are important. We will report on applications of Stamatellos, D., Whitworth, A. P., Boyd, D. F. A., & Goodwin, S. P. the method in future publications. 2005, A&A, 439, 159 Truelove, J. K., Klein, R. I., McKee, C. F., Holliman, J. H., II, Howell, Acknowledgements. We would like to thank the referee, S. Inutsuka, L. H., Greenough, J. A., & Woods, D. T. 1998, ApJ, 495, 821 for his suggestions which helped to improve the original manuscript. Viau, S., Bastien, P., & Cha, S.-H. 2006, ApJ, 639, 559 The computations reported here were performed using the UK Whitehouse, S. C. & Bate, M. R. 2004, MNRAS, 353, 1078 Astrophysical Fluids Facility (UKAFF). We thank S. Whitehouse and Whitehouse, S. C., Bate, M. R., & Monaghan, J. J. 2005, MNRAS, M. Bate for kindly providing data from Whitehouse & Bate (2006), 364, 1367 C. Clarke, M. Bate, I. Bonnell and R. W¨unsch for useful discussions, Whitehouse, S. C., & Bate, M. R. 2006, MNRAS, 367, 32 and D. Price for the use of splash/supersphplot. We also acknowledge Whitworth, A. P., & Stamatellos, D. 2006, A&A, 458, 817 support by PPARC grant PPA/G/O/2002/00497. Whitworth, A. P., Chapman, S. J., Bhattal, A. S., Disney, M. J., Pongracic, H., & Turner, J. A. 1995, MNRAS, 277, 727 References Alexander, D. R., & Ferguson, J. W. 1994, ApJ, 437, 879 Attwood, R. E., Goodwin, S. P., & Whitworth, A. P. 2007, A&A, 464, 447 Bate, M. R. 1998, ApJ, 508, L95 Bate, M. R., & Burkert, A. 1997, MNRAS, 288, 1060