radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. aims: we...

16
Zurich Open Repository and Archive University of Zurich Main Library Strickhofstrasse 39 CH-8057 Zurich www.zora.uzh.ch Year: 2011 Radiation hydrodynamics with adaptive mesh refinement and application to prestellar core collapse. I. Methods Commerçon, B ; Teyssier, R ; Audit, E ; Hennebelle, P ; Chabrier, G Abstract: Context. Radiative transfer has a strong impact on the collapse and the fragmentation of prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code. The method is designed for astrophysical purposes, and in particular for protostellar collapse. Methods: We present the solver, using the co-moving frame to evaluate the radiative quantities. We use the popular flux-limited diffusion approximation under the grey approximation (one group of photons). The solver is based on the second-order Godunov scheme of RAMSES for its hyperbolic part and on an implicit scheme for the radiation diffusion and the coupling between radiation and matter. Results: We report in detail our methodology to integrate the RHD solver into RAMSES. We successfully test the method in several conventional tests. For validation in 3D, we perform calculations of the collapse of an isolated 1 Mȯ prestellar dense core without rotation. We successfully compare the results with previous studies that used different models for radiation and hydrodynamics. Conclusions: We have developed a full radiation-hydrodynamics solver in the RAMSES code that handles adaptive mesh refinement grids. The method is a combination of an explicit scheme and an implicit scheme accurate to the second-order in space. Our method is well suited for star-formation purposes. Results of multidimensional dense-core- collapse calculations with rotation are presented in a companion paper. DOI: https://doi.org/10.1051/0004-6361/201015880 Posted at the Zurich Open Repository and Archive, University of Zurich ZORA URL: https://doi.org/10.5167/uzh-48287 Journal Article Accepted Version Originally published at: Commerçon, B; Teyssier, R; Audit, E; Hennebelle, P; Chabrier, G (2011). Radiation hydrodynamics with adaptive mesh refinement and application to prestellar core collapse. I. Methods. Astronomy Astrophysics, 529:A35. DOI: https://doi.org/10.1051/0004-6361/201015880

Upload: others

Post on 24-Feb-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

Zurich Open Repository andArchiveUniversity of ZurichMain LibraryStrickhofstrasse 39CH-8057 Zurichwww.zora.uzh.ch

Year: 2011

Radiation hydrodynamics with adaptive mesh refinement and application toprestellar core collapse. I. Methods

Commerçon, B ; Teyssier, R ; Audit, E ; Hennebelle, P ; Chabrier, G

Abstract: Context. Radiative transfer has a strong impact on the collapse and the fragmentation ofprestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for theRAMSES code. The method is designed for astrophysical purposes, and in particular for protostellarcollapse. Methods: We present the solver, using the co-moving frame to evaluate the radiative quantities.We use the popular flux-limited diffusion approximation under the grey approximation (one group ofphotons). The solver is based on the second-order Godunov scheme of RAMSES for its hyperbolic part andon an implicit scheme for the radiation diffusion and the coupling between radiation and matter. Results:We report in detail our methodology to integrate the RHD solver into RAMSES. We successfully test themethod in several conventional tests. For validation in 3D, we perform calculations of the collapse of anisolated 1 Mo prestellar dense core without rotation. We successfully compare the results with previousstudies that used different models for radiation and hydrodynamics. Conclusions: We have developed afull radiation-hydrodynamics solver in the RAMSES code that handles adaptive mesh refinement grids.The method is a combination of an explicit scheme and an implicit scheme accurate to the second-orderin space. Our method is well suited for star-formation purposes. Results of multidimensional dense-core-collapse calculations with rotation are presented in a companion paper.

DOI: https://doi.org/10.1051/0004-6361/201015880

Posted at the Zurich Open Repository and Archive, University of ZurichZORA URL: https://doi.org/10.5167/uzh-48287Journal ArticleAccepted Version

Originally published at:Commerçon, B; Teyssier, R; Audit, E; Hennebelle, P; Chabrier, G (2011). Radiation hydrodynamicswith adaptive mesh refinement and application to prestellar core collapse. I. Methods. AstronomyAstrophysics, 529:A35.DOI: https://doi.org/10.1051/0004-6361/201015880

Page 2: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

arX

iv:1

102.

1216

v2 [

astr

o-ph

.IM]

8 F

eb 2

011

Astronomy & Astrophysicsmanuscript no. 15880 © ESO 2011February 9, 2011

Radiation hydrodynamics with Adaptive Mesh Refinement andapplication to prestellar core collapse.

I. Methods

B. Commercon1,2,3,4 , R. Teyssier2,5 , E. Audit2 , P. Hennebelle3 , and G. Chabrier4,6

1 Max Planck Institute for Astronomy, Konigstuhl 17, 69117 Heidelberg, Germanye-mail:[email protected]

2 Laboratoire AIM, CEA/DSM - CNRS - Universite Paris Diderot, IRFU/SAp, 91191 Gif sur Yvette, France3 Laboratoire de radioastronomie (UMR 8112 CNRS),Ecole Normale Superieure et Observatoire de Paris, 24 rue Lhomond, 75231

Paris Cedex 05, France4 Ecole Normale Superieure de Lyon, Centre de recherche Astrophysique de Lyon (UMR 5574 CNRS), 46 allee d’Italie, 69364Lyon

Cedex 07, France5 Universitat Zurich, Institute fur Theoretische Physik, Winterthurerstrasse 190, CH-8057 Zurich, Switzerland6 School of Physics, University of Exeter, Exeter, UK EX4 4QL

Received October 7th, 2010; accepted xxx, 2011

ABSTRACT

Context. Radiative transfer has a strong impact on the collapse and the fragmentation of prestellar dense cores.Aims. We present the radiation-hydrodynamics solver we designedfor theRAMSES code. The method is designed for astrophysicalpurposes, and in particular for protostellar collapseMethods. We present the solver, using the co-moving frame to evaluatethe radiative quantities. We use the popular flux limiteddiffusion approximation, under the grey approximation (one group of photon). The solver is based on the second-order Godunovscheme ofRAMSES for its hyperbolic part, and on an implicit scheme for the radiation diffusion and the coupling between radiationand matter.Results. We report in details our methodology to integrate the RHD solver into RAMSES. We test successfully the method againstseveral conventional tests. For validation in 3D, we perform calculations of the collapse of an isolated 1 M⊙ prestellar dense core,without rotation. We compare successfully the results withprevious studies using different models for radiation and hydrodynamics.Conclusions. We have developed a full radiation hydrodynamics solver in theRAMSES code, that handles adaptive mesh refinementgrids. The method is a combination of an explicit scheme and an implicit scheme, accurate to the second-order order in space. Ourmethod is well suited for star formation purposes. Results of multidimensional dense core collapse calculations with rotation arepresented in a companion paper.

Key words. hydrodynamics, radiative transfer - Methods: numerical- Stars: low mass, formation - ISM: kinematics and dynamics,clouds

1. Introduction

Within the past recent years, star formation calculations haveundergone a rapid increase in the variety of physical modelsin-cluded. Coupling between radiative transfer and hydrodynamicshas been widely studied for many years, considering differentregimes and frames (e.g. Mihalas & Mihalas 1984; Lowrie et al.2001; Mihalas & Auer 2001; Krumholz et al. 2007b). Radiationhydrodynamics (RHD) methods have been developed in gridbased codes (Stone & Norman 1992; Hayes & Norman 2003;Krumholz et al. 2007a; Kuiper et al. 2010; Sekora & Stone2010; Tomida et al. 2010) and smoothed particles hydrodynam-ics (SPH) codes (Boss et al. 2000; Whitehouse & Bate 2006;Stamatellos et al. 2007). Most of these studies use the popularflux limited diffusion approximation (FLD, e.g. Minerbo 1978;Levermore & Pomraning 1981) approximation to model the ra-diation transport.

Send offprint requests to: B. Commercon

In star formation calculations, the easiest method to takeinto account radiative transfer is to use a barotropic approxi-mation, which reproduces crudely the thermal behavior of thegas during the collapse. However, more accurate RHD cal-culations show that a barotropic EOS cannot account for re-alistic cooling and heating of the gas (e.g. Boss et al. 2000;Attwood et al. 2009; Commercon et al. 2010a, hereafter PaperII). Recently, using radiation-magnetohydrodynamics calcula-tions, Commercon et al. (2010b) have shown that the barotropicapproximation cannot properly account for the combined effectsof magnetic field and radiative transfer in the first collapseandin the first core formation. On larger scales, radiative transferhas been found to greatly reduce the fragmentation because ofthe radiative feedback due to accretion and protostellar evolu-tion (Bate 2009; Offner et al. 2009).

In this study, we present a new RHD solver based on theFLD approximation, that we integrate in the adaptive mesh re-finement (AMR) codeRAMSES (Teyssier 2002). The solver isconsistently integrated in the second-order predictor-corrector

Page 3: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

2 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

Godunov scheme ofRAMSES, that we modify to account for theradiative pressure. On the other hand, we add an implicit solverto handle the radiation diffusion and the coupling between mat-ter and radiation, that involve physical processes on timescalesmuch shorter that the hydrodynamical one. The FLD is easierto implement in an AMR code than more sophisticated methodsthat would require an additional equation on the first momentofthe radiative transfer equation (e.g. M1 model, Gonzalez et al.2007). The extension to (ideal) MHD flows presents no partic-ular difficulties and has already been used (Commercon et al.2010b), based on the solver presented in Fromang et al. (2006)and Teyssier et al. (2006).

The paper is organized as follows: in Sect. 2, we recall theRHD equations in the comoving frame we use and we presentbriefly the FLD approximation. The RHD solver for theRAMSEScode is presented in Sect. 3. In Sect. 4, the method is then testedagainst well-known test cases. As a final test, RHD dense corecollapse calculations with a very high resolution are performed.Section 5 summarizes our work and the main results, and presentour perspectives.

2. Radiation hydrodynamics in the Flux LimitedDiffusion approximation

2.1. Radiation hydrodynamics in the comoving frame

We consider the equations governing the evolution ofan inviscid, radiating fluid, where radiative quantities areestimated in the comoving frame and frequency integrated(Mihalas & Mihalas 1984)

∂tρ + ∇[

ρu]

= 0∂tρu + ∇

[

ρu ⊗ u + PI]

= σRFr/c∂tE + ∇ [u (E + P)] = σRFr/c · u − σP(4πB − cEr)∂tEr + ∇ [uEr] = −∇ · Fr − Pr : ∇u + σP(4πB − cEr)∂tFr + ∇ [uFr] = −c2∇ · Pr − (Fr · ∇) u − σFcFr,

(1)whereρ is the material density,u is the velocity,P the thermalpressure,σR is the Rosseland mean opacity,Fr is the radiativeflux, E the fluid total energyE = ρǫ + 1/2ρu2 (ǫ is the inter-nal specific energy),σP is the Planck opacity,B = B(T ) is thePlanck function,Er is the radiative energy andPr is the radiationpressure. We see that the termσRFr/c acts as a radiative force onthe material. The material energy lost by emission is transferredinto radiation, and radiative energy lost by material absorptionis given to the material. To close this system, we need two clo-sure relations: one for the gas and one for the radiation. In thiswork, we only consider an ideal gas closure relation for the ma-terial: P = (γ − 1)e = ρkBT/µmH whereγ is the specific heatsratio, µ is the mean molecular weight ande = ρcvT is the gasinternal energy. For the radiation, we use the FLD approxima-tion to close the system of moment equations (Minerbo 1978;Levermore & Pomraning 1981). In this work, we consider onlythe simplified case of agrey material, where all frequency de-pendent quantities are integrated over frequency. We cannot usea frequency dependent model for our purpose because of CPUlimitation.

In comparison with the laboratory frame formulation, Castor(1972) demonstrated that in the comoving frame, an additionaladvective flux of the radiation enthalpy is not taken into account.In the dynamic diffusion regime, where the optical depthτ >> 1and (v/c)τ >> 1, this radiative flux can dominate the diffu-sion flux, emission or absorption. For an alternative mixed frameformulation, see Krumholz et al. (2007b). Note that, in the low

mass star domain, the main focus of this work, we do not expectto encounter dynamic diffusion situations.

2.1.1. The Flux Limited Diffusion approximation

As mentioned earlier, we need a closure relation to solve themoment equations coupled to the hydrodynamics (closed by theperfect gas relation), and such a relation is of prime importance.Many possible choices for the closure relation exist. Amongthese models, the FLD approximation is among the simplestones and uses moment models of radiation transport (Minerbo1978; Levermore & Pomraning 1981).

Under the flux limited diffusion approximation, the radiativeflux is expressed directly as a function of the radiative energyand is proportional and colinear to the radiative energy gradient(Fick’s law). Under the grey approximation, we have

Fr = −cλσR∇Er, (2)

whereλ = λ(R) is the flux limiter, andR = |∇Er|/(σREr). Inthis study, we retain the flux limiter which has been derived byMinerbo (1978), assuming the intensity as a piecewise linearfunction of solid angle

λ =

{

2/(3+√

9+ 12R2) if 0 ≤ R ≤ 3/2,(1+ R +

√1+ 2R)−1 if 3/2 < R ≤ ∞.

(3)

The flux limiter has the property thatλ → 1/3 in opticallythick regions andλ → 1/R in optically thin regions. We re-cover the proper value for diffusion in optically thick regime,F = −c/(3σR)∇Er, and the flux is limited tocEr in the opticallythin regime. Under the FLD approximation, the radiative trans-fer equation is then replaced by a unique diffusion equation onthe radiative energy

∂Er

∂t− ∇ ·

(

cλσR∇Er

)

= σP(4πB − cEr). (4)

3. A multidimensional Radiation Hydrodynamicssolver for RAMSES

3.1. The AMR RAMSES code

We use theRAMSES code (Teyssier 2002), which integratesthe equations of ideal magnetohydrodynamics (Fromang et al.2006; Teyssier et al. 2006) using a second-order Godunov fi-nite volume scheme. The MHD equations are integrated us-ing a MUSCL predictor-corrector scheme, originally presentedin van Leer (1979). Flux at the cell interface are estimated us-ing approximated Riemann solver (Lax-Friedrich, HLL, HLLD,etc...). For its AMR grid,RAMSES is based on a ‘tree-based”AMR structure, the refinement is made on a cell-by-cell basis.Various refinements can be used (fluid variables gradients, insta-bility wavelength, etc...).

The AMR code RAMSES has already been often usedfor star formation purposes (Hennebelle & Fromang 2008;Hennebelle & Teyssier 2008; Hennebelle & Ciardi 2009;Commercon et al. 2010b). Commercon et al. (2008) have thor-oughly compared successfully its results with standard SPH,showing a good agreement between the methods.

Page 4: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 3

3.2. The Eulerian approach and properties of conservationlaws

In Eulerian hydrodynamics, the mesh is fixed and gas den-sity, velocity and internal energy are primary variables. Eulerianmethods fall into two groups: finite difference methods (e.g.the ZEUS code, Stone & Norman 1992; Turner & Stone 2001)and finite volume methods (e.g. theRAMSES code, Teyssier2002). In the first group, flow variables are conceived as beingsamples at certain points in space and time. Partial derivativesare then computed from these sampled values and followEuler equations. In the finite volume approach, flow variablescorrespond to average values over a finite volume - the cell - andobey the conservation laws in the integral form. Their evolutionis determined using Godunov methods by calculating the flux ofevery conserved quantity across each cell interface.

For an inviscid, compressible flow, the Euler equations, intheir conservative form, read

∂tρ + ∇ [

ρu]

= 0∂tρu + ∇

[

ρu ⊗ u + PI]

= 0∂tE + ∇ [u (E + P)] = 0

(5)

This system can be written in the general hyperbolic conserva-tive form

∂U

∂t+ ∇.F(U) = 0, (6)

where the vectorU = (ρ, ρu, E) contains conservative variables,and the flux vectorF(U) = (ρu, ρu⊗u+PI, u (E+ P)) is a linearfunction ofU.

In this paper, we use the second-order Godunov method, butapplied to the modified Euler equation system, under the FLDapproximation.

3.3. The conservative Radiation Hydrodynamics scheme

Let us rewrite the grey RHD equations under the FLD ap-proximation within the comoving frame, taking into accountthegravity terms

∂tρ + ∇[

ρu]

= 0∂tρu + ∇

[

ρu ⊗ u + PI]

= −ρ∇Φ − λ∇Er∂tET + ∇ [u (ET + P)] = −ρu · ∇Φ − Pr∇ : u − λu∇Er

+∇ ·(

cλρκR∇Er

)

∂tEr + ∇ [uEr] = −Pr∇ : u + ∇ ·(

cλρκR∇Er

)

+κPρc(aRT 4 − Er)(7)

Note that we rewrite the opacityσi asκiρ. The dimension ofκiis cm2 g−1.

The basic idea is to build a solver for a radiative fluid, with anadditional pressure due to the radiation field: the radiative pres-sure. Following the Euler equations in their conservative form,the new conservative quantities are: densityρ, momentumρu,total energyET of the fluid (gas+ photon) per unit volume,i.e. ρǫ + ρu2/2+ Er. Primitive hydrodynamical variables do notchange for the fluid, but we add a fourth equation for the radia-tive energy.

In order to simply integrate these equations inRAMSES andto minimize the number of changes with the pure hydrodynam-ical version, we decompose each term where the flux limiterλappears as follows:λ = 1/3 + (λ − 1/3). We thus distinguish

a diffusive part (Eddington approximation,Pr = 1/3ErI) and acorrection part. The computation of predicted states and fluxesin the MUSCL scheme is done under the Eddington approxima-tion which is then corrected in an additional corrective step. TheRHD equations can be rewritten as

∂tρ + ∇[

ρu]

= 0∂tρu + ∇

[

ρu ⊗ u + (P + 1/3Er)I]

= −ρ∇Φ − (λ − 1/3)∇Er

∂tET + ∇ [u (ET + P + 1/3Er)] = −ρu · ∇Φ−(λ − 1/3)(u∇Er + Er∇ : u)+∇ ·

(

cλρκR∇Er

)

∂tEr + ∇ [uEr] = −Pr∇ : u + κPρc(aRT 4 − Er)+∇ ·

(

cλρκR∇Er

)

.

(8)The new system∂tU+∇F(U) = S (U) is composed of the modi-fied hyperbolic left hand side (LHS) and the right hand side RHSsource, corrective and coupling termsS (U) = S exp+ S imp. Thehyperbolic system, as well as the source and corrective termsS exp, are integrated in time with an explicit scheme. The modi-fied RHD hyperbolic system reads

U =

ρρuETEr

, F(U) =

ρuρu ⊗ u + (P + 1/3Er)I

u (ET + P + 1/3Er)uEr

. (9)

This system is used in the predictor-corrector MUSCL temporalintegration. To predict states, we consider the worst case,wherethe radiative pressure is the greatest (1/3Er). For the conserva-tive update (corrector step) we consider the LHS of system (8).The associated eigenvalues corresponding to the 3 waves are

λi =

u −√

γPρ+

4Er9ρ

u

u +√

γPρ+

4Er9ρ

. (10)

Note that radiative pressure enlarges the span of solutions, sincewave speeds are larger. Once again, with the Eddington approxi-mation, we build the system in the case where the radiative pres-sure would be the greatest. Therefore, the waves propagate at aspeed that is within the wave extrema.

The next step consists in correcting errors due to theEddington approximation by integrating source termsS ne

S ne =

0−(λ − 1/3)∇Er

−(λ − 1/3)(u∇Er + Er∇ : u)Pr∇ : u

. (11)

Note that in this work, we consider an isotropic radiative pres-sure tensorPr = λErI. Another authors considered extensionsto this closure relation, using Levermore (1984) FLD theory(Turner & Stone 2001; Krumholz et al. 2007b).

To ensure the stability of the explicit step, the CourantFriedrich Levy stability condition used to estimate the timesteptakes also into account the radiative pressure. The updatedCFLcondition is simply

∆t ≤ CCFL∆x

u +√

γPρ+

4Er9ρ

. (12)

Page 5: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

4 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

3.4. The implicit radiative scheme

The most demanding step in our time-splitting scheme is todeal with the diffusion term∇ ·

(

cλρκR∇Er

)

and the coupling term

κPρc(aRT 4 − Er), which corresponds toS imp. This update has tobe done with animplicit scheme, since the time scales of theseprocesses are much shorter than those of pure hydrodynamicalprocesses. Two coupled equations are integrated implicitly

{

∂tρǫ = −κPρc(aRT 4 − Er)∂tEr − ∇ cλ

κRρ∇Er = +κPρc(aRT 4 − Er)

, (13)

which give the implicit scheme on an uniform grid1

CvT n+1 −CvT n

∆t= −κnPρ

nc(aR(T n+1)4 − En+1r )

En+1r − En

r

∆t− ∇ cλn

κnRρn∇En+1

r = +κnPρnc(aR(T n+1)4 − En+1

r ),

(14)whereρǫ = CvT . The nonlinear term (T n+1)4 makes this

scheme difficult to invert. On the other hand, it is much easierto solve implicitly a linear system. Assuming that changes oftemperature are small within a time step, we can write

(T n+1)4 = (T n)4

(

1+(T n+1 − T n)

T n

)4

≈ 4(T n)3T n+1 − 3(T n)4

(15)Eventually, with (14a), we obtainT n+1

i as a function ofT ni and

En+1r,i . ThenT n+1

i can be directly injected in the radiative energyequation (14b), andEn+1

r,i is finally expressed as a function ofEn+1

r,i+1, En+1r,i−1, En

r,i andT ni . The implicit scheme for the radiative

energy in a cell of volumeVi in thex−direction becomes

(En+1r,i − En

r,i)Vi − c∆t

(

λ

κRρ

)

i+1/2

S i+1/2

En+1r,i+1 − En+1

r,i

∆xi+1/2

+ c∆t

(

λ

κRρ

)

i−1/2

S i−1/2

En+1r,i − En+1

r,i−1

∆xi−1/2(16)

= c∆tκnP,iρni

(

4aR(T ni )3T n+1

i − 3aR(T ni )4 − En+1

r,i

)

Vi,

The gas temperature within a cell is simply given by

T n+1i =

3aRκnP,ic∆t

(

T ni

)4+ CvT n

i + κnP,ic∆tEn+1

r,i

Cv + 4aRκnP,ic∆t

(

T ni

)3. (17)

Note that we compute the Planck and Rosseland opacities andthe flux limiter with a gas temperature value given before theimplicit update (with indexn), in order to preserve the linearityof the solver.

3.5. Implicit scheme integration with the Conjugate Gradientalgorithm

Equation (16) is solved on a full grid, made ofN cells. Itresults in a system ofN linear equations, that can be written as alinear system of equations

Ax = b, (18)

1 Index n andn + 1 are used for variables before and after the im-plicit update. Outputs of the explicit hydrodynamics scheme suppliesvariables with indexn. It does not match the variables at timetn andtn+1.

where x is a vector containing radiative energy values. TheConjugate Gradients (CG) method is one of the most popu-lar non-stationary iterative methods for solving large symmet-ric systems of linear equationsAx = b. The CG method canbe used if the matrixA to be inverted is square, symmetric andpositive-definite. The CG is memory-efficient (no matrix stor-age) and runs quickly with sparse matrices. For aN × N matrix,the CG converges in less thanN iterations. Basically, the CGmethod is a steepest gradient descent method in which descentdirections are updated at each iteration. Another advantage isthat the CG method can be run easily on parallel machines.

In order to improve convergence of CG or even to insureconvergence in case of an ill-conditioned matrixA, we use apreconditioning matrixM which approximatesA. M is alsoassumed to be symmetric and positive definite. In this work,we use a simple diagonal preconditioning matrix, which retainsonly the inverse ofA diagonal elements. The convergence ofthe CG algorithm is estimated following two criteria: estimationof the normL2 (criterion ||r( j)||/||r(0)|| < ǫ) or estimation of thenorm L∞ (maximum residual value max{r( j)}/max{r(0)} < ǫ).Values ofǫ typically range from 10−8 to 10−3. In appendix wepresent an alternative method to the conjugate gradient, theSuper-Time Stepping method, which can be used efficiently onuniform grids or in some particular cases.

3.6. Comparison to other schemes

Other RHD solvers based on the FLD approximation havebeen designed in grid based codes. Among them, theZEUS andORION implementations are the most widely used and discussed.Compared toZEUS (Stone & Norman 1992; Turner & Stone2001; Hayes et al. 2006), our method is fundamentally different,although they also use the comoving frame to estimate the radia-tive quantities.ZEUS code is based on a finite difference scheme,using artificial viscosity and regular grids. Its non-conservativeformulation can lead to spurious wave propagation when the res-olution is not high enough, or if the radiative pressure dominatesthe characteristic velocity (the classical Burgers equation prob-lem). InZEUS, all the radiative terms, like the radiation transportand the radiative pressure work, are integrated implicitly. Theimplicit scheme is based on a Newton-Raphson method, usingGMRES or LU algorithms for the matrix inversion.ORION is a patched based AMR code, less flexible than tree-

based AMR (Krumholz et al. 2007a). Krumholz et al. (2007a)implement the mixed frame RHD equation, using a multi-grid,multi-timestep method to solve the implicit scheme for the radi-ation module (Howell & Greenough 2003). The hydrodynamicpart of Orion uses a second-order conservative Godunov scheme,with approximate Riemann solvers and very little artificialvis-cosity to treat shocks and discontinuities. Using the same idea asin this study, the diffusion and matter-radiation coupling termsare integrated implicitly, while the radiative force and radiativepressure work are integrated explicitly. Contrary to our work,Krumholz et al. (2007a) do not take into account the radiativepressure in the flux estimate at the cell interface for the conser-vative update, which could also lead to an inaccurate wave speedpropagation in radiation pressure dominated regions.

3.7. Implicit scheme on an AMR grid

For studies involving large dynamical ranges, such as starformation, it is necessary to extend our implicit scheme to AMR

Page 6: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 5

grids. The difficulty is to compute the right fluxes and gradientsat the interfaces between two cells. We need to consider carefullythe energy balance on a given volume. Energy balances are doneon volumes overlapping two cells, that depends on whether themesh is refined or not. Consider the face of a cell on levelℓ; 3connecting configurations with other cells are possible (see Fig.1):

– Configuration 1: the neighboring cell is at the same levelℓ:cells 1 and 3,

– Configuration 2: the neighboring cell is at levelℓ − 1: cells 1and i,

– Configuration 3: 2 neighboring cells exist at levelℓ + 1: celli with cells 1 and 2.

Last but not least, the diffusion routine is called only onceper coarse step (no multiple timestepping), and scans the fullgrid, from the finer level to the coarse level. In order to opti-mise matrix-vectors products, we choose to avoid dealing withconfiguration 3. Hence, when cells at levelℓ + 1 are monitored,values for cells at levelℓ are updated. Configurations 2 and 3 arethen performed at the same time. Depending on the configura-tion, gradients and flux estimates are different. In the following,we will focus on cell 1, of size∆x × ∆x.

2

1 3

4

i

Fig. 1.Example of AMR grid configuration

3.7.1. Gradient estimate

Gradients∇Er are estimated between the two neighboringcells center

− Configuration 1 : (∇Er)1,3 =Er,1 − Er,3

∆x

− Configuration 2 : (∇Er)1,i =Er,1 − Er,i

3∆x/2

3.7.2. Flux estimate

Let S ℓ be the surface of interface of a cell at levelℓ andFℓi, jthe flux across this surface between two cellsi and j. The energyrateF × S that is exchanged at this interface is

− Configuration 1 :Fℓ1,3 × S ℓ =Er,1 − Er,3

∆x× S ℓ

− Configuration 2 :Fℓ1,i × S ℓ =Er,1 − Er,i

3∆x/2× S ℓ

− Configuration 3 :Fℓi,1,2 × S ℓ−1 = Fℓi,1 × S ℓ + Fℓi,2 × S ℓ

Since access to neighboring finer cells is not straightforward,we see from configuration 3 all the interest of updating quantitiesat levelℓ − 1 when scanning grid at levelℓ.

3.8. Limits of the methods

The first drawback is the use of the FLD approximationthat implies isotropy of the radiation field. Anisotropies in thetransparent regime are not well processed with the FLD, con-trary to more accurate models like M1(Gonzalez et al. 2007)or VETF (Hayes & Norman 2003). A second limitation comesfrom the grey opacity assumption which could limit the accre-tion on the protostars (see Zinnecker & Yorke 2007, and refer-ences therein). In high mass star formation, Yorke & Sonnhalter(2002) show that using a frequency-dependent radiative transfermodel enhances the flashlight effect and helps to accrete moremass onto the central protostar.

From a technical point of view, our method works only forunique time stepping, i.e. all levels evolve with the same timestep. We do not take advantage of the multiple time steppingpossibility. As a compromise, we investigate the possibility toevolve finer levels with their own time steps and perform adiffusion-coupling steps every 2, 4 or more finer time steps. Asa result, we find that performing the diffusion step only every2 or 4 fine timesteps gives correct results. The frequency of theimplicit solver calls is left to the user convenience, by useofthe mutli-time stepping ofRAMSES. For instance, for a grid oflevels ranging form levelℓmin to ℓmax, a unique timestep canbe used for levels ranging form levelℓmin to ℓi. In that case,only the levels finer thatℓi will use not updated radiative quan-tities in the Godunov solver. A future development would be touse a multigrid solver or preconditioner for parabolic equations(Howell & Greenough 2003).

Another difficulty comes from the residual norm and scalarestimates in the CG algorithm. For large grid with a large num-ber of cells, the dot product can be dominated by round-off er-rors, due to estimates close to machine precision. This becomeseven worse in parallel calculations. The usual MPI functionMPI SUM fails with a large number of processors, the resultsof any sum becoming a function of number of processors... Thisaffects dramatically the number of iterations. We implement anew MPI function that performs summation in double-doubleprecision following He & Ding (2000), using the Knuth (1997)method.

Eventually, our method involves only immediate neighbor-ing cells, whatever their refinement level is. As a consequence,our method is only first order at the border between levels. Thiscould give rise to a loss of accuracy in diffusion problems, sincegradient estimates are not second-order accurate, when neigh-boring cells are at finer levels (see configuration 3, Popinet2003). However, the tests we have been performing ascertainthatthe method is stillglobally second order accurate. The errors areonly confined to surfaces much smaller that the total volume.

4. Radiation Hydrodynamics solver tests

4.1. 1D test: linear diffusion

We only consider in this test the radiative energy diffusionequation, without either hydrodynamics or coupling with thegas. The equation to integrate is simply

∂Er

∂t− ∇ ·

(

c3ρκR

∇Er

)

= 0. (19)

Consider a box of length L=1. The initial radiative energy cor-responds to a delta function, namely it is equal to 1 everywherein the box, except at the center where it equalsEr,L/2∆x = E0 =

1×105. To simplify, we chooseρκR = 1 and a constant time step.

Page 7: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

6 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

Fig. 2. (a): Comparison between numerical solution (squares)and analytical solution (red line) at time t=1× 10−12 for the cal-culations with 16 cells. (b): L1 norm of the error as a function ofh = 1/∆x. The dotted line shows the evolution of the error as afunction ofh2 and the dashed line the evolution of the error as afunction ofh.

We apply Von Neumann boundary conditions, i.e. zero-gradient.The analytical solution in ap-dimensional problem is given by

Er,a(x, t) =E0

2p(πχt)p/2e−(

x2

4χt

)

, (20)

whereχ = c/(3ρκR).

Table 1. CPU time, total number of time steps and number ofiterations per time step for various numbers of cells N.

N CPU time (s) N∆t Niter/N∆t

32 3.5 51 9.964 7.1 102 10.4128 14.36 205 10.6256 30.85 409 11.8

Figure 2(a) shows results at timet = 1×10−12 for a resolutionof N = 16 cells. The numerical solution is very close to theanalytical one, even with this small number of cells. In Fig.2(b)we show the evolution of the L1 norm of the relative error as afunction ofh = 1/∆x. The L1 norm is estimated as follows

L1 =

∑N1 |Er,i − Er,a(xi, t)|∆xi∑N

1 Er,a(xi, t)∆xi, (21)

whereEr,i is the numerical value of the radiative energy at posi-tion xi and timet, andEr,a(xi, t) the corresponding analytic value.The error clearly grows ash2 (dotted line), which indicates thatour method is second-order accurate.

In table 1, we report the CPU time, the total number of iter-ations and the number of time steps for various numerical res-olutions. At low resolution, the number of time steps increaseslinearly with the number of cells, as well as the CPU time. Thenumber of iterations per time step is constant, i.e. the conver-gence of CG does not depend on the dimension of the problem,but on the nature on the problem.

4.2. 1D test: non linear diffusion

In this second test, we consider a initial discontinuity in abox with different initial radiative energy states:Er = 4 on theleft andEr = 0.5 on the right. We apply Von Neumann bound-ary conditions. We integrate the same equation as in the previoustest, but with a Rosseland opacity as a nonlinear function oftheradiative energy, i.e.ρκR = 1× 1011E−1.5

r . Last, we allow refine-ment with a criterion based on the radiative energy gradient. Ineach region where∇Er/Er > 3 %, the grid is refined.

Figure 3(a) shows the radiative energy profiles at timet =1.4× 10−2 for calculations run with a coarse grid of 16 cells anda maximum effective resolution of 512 cells (squares), and forcalculations run with 2048 cells, taken to be the ”exact” solution(red curve). Because of the nonlinear opacity, the diffusion ismore efficient in the high energy region. The mean opacity at cellinterface is computed using an arithmetic average, more adaptedin the case of non-linear opacity. The levels are finer (higherresolution) in high radiative energy gradient regions. Note thatwe check that we get similar results in a 2D plane parallel caseand in a 2D case with an initial step function making an angleπ/4 with the computational box axis. This validates our routinein the x andy directions.

In Fig. 3(b), we show the evolution of the L1 norm of theerror, as a function of the mesh spacing. The uniform grid points(diamonds) corresponds to calculations run with a number ofcells ranging from 16 to 512 (i.e.ℓ = 4 toℓ = 9) . When AMR isused (squares), the error is plotted as function of the minimumgrid spacing, corresponding to effective resolutions ranging from32 to 512 cells. The coarse level remains unchanged,ℓmin = 4(i.e. 16 coarse cells). The advantage of the AMR is clear, theerror remains identical compared to the uniform grid case, butthe number of cells is greatly reduced (25 cells withℓmax = 5, 38cells withℓmax = 6, 59 cells withℓmax = 7, 83 cells withℓmax = 8and 110 cells withℓmax = 9). The AMR implementation workswell (second-order accuracy), and does not suffer from the factthat our scheme is only first order in space at the level interface,which validates our scheme used to estimate the gradients atthecell interface in Sect. 3.7. Finally, note that as in the previoustest, the error increases withh2, even if the diffusion problem isnon linear as it is the case for radiation.

Page 8: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 7

Fig. 3.Non linear diffusion of an initial step function with AMR,the refinement criterion based on radiative energy gradients. (a)Radiative energy profiles at timet = 1.4×10−2 (square - numer-ical solution, ”exact” solution in red, run with 2048 cells). TheAMR levels (right axis) are plotted in blue. (b) L1 norm of theerror as a function ofh = 1/∆x, without AMR (diamond) andwith AMR (squares), up to an effective resolution of 512 cells(the error is plotted as a function of the minimum mesh spac-ing, corresponding to the maximum resolution). The dotted lineshows the evolution of the error as a function ofh2.

4.3. Matter-Radiation coupling test

Another conventional test is the matter-radiation coupling.Consider a static, uniform, absorbing fluid initially out ofther-mal balance, in which the radiation energyEr dominates and isconstant. An analytic solution can be obtained for the time evo-lution of the gas energye, by solving the ordinary differentialequation (Turner & Stone 2001)

dedt= cσEr − 4πσB(e). (22)

We performed two tests, with two initial gas energies,e = 1010

erg cm−3 and e = 102 erg cm−3. In both tests, the following

quantities are taken constant: the radiative energyEr = 1× 1012

erg cm−3, the opacityσ = 4× 10−8 cm−1, the densityρ = 10−7

g cm−3, the mean molecular weightµ = 0.6, and the adiabaticindexγ = 5/3. Figure 4 shows the evolution in time of the gasenergy for the analytic solution (red line) and the numerical so-lution (squares). In the first calculations, where the initial gastemperature is greater than the radiative temperature, we useda variable time step∆t that increases with time, starting from10−20 s. This good sampling gives very good results. In the sec-ond case, we use a constant time step∆t = 10−12 s. Although thesampling is bad at early times and longer than the cooling time,numerical solutions always match the analytic one. This vali-dates our linearization of the emission term (aRT 4) in equation(15).

Fig. 4. Matter-radiation coupling test. The radiative energy iskept constant,Er = 1×1012 erg cm−3, whereas the initial gas en-ergies are out of thermal balance (e = 102 erg cm−3 ande = 1010

erg cm−3). Numerical (square) and analytic (red curve) evolu-tions of the gas energy are given as a function of time.

4.4. 1D full RHD tests: Radiative shocks

Testing the numerical method against radiative shock calcu-lations is a last important step that every code attempting to inte-grate RHD equations should perform (Hayes & Norman 2003;Whitehouse & Bate 2006; Gonzalez et al. 2007). FollowingEnsman (1994) initial conditions, we test our routine for sub-and super-critical radiative shocks.

Initial conditions are as follows: uniform densityρ0 = 7.78×10−10 g cm−3 and temperature T0=10 K. The box length isL=7× 10−10cm, the opacity is constant (σ = 3.1× 10−10 cm−1),µ = 1 andγ = 7/5. The 1D homogeneous medium moves witha uniform speed (piston speed) from right to left and the leftboundary is a wall. The shock is generated at this boundary andtravels backwards. The piston velocity varies, producing sub- orsuper-critical radiative shocks. The AMR is used, and the re-finement criterion is based on the density and radiative energygradients (30%), the grid has 32 coarse cells and we use five lev-els of refinement. We use the Minerbo flux limiter. The time step

Page 9: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

8 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

Fig. 5.Left: Temperature profiles for a subcritical shock with piston velocity v = 6 km s−1, at timet = 3.8×104 s.Right: Temperatureprofiles for a supercritical shock with piston velocityv = 20 km s−1, at timet = 7.5 × 103 s. In both cases, the temperatures aredisplayed as a function ofz = x − vt. The squares represent the gas temperature and the diamondsthe radiative temperature. Thered curves represent the gas and radiative temperatures obtained with a calculation using 2048 cells, that we take as the”exact”solution. The AMR levels (blue line - right axis) are overplotted.

is given by the hydrodynamics CFL for the explicit and implicitschemes.

Figure 5 shows the gas and radiative temperatures for sub-and super-critical radiative shocks, as a function ofz = x − vt,wherev is the piston’s velocity. The AMR is used in both cal-culations. The squares represent the gas temperature and the di-amonds the radiative temperature. The red curves representthegas and radiative temperatures obtained with a calculationusing2048 cells, that we take as the ”exact” solution. The subcriticalshock is obtained with a piston’s velocityv = 6 km s−1, whereasthe supercritical shock is obtained withv = 20 km s−1. In bothtests, the occurence of an extended, non-equilibrium radiativeprecursor is obvious. As expected, in the supercritical case, pre-and post-shock gas temperatures are equal.

For the subcritical case, the postshock gas temperature isgiven by (Ensman 1994; Mihalas & Mihalas 1984)

T2 ≈2(γ − 1)v2

R(γ + 1)2, (23)

whereR = k/µmH is the perfect gas constant. For our initialsetup, this analytic estimate givesT2 ∼ 810 K. Numerical cal-culations giveT2 ∼ 825K at timet = 3.8 × 104 s, in goodagreement with the analytic estimate, comparable to valuesob-tained with more accurate methods (Gonzalez et al. 2007). Thecharacteristic temperatureT− ∼ 275 K immediately in front ofthe shock is in very good agreement with the analytic estimate(Mihalas & Mihalas 1984)

T− ≈γ − 1ρvR

2σRT 42√

3∼ 276 K. (24)

This means that, in front of the shock, the gas internal energyflux flowing downstream is equal to the radiative flux flowingupstream. All the radiative energy is absorbed upstream andcon-tributes to heat up the upstream gas. Similarly, the spike temper-atureT+ ∼ 1038 K is also in good agreement with the analyticestimate of Mihalas & Mihalas (1984)

T+ ≈ T2 +3− γγ + 1

T− ∼ 980 K. (25)

We note that the AMR scheme enables us to describe care-fully the gas temperature spike at the shock. The mediumaround the spike is optically thin, and the numerical resolutionin this region is therefore of crucial importance. The spike’samplitude varies according to the model used for radiationand to the effective numerical resolution. Thanks to the AMRscheme, the spike’s amplitude is larger in the supercritical case,but not as large as those obtained with M1 or VTEF models(Hayes & Norman 2003; Gonzalez et al. 2007). However, thislast test shows the ability of our time-splitting method to inte-grate the RHD equations.

4.5. 3D dense core collapse calculations without rotation

In this section, we perform calculations of a 1 M⊙ dense corecollapse without rotation, using our grey FLD solver. We com-pare our FLD results for a model without initial rotation withthe ones obtained by Masunaga et al. (1998) and with our resultsobtained with a 1D code (see Commercon 2009). We also com-pare qualitatively our results with the pioneered ones of Larson(1969) and Winkler & Newman (1980). This latter test providesa validation in 3D for star formation purposes.

4.5.1. Initial conditions

To make the comparison with other studies easier, we usethe same initial conditions as in Commercon et al. (2008) andin Paper II and the Lax Friedrich Riemann solver. We choosehighly gravitationally unstable initial conditions. The initialsphere is isothermal,T0 = 10 K, and has a uniform densityρ0 = 1.38× 10−18 g cm−3. The ratioα between initial thermalenergy and gravitational energy isα ∼ 0.50. The initial radius isR0 = 7.07× 1016 cm. The theoretical free-fall time istff = 57kyr. The initial isothermal sound speed iscs0 ∼ 0.19 km s−1 andγ = 5/3. The outer region of the sphere is at the same temper-ature as the core temperature but is 100 times less dense. The

Page 10: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 9

Reference Rfc Mfc M Lacc Tc Tfc S c αacc

(AU) (M⊙) (M⊙/yr) (L⊙) (K) (K) (erg K−1 g−1)This work 8 2.1× 10−2 3.7× 10−5 0.014 396 81 2.11× 109 24

Masunaga et al. (1998) ∼ 8 ∼ 10−2 ∼ 10−5 0.002 ∼ 200 60 2.08× 109 6Commercon (2009) 7 2.31× 10−2 3× 10−5 0.015 419 70 2.02× 109 19

Larson (1969) ∼4 ∼ 1× 10−2 - - 170 - − -

Table 2. Summary of first core properties at timet =1.012tff andρc = 2.7× 10−11 g cm−3. Rfc, Mfc andTfc give respectively theradius and the mass of the first core, and the temperature at the first core border. The mass accretion rateM and accretion luminosityLacc = GMfcM/Rfc are also computed at the first core border.Tc andS c give the central temperature and entropy.αacc is a typicalaccretion parameter. The comparative values are roughly estimated atρc ∼ ×10−11 g cm−3 in Masunaga et al. (1998), atρc = 10−10

g cm−3 in Commercon (2009) and atρc = 2× 10−10 g cm−3 in Larson (1969).

sphere radius is equal to a quarter of the box length in order tominimize border effects.

We use the set of opacities given by Semenov et al. (2003)for low temperature (< 1000 K), that we compute as a func-tion of the gas temperature and density. For each cell, we per-form a bilinear interpolation on the mixed opacities table.Below1500 K, opacities are dominated by grain (silicate, iron, troilite,etc..). In Semenov et al. (2003), the dependence of the evapo-ration temperatures of ice, silicates and iron on gas density aretaken into account. In this work, we use spherical compositeag-gregate particles for the grain structure and topology and anor-mal iron content in the silicates, Fe/(Fe+Mg)=0.3.

4.5.2. Results

To resolve the Jeans length, we useNJ = 10 (i.e. 10 pointsper Jeans length) . Masunaga et al. (1998) showed that, for lowmass star formation, the first core properties are independent ofthe initial conditions. We can then compare our results withthoseobtained by Masunaga et al. (1998), even if we use different ini-tial conditions. We also compare our results with those obtainedusing a 1D spherical code (Audit et al. 2002) in Commercon(2009).

Table 2 summarizes the first core properties obtained at timet =1.012tff with RAMSES. First core radius and mass are qualita-tively similar to the results obtained in other 1D Lagrangean cal-culations (see Masunaga et al. 1998; Commercon 2009), even-though we use a completely different hydrodynamical scheme(e.g. no artificial viscosity, Eulerian, etc... The first core radius ishowever a factor 2 greater than the one found in Larson (1969)and Winkler & Newman (1980), who used simplified dust opac-ity models. Since the first core is mainly set by the opacity, thisexplains the differences. We define the first core radius as the ra-dius at which the infall velocity is maximal. The accretion rateon the first core is typical of low mass star formation,∼ 10−5

M⊙/yr. We note that the valueαacc ∼ 24 is relatively high,with αacc defined asM = αaccc3

s0/G (wherecs0 the isothermalsound speed). This indicates that our collapse model is closer tothe dynamical Larson-Penston collapse solution (Larson 1969;Penston 1969), than to the SIS model of Shu (1977), for whichαacc∼ 0.975.

In Fig. 6, we show the profiles of density, radial velocity,temperature, optical depth and integrated mass as a functionof the radius and the temperature as a function of the densityin the computational domain, at timet =1.012 tff . All quanti-ties are mean values in the equatorial plane. In the density pro-files, all the cells of the calculations have been displayed (bluepoints). The spread in the density distribution is very small. Thespherical symmetry is thus well conserved in the 3D calculationswith RAMSES. We compare these profiles with those obtained in

Commercon (2009). The density jump between the first core bor-der and the center is of the same order of magnitude as for the1D spherical case. The infall velocity at the shock is also com-parable (∼ 2 km s−1). The accretion shock takes place aroundτ ∼ 5 − 10, in the optically thick region. We do not see a jumpin temperature through the accretion shock, which is a super-critical radiative shock. Eventually, we see from the temperatureversus density plot that the thermal behavior of the gas is notperfectly adiabatic in the central core. The first core is notfullyadiabatic and is able to decrease his entropy level by radiatingin the upstream material. The slight kink in the curve atT ∼ 80K (log(T ) ∼ 1.7) corresponds to ice evaporation in the opacitytable. The opacity decreases abruptly, this is the reason why thecooling is more efficient in that region.

5. Summary and perspectives

We have developed a full radiation-hydrodynamics solverusing the flux limited diffusion approximation, which is inte-grated in the AMRRAMSES code. Our solver uses a time-splittingintegrator scheme, and combines explicit and implicit methods.Each step of the integration is detailed in this work. The methodhas been tested successfully against several conventionaltestsin 1D and 2D. We demonstrate that our method is second-orderaccurate in space, even when AMR is used. We also perform col-lapse calculations of a non-rotating dense core and we comparesuccessfully our results with the one obtained by Masunaga et al.(1998) and Commercon (2009), based on different methods in1D spherical codes. Our method has thus been demonstratedto be robust and well suited for star formation. In Paper II, wepresent detailed RHD calculations with a very high resolution ofdense core collapse in rotation. We show that our method enablesto handle accurately with the heating and cooling processes. Lastbut not least, we have extended our method to radiation magne-tohydrodynamics flows in Commercon et al. (2010b).

The next step following this work will be to tune our solverfor adaptive time-stepping in order to take all the benefits ofthe AMR in RAMSES. For example, the next stages of the col-lapse, the second collapse and the second core formation, re-quire a huge amount of numerical resolution and the dynam-ical timescale becomes much shorter. An adaptive time-stepscheme is then suitable under these conditions. Another im-provement is to use a multi-group approach in the radiationsolver. Some attempts have been presented in the literature(e.g.Shestakov & Offner 2008), but the computational cost remainsnowadays too high compared to the grey model.

Acknowledgements. The calculations were performed at CEA on the DAPHPCcluster. The research of B.C. is supported by the postdoctoral fellowshipsfrom Max-Planck-Institut fur Astronomie . The research leading to these re-sults has received funding from the European Research Council under the

Page 11: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

10 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

Fig. 6.Profiles of density, radial velocity, temperature, opticaldepth and integrated mass as a function of the radius and the temper-ature as a function of density in the 3D computational domain. All values are computed at timet =1.012tff .

European Community’s Seventh Framework Programme (FP7/2007-2013 GrantAgreement no. 247060). BC also thanks Neal Turner for usefuldiscussions.

References

Alexiades, V., Amiez, G., & Gremaud, P.-A. 1996, Com. Num.Meth. Eng, 12, 12

Attwood, R. E., Goodwin, S. P., Stamatellos, D., & Whitworth,A. P. 2009, A&A, 495, 201

Audit, E., Charrier, P., Chieze, J., & Dubroca, B. 2002, ArXivAstrophysics e-prints

Bate, M. R. 2009, MNRAS, 392, 1363

Boss, A. P., Fisher, R. T., Klein, R. I., & McKee, C. F. 2000,ApJ, 528, 325

Castor, J. I. 1972, ApJ, 178, 779Commercon, B. 2009, PhD thesisCommercon, B., Audit, E., Chabrier, G., Hennebelle, P., &

Teyssier, R. 2010a, in perparationCommercon, B., Hennebelle, P., Audit, E., Chabrier, G., &

Teyssier, R. 2008, A&A, 482, 371Commercon, B., Hennebelle, P., Audit, E., Chabrier, G., &

Teyssier, R. 2010b, A&A, 510, L3+Ensman, L. 1994, ApJ, 424, 275Fromang, S., Hennebelle, P., & Teyssier, R. 2006, A&A, 457,

371

Page 12: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 11

Gonzalez, M., Audit, E., & Huynh, P. 2007, A&A, 464, 429Hayes, J. C. & Norman, M. L. 2003, ApJS, 147, 197Hayes, J. C., Norman, M. L., Fiedler, R. A., et al. 2006, ApJS,

165, 188He, Y. & Ding, C. H. Q. 2000, in ICS ’00: Proceedings of the

14th international conference on Supercomputing (New York,NY, USA: ACM), 225–234

Hennebelle, P. & Ciardi, A. 2009, A&A, 506, L29Hennebelle, P. & Fromang, S. 2008, A&A, 477, 9Hennebelle, P. & Teyssier, R. 2008, A&A, 477, 25Howell, L. H. & Greenough, J. A. 2003, Journal of

Computational Physics, 184, 53Knuth, D. E. 1997, The art of computer programming, volume

2 (3rd ed.): seminumerical algorithms (Boston, MA, USA:Addison-Wesley Longman Publishing Co., Inc.)

Krumholz, M. R., Klein, R. I., & McKee, C. F. 2007a, ApJ, 656,959

Krumholz, M. R., Klein, R. I., McKee, C. F., & Bolstad, J.2007b, ApJ, 667, 626

Kuiper, R., Klahr, H., Dullemond, C., Kley, W., & Henning, T.2010, A&A, 511, A81+

Larson, R. B. 1969, MNRAS, 145, 271Levermore, C. D. 1984, J. Quant. Spec. Radiat. Transf., 31, 149Levermore, C. D. & Pomraning, G. C. 1981, ApJ, 248, 321Lowrie, R. B., Mihalas, D., & Morel, J. E. 2001, Journal of

Quantitative Spectroscopy and Radiative Transfer, 69, 291Masunaga, H., Miyama, S. M., & Inutsuka, S.-I. 1998, ApJ, 495,

346Mignone, A., Bodo, G., Massaglia, S., et al. 2007, ApJS, 170,

228Mihalas, D. & Auer, L. H. 2001, Journal of Quantitative

Spectroscopy and Radiative Transfer, 71, 61Mihalas, D. & Mihalas, B. W. 1984, Foundations of radiation

hydrodynamics, ed. D. Mihalas & B. W. MihalasMinerbo, G. N. 1978, J. Quant. Spec. Radiat. Transf., 20, 541Offner, S. S. R., Klein, R. I., McKee, C. F., & Krumholz, M. R.

2009, ApJ, 703, 131O’Sullivan, S. & Downes, T. P. 2006, MNRAS, 366, 1329Penston, M. V. 1969, MNRAS, 144, 425Popinet, S. 2003, Journal of Computational Physics, 190, 572Sekora, M. D. & Stone, J. M. 2010, Journal of Computational

Physics, 229, 6819Semenov, D., Henning, T., Helling, C., Ilgner, M., & Sedlmayr,

E. 2003, A&A, 410, 611Shestakov, A. I. & Offner, S. S. 2008, Journal of Computational

Physics, 227, 2154Shu, F. H. 1977, ApJ, 214, 488Stamatellos, D., Whitworth, A. P., Bisbas, T., & Goodwin, S.

2007, A&A, 475, 37Stone, J. M. & Norman, M. L. 1992, ApJS, 80, 753Teyssier, R. 2002, A&A, 385, 337Teyssier, R., Fromang, S., & Dormy, E. 2006, Journal of

Computational Physics, 218, 44Tomida, K., Tomisaka, K., Matsumoto, T., et al. 2010, 714, L58Turner, N. J. & Stone, J. M. 2001, ApJS, 135, 95van Leer, B. 1979, Journal of Computational Physics, 32, 101Whitehouse, S. C. & Bate, M. R. 2006, MNRAS, 367, 32Winkler, K. & Newman, M. J. 1980, ApJ, 238, 311Yorke, H. W. & Sonnhalter, C. 2002, ApJ, 569, 846Zinnecker, H. & Yorke, H. W. 2007, ARA&A, 45, 481

Appendix A: The Super-Time Stepping versus theConjugate Gradient

In this annex, we present the Super-Time-Stepping (STS)method. It is used to solve parabolic equation systems, liketheConjugate Gradient (CG) we used previously. We implement theSTS scheme intoRAMSES. We compare the CG and the STSmethods for the particular case of the 1D linear diffusion testpresented in §4.1.

A.1. The Super-Time -Stepping

The STS is a very simple and effective way to speed upexplicit time-stepping schemes for parabolic problems. Themethod has been rediscovered recently in Alexiades et al.(1996), but it remains relatively unknown in computationalas-trophysics (Mignone et al. 2007; O’Sullivan & Downes 2006).The STS frees the explicit scheme from stability restriction onthe time-step. It can be very powerful in some cases and is easyto implement compared to implicit methods that involve matrixinversions.

The STS is designed for time dependent problem, suchas

dUdt

(t) + AU(t) = 0, (A.1)

where A is a square, symmetric positive definite matrix.Equation A.1 is rewritten with the corresponding standard ex-plicit scheme

Un+1 = Un − ∆tAUn, (A.2)

The explicit scheme is subject to the restrictive stabilitycondi-tion

ρ(I − ∆tA) < 1, (A.3)

whereρ(·) denotes the spectral radius. The equivalent CFL con-dition is

∆t < ∆texpl =2λmax, (A.4)

whereλmax stands for the largest eigenvalue ofA. For the caseof the 1D heat equation∂u/∂t = χ∆u, discretized by standardsecond-order differences on a uniform mesh, we haveλmax =

4χ∆x2 (∆texpl = ∆x2/2χ).In the STS method, the restrictive stability condition is

relaxed by requiring the stability at the end of a cycle ofNststime-steps instead of requiring stability at the end of eachtimestep∆t. It leads to a Runge-Kutta-like method withNsts stages.Following Alexiades et al. (1996), we introduce asuperstep∆T =

∑Nstsj=1 τ j consisting ofNsts substeps τ1, τ2, · · ·, τNsts. The

idea is to ensure stability over the superstep∆T , while trying tomaximize its duration. The inner values, estimated after eachτ j, should only be considered as intermediate calculations. Onlythe values at the end of the superstep approximate the solutionof the problem.

The new algorithm can be written as

Un+1 =

Nsts∏

j=1

(I − τ jA)

Un, (A.5)

and the corresponding stability condition is

ρ

Nsts∏

j=1

(I − τ jA)

< 1. (A.6)

Page 13: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

12 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

In order to find∆T as large as possible, the properties ofChebyshev polynomials are exploited, providing a set of opti-mal values for the substeps given by

τ j = ∆texpl

[

(−1+ νsts)cos

(

2 j − 1Nsts

π

2

)

+ 1+ νsts

]−1

, (A.7)

whereνsts is a damping factor that should satisfy 0< νsts <λmin/λmax. The superstep∆T is given by

∆T =Nsts∑

j=1

τ j = ∆texplNsts

2ν1/2sts

(1+ ν1/2sts )2Nsts − (1− ν1/2sts )2Nsts

(1+ ν1/2sts )2N + (1− ν1/2sts )2Nsts

.

(A.8)Note that∆T → N2

sts∆texpl asνsts→ 0. The method is unstablein the limit νsts = 0. The STS method is thus almostNsts timesfaster than the standard explicit scheme. When∆T is taken tobe the advective (CFL) time step∆t while coupling with the hy-drodynamics, the STS requires only approximately (∆t/∆texpl)1/2

iterations rather than∆t/∆texpl with an explicit scheme.

A.2. The STS implementation for the FLD equation

The STS scheme replaces the implicit radiative scheme pre-sented in §3.4. Equations of system (14) written with an explicitscheme become

CvT n+1 − CvT n

∆t= −κnPρ

nc(aR(T n)4 − Enr )

En+1r − En

r

∆t= ∇ cλn

κnRρn∇En

r + κnPρ

nc(aR(T n)4 − Enr ),

(A.9)The explicit time step∆texpl is estimated using values at time

n. The next step consists of estimating values ofNsts andνsts,the latter depending on the spectral properties ofA. However, asmentioned in Alexiades et al. (1996), it is not required to havea precise knowledge of the spectral properties for the methodto be robust.Nsts andνsts are thus arbitrary chosen by the user.Instead of executing one time step of length∆texpl, one executessupersteps of length∆T . Nsts substepsτ1, τ2, · · ·, τNsts are thusperformed without outputing until the end of each superstep.When the STS is coupled to the hydrodynamics solver, the cy-cle is repeated until the time step, given by the hydrodynamicalCFL condition, is reached. Superstep∆T and substepsτi are re-estimated at the end of each cycle.

A.3. Comparison with the Conjugate Gradient method

To compare the STS with the CG algorithm we have used inall this work, we consider the test case presented in §4.1. Theequation to integrate is simply

∂Er

∂t− ∇ ·

(

c3ρκR

∇Er

)

= 0. (A.10)

The initial setup is identical to those in §4.1. It consists of aninitial pulse of radiative energy in the middle of the box. Wepresent here calculations made with either the STS method orthe CG algorithm. In both cases, CG and STS are applied overan arbitrary time step∆t that simulates time step that would begiven by the hydro CFL. All calculations have been performedon a grid made of 1024 cells. In the STS calculations, for each

value of∆t, calculations have been performed using various val-ues ofNsts andνsts. For the CG method, only the convergencecriterionǫconv changes.

Figure A.1 shows the radiative energy profiles at timet = 1×10−13 s for all the calculations we have performed. In all panels,the analytic solution is plotted (black line). The two upperplotsgive results for the CG method. For∆t ≥ 10−14, the accuracyis very limited. We also see that for∆t ≥ 10−13, the diffusionwave does not propagate at the right speed. The total energy isconserved, but the diffusion wave has not the correct extent. Onthe other hand, the STS results are much more accurate, exceptin the case withNsts = 20 andνsts = 1× 10−6. By construction,STS is expected to be more accurate. The stability is not goodwhen Nsts = 20 andνsts = 1 × 10−6 sinceνsts is close to thestability limit (see Alexiades et al. 1996).

Fig. A.2.Comparison of calculations done using STS or CG anda variable time step given by∆t = 1 × 10−16 ∗ 1.05istep, whereistep is the index of the number of global (hydro) time steps.Results are given at timet = 1× 10−13s.

In table A.1, we give the CPU time andNiter, which corre-sponds to the number of iterations for the CG and to the numberof substeps for the STS. The number of operations per iterationin the CG and per substep in the STS are equivalent, since itinvolves the same number of cells (1024). The CPU time spentwith the STS is ten times smaller than the one of the CG method.The STS also requires often twice less iterations than the CG.The bottom lines give results for calculations made with a vari-able time step, which increases with time. The correspondingprofiles are plotted in Fig. A.2. The STS remains in this casemore accurate than the CG, which is quite accurate over morethan three orders of magnitude. The CG gives good results, be-cause, thanks to the variable time steps, the diffusion wave prop-agates at a correct speed. Indeed, att = 0, the gradient of ra-diative energy is steep and the diffusion wave speed is very high.Using an initial short time step∆t = 10−16 enables us to be closerto the CFL condition associated to the diffusion wave speed.Then, radiative energy gradients and the former CFL conditionrelax and the time step can increase with time. This relaxationon the integration time step enables to maximise the accuracy ofimplicit methods using a subcycling scheme based on the diffu-sion wave speed propagation. However, this speed remains quitedifficult to estimate.

Page 14: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 13

Method Parameters ∆t CPU time (s) Niter

CG ǫconv = 1× 10−6 1× 10−16 82.9 10805CG ǫconv = 1× 10−8 1× 10−16 68.5 14623STS νsts = 0.001 , Nsts = 10 1× 10−16 20.4 9000CG ǫconv = 1× 10−6 1× 10−15 21.2 4738CG ǫconv = 1× 10−8 1× 10−15 27.8 6456STS νsts = 1× 10−6 , Nsts= 20 1× 10−15 2.8 2107STS νsts= 0.001 , Nsts= 5 1× 10−15 2.9 2408STS νsts = 0.001 , Nsts = 20 1× 10−15 2.9 2408STS νsts = 0.001 , Nsts = 10 1× 10−15 2.9 2408STS νsts= 0.005 , Nsts= 5 1× 10−15 3.1 2709STS νsts = 0.005 , Nsts = 10 1× 10−15 3.04 2709CG ǫconv = 1× 10−6 1× 10−14 11.4 2848CG ǫconv = 1× 10−8 1× 10−14 15.4 3892STS νsts = 1× 10−6 , Nsts= 20 1× 10−14 0.6 600STS νsts= 0.001 , Nsts= 5 1× 10−14 0.99 1470STS νsts = 0.001 , Nsts = 20 1× 10−14 0.75 900STS νsts = 0.001 , Nsts = 10 1× 10−14 0.69 780STS νsts= 0.005 , Nsts= 5 1× 10−14 1.1 1620STS νsts = 0.005 , Nsts = 10 1× 10−14 0.87 1170CG ǫconv = 1× 10−6 5× 10−14 6.9 1755CG ǫconv = 1× 10−8 5× 10−14 9.3 2365STS νsts = 1× 10−6 , Nsts= 20 5× 10−14 0.39 390STS νsts= 0.001 , Nsts= 5 5× 10−14 0.8 1326STS νsts = 0.001 , Nsts = 20 5× 10−14 0.56 756STS νsts = 0.001 , Nsts = 10 5× 10−14 0.46 534STS νsts= 0.005 , Nsts= 5 5× 10−14 0.87 1476STS νsts = 0.005 , Nsts = 10 5× 10−14 0.68 1032CG ǫconv = 1× 10−6 1× 10−13 4.6 1135CG ǫconv = 1× 10−8 1× 10−13 5.6 1399STS νsts = 1× 10−6 , Nsts= 20 1× 10−13 0.36 351STS νsts= 0.001 , Nsts= 5 1× 10−13 0.77 1311STS νsts = 0.001 , Nsts = 20 1× 10−13 0.52 729STS νsts = 0.001 , Nsts = 10 1× 10−13 0.43 495STS νsts= 0.005 , Nsts= 5 1× 10−13 0.83 1467STS νsts = 0.005 , Nsts = 10 1× 10−13 0.65 1020

CG ǫconv = 1× 10−8 1× 10−16 ∗ 1.05istep 19 4680STS νsts = 0.005 , Nsts = 10 1× 10−16 ∗ 1.05istep 1.7 1782

Table A.1. Summary of calculations plotted in Fig. A.1. CPU time, the number of iterations in the CG method or the number ofsubsteps in the STS method are given, for various time steps and various values ofǫconv for the CG, and Nsts andνsts for STS.

Eventually, we must conclude by pointing out that even ifthe STS method is well adapted for this problem, it remains verylimited for star formation calculations. Indeed, the diffusion timeis very short compared to the dynamical time estimated as thefree-fall time (see Fig. A.3) and then, the STS requires a toolarge number of substeps. The convergence of the CG dependson the nature of the problem and is not affected by strong differ-ences between the diffusion and the dynamical times. Moreover,we never encounter such steep gradients in the radiative energydistribution in star formation calculations. The STS couldbe effi-cient only within the fragments, where the diffusion time is verylong. This is the reason why we use only the CG method in allthis work. An alternative but non-trivial solution would betocouple the CG and the STS methods.

Page 15: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

14 B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse.

Fig. A.3. Contours in the equatorial plane of the ratio betweendiffusion and free fall times for collapse calculations. The diffu-sion time is estimated asτdiff =

l2c

3κRρ, wherel is the local Jeans

length.

Page 16: Radiation hydrodynamics with adaptive mesh refinement and ... · prestellar dense cores. Aims: We present the radiation-hydrodynamics (RHD) solver we designed for the RAMSES code

B. Commercon et al.: Radiation hydrodynamics with Adaptive Mesh Refinement and application to prestellar core collapse. 15

Fig. A.1. Comparison of the numerical solutions using STS or CG with the analytic one (black line) at timet = 1 × 10−13 s. Thecolor curves depict numerical solutions obtained with timestep∆t equals to 1× 10−13 (blue), 5× 10−14 (red), 1× 10−14 (green),1× 10−15 (yellow) and 1× 10−16 (cyan).