<<

Mon. Not. R. Astron. Soc. 000, 000–000 (0000) Printed 8 November 2017 (MN LATEX style file v2.2)

Single Implementation Notes

PFH

8 November 2017

1 METHODS 1/2 − 1 times the cloud diameter Lcloud) are driven as an Ornstein-Uhlenbeck process in Fourier space, with the com- Our simulations use GIZMO (?),1, and include full self- pressive part of the modes projected out via Helmholtz de- , adaptive resolution, ideal and non-ideal magneto- composition so that we can specify the ratio of compress- hydrodynamics (MHD), detailed cooling and heating ible and incompressible/solenoidal modes. Unless otherwise physics, formation, , and feedback in the specified we adopt pure solenoidal driving, appropriate for form of protostellar jets and radiative heating, and main- e.g. galactic shear (so that we do not artificially “force” com- sequence stellar feedback in the form of photo-ionization pression/collapse), but we vary this. The specific implemen- and photo-electric heating, radiation pressure, stellar winds, tation here has been verified in ????. and supernovae. A subset of our runs include explicit treat- The driving specifies the large-scale steady-state (one- ment of the dust particle and cosmic ray dynamics as well dimensional) turbulent velocity σ ≡ hv2 i1/2 and as radiation-hydrodynamics; otherwise these are included in 1D turb, 1D Mach number M ≡ h(v /c )2i1/2, where v is simplified form. turb, 1D s turb, 1D an (arbitrary) projection (in detail we average over all 1.1 Gravity random projections). Unless otherwise specified, we initial- ize our clouds on the linewidth-size relation from ?, with All our simulations include full self-gravity for gas, , −1 1/2 σ1D ≈ 0.7 km s (Lcloud/pc) and dust. The gravity solver in GIZMO is a heavily modi- fied version of the Tree-PM method in GADGET-3 (?). Be- 1.2.2 Magnetic Fields cause this is a Lagrangian code, there is no fixed “spatial Unless otherwise specified all simulations include magnetic resolution” for gas: gravitational force softenings scale adap- fields. An initially constant mean-field B0 is evolved with tively (in a fully-conservative manner; see ?) with the inter- the turbulence so that runs begin with fully-developed tur- particle separation and can (in principle) become arbitrarily 2/3 bulent field structure. By default, we take |B0| = 10 µG n4 small (such that the assumed gas distribution determining 4 −3 where n4 = hn0/10 cm i refers to the initial density of the the gravitational forces at the resolution limit is identical to cloud (n0); the local fields quickly grow and saturate with the assumption in the hydrodynamic equations). Softenings amplitudes h|B|2i1/2 ∼ 60 µG n2/3. We consider variations for star particles are set sufficiently small that they are al- 4 in the mean field strength. ways Keplerian, though we find no difference setting them adaptively based on a “nearest neighbors” distance to sur- 1.2.3 Non-Ideal Effects rounding gas particles. By default, we solve the ideal MHD equations, but (option- 1.2 Fluid Dynamics ally) include various non-ideal processes. These include: Our MHD simulations use the Lagrangian finite-volume (i) Non-ideal MHD: Ambipolar diffusion, Ohmic resi- “meshless finite mass” Godunov method in GIZMO, which tivity, and the Hall effect: in dense, neutral gas non-ideal captures advantages of both grid-based and smoothed- MHD effects can be important. All three effects are always particle hydrodynamics (SPH) methods. In ???? we con- integrated explicitly and treated self-consistently (for all sider extensive surveys of test problems in both hydrody- gas elements), with coefficients calculated on-the-fly inde- namics and MHD, and demonstrate accuracy and conver- pendently for all gas elements based on their temperature, gence in good agreement with well-studied state-of-the-art density, magnetic field strength, and ionization states of all regular-mesh finite-volume Godunov methods and moving- tracked ions and dust grains (accounting for the full grain mesh codes (e.g. ATHENA & AREPO; ??), especially for size spectrum, variable local dust-to-gas ratios, and locally super-sonic and sub-sonic MHD turbulence and instabilities variable abundance patterns, and the details of the followed such as the Hall MRI. local radiation and cosmic ray fields). For more details see § A1. 1.2.1 Turbulence (ii) Spitzer-Braginskii conduction & viscosity: In To reflect the turbulent formation and environment of re- hot gas (generated by shocks and feedback), conduction and alistic clouds, we drive turbulence on the largest (box-size) viscosity can be important. We solve the fully anisotropic scales in the simulation. The driving follows ?, using the conduction and viscosity equations as described in ?, us- method from ???: a small range of modes (wavelengths ing the standard (temperature, density, and ionization-state dependent) Spitzer-Braginskii conduction and viscosity co- efficients as detailed in ?. For details see § A2. 1 A public version of this code is available at http://www.tapir. (iii) Passive scalar (metal) diffusion: Because our de- caltech.edu/~phopkins/Site/GIZMO.html. fault hydrodynamic method follows finite-mass elements,

c 0000 RAS 2 PFH micro-physical diffusion of passive scalars (e.g. metals) in a meta-galactic background (from ?) together with local ra- turbulent ISM requires an explicit numerical diffusion term. diation sources (see feedback, below). We account for self- This is implemented following the standard diffusion opera- shielding with a local Sobolev/Jeans-length approximation tors in ?; for details see § A3. (integrating the local density at a given particle out to a Extensive tests of the numerical implementations of each Jeans length to determine a surface density Σ, then atten- of these terms are presented in ?. We showed there that uating the flux seen at that point by exp (−κν Σ)); this ap- the methods are higher-order accurate, fully conservative, proximation has been calibrated in full radiative transfer competitive with state-of-the-art fixed-grid methods (in e.g. experiments in ? and ?. At high densities the ionization is ATHENA), and can correctly capture the linear and non- dominated by cosmic rays: we therefore also self-consistently linear behavior of anisotropic-diffusion-driven instabilities compute the ionization state and grain charges following ? such as the magneto-thermal, heat-flux bouyancy-driven, (as described in § A1) for a mostly-neutral gas with a mix- and Hall-magnetorotational instabilities. In contrast, histor- ture of electrons, ions, neutrals, cosmic rays, and dust grains, ical implementations of these physics in SPH methods tend and adopt this as our default when it yields a larger free to artificially suppress these instabilities (or can be numeri- electron fraction. cally unstable). High-temperature (> 104 K) metal-line excitation, ion- ization, and recombination rates then follow ?. Free-free, bound-free, and bound-bound collisional and radiative rates 1.2.4 Dust & Metals for H and He follow ? with the updated fitting functions in ?. Photo-electric rates follow ?, accounting for PAHs and local Our simulations separately track 11 metal species as de- variations in the dust abundance. Compton heating/cooling scribed above for the cooling physics. We assume initially (off the combination of the CMB and local sources) follows uniform abundances, with total metal abundance Z and so- ? (allowing in principle for two-temperature plasma effects, lar abundance ratios. Enrichment from stellar winds and although these are not important here). Fine-structure and supernovae, when they occur, follows (?): the appropriate molecular cooling at low temperatures (5 − 104 K) follows a metal yields tabulated from ? are injected into the exact pre-computed tabulation of CLOUDY runs as a function of same gas elements surrounding the star as the correspond- density, temperature, , and local radiation back- ing mass, momentum, and energy. Unresolved metal diffu- ground (see ?). Collisional dust heating/cooling rates fol- sion between gas elements can be optionally modeled as de- low ? with updated coefficients from ? assuming a mini- scribed in § 1.2.3. mum grain size of 10 A,˚ and dust temperatures calculated By default, we assume a constant dust-to-metals ratio, below. Cosmic ray heating follows ? accounting for both giving dust-to-gas mass ratio f = 0.5 Z, for computing all dg hadronic and Compton interactions, with the cosmic ray dust-based quantities. background estimated as described below. Hydrodynamic However, in a subset of runs, we explicitly model the heating/cooling rates (including shocks, adiabatic work, re- dust dynamics following ?. ??? connection, resistivity, etc.) are computed in standard fash- ion by the MHD solver; this is incorporated directly into our fully-implicit solution rather than being operator-split, 1.2.5 Cosmic Rays since operator-splitting can lead to large errors in tempera- By default, we assume a uniform cosmic ray ionization rate ture in the limit where the cooling time is much faster than ζ = 10−17 s−1, which we can freely vary. the dynamical time. In a subset of runs, we explicitly model the cosmic ray At sufficiently high densities, gas becomes optically dynamics. ??? thick to its own cooling radiation. In simulations with ex- plicit multi-frequency radiative transfer, described below, this can be handled explicitly. In our default simulations, 1.2.6 Radiation however, we can accurately approximate the optically-thick cooling limit following ? (the relevant approximations are ??? checked against exact results for proto-planetary disks in ???).2 1.3 Cooling & Heating Physics

The cooling physics here has been described in sev- 2 Following ?, each gas element is treated as a midplane element eral previous papers (?). Gas heating & cooling is embedded in an optically thick slab with surface density Σslab solved following a fully-implicit algorithm, as in ?. calculated according to our previous Sobolev approximation. We Heating/cooling rates are computed explicitly including: assume it is in LTE, which relates the temperature change at free-free, bound-bound, photo-ionization, recombination, midplane to surface radiation by way of the optical depth, us- Compton, photo-electric, metal-line, fine-structure, molec- ing the equations in Appendix A therein. To good approxima- ular, dust-gas collisional, cosmic ray, and hydrodynamic tion, the heating/cooling rate per element is “capped” at the maximum value |dE/dt| = σ T 4 (Σ /µ)−1/(1 + κ Σ ), (shocks/compression/expansion) processes. We separately mid slab R slab where T = T is the element or “midplane” temperature, µ the track 11 species (H, He, C, N, O, Ne, Mg, Si, S, Ca, Fe) as mid mean molecular weight, and κR the Rosseland mean opacity. We well as dust and cosmic rays. calculate κR at low temperatures from the tables in ?; at high Ionization states and molecular fractions are computed temperatures (> 1500 K) we explicitly tabulate the Thompson, from CLOUDY simulations assuming collisional+photo- molecular-line, H− ion, Kramers, and e− conductivity terms as ionization equilibrium, including the effects of a uniform in ?.

c 0000 RAS, MNRAS 000, 000–000 Single Star Notes 3

A 5 K temperature floor is enforced, although this has (ii) Diffuse Accretion: If e.g. the initial protostellar no detectable effect on our conclusions. mass is small, it may be impossible to resolve accretion via 1.4 “Protostellar” Sink Particles (i) above. We therefore estimate the accretion radius: GM Dense, self-gravitating gas can collapse below our resolution sink Racc ≡ 2 2 2 (1) limit, at which point it is treated via a standard sink-particle cs + vA + h|vgas − vsink| i approach; these sink particles represent accreting sites of 2 where the surrounding gas properties (cs, ρ, h|vgas −vsink| i) protostar formation and so act, in turn, back on the medium are computed via a kernel-weighted mean from the gas par- from which they formed. ticles surrounding the sink. If the gas is smooth on sub- 1.4.1 Sink Formation resolution scales, then that within Racc is bound; so if Racc is unresolved (smaller than the kernel search radius), we add a Following ?, a gas resolution element (cell or particle) is con- continuous mass accretion following Bondi-Hoyle-Lyttleton verted to a sink particle when it meets the following criteria: theory: (i) Self-gravitating: We require the cell is locally self- M˙ ≡ 4π ρ R2 v (R ) (2) gravitating. Specifically, ??? BHL acc ff acc

(ii) Local extremum: We only allow sink formation if The sink grows continuously by M˙ BHL ∆t in a timestep ∆t, the particle is a local density maximum among its ∼ 32 near- algorithmically implemented following ?. Note that if Rracc est neighbors. As shown in ?, this prevents spurious forma- is resolved, this is in the regime where our “resolved gravita- tion of multiple sink particles in a single resolution element tional capture” method should correctly identify accretion, that should collapse to form one object. We have alterna- so we set M˙ BHL = 0. tively considered requiring a local potential minimum, but (iii) Sink Mergers: ??? this adds considerable computational expense and gives in- distinguishable results in our tests. From Gravitational Capture to the Protostar: (iii) High-density: The gas must exceed a minimum The above criteria (i)-(ii) govern gravitational capture of density n > nthreshold. We typically adopt nthreshold = gas. Once captured, however, this is not immediately ac- 100 n0. creted onto a protostar. We therefore divide the sink mass (iv) Self-shielding: The gas must be shielded from am- into two components: Msink = Mps + Mdisk, a “proto- bient UV radiation so it can cool. We adopt the column- star” mass Mps and a “reservoir” mass Mdisk (which rep- density and metallicity-dependent threshold from ?; this is resents some combination of and unresolved trivially satisfied for almost all gas that meets our density collapsing core). At sink formation, Mps = 0, and when- and self-gravity criteria. ever Msink increases, the mass is added to Mdisk. We there- (v) Jeans unstable: We require a Jeans mass ??? fore require some prescription to transfer mass from Mdisk (vi) Converging flow: The local velocity divergence to Mps. We have considered (i) instantaneous transfer ev- ˙ 3 (centered on the element) must satisfy ∇ · v < 0. This is ery timestep (no “reservoir”), (ii) constant Mps = cs/G, usually satisfied given the self-gravity criterion above but as long as Mdisk > 0, (iii) constant disk depletion rate ˙ 5 prevents spurious sink formation in transient events. Mps = Mdisk/tdep with tdep ∼ 10 yr, (iv) infall at the ˙ (vii) No duplication: Sink formation is prohibited if free-fall velocity Mps = Mdisk/tff (Racc), and (v) a ?-type α- there is another sink particle within the resolution element disk with some “effective viscosity,” following ? for gravito- (i.e. within the radius including the nearest ∼ 32 gas ele- turbulent viscosity and assuming the disk is truncated where ˙ 2 ments). Q < 1, giving Mps ∼ (Mdisk/tdep)(Mdisk/Msink) . We find the specific choice has little effect, except (i) gives artificially If all of these criteria are met, a gas particle is instantly “bursty” accretion which produces spurious noise in the dust converted into a sink particle, conserving mass. temperature; we adopt (v) as our default. 1.4.2 Sink Growth 1.4.3 Protostellar Feedback from Sinks Once formed, sinks can grow via two accretion channels: (i) Jets: launch jets. We assume (i) Resolved Gravitational Capture: If a gas element ??? b is explicitly resolved and bound to the sink, it is imme- (ii) Dust Heating: Radiation from protostars can heat diately captured by the protostar. We require (1) that the dust; to model this we require the L of each pro- element have velocity relative to the sink below the Kep- tostar, which we take as the maximum of the accretion (Lacc) lerian escape velocity |vb − vsink| < vesc(Msink, rb) where and/or pre-main sequence luminosity (Lpms). For protostars rb ≡ |xb − xsink|; (2) that it be bound to the sink plus local above the Deuterium burning limit, Mps > 0.013 M , we −7 2 gas enclosed if we spread the mass in the particle such that take Lacc = 5 × 10 M˙ ps c , which corresponds to the stan- it forms an isothermal sphere around the sink: Ethermal, b + dard linear size-mass relation with Rps ∼ 5 (Mps/M ) (see 2 2 EB, b + (mb/2) |vb − vsink| < 2 GMsink/rb + 4π G ρb rb ; and e.g. ?). Below the Deuterium burning limit, we include only (3) that the apocentric radius of the orbit of b (assuming a the gravitational energy released by surface accretion, as- Keplerian test-particle orbit about the sink with the given suming a constant Jupiter-density size-mass relation, giving −8 2/3 rb and |vb − vsink|) is less than twice the resolution scale Lacc = 5 × 10 (Mps/MJ ) . To be conservative, we take (the kernel search radius around the sink). If a gas element Lpms from a simple zero-age relation (likely b meets this criteria for more than one sink particle it is ac- to under-estimate the luminosity for creted onto whichever dominates the local acceleration (i.e. accretion to the surface of a Jupiter-density 2 larger value of Msink/|xb − xsink| ). ???

c 0000 RAS, MNRAS 000, 000–000 4 PFH

(iii) Radiation Pressure: (vi) Cosmic Rays: Following ?, if we enable explicit ??? tracking of cosmic rays (§ 1.2.5), then whenever fast winds −1 (vwind > 500 km s , though the exact choice is not impor- tant) and/or SNe are coupled to gas surrounding a star, we 1.5 “Star” Particles assume a fixed fraction = 10% of the kinetic energy goes 1.5.1 Promotion into the cosmic ray component. (vii) Supernovae: SNe are implemented following ?. At the end of their pre-main sequence lifetime, we “pro- If a star with M∗ > 8 M reaches the end of its mote” our proto-stellar particles to zero-age main sequence main-sequence lifetime (simply estimated as tMS ≈ (ZAMS) stars. The pre-main sequence lifetime is calculated −1 9.6 Gyr (M∗/M )(L∗/L ) ), it explodes. The entire re- based on the Kelvin-Helmholtz time, with the simple toy maining mass goes into ejecta (i.e. we ignore relics), with model described in Appendix ??. Directly using tabulated kinetic energy 1051 erg, and metal yields calculated from ?. fits to models from MESA gives a similar The detailed coupling is numerically identical to that for result for our purposes. Roughly, the typical lifetimes scale winds. −2.5 as ∼ 50 Myr (Mps/M ) . At this point, accretion and protostellar jets are ter- minated, we assume the remainder of the accretion disk is APPENDIX A: NON-IDEAL FLUID TERMS dispersed, and the stars begin to follow standard stellar evo- lution tracks. A1 Non-Ideal MHD

1.5.2 Feedback Astrophysical non-ideal MHD includes Ohmic dissipation, the Hall effect, and ambipolar diffusion. All appear as diffu- Stars act on the gas via several mechanisms: sion operators in the induction equation; if we operator-split the ideal MHD term (already solved in GIZMO), we have (i) Dust Heating: The stars continue to heat dust; this is followed in the same manner as in § 1.4.3. We assume each dB h     i = −∇ × ηO J + ηH J × Bˆ − ηA J × Bˆ × Bˆ star of mass M∗ emits blackbody radiation with luminosity: dt (A1)  0 (m < 0.012)  where J = ∇ × B. The diffusivities ηO,H,A govern Ohmic  2 0.185 m (0.012 < m < 0.43) resistivity, the Hall effect, and ambipolar diffusion, respec- L  ∗ = m4 (0.43 < m < 2) (3) tively, and are given by the general expressions: L  3.5 2 1.5 m (2 < m < 53.9) c 1  ηO ≡ (A2) 32000 m (53.9 < m) 4π σO 2 c σH where m ≡ M∗/M ; we assume a size-mass relation R∗ = ηH ≡ 2 2 (A3) β 4π σH + σP R m with β ≈ 0.738 to calculate the effective temperature 2   c σP 1 Teff (M∗). ηA ≡ 2 2 − (A4) (ii) Radiation Pressure: This also continues to act per 4π σH + σP σO e c X § 1.4.3, but now using the ZAMS luminosity and spectrum. σ ≡ n |Z | β (A5) O B j j j (iii) Photo-Electric Heating: This is followed as in ?. j Given L∗ and Teff , we estimate the production of photons e c X nj Zj from each star with energies X − Y ??? eV, and follow their σH ≡ (A6) B 1 + β2 transport per § 1.2.6. This is used to define the local radi- j j ation field seen by each dust grain, which determines the e c X nj |Zj | βj σ ≡ (A7) heating rate following ?. P B 1 + β2 j j (iv) Photo-Ionization Heating: This is followed as in |Z|j e B ?. Given L∗ and Teff , we calculate the ionizing photon pro- βj ≡ (A8) duction rate Q from each star, and follow transport of these mj c νj photons per § 1.2.6. This is combined with the metagalactic where σO,H,P are the Ohmic, Hall, and Pedersen conduc- UV background as described in § 1.3 to self-consistently de- tivities, the index j sums over the different relevant species termine the photo-ionization heating rate and gas ionization in the fluid (here ions, electrons, neutrals, and dust grains, state. e, i, n, g, respectively), Zn = 0, Ze = −1, Zi = +1 and Zg (v) Winds: ???? Stuff are the mean neutral/electron/ion/grain charges, mn, e, i, g the electron/ion/grain mass (mn = µ mp is calculated us- ˙ 1/α  7/8 Mwind −9 α (q K) L∗ 0.185 ing the appropriate mean molecular weight µ for the ele- −1 = 2.34 × 10 m (4) M yr q L ment abundances, temperature, and molecular fraction de- 3 (1 − α)Γ termined in the cooling chemistry, and mg = (4π/3) a ρ¯g q ≡ (5) g 1 − Γ with ag the grain radius andρ ¯g the internal grain material α ≈ 0.5 + 0.4 (1 + 16 m−1)−1 (6) density), nn, e, i, g the number density of each species (with mean number density n = ρ/(µ mp) and ng = mn fdg n/mg where K ≈ 1/30 and the weak dependence of α on mass with fdg the dust-to-gas ratio by mass), mp is the proton are calibrated to observations and Γ = L∗/LEdd(M∗) is the mass, e the electron charge, c the speed of light, and B = |B| Eddington factor. the of the magnetic field.

c 0000 RAS, MNRAS 000, 000–000 Single Star Notes 5

At the densities and temperatures of interest, the colli- equations: sion frequencies νe, i, g are given by:   −1.5 3 −1 SB ˆ ˆ Fe = κ B B · ∇u + Π · v (A19) νe = 0.051 ne T100 cm s (A9)  0.65 0.5 SB ρn 5.15 T100 + 1.06 T100 3 −1 Fp = Π ≡ 3 ν K [K :(∇ ⊗ v)] (A20) + 9 cm s 10 (mn + me) 1 K ≡ Bˆ ⊗ Bˆ − I (A21) ρe −1.5 3 −1 3 νi = 0.051 ne T100 cm s (A10) ρi 5/2 0.96 (kB T ) −1  1 1  κ = (1 + 4.2 `e/`T ) (A22)  m  2  m  2 1/2 4 p p me e ln Λ ρn 1.91 µ + 0.31 µ i−H2 i−He 3 −1 0.406 m1/2 (k T )5/2 + 9 cm s i B −1 10 (mn + mi) ν = 4 (1 + 4.2 `e/`T ) (A23) (Zi e) ln Λ 2  1/2 π ag δgn ρn 128 kB T νg = (A11) (mn + mg) 9π mn where ⊗ denotes the outer product, Bˆ is the direction of where the terms in νe and νi represent electron-ion, the magnetic field vector, I is the identity matrix, v the electron/ion-H2, and electron/ion-He collisions, respectively, velocity, u the specific internal energy, : denotes the double- with assumed H, He abundances ≈ 0.76, 0.24 (changing this dot-product (A : B ≡ Trace(A · B)), ln Λ ≈ 37.8 is the has negligible effects), and T100 ≡ T/100 K; in νg, δgn ≈ 1.3 Coulomb logarithm (?), `e is the electron mean-free path, is the Epstein coefficient for spherical grains (?). and `T = T/|∇T | is the temperature gradient scale length. We follow ? and assume the grains have a non-evolving In these equations, κ is the conductivity, and ν the viscosity size distribution, and that the system obeys global charge (with Π the viscous tensor). Details of the coefficients are in neutrality and local ionization equilibrium: this allows us to (Su et al., in prep.). calculate a k T Z ≡ −ψ g B (A12) g e2  (m /m )1/2  A3 Turbulent Diffusivity ψ = α exp (ψ) − i e (A13) 1 + ψ In some “sub-grid” models for turbulence, the effects of un- 2 1/2 2 resolved eddies are treated as diffusion processes. Following ζ e me mg α ≡ 1/2 3 2 3/2 2 (A14) ?, we can approximate the “eddy diffusivity” as (8π) ag fdg (kB T ) mn n

ζ n 2 ni = (A15) D ≡ (C ∆x) kSk (A24) kig ng ζ n ne = (A16) where C ≈ 0.15 is a constant calibrated to numerical sim- keg ng ulations in ?, ∆x is the grid scale (for our MFM method,  1/2 2 8 kB T this is equal to the rms inter-element spacing), and S ≡ kig ≡ π ag (1 + ψ) (A17) T π mi [(∇ ⊗ v) + (∇ ⊗ v) ] − Trace(∇ ⊗ v)/3 is the symmetric shear tensor.  8 k T 1/2 k ≡ π a2 B exp (−ψ) (A18) With this enabled, we can treat sub-grid diffusion of eg g π m e internal energy and momentum using our standard conduc- where kB is the Boltzmann constant, T is the gas kinetic tion and viscosity equations but adding this “turbulent dif- temperature, kig, eg are the coefficients for ion-grain and fusivity” to the physical conductivity and viscosity. Passive electron-grain collisions respectively. scalars, in particular metals, are also diffused, even where For the grains, we assume an effective size ag = 0.1 µm, there is no mass flux, with ∂Z/∂t = −∇ · (D ∇Z). Since −3 material densityρ ¯g = 3 g cm (typical of both silicate the abundance of ions and electrons is determined every and carbonaceous grains), and constant dust-to-metals ra- timestep from the element MHD properties assuming local tio fdg = 0.01 (Z/Z ). For reasonable values, these choices equilibrium, we do not need to explicitly treat their diffu- only weakly influence the coefficients ηO,H,A, compared to sion. the values of n, T , and ζ. We assume that at low tempera- tures and high densities, the ions are dominated by Mg, so mi = 24.3 mp (at high temperatures, lighter ions become im- portant, but this only changes the diffusivities where they are dynamically irrelevant; explicitly assuming mi = mp above 200 K, for example, we obtain identical conclusions). APPENDIX B: DUST DYNAMICS This completely determines the non-ideal MHD coefficients, In ???, we describe in detail the numerical implementation given the MHD state of the gas and ζ. and algorithmic as well as physical tests of explicit dust dy- namics. Briefly, the dust is treated as a collection of “super- A2 Spitzer-Braginskii Viscosity and Conduction particles,” each one of which represents a collection of grains As detailed in ?, the implementation of Spitzer-Braginskii of similar size whose trajectory is explicitly integrated in the viscosity and conduction in GIZMO adds the following addi- code according to the equations of motion for grains of that tional energy and momentum fluxes to the standard MHD size. We explicitly include drag, Lorentz, radiation pressure,

c 0000 RAS, MNRAS 000, 000–000 6 PFH and gravitational forces, i.e. tion for the CR energy density ecr is

∂ecr =(v + vst) · ∇Pcr − ∇ · [(v + vst)(ecr + Pcr)] dvg ∂t = adrag + aLor + arad + agrav (B1) dt + ∇ · [vdi ecr] − Γcr +e ˙∗ (C1) (vg − ugas) adrag = − (B2) Pcr = (γcr − 1) ecr (C2) ts ˆ ! " 1 #−1 2 2 1/2 B · ∇Pcr 1/2  2  2  ˆ π ρ¯g ag 9π s αc (ni/n) vst = − cs + vA B (C3) ts ≡ 1 + + |∇Pcr| 1/2 4 s3 8 cs ρgas 64 1 + 3π1/2 ! Bˆ · ∇ecr Zg e vdi = κdi Bˆ (C4) aLor = (vg − ugas) × B (B3) ecr mg c 2 ˜ −16 −1  nH  π ag Q Γcr = 7.51 × 10 s ecr (1 + 0.22n ˜e) (C5) arad = Frad (B4) cm−3 mg c 2 vcr rg Bcoherent κdi ∼ 2 (C6) 3 Brandom(rg) where dvg/dt is a Lagrangian derivative, vg the grain veloc- 1 2 2   3   3 1/3 28 cm µG Ldrive ity, ug the gas velocity, s ≡ |vg − ugas|/cs, Zg is the grain ∼ 3 R × 10 GV s |B| kpc charge (determine as described in § A1), Frad the net inci- dent radiation flux (computed as described in the text), and where Pcr is the CR pressure, v is the gas speed, vst is Q˜ is the dimensionless, flux-integrated absorption efficiency the CR streaming speed, cs the sound speed, vA the Alfven which we take to be unity for simplicity. The second term in velocity (so |vst| scales as cs when vA  cs and vA when ts accounts for Coulomb interactions (with αc ≈ 11.2 from cs  vA), Bˆ = B/|B| where B is the magnetic field vector, ?); we include it for completeness but it is only important at 4 vdi is a diffusion speed with κdi the CR diffusion coefficient. temperatures T  10 K. The gravitational force agrav (and The first terms here includes advection and adiabatic self-gravity from dust) is treated identically to our other effects; advection with gas follows trivially from our La- particle types. grangian code; adiabatic CR compression/expansion, and We do not explicitly follow grain formation, destruc- work done on the gas, are accounted for self-consistently in tion, or size evolution, since these are both highly uncertain the Riemann problem. The streaming terms account for the and, in most models, produce evolution on longer timescales CR streaming instability; in this form the streaming terms than we are interested in here. However we will study how resemble a diffusion equation and we solve them as such. the grain dynamics can modify these evolution equations Note that the vst · ∇Pcr term represents heating due to self- on longer timescales. Dust-dust collisions are always sub- excited waves that are rapidly damped in the plasma, which dominant to dust-gas drag in the dynamics equations for produce an energy loss from the CRs which we assume is the dust (although they can be important for dust size evo- rapidly thermalized so is added as a gas-heating term. lution). And we ignore back reaction from the dust on the The diffusion coefficient κdi is more uncertain; we have gas, which is only important when the local dust-to-gas ratio also considered adopting a simple constant, Milky Way-like exceeds unity. 28 2 −1 value of κdi ∼ 3×10 cm s , and find this makes no differ- We assume a constant grain material densityρ ¯g = ence to our major conclusions. This is not surprising given −3 3 g cm and populate a grain size distribution from ∼ that CRs do not qualitatively alter our results or appear to 0.1 − 10 µm. Smaller grains are very tightly coupled and dominate the feedback. But for our default we use the stan- we assume they move with the gas. dard turbulent diffusivity; here Bcoherent and Brandom(rg) represent the coherent mean B-field and random compo- nent on the scale rg of the gyro radius of CRs; assuming vcr ∼ c, a constant RGV ∼ 1 magnetic rigidity in giga- volts (which determines rg), and a Kolmogorov spectrum 2 for Brandom with driving scale of order the pressure gradi- ent scale length (Ldrive ∼ P/|∇P |), we obtain the second expression for κdi, which is used in the simulations here. APPENDIX C: COSMIC RAYS Γcr is the loss rate of CRs to gas and radiation, here from ? including combined hadronic plus Coulomb losses; A detailed series of papers on our numerical treatment of nH is the hydrogen number density andn ˜e is the number CRs and their consequences for and of free electrons per hydrogen nucleus. Following their es- will be the subject of future work (in preparation). Here timate, 1/6 of the hadronic losses and all of the Coulomb we briefly outline the key physical equations being solved, losses are assumed to be thermalized and appear as a gas as, for our implementation here, these have all appeared in heating term. This makes it clear how ecr is directly re- previous work. lated to the cosmic ray ionization rate ζ defined in the text CRs are approximated as a single-species, ultra- and needed for ionization calculations: for our definitions −17 −1 −3 relativistic (γcr = 4/3) fluid. In the code we evolve the con- ζ ≈ 10 s [ecr/1.3 eV cm ]. Finally,e ˙∗ represents in- served variable Ecr, i, the total CR energy associated with jection via stellar feedback (described above). particle i. We follow ?? in our implementation, with some Note that the equations here include the proper cou- significant improvements. Following ?, the evolution equa- pling of the CRs to magnetic fields. Unlike many previous

c 0000 RAS, MNRAS 000, 000–000 Single Star Notes 7 studies, we include this and solve the fully anisotropic diffu- where R0 is an arbitrary (large) initial radius (which has sion equations. A detailed comparison of numerical methods almost no effect on our results, since so long as it is large, for anisotropic diffusion in mesh-free codes is in preparation, initial contraction of new material is very fast), taken to but the results in GIZMO agree very well, on all tests, with be R0 ≡ 100 R m, and tc is the contraction time. On the those from ATHENA. (Rps > Rcrit), we assume contraction at con- 0.55 stant effective temperature, Teff = 4000 K m , and on the APPENDIX D: Henyey track (Rps ≤ Rcrit), contraction at constant lumi- D1 Protostars nosity LHenyey, giving:  1.45 −3 The moment a sink particle is formed, a “protostar” of zero 80.21 Myr m rps (Rps > Rcrit)    mass and zero size is created at its center. The protostar then tc = 2 −1 L 18.15 Myr m rps (Rps ≤ Rcrit) evolves continuously to higher masses and non-zero sizes as LHenyey it accretes mass from the “reservoir” (described in the text) (D8) of mass which has been swallowed by the sink. rps ≡ Rps/R Each such protostar begins on the Hayashi track. The mass evolves only via accretion. The size evolves according We consider the proto-star to reach the main-sequence to a combination of accretion and contraction. If the star is “ignition” radius (where contraction should halt) when we 0.8 0.57 accreting sufficiently rapidly, it will increase in radius owing reach the radius rps ≤ m for m < 1 or rps ≤ m for to the new material – however as soon as accretion slows m ≥ 1. At that point we promote the proto-star to a “star.” down, contraction takes over. For simplicity, on the Hayashi D2 Main-Sequence Stars track (neglecting accretion) we assume contraction at con- stant effective temperature. Eventually the star contracts Once on the main sequence, stars are not allowed to accrete, and are assigned a luminosity L∗ = LZAMS (Eq. D4). to a radius Rcrit, where it reaches the Henyey track, from which point it contracts at approximately constant luminos- ity. Eventually it contracts to the zero-age main sequence (ZAMS) size, at which point we “promote” the proto-star (sink) to a zero-age “star.” At any point during the protostellar phase, the lumi- nosity is the sum of accretion & internal luminosities:

Lps ≡ Lacc + Linternal (D1) where the accretion luminosity is given by 2 Lacc ≡ r M˙ ps c (D2) ( 5 × 10−7 (m ≥ 0.012) r = −8 2/3 5 × 10 (Mps/MJ ) (m < 0.012)

m ≡ Mps/M and the internal luminosity depends on whether the proto- star is on the Hayashi track ( LHayashi (Rps > Rcrit) Linternal = (D3) LHenyey (Rps ≤ Rcrit)

LHenyey ≈ LZAMS(Mps) (D4)  0 (m < 0.012)  2 0.185 m (0.012 < m < 0.43) L  ZAMS = m4 (0.43 < m < 2) L  3.5 1.5 m (2 < m < 53.9)  32000 m (53.9 < m)  2 Rps 0.55 LHayashi ≈ LKH = 0.226 L m (D5) R

Rcrit ≡ Rps[LHayashi = LHenyey | m] (D6) The luminosity at each time is taken to be a blackbody 4 2 with effective temperature Teff = Lps/(4π σB Rps). The protostellar radii are evolved explicitly for each pro- tostar, according to contraction and new accretion (where the new material comes in with large radius):

Rps M˙ ps R˙ ps = − + (R0 − R) (D7) tc(Rps, ...) Mps

c 0000 RAS, MNRAS 000, 000–000