Open Access
Issue
A&A
Volume 698, May 2025
Article Number A310
Number of page(s) 16
Section Numerical methods and codes
DOI https://doi.org/10.1051/0004-6361/202553946
Published online 25 June 2025

© The Authors 2025

Licence Creative CommonsOpen Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

This article is published in open access under the Subscribe to Open model. Subscribe to A&A to support open access publication.

1 Introduction

Protostars harbor a rich and complex chemistry, both in their envelope and their protoplanetary disk (e.g., Jørgensen et al. 2016; McGuire 2022). Protostars are however chemically diverse (Lefloch et al. 2018), highlighting the importance of understanding the chemical and physical processes that drive this diversity.

Interferometers such as the Atacama Large Millimeter/ submillimeter Array (ALMA) and the NOrthern Extended Millimeter Array (NOEMA), with their high angular resolution (<1″), can probe the chemical content of protostellar sources at the scale of protoplanetary disks. Coupled with spectrometers, those instruments deliver observations in the form of hyperspectral cubes. Although rigorous analysis may distinguish the origin of molecular emission (the disk or the outflow for example, see e.g., Tychoniec et al. 2021), interferometric observations remain complex to analyze. Chemical models are a complementary tool to understand the origin of molecules in such regions. By carrying out radiative transfer calculations on simulated chemical abundance maps, we can produce synthetic (i.e., simulated) observations (as in Nazari et al. 2022), which allows for a more direct comparison between models and interferometric observations.

Such models require physical conditions, typically density and temperature, as input for their calculations. They are usually provided by analytical physical models (e.g., Visser et al. 2009; Gavino et al. 2021; Murillo et al. 2022) or by magnetohydrodynamics (MHD) simulations (e.g., Coutens et al. 2020; Navarro-Almaida et al. 2024). MHD simulations however require large amounts of resources. Simulating the collapse of a prestellar core, followed by the formation and evolution of a central object and a protoplanetary disk, is extremely challenging due to the wide range of spatial and temporal scales needed to describe those phenomena (Vaytet et al. 2018; Ahmad et al. 2024). Analytical and semi-analytical models require much less computational resources, allowing for broader accessibility and making parametric studies affordable. These models rely on simplifying assumptions and cannot fully capture the complexity of the underlying physics. On the other hand, they provide clear relationships between key physical parameters and their macroscopic results (e.g., the impact of the magnetic mass-to-flux ratio on the size of protoplanetary disks), which greatly facilitates the interpretation.

In this paper, we present the Analytical Protostellar Environment (APE) code1. APE simulates density, temperature, extinction, and dust-size distribution maps in a protostellar environment, including the central object, the envelope, the disk, and the outflow. The analytical model can simulate the whole system evolution throughout the prestellar core, Class 0 and Class I phases, at a fraction of the cost of MHD simulations. In addition to the physical model, we provide scripts and interfaces to other publicly available codes to perform chemical simulations (Nautilus, Ruaud et al. 2016), radiative transfer calculations (RADMC-3D, Dullemond et al. 2012), and synthetic imaging (Imager2). The aim of APE is to provide a fast and accessible way to generate maps of chemical abundances and their simulated emission.

Section 2 is dedicated to the description of APE, with Sect. 2.1 explaining in more detail the general purpose of the code. In Sect. 3, we show an example of application. We conclude in Sect. 4.

thumbnail Fig. 1

Schematic of an APE snapshot simulation.

2 The APE code

2.1 General description

APE can be used in two modes: a “snapshot” mode, in which it generates a map of density and temperature, and a “particle” mode, which calculates the trajectory of a virtual particle in the evolving system. The initial condition (t = 0) is a critical Bonnor-Ebert sphere (Ebert 1955; Bonnor 1956) for which we derived analytical evolution equations for its dynamics and density profile. After a free fall time, a central object, a disk and an outflow are created. The mass accreted in the center is distributed between the central object and the disk, from which the code computes the radius of the central object, luminosity and temperature, and the disk density and temperature profiles. Dust grains are included in the form of an evolving size-distribution. A schematic of the simulated region is displayed in Fig. 1. All APE input parameters are listed in Table 1 with their description.

2.1.1 Working modes

Snapshot mode. In snapshot mode, APE generates a map of a protostellar system with an envelope, a disk, a central object and an outflow. The code uses a 2D grid in spherical coordinates, assuming a cylindrical symmetry and a symmetry with respect to the mid-plane of the disk. The region simulated, in spherical coordinates, is then [0 ≤ rlbox, φ= 0, 0 ≤ θπ/2], with lbox the size of the simulated region (input parameter). The user can either choose a linear or a logarithmic grid spacing in radius. In each cell, the flow variables (density, temperature, velocities and the grain size-distribution) are calculated as a function of the model parameters input by the user: the mass of the initial Bonnor-Ebert sphere, the magnetic mass-to-flux ratio and the age of the central object. An example of a snapshot is displayed in Fig. 2. Generating the full map takes typically 1 second for 10 000 grid cells on a regular laptop.

Particle mode. The purpose of the particle mode is to emulate hydrodynamics simulations at a fraction of the cost. The user chooses an initial position of the particle at t = 0 (in the initial Bonnor–Ebert sphere). The trajectory of the particle is then calculated over time, until the particle reaches the center (the central object if it is created), the outflow or until a time defined by the user. The result is a complete density and temperature history of the particle. This computation can be done in reverse, with the user choosing the age of the system, like in snapshot mode, and the final position of the particle at this time. The trajectory is then calculated backward until the system reaches its initial condition at t = 0. Five to thirty seconds are needed to compute the full trajectory.

Grid of particles. The snapshot and particle modes can be combined to compute the full history of the gas displayed in a snapshot. In that case, a map is created like in snapshot mode, and a particle placed in each grid cell. APE then computes the trajectory in reverse of all those particles until t = 0. The density and temperature history of those particles can then be used as an input for a chemical modeling code, to ultimately produce maps of chemical abundances.

thumbnail Fig. 2

Top panel: density map generated by APE. Bottom panel: zoom of the inner 200 au, with a reduced color sampling.

Table 1

APE input parameters.

2.1.2 Radiative transfer

APE has been designed to work with the radiative transfer code RADMC-3D (Dullemond et al. 2012). In snapshot mode, the output files of APE can be directly used as input for RADMC-3D with opacities calculated directly from the dust grain model of APE. That way, the user can either generate a temperature map more accurate than the analytical descriptions provided in APE, or address any science topic for which radiative transfer calculations are needed. APE also offers the possibility to use temperatures from RADMC-3D simulations in particle mode. Since running radiative transfer calculations at each time-step would be costly, we provide scripts to generate snapshots at regular time intervals, on which RADMC-3D is run to produce temperature maps at those times. Subsequent APE simulations in particle mode then use those maps to interpolate (in time and space) the temperature at every time-step in the particle trajectory.

2.2 The envelope

The envelope initial condition is a critical Bonnor-Ebert sphere (Ebert 1955; Bonnor 1956) in free fall.

2.2.1 Base of the model

The Bonnor-Ebert sphere is a spherically symmetric isothermal cloud of gas in which the gravity and the thermal pressure are at equilibrium. The density profile, ρ, is normalized by the central density, ρc, D=ρρc,$\[D=\frac{\rho}{\rho_{\mathrm{c}}},\]$(1)

while the spherical radius coordinate, r, is normalized as xbe=r4πGρccs,$\[x_{\mathrm{be}}=r \frac{\sqrt{4 \pi G \rho_{\mathrm{c}}}}{c_{\mathrm{s}}},\]$(2)

with G the gravitational constant and cs the sound speed. The equilibrium between thermal pressure, P, and gravity potential, Φ, reads Φ=1ρP.$\[\nabla \Phi=-\frac{1}{\rho} \nabla P.\]$(3)

We can combine Eq. (3) with the equation of state for an isothermal perfect gas P=ρcs2,$\[P=\rho c_{\mathrm{s}}^2,\]$(4)

to obtain the relation ρ=ρceΦcs2.$\[\rho=\rho_{\mathrm{c}} e^{-\frac{\Phi}{c_{\mathrm{s}}^2}}.\]$(5)

Finally, combining the Poisson equation ΔΦ=4πGρ,$\[\Delta \Phi=4 \pi G \rho,\]$(6)

with the divergence of Eq. (3) in spherical coordinates results in the Lane–Emden equation d2Φdxbe2+2xbedΦdxbe=eΦcs2.$\[\frac{\mathrm{d}^2 \Phi}{\mathrm{~d} x_{\mathrm{be}}^2}+\frac{2}{x_{\mathrm{be}}} \frac{\mathrm{~d} \Phi}{\mathrm{~d} x_{\mathrm{be}}}=e^{-\frac{\Phi}{c_{\mathrm{s}}^2}}.\]$(7)

The normalized radius of a critical Bonnor-Ebert sphere is xbe = xcrit ≈ 6.451, above which no hydrostatic equilibrium is possible. The gravitational potential and density profiles, Φ(xbe) and ρ(xbe), are integrated using the Lane-Emden Equation (7), with Φ(0) = 0 and dΦ/dxbe(0) = 0. The resulting Bonnor-Ebert density profile, D(xbe), is represented in Fig. 3.

The mass of the cloud of radius rcld is given by Mcld=0rcld4πr2ρ(r)dr,=4πρc(cs4πGρc)30xcrit D(x)xbe2dxbe,=Imcs3G32(4π)12ρc12,$\[\begin{aligned}M_{\mathrm{cld}} & =\int_0^{r_{\mathrm{cld}}} 4 \pi r^2 \rho(r) d r, \\& =4 \pi \rho_{\mathrm{c}}\left(\frac{c_{\mathrm{s}}}{\sqrt{4 \pi G \rho_{\mathrm{c}}}}\right)^3 \int_0^{x_{\text {crit }}} D(x) x_{\mathrm{be}}^2 d x_{\mathrm{be}}, \\& =I_m c_{\mathrm{s}}^3 G^{-\frac{3}{2}}(4 \pi)^{-\frac{1}{2}} \rho_{\mathrm{c}}^{-\frac{1}{2}},\end{aligned}\]$(8)

where Im is the value of the integral on x that approximates to 15.7 when integrating the whole profile. Finally the central density is given by ρc=Im2cs6G3(4π)1Mcld2=7.78×1019gcm3(McldM)2.$\[\rho_{\mathrm{c}}=I_m^2 c_{\mathrm{s}}^6 G^{-3}(4 \pi)^{-1} M_{\mathrm{cld}}^{-2}=7.78 \times 10^{-19} \mathrm{~g} \mathrm{~cm}^{-3}\left(\frac{M_{\mathrm{cld}}}{M_{\odot}}\right)^{-2}.\]$(9)

We assumed that the enclosed mass is invariant with time for a given fluid particle (equivalent to collapsing spherical shells that cannot cross each-other). The free fall velocity of a particle at radius r would then be vr(r)=2GMin(r)/r$\[v_{r}(r)=-\sqrt{2 G M_{\text {in}}(r) / r}\]$, where Min(r) is the mass enclosed at radius r. However, several physical processes support the gas against gravity, effectively reducing the infall velocity: rotation, thermal pressure, magnetic fields and turbulence. The effective free fall time can then be increased by a factor ~1.3–2 with rotation and thermal pressure alone (see e.g., Gabbasov et al. 2017), and by a factor ≳2 between moderate and strong magnetic fields (Masson et al. 2016). We therefore assumed a factor 2 reduction in radial velocity and adopt vr(r)=GMin(r)2r.$\[v_r(r)=-\sqrt{\frac{G M_{\mathrm{in}}(r)}{2 r}}.\]$(10)

Solving the differential equation drdt=vr(r),$\[\frac{d r}{d t}=v_r(r),\]$(11)

yields the following analytical expression r(t)=[r03232GMin(r0)2t]23,$\[r(t)=\left[r_0^{\frac{3}{2}}-\frac{3}{2} \sqrt{\frac{G M_{\mathrm{in}}\left(r_0\right)}{2}} t\right]^{\frac{2}{3}},\]$(12)

where r0 is the radius of the fluid particle at t = 0.

thumbnail Fig. 3

Normalized density profile of a Bonnor-Ebert sphere.

2.2.2 Computing the flow variables

The aim is to compute the density and velocity at any given time, t, and radius, r, in the envelope. Rewriting Eq. (12) at a time t and radius r, the equation 1r0[r03232GMin(r0)2t]23rr0=0,$\[\frac{1}{r_0}\left[r_0^{\frac{3}{2}}-\frac{3}{2} \sqrt{\frac{G M_{\mathrm{in}}\left(r_0\right)}{2}} t\right]^{\frac{2}{3}}-\frac{r}{r_0}=0,\]$(13)

is solved for r0(r, t) by dichotomy. With the initial position of the fluid particle, we obtain the enclosed mass by integrating Eq. (8), and the radial velocity with Eq. (10). To calculate the density, we considered the compression of a thin spherical shell contained between radii r and r + dr. The density is then computed using the initial density of the fluid particle ρ(r0(r, t), t = 0), from the initial Bonnor-Ebert density profile, and the volume compression of the spherical shell between [r0(r, t); r0(r + dr, t)] and [r, r + dr]. We therefore have ρ(r,t)=ρ(r0(r,t),t=0)r0(r+dr,t)3r0(r,t)3(r+dr)3r3.$\[\rho(r, t)=\rho\left(r_0(r, t), t=0\right) \frac{r_0(r+\mathrm{d} r, t)^3-r_0(r, t)^3}{(r+\mathrm{d} r)^3-r^3}.\]$(14)

In the code, we take dr = r/100. While the Bonnor–Ebert density profile is asymptotically proportional to r−2, the slope transitions toward r−1.5 as the collapse proceeds, similarly to other free fall analytical models (e.g., Cassen & Moosman 1981; Hartmann 2009). Figure 4 shows the density profile of the envelope for a 2 M cloud at time t ≈ 192 kyr (free fall time of 152 kyr). To validate our envelope model, we also present a comparison between the envelope model of APE and a MHD simulation in Appendix A.

The envelope rotation velocity has no impact on the physical model, but can be relevant for synthetic observations. We assumed that the envelope is initially rotating at an angular velocity of Ω0, which is chosen by the user. The angular velocity at a radius r and time t is then simply calculated assuming angular momentum conservation Ω(r,t)=Ω0(r0(r,t)r)2.$\[\Omega(r, t)=\Omega_0\left(\frac{r_0(r, t)}{r}\right)^2.\]$(15)

thumbnail Fig. 4

Density profile of a collapsing Bonnor–Ebert sphere following our model, for a 2 M sphere at time t ≈ 192 kyr (in blue). The dashed black line represents a r32$\[r^{-\frac{3}{2}}\]$ profile.

2.2.3 Maximum time

Assuming the cloud has a normalized radius of x = xcrit = 6.451, we can compute the cloud radius rcld with Eq. (2). The edge of the cloud reaches the center at time tmax, with r(tmax)=[rcld3232GMcld2tmax]23=0.$\[r\left(t_{\max }\right)=\left[r_{\mathrm{cld}}^{\frac{3}{2}}-\frac{3}{2} \sqrt{\frac{G M_{\mathrm{cld}}}{2}} t_{\max }\right]^{\frac{2}{3}}=0.\]$(16)

Therefore tmax=223GMcldrcld32.$\[t_{\max }=\frac{2 ~\sqrt{2}}{3 ~\sqrt{G M_{\mathrm{cld}}}} r_{\mathrm{cld}}^{\frac{3}{2}}.\]$(17)

Replacing rcld with Equation (2), Mcld with Eq. (8), and ρc using the free fall time expression tff=3π32Gρc,$\[t_{\mathrm{ff}}=\sqrt{\frac{3 \pi}{32 G \rho_{\mathrm{c}}}},\]$(18)

we obtain tmax=8xcrit3233πImtff2tff.$\[t_{\max }=\frac{8 x_{\mathrm{crit}}^{\frac{3}{2}}}{3 ~\sqrt{3} \pi ~\sqrt{I_m}} t_{\mathrm{ff}} \approx 2 t_{\mathrm{ff}}.\]$(19)

Beyond 2 free fall time, we therefore considered by default that the envelope is depleted. Should the user wish to extend the envelope lifetime beyond 2 free fall times, APE provides the possibility to do so by changing an “effective” xcrit which only affects the extent of the initial Bonnor-Ebert sphere (not the central density or the free fall time).

2.2.4 Envelope temperature

In APE, the temperature may be computed using the radiative transfer code RADMC-3D (Dullemond et al. 2012), which provides a temperature at each location for each grain size. We also provide a size-independent approximation of the temperature for faster calculations, which we describe hereafter. The initial envelope temperature Tmc is set by the user with the temp_molecular_cloud parameter. Once the central object is ignited and starts radiating from its surface, the temperature rises. Assuming the envelope is optically thin, the total energy flux is conserved when integrated over a sphere. Therefore, writing ϕ(r) the radiative power received per surface unit at radius r, the quantity ϕ(r)4πr2 is constant with respect to r. Assuming the central object is a black body, the radiative flux emitted per surface unit at the central object surface is ϕ(R)=σBT4,$\[\phi_*\left(R_*\right)=\sigma_{\mathrm{B}} T_*^4,\]$(20)

with R* and T* the radius and temperature of the central object, and σB the Stefan-Boltzmann constant. The total radiative flux crossing a sphere of radius r is then equal to the flux emitted by the central object 4πr2ϕ(r)=4πR2ϕ(R).$\[4 \pi r^2 \phi(r)=4 \pi R_*^2 \phi_*\left(R_*\right).\]$(21)

Assuming a background radiation from the surrounding molecular cloud at temperature Tmc, a dust grain at a distance r then receives the radiative power per surface unit ϕgrain (r)=ϕ(r)+σBTmc4,$\[\phi_{\text {grain }}(r)=\phi(r)+\sigma_{\mathrm{B}} T_{\mathrm{mc}}^4,\]$(22)

At thermal equilibrium, assuming that the grains are black bodies, the received and emitted flux are equal. ϕgrain (r)=σBTgrain (r)4.$\[\phi_{\text {grain }}(r)=\sigma_{\mathrm{B}} T_{\text {grain }}(r)^4.\]$(23)

Combining Eqs. (20), (22) and (23), we obtain the grain equilibrium temperature independent of the grain size. Tgrain(r)=[(Rr)2T4+Tmc4]14.$\[T_{\mathrm{grain}}(r)=\left[\left(\frac{R_*}{r}\right)^2 T_*^4+T_{\mathrm{mc}}^4\right]^{\frac{1}{4}}.\]$(24)

Assuming the gas and grains reach thermal equilibrium quickly, we write T(r) ≈ Tgrain(r). This model does not account for the shadow cast by the disk, which lowers the temperature of the envelope near the midplane. However, this temperature is simply an estimate that does not affect the density or dynamics of the envelope. This relation provides a good approximation to the envelope temperature calculated by the radiative transfer computations of RADMC-3D, for r ≳ 50 au. Closer to the central object, the envelope temperature is higher along the walls of the outflow cavity. For a precise temperature map, we encourage users to perform the radiative transfer calculations with the tools provided with APE.

2.3 The central object

The typical density at which the first hydrostatic core collapses to form the central object is typically 10−8 g cm−3 (Larson 1969; Vaytet et al. 2018). This density is reached at around t = tff after the start of the collapse. We therefore set the creation of the central object and the disk at t = tff.

2.3.1 Mass and radius

We defined the total accreted mass Macc as the mass of the envelope that has collapsed within the innermost cells (typically on a scale of 1 au). This mass is distributed between the disk Mdisk and the central object M*. Adams & Shu (1986) derive Mdisk=(1η)MdMacc,$\[M_{\mathrm{disk}}=(1-\eta) \mathcal{M}_{\mathrm{d}} M_{\mathrm{acc}},\]$(25)

with η a free parameter, and Md=13uu1(1u)12u43du,$\[\mathcal{M}_{\mathrm{d}}=\frac{1}{3} u_* \int_{u_*}^1(1-u)^{\frac{1}{2}} u^{-\frac{4}{3}} d u,\]$(26)

where u* = R*/rdisk. Following Young & Evans (2005), we take η = 0.75 so that the ratio Mdisk/M* remains close to the observationally estimated value of ≈1/3 (Li 2002; Kratter et al. 2008). The star mass is therefore M=MMdisk=(1(1η)Md)Macc.$\[M_*=M-M_{\mathrm{disk}}=\left(1-(1-\eta) \mathcal{M}_{\mathrm{d}}\right) M_{\mathrm{acc}}.\]$(27)

The radius of the central object, R*, is controlled by the increase in entropy at the accretion shock on its surface, as well as the extent of its convection zone and the deuterium-burning zone. This calculation was performed in detail by Hosokawa & Omukai (2009) for low- and high-mass central objects. We used tabulated results from their simulations that provide the evolution of the radius and luminosity of young stars as a function of their mass and accretion rate. The instantaneous accretion rate M˙$\[\dot{M}\]$ is calculated at any time t as the variation in the accreted mass Macc between times 0.99t and 1.01t. We assumed that the central object receives 75% of this mass to match the approximate mass ratio between the disk and the central object. We then paired the evolution tracks of Hosokawa & Omukai (2009) with Equation (27) and determine the corresponding M* and R* by dichotomy and interpolation of the tables. The upper panel of Fig. 5 shows the mass–radius relation for several accretion rates. The radius generally increases with mass, although central objects undergo a phase of swelling and contraction above 3 M. Those relations have been computed up to 10 M for M˙=106Myr1$\[\dot{M}=10^{-6} \mathrm{M}_{\odot} ~\mathrm{yr}^{-1}\]$ and 90 M for M˙=103Myr1$\[\dot{M}=10^{-3} \mathrm{M}_{\odot} ~\mathrm{yr}^{-1}\]$.

2.3.2 Luminosity and temperature

We interpolated the central object luminosity L* from the tabulated results of Hosokawa & Omukai (2009), using the calculated accretion rate and mass of the central object. L* includes both the photometric luminosity and the accretion luminosity. The bottom panel of Fig. 5 displays both the photometric and total luminosities as a function of M* for different accretion rates. The effective temperature of central object is then calculated from L* and R* as T=(L4πσBR2)14.$\[T_*=\left(\frac{L_*}{4 \pi \sigma_{\mathrm{B}} R_*^2}\right)^{\frac{1}{4}}.\]$(28)

2.4 The disk

2.4.1 The magnetic field and disk radius

Magnetic fields are important for the formation and evolution of protoplanetary disks. The field is coupled to the gas and gets twisted by its rotation. That creates a magnetic tension force that opposes the rotation, which is called magnetic braking. In an ideal magnetohydrodynamics (MHD) description, the magnetic field is perfectly coupled to the gas. The field piles-up in the central region and creates a strong braking, preventing the formation of a rotationally supported disk (RSD). The non-ideal MHD description, which accounts for dissipative and decoupling processes of the magnetic field, is needed to prevent such a strong braking and the unbounded pile-up of the magnetic field.

Lee et al. (2021) derived analytical formulae for the radius of RSDs under a full non-ideal magnetohydrodynamics (MHD) regime. They assume that at equilibrium, the accretion of angular momentum compensates exactly the loss by magnetic braking, and consider relevant non-ideal MHD effects in different regimes. In the present model, we do not explicitly calculate the magnetic field geometry, but we can estimate the strength of the magnetic field in the disk. As highlighted by Masson et al. (2016) and Vaytet et al. (2018), the magnetic field strength reaches a plateau in the disk region due to its dissipation by diffusive effects. In the envelope, the magnetic field intensity increases with the contraction of the gas. Following Nakano et al. (2002), we have B=1λ4(πkBTρμmp)12=4.27×102G(ρ1013gcm3)12λ1,$\[B=\frac{1}{\lambda} 4\left(\frac{\pi k_{\mathrm{B}} T \rho}{\mu m_{\mathrm{p}}}\right)^{\frac{1}{2}}=4.27 \times 10^{-2} \mathrm{G}\left(\frac{\rho}{10^{-13} \mathrm{~g} \mathrm{~cm}^{-3}}\right)^{\frac{1}{2}} ~\lambda^{-1},\]$(29)

where kB is the Boltzmann constant, μ = 2.31, the mean atomic mass of molecules in the gas, and mp the mass of the proton. λ is the mass-to-flux ratio, which is defined by Mouschovias & Spitzer (1976) as λ=M/ΦB(M/ΦB)crit,$\[\lambda=\frac{M / \Phi_{\mathrm{B}}}{\left(M / \Phi_{\mathrm{B}}\right)_{\mathrm{crit}}},\]$(30)

with M the cloud mass, ΦB=πrcld2B$\[\Phi_{\mathrm{B}}=\pi r_{\text {cld}}^{2} B\]$ the magnetic flux and (MΦB)crit=0.533π5G.$\[\left(\frac{M}{\Phi_{\mathrm{B}}}\right)_{\mathrm{crit}}=\frac{0.53}{3 \pi} ~\sqrt{\frac{5}{G}}.\]$(31)

We therefore have λB−1. The mass-to-flux ratio is the main parameter influencing the disk size, and can take any value > 1 (Crutcher 1999). Numerical simulations generally consider λ values between 2 and 10 for magnetized cores. We calculated the magnetic field strength at ρ = 10−13 g cm−3, which is the formation density of the first hydrostatic core (Larson 1969), which coincides with the formation of the disk.

Lee et al. (2021) determine two possible outcomes that are the “para-disk” and the “ortho-disk” (see also Tsukamoto et al. 2015), depending on the relative directions of the disk rotation and the Hall drift of magnetic field lines. Ultimately, they show that the ortho-disk is short-lived and that a counter-rotating para-disk eventually forms, which is also observed in simulations (Tsukamoto et al. 2017; Zhao et al. 2020). Hennebelle et al. (2016) and Lee et al. (2021) derive the radius of the para-disk rdisk(t)=19.2au[ηA1019cm2s1]29[Macc(t)0.1M]13[B0.1G]49.$\[r_{\mathrm{disk}}(t)=19.2 ~\mathrm{au}\left[\frac{\eta_{\mathrm{A}}}{10^{19} \mathrm{~cm}^2 \mathrm{~s}^{-1}}\right]^{\frac{2}{9}}\left[\frac{M_{\mathrm{acc}}(t)}{0.1 ~\mathrm{M}_{\odot}}\right]^{\frac{1}{3}}\left[\frac{B}{0.1 ~\mathrm{G}}\right]^{-\frac{4}{9}}.\]$(32)

Using our magnetic field prescription, Eq. (32) becomes rdisk(t)=28.0au[ηA1019cm2s1]29[Macc(t)0.1M]13λ49.$\[r_{\mathrm{disk}}(t)=28.0 ~\mathrm{au}\left[\frac{\eta_{\mathrm{A}}}{10^{19} \mathrm{~cm}^2 \mathrm{~s}^{-1}}\right]^{\frac{2}{9}}\left[\frac{M_{\mathrm{acc}}(t)}{0.1 ~\mathrm{M}_{\odot}}\right]^{\frac{1}{3}} ~\lambda^{\frac{4}{9}}.\]$(33)

The ambipolar resistivity ηA depends on the physical and chemical environments. The ambipolar resistivity is of the order of 1020 cm2 s−1 in the envelope, but decreases by a few orders of magnitude in higher density regions such as the disk (Marchand et al. 2016). However, the disk radius depends only weakly on the resistivity, with an exponent of 2/9. While it is possible to calculate it self-consistently, it would increase the number of parameters that rdisk depends on for a minor gain. Instead, we imposed a value of ηA = 1018 cm2 s−1 (consistent with MHD simulations, e.g., Wurster et al. 2016, 2017; Marchand et al. 2023; Lebreuilly et al. 2023), so that the user can act more directly on the disk size through the mass-to-flux ratio λ.

thumbnail Fig. 5

Upper panel: mass–radius relation of central objects for different accretion rates, from the tabulated results of Hosokawa & Omukai (2009). Bottom panel: same as upper panel for the mass-luminosity relation. The solid lines represent the total central object luminosity L*, while dashed lines represent only the photometric luminosity (excluding the accretion luminosity).

2.4.2 The disk profile

We assumed an α disk framework (Shakura & Sunyaev 1973), where α is a free-parameter chosen by the user. At a given time, t, and cylindrical radius, rc, the viscosity of the gas is given by ν(rc,t)=αcs(rc,t)H(rc,t),$\[\nu\left(r_{\mathrm{c}}, t\right)=\alpha c_{\mathrm{s}}\left(r_{\mathrm{c}}, t\right) H\left(r_{\mathrm{c}}, t\right),\]$(34)

where cs(rc,t)=kBTm(rc,t)μmp,$\[c_{\mathrm{s}}\left(r_{\mathrm{c}}, t\right)=\sqrt{\frac{k_{\mathrm{B}} T_{\mathrm{m}}\left(r_{\mathrm{c}}, t\right)}{\mu m_{\mathrm{p}}}},\]$(35)

is the sound speed evaluated at the mid-plane, H(rc,t)=csΩK(rc,t),$\[H(r_{\mathrm{c}}, t)=\frac{c_{\mathrm{s}}}{\Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right)},\]$(36)

is the scale height of the disk at a radius rc, and ΩK(rc,t)=GM(t)rc3,$\[\Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right)=\sqrt{\frac{G M_*(t)}{r_{\mathrm{c}}^3}},\]$(37)

is the Keplerian angular velocity.

We used a power-law with an exponential cut-off to describe the surface density profile (Lynden-Bell & Pringle 1974) Σ(rc,t)=Σ0(t)(rcrdisk (t))1erc/rdisk (t),$\[\Sigma\left(r_{\mathrm{c}}, t\right)=\Sigma_0(t)\left(\frac{r_{\mathrm{c}}}{r_{\text {disk }}(t)}\right)^{-1} e^{-r_{\mathrm{c}} / r_{\text {disk }}(t)},\]$(38)

where Σ0(t) is calculated as a function of the disk mass Mdisk(t)=rirdisk02πΣ(rc,t)rcdrcdϕ=2πΣ0(t)rdisk(t)2(eri/rdisk(t)e1).$\[\begin{aligned}M_{\text {disk}}(t) & =\int_{r_{\mathrm{i}}}^{r_{\text {disk}}} \int_0^{2 \pi} \Sigma\left(r_{\mathrm{c}}, t\right) r_{\mathrm{c}} \mathrm{d} r_{\mathrm{c}} \mathrm{d} \phi \\& =2 \pi \Sigma_0(t) r_{\text {disk}}(t)^2\left(e^{-r_{\mathrm{i}} / r_{\text {disk}}(t)}-e^{-1}\right).\end{aligned}\]$(39)

In APE, the user can choose to either leave the exponential cutoff in Eq. (38), or to sharply cut the disk at a radius rdisk. The volume density profile at the mid-plane can then be calculated as ρm(rc,t)=Σ(rc,t)H(rc,t)2π,$\[\rho_{\mathrm{m}}\left(r_{\mathrm{c}}, t\right)=\frac{\Sigma\left(r_{\mathrm{c}}, t\right)}{H\left(r_{\mathrm{c}}, t\right) \sqrt{2 \pi}},\]$(40)

and the vertical profile ρ(rc,z,t)=ρm(rc,t)exp(z22H2(rc,t)).$\[\rho\left(r_{\mathrm{c}}, z, t\right)=\rho_{\mathrm{m}}\left(r_{\mathrm{c}}, t\right) \exp \left(-\frac{z^2}{2 H^2\left(r_{\mathrm{c}}, t\right)}\right).\]$(41)

In addition to the Keplerian angular velocity (Eq. (37)), the gas in an α disk slowly drifts inward due to the viscosity, with a velocity vr(rc,t)=32αcs2(rc,t)rcΩK(rc,t).$\[v_r\left(r_{\mathrm{c}}, t\right)=-\frac{3}{2} \alpha \frac{c_{\mathrm{s}}^2\left(r_{\mathrm{c}}, t\right)}{r_{\mathrm{c}} \Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right)}.\]$(42)

2.4.3 The disk temperature

Many variables depend on the temperature of the disk, through the value of the sound speed. To calculate the temperature of the mid-plane Tm(rc, t) (dropping the (rc,t) notation hereafter), we followed the method of Hueso & Guillot (2005). The temperature value is a balance between the stellar and cloud ambient irradiation, the viscous dissipation of kinetic energy, and the cooling σBTm4=18(38τR+12τP)Σ(rc,t)ν(rc,t)ΩK2(rc,t)+σBT4.$\[\sigma_{\mathrm{B}} T_{\mathrm{m}}^4=\frac{1}{8}\left(\frac{3}{8} \tau_{\mathrm{R}}+\frac{1}{2 \tau_{\mathrm{P}}}\right) \Sigma\left(r_{\mathrm{c}}, t\right) \nu\left(r_{\mathrm{c}}, t\right) \Omega_{\mathrm{K}}^2\left(r_{\mathrm{c}}, t\right)+\sigma_{\mathrm{B}} T_{\ell}^4.\]$(43)

The first term on the right-hand-side is a sum of optically thin and optically thick contributions (Nakamoto & Nakagawa 1994), with τR and τP the Rosseland and Planck mean optical depths, respectively. Similarly to the envelope, T represents the temperature equilibrium between the stellar irradiation T,1 and the ambient cloud temperature Tmc = 10 K, so that T4=T,14+Tmc4.$\[T_{\ell}^4=T_{\ell, 1}^4+T_{\mathrm{mc}}^4.\]$(44)

Temperature T,1 is a function of the temperature of the central object T* and radius R*. It is given by Adams et al. (1988); Ruden & Pollack (1991) and reads T,1=T[23π(Rrc)3+12(Rrc)2(Hrc)(dlnHdlnrc1)]14,$\[T_{\ell, 1}=T_*\left[\frac{2}{3 \pi}\left(\frac{R_*}{r_{\mathrm{c}}}\right)^3+\frac{1}{2}\left(\frac{R_*}{r_{\mathrm{c}}}\right)^2\left(\frac{H}{r_{\mathrm{c}}}\right)\left(\frac{d ~\ln~ H}{d ~\ln~ r_{\mathrm{c}}}-1\right)\right]^{\frac{1}{4}},\]$(45)

where d ln H/d ln r = 9/7 is assumed to avoid numerical instability (Hueso & Guillot 2005).

As Hueso & Guillot (2005), we assumed τP=2.4τR,$\[\tau_{\mathrm{P}}=2.4 \tau_{\mathrm{R}},\]$(46)

and we took τR=κRΣ2.$\[\tau_{\mathrm{R}}=\frac{\kappa_{\mathrm{R}} \Sigma}{2}.\]$(47)

Rosseland opacities κR are calculated from the DSHARP opacities (Birnstiel et al. 2018) using the local dust grain size-distribution (see Sect. 2.6). The coefficients are averaged over the size-distribution κR=aminamaxn(a)m(a)κR(a)daaminamaxn(a)m(a)da,$\[\kappa_{\mathrm{R}}=\frac{\int_{a_{\min }}^{a_{\max }} n(a) m(a) \kappa_{\mathrm{R}}(a) \mathrm{d} a}{\int_{a_{\min }}^{a_{\max }} n(a) m(a) \mathrm{d} a},\]$(48)

where amin and amax are the minimum and maximum grain sizes of the distribution, n(a) the number density of grains of size a and m(a) their mass. Here, the choice of opacities effectively influences the temperature of the midplane of the disk where the viscosity is high (typically r ≲ 30 au). In turn, this impacts the local scale-height, H, and thus the density in the same regions (with subsequent consequences on chemical abundances). For example, higher opacities would increase the temperature and the scale-height, but decrease the density of the gas. The DSHARP opacities are the default in APE, but the user can also generate their own opacity table (the process is explained in the APE user manual provided with the code).

Grains start to sublimate at temperatures ≳750 K, effectively reducing the opacity. Based on Lenzuni et al. (1995) and similarly to Marchand et al. (2016), we considered that the grain number decreases in several stages, representing the successive sublimation of carbon, silicate and aluminum material. We assumed that grains are made of a unique material, and we modeled this phenomenon by considering a linear decrease in a given material between two temperatures T1 and T2. Those temperatures and relative abundance of the materials are summarized in Table 2. The temperature at which all grains have sublimated, Tevap = 1700 K, is imposed as the maximum temperature in the disk. This impacts only the innermost regions of the disk (typically ≲5 au).

The temperature Equation (43) can then be rewritten in the form σBTm4(Y1(rc,t)κR(Tm)+Y2(rc,t)κR(Tm))TmY3(rc,t)Tm12Y4(rc,t)=0,$\[\sigma_{\mathrm{B}} T_{\mathrm{m}}^4-\left(Y_1\left(r_{\mathrm{c}}, t\right) \kappa_{\mathrm{R}}\left(T_{\mathrm{m}}\right)+\frac{Y_2\left(r_{\mathrm{c}}, t\right)}{\kappa_{\mathrm{R}}\left(T_{\mathrm{m}}\right)}\right) T_{\mathrm{m}}-Y_3\left(r_{\mathrm{c}}, t\right) T_{\mathrm{m}}^{\frac{1}{2}}-Y_4\left(r_{\mathrm{c}}, t\right)=0,\]$(49)

where we have Y1(rc,t)=364kBμmpαΣ2(rc,t)ΩK(rc,t),$\[Y_1\left(r_{\mathrm{c}}, t\right)=\frac{3}{64} \frac{k_{\mathrm{B}}}{\mu m_{\mathrm{p}}} \alpha \Sigma^2\left(r_{\mathrm{c}}, t\right) \Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right),\]$(50) Y2(rc,t)=596kBμmpαΩK(rc,t),$\[Y_2\left(r_{\mathrm{c}}, t\right)=\frac{5}{96} \frac{k_{\mathrm{B}}}{\mu m_{\mathrm{p}}} \alpha \Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right),\]$(51) Y3(rc,t)=σBT4kBμmp17ΩK(rc,t)rc(Rrc)2,$\[Y_3\left(r_{\mathrm{c}}, t\right)=\sigma_{\mathrm{B}} T_*^4 \sqrt{\frac{k_{\mathrm{B}}}{\mu m_{\mathrm{p}}}} \frac{1}{7 \Omega_{\mathrm{K}}\left(r_{\mathrm{c}}, t\right) r_{\mathrm{c}}}\left(\frac{R_*}{r_{\mathrm{c}}}\right)^2,\]$(52) Y4(rc,t)=23πσBT4(Rrc)3+σBTmc4.$\[Y_4\left(r_{\mathrm{c}}, t\right)=\frac{2}{3 \pi} \sigma_{\mathrm{B}} T_*^4\left(\frac{R_*}{r_{\mathrm{c}}}\right)^3+\sigma_{\mathrm{B}} T_{\mathrm{mc}}^4.\]$(53)

Solving Eq. (49) for Tm provides the mid-plane temperature profile, from which cs(rc, t), H(rc, t), and ρ(rc, z, t) can be deduced.

Table 2

Grain sublimation parameters.

2.5 Outflow

The magneto-centrifugal forces can launch a collimated jet at the scale of the central object. This creates a conic cavity with an opening angle, γ, in which low-density gas escapes at velocities of several 10 s of km s−1. We assumed that the opening angle varies with height, in accordance to observations (Velusamy & Langer 1998; Cantó et al. 2008). As in Visser et al. (2011), the cavity boundary is defined by rc(au)<rcav=(z0.191au)23(ttacc)2,$\[r_{\mathrm{c}}(\mathrm{au})<r_{\mathrm{cav}}=\left(\frac{z}{0.191 ~\mathrm{au}}\right)^{\frac{2}{3}}\left(\frac{t}{t_{\mathrm{acc}}}\right)^2,\]$(54)

for t > t*, where tacc = 2tff. Although the gas velocity in the jet does not affect the global structure, we assumed that this velocity is the escape velocity from the central object taken at the inner radius of the disk vesc=2GMrin,$\[v_{\mathrm{esc}}=\sqrt{\frac{2 G M_*}{r_{\mathrm{in}}}},\]$(55)

where rin=L4πσBTevap4.$\[r_{\mathrm{in}}=\sqrt{\frac{L_*}{4 \pi \sigma_{\mathrm{B}} T_{\mathrm{evap}}^4}}.\]$(56)

The density of the gas inside outflow cavity walls is much lower than that of the disk or the envelope. It is generally measured to be ~103 to ~106 cm−3 in both models and observations (e.g., Lefloch et al. 2015; Rivera-Ortiz et al. 2023), with densities of ~104 cm−3 generally used in analytical models (e.g., Visser et al. 2009). Here, we assumed that the outflow density is 104 cm−3 at z = 1000 au, and decreases with height as the cross-section of the cavity increases. nH(z)=nH,0(zz0)2,$\[n_{\mathrm{H}}(z)=n_{\mathrm{H}, 0}\left(\frac{z}{z_0}\right)^{-2},\]$(57)

with nH,0 = 104 cm−3 and z0 = 1000 au. The outflow is a low-opacity region through which the radiative flux of the central object can heat the envelope outside the cavity walls. The opening angle therefore impacts the location of the heated region, while the density affects the efficiency of this heating.

2.6 Dust grains

We included a treatment of the dust size-distribution to estimate the opacities for radiative transfer calculations. While the characteristic size of grains is sub-micron in the interstellar medium (Mathis et al. 1977), they grow by coagulation during star formation and can quickly reach radii larger than 100 μm in protoplanetary disks (Marchand et al. 2023). In APE, we have implemented the simulation results of Lebreuilly et al. (2023). They performed 1D non-ideal MHD simulations of protostellar collapses using the SHARK code (Lebreuilly et al. 2023) to track the evolution of the grain size-distribution by coagulation and fragmentation. This evolution is controlled by the collision rates between grains. Lebreuilly et al. (2023) take into account differential grain-grain velocities originating from the gas turbulence (Ormel & Cuzzi 2007), ambipolar diffusion (due to the electrical charges of grains, see Guillet et al. 2020) and Brownian motion (Bate 2022). Turbulence is efficient at growing large grains in high-density environments (as the disk), while ambipolar diffusion and Brownian motion efficiently remove small grains in the envelope. In the disk, the fragmentation limits the growth and repopulate the small-grains population.

We used the last output of the simulation PC1-FRAG of Lebreuilly et al. (2023) to associate gas densities with size-distributions. The simulation was originally performed using 100 bins in size between 7 nm and 1 cm, with a dust-to-gas mass ratio of 1%. This large number of bins may however result in expensive radiative transfer calculations, and we resampled the distribution into 20 bins between 16 nm and 3.9 mm. In APE, we provide the resampled distribution and the associated opacities for radiative transfer post-processing. Size-distributions at ρ = 10−17, 10−14 and 10−11 g cm−3 are displayed in Fig. 6. In the envelope (represented by the solid line), the distribution is close to the initial Mathis, Rumpl, Nordsieck (MRN) distribution (Mathis et al. 1977), with the peak of the distribution shifting toward larger sizes as the density increases.

The results of Lebreuilly et al. (2023) are however only valid for a dust-to-gas mass ratio of 0.01. As users may desire different dust-to-gas mass ratios, we provide an alternative grain coagulation model. Marchand et al. (2021) show that, when considering only collisions from turbulence, the dust coagulation can be treated as a 1-dimension problem. Size-distributions depend then only on the initial distribution, and one variable that they name χ, which is a function of the density and temperature history of the grains. This variable also scales linearly with the dust-to-gas mass ratio. 3D simulations with non-ideal MHD by Marchand et al. (2023) present the evolution of χ and the dust size throughout the collapse. From their simulation, we derived a prescription for χ at a dust-to-gas mass ratio of 0.01 χ(0.01)={1016(ρ3×1020)14(ρ1015gcm3)1.34×1018(ρ3.83×1012)115(T10)115(ρ>1015gcm3).$\[\chi(0.01)=\left\{\begin{array}{ll}10^{16}\left(\frac{\rho}{3 \times 10^{-20}}\right)^{\frac{1}{4}} & \left(\rho \leq 10^{-15} \mathrm{~g} \mathrm{~cm}^{-3}\right) \\1.34 \times 10^{18}\left(\frac{\rho}{3.83 \times 10^{-12}}\right)^{\frac{1}{15}}\left(\frac{T}{10}\right)^{\frac{1}{15}} & \left(\rho>10^{-15} \mathrm{~g} \mathrm{~cm}^{-3}\right)\end{array}.\right.\]$(58)

χ is then linearly scaled by the desired dust-to-gas mass ratio, dtg. χ(dtg)=χ(0.01)dtg0.01.$\[\chi(d t g)=\chi(0.01) \frac{d t g}{0.01}.\]$(59)

The prescription is discontinuous as the growth of grains is fast at densities ρ > 10−15 g cm−3 (Marchand et al. 2023). The outflow is composed of material lifted from regions in the vicinity of the disk, typically at densities close to ρ = 10−15 g cm−3 (Marchand et al. 2023); we therefore considered that the value of χ in the outflow matches the one at density ρ = 10−15 g cm−3. We have generated a tabulated size-distribution evolution path as a function of χ using the Ishinisan code (Marchand et al. 2021). We provide this evolution path with APE. The dust abundance is then read from the table using the local values of χ.

In APE, choosing a dust-to-gas mass ratio exactly equal to 0.01 is equivalent to choosing the coagulation model of Lebreuilly et al. (2023). Any other value of dtg switches the coagulation model to Marchand et al. (2023). The user can also choose to turn off the coagulation to only have a MRN distribution.

As grains grow, their total surface area decreases, which can impact the chemical evolution. However, to our knowledge, no chemical code currently supports an evolving grain size-distribution. Nautilus, in particular, supports only a fixed grain size with a fixed dust-to-gas mass ratio. A few attempts at emulating the evolution of grains in chemical networks have been published. For example, Iqbal & Wakelam (2018) implemented a fixed, full size-distribution in Nautilus. They found that differences in the chemical evolution between two size-distributions could be small as long as the total surface areas were close, but could become significant otherwise or in the presence of cosmicrays. More recently, Navarro-Almaida et al. (2024) modified Nautilus by computing an effective grain size at each step. They found that the main impact of the decrease in grain surface area is seen in dense regions, below 100 K, as many species are still in solid phase. APE has been designed to interface with any chemical code, preferentially with the public version of Nautilus. Tools and methods to account for an evolving grain size-distribution in chemical simulations are still being developed and, to this day, none are publicly available. Nonetheless, this is a crucial aspect of the chemistry of star formation, and APE is able to provide evolving size-distributions to future codes that include this physics. Until such implementations become available, we do not account for grain growth in our chemical runs.

thumbnail Fig. 6

Grain size-distributions at various densities. The y-axis represents the mass density of the grains normalized by the mass density of the gas.

2.7 Extinction

APE has been designed to work with the three-phase kinetic chemistry code Nautilus (Ruaud et al. 2016) by generating necessary input files. Nautilus accounts for the impact of external UV emission on the chemical species, and requires an extinction value. We estimated the extinction, Av, through the column density NH2 of the gas between the point of interest and the outside of the cloud (Semenov et al. 2010) Av=NH21.59×1021gcm2.$\[A_{\mathrm{v}}=\frac{N_{\mathrm{H}_2}}{1.59 \times 10^{21} \mathrm{~g} \mathrm{~cm}^{-2}}.\]$(60)

We assumed a power-law density profile in the envelope, ρ(r) ~ rs (with s converging toward −1.5, see Sect. 2.2.2). After estimating s, an integration is performed toward the outer-edge of the envelope to obtain the column density NH2,env(r)=rrmaxρ(r)dr,$\[N_{\mathrm{H}_2, \mathrm{env}}(r)=\int_r^{r_{\max }} \rho\left(r^{\prime}\right) \mathrm{d} r^{\prime},\]$(61) =ρ(r)s+1rmaxs+1rs+1rs,$\[=\frac{\rho(r)}{s+1} \frac{r_{\max }^{s+1}-r^{s+1}}{r^s},\]$(62) =exp[ln(ρ(r))+ln(r)ln((s+1))+ln(1(rmaxr)s+1)].$\[=\exp \left[~\ln (\rho(r))+~\ln (r)-~\ln (-(s+1))+~\ln \left(1-\left(\frac{r_{\max }}{r}\right)^{s+1}\right)\right].\]$(63)

Equations (62) and (63) are equivalent, but we employed the latter in APE to avoid numerical precision issues. We have added a negative sign to the last two terms of Eq. (63) because s + 1 < 0.

In the disk, for the gas at cylindrical radius rc and height z, the density profile is integrated vertically until one scale-height (dropping the dependency in t): NH2,disk(rc,z)=zH(rc)ρm(rc)exp(z22H2(rc))dz,$\[N_{\mathrm{H}_2, \text {disk}}\left(r_{\mathrm{c}}, z\right)=\int_z^{H\left(r_{\mathrm{c}}\right)} \rho_{\mathrm{m}}\left(r_{\mathrm{c}}\right) \exp \left(-\frac{z^{\prime 2}}{2 H^2\left(r_{\mathrm{c}}\right)}\right) \mathrm{d} z^{\prime},\]$(64) =π2ρm(rc)H(rc)[1erf(z2H(rc))],$\[=\sqrt{\frac{\pi}{2}} \rho_{\mathrm{m}}\left(r_{\mathrm{c}}\right) H\left(r_{\mathrm{c}}\right)\left[1-\operatorname{erf}\left(\frac{z}{\sqrt{2} H\left(r_{\mathrm{c}}\right)}\right)\right],\]$(65)

with erf the error function. We added a flat value to account for the external cloud extinction. This value is a parameter, which can be chosen by the user. Finally, the total extinction is the sum of the three contributions Av(r,rc,z)=Av,env(r)+Av,disk(rc,z)+Av,cloud.$\[A_{\mathrm{v}}\left(r, r_{\mathrm{c}}, z\right)=A_{\mathrm{v}, \text {env}}(r)+A_{\mathrm{v}, \text {disk}}\left(r_{\mathrm{c}}, z\right)+A_{\mathrm{v}, \text {cloud}}.\]$(66)

2.8 APE workflow

Unlike hydrodynamics simulations, determining the physical properties at a specific location in APE does not require the description of the whole history of the gas. For instance, the density at location (r,θ) at time t is calculated with no knowledge of the gas surrounding this location or the system at earlier time points. The calculation solely relies on key characteristics of the central object (mass, radius, luminosity, temperature) and the disk (mass, size, mid-plane profile). This feature significantly accelerates the computation: a snapshot at time t can be generated without computing the whole gas history since t = 0, and a particle trajectory can be traced without computing the whole map at each time-step. Hence, the grid resolution does not influence the physical result (although it impacts the post-processing calculations like radiative transfer and synthetic observations). The APE workflow is summarized in Fig. 7.

2.9 The trajectory of particles

In particle mode, particles start with an initial user-defined position and move according to the local velocity field. The default time-step is dt0 = 200 years (this value can be changed by the user). However, the time-step is limited when the velocity of the particle is high or if the particle is close to the edges of the simulation box. The time-step is calculated as dt=min(1frvr,dt0),$\[d t=\min \left(\frac{1}{f} \frac{r}{v_r}, d t_0\right),\]$(67)

with r the spherical radial coordinate, vr the radial velocity, and f an arbitrary safety factor. Dynamically, this factor is especially important in the inner envelope, where radial velocities can reach several km s−1. Conversely, the radial velocity in the disk is low (~10−3 km s−1), and the particle trajectory is little sensitive on the factor f. However, the value of the time-step may influence the chemical evolution of the particle. We performed a convergence study on the influence of f upon chemical abundances. We ran APE with a particle starting at position (x = rc = 5 au, z = 1 au) (in the disk) at t = tff + 40 kyr, in reverse mode until t = 0, with dt0 = 200 years. The system parameters are the same as the fiducial case presented in Sect. 3.1.2, with a cloud mass of 2 M and a mass-to-flux ratio λ = 5. The particle spends ~150 kyr in the envelope and ~40 kyr in the disk. This final position has be chosen so that the particle travels across a wide range of physical conditions, from the envelope to the inner disk, and is thus more impacted by changes in the time-step. We investigated values of f of 10, 100, 1000 and 10 000. Dynamically, the trajectories are very close, with less than a 0.4% difference in their final positions, as listed in Table 3. We ran the Nautilus code on those trajectories using the publicly provided chemical network. In Fig. 8, we display box plots of the relative differences of abundance for all chemical species in the network, using f = 10 000 as the reference case. For f=10 and 100, half of the species have less than a 4% difference with respect to the reference case. Over 95% of species have less than a 15% difference. Nearly all species have less than a 50% difference, except 4 species in gas and solid phase for f=10 (FeOH, HFeOH, HOFeOH, and FeHOHOH), and 2 species for f=100 (NH2PO and HOFeOH), while all within a factor 2. The case f=1000 is well converged with all species displaying less than 5% difference with f=10 000, except HCONO with a 8% difference and NH2PO with a 90% difference. For chemical convergence, we therefore recommend to use 1000 ≥ f > 100, but choosing f=10 results in a ~50% maximum error on abundances while requiring much less computational resource. We reach the same conclusions for a particle starting at (x=1 au, z=5 au) and staying exclusively in the envelope.

thumbnail Fig. 7

Workflow of the APE code.

Table 3

APE computation results for various factors f limiting the time-step of the particles.

thumbnail Fig. 8

Distributions of the relative differences in abundances for several values of f, using f=10 000 as reference. The horizontal black lines represent the medians of the distributions, the colored boxes range from the first to the third quartiles, and the vertical black lines span from the minimum to the maximum values. For the f = 1000 case, the colored box is not visible as its upper limit stands at a value of 0.001.

2.10 Producing synthetic observations

The purpose of APE is to generate physical conditions to run chemical models and synthetic observations. Producing synthetic observations requires simulating the telescope view of an emission map, which is itself computed by radiative transfer calculations from abundance maps. While the users of APE are free to use any software to perform those steps, we only provide scripts to the publicly available codes Nautilus (Ruaud et al. 2016), RADMC-3D (Dullemond et al. 2012), and Imager3 to facilitate the process.

For molecular line observations, the first step is the production of chemical abundance maps. The “grid of particles” mode of APE places virtual particles in each cell of the map at a given time tfinal (generated in the same way as in a snapshot), and computes their trajectory backward in time until the initial condition t = 0 is reached. The history of each particle can then be used as input for Nautilus, alongside initial abundances and a chemical reaction network, to compute its chemical evolution. The chemical abundance maps can then be reconstructed into a grid, similarly to a density snapshot, from the final abundances of all particles at time tfinal.

The next step is the computation of emission maps. To that end, RADMC-3D needs information about the grid data (automatically generated by APE), spectroscopic data (user-provided) and observational parameters. Those parameters are user-defined and include the observation wavelength (alternatively which molecular transitions to observe), and the source inclination. RADMC-3D then reconstructs the 3D spatial distribution of the molecule from the axisymmetric APE data, and produces an emission cube. Finally, Imager is run on the emission map with the “simulate” function to produce cubes of observations.

With APE, we provide a script, available both in Python and Julia, in which the user can choose all observation parameters: the species, the frequency bandwidth, the spectral resolution, the inclination, the source distance and declination, the ALMA configuration, the observing time, and the noise. The script is an interface between the outputs of APE (once the chemical abundance maps have been generated), RADMC-3D, and Imager. The final output is a FITS file with the clean cube, optionally in which the continuum has been subtracted.

3 Application

3.1 Computing abundance maps

3.1.1 Method

In this section, we illustrate an application of APE, which is to compute the abundance map of several molecules, using the “Grid of particles” mode described in Sect. 2.10. The temperature is interpolated in time and space along the trajectory of particles using RADMC-3D as explained in Sect. 2.1.2.

3.1.2 Simulation setup

We considered a cloud with an initial mass of 2 M, and produce a snapshot 150 kyr after the formation of the central object, which occurs at t = tff ≈ 152 kyr. The disk size is determined by the mass-to-flux ratio, which we chose to be λ = 5 as it is a standard value in protostellar collapse simulations (e.g., Masson et al. 2016; Wurster et al. 2016; Marchand et al. 2023). The dust-to-gas mass ratio is 1% and we enabled dust coagulation. The initial angular velocity of the cloud is set at Ω0 = 2 × 10−15 s−1. The grid is composed of 5625 cells, with a logarithmic radial sampling of 75 points between r = 1 au and r = 1000 au, and a uniform poloidal sampling of 75 points between θ = 0 and θ = π/2. We used a limiting factor f = 300 on the time-step (see Sect. 2.9).

3.1.3 Chemical model

Each particle history is used as input for the Nautilus code (Ruaud et al. 2016), which performs three-phase gas-grain chemical calculations (gas phase – grain surface – grain mantle). The chemical network used in the Nautilus code contains about 800 species and ~9000 individual reactions (Manigand et al. 2021; Coutens et al. 2022; Agúndez et al. 2023). The grain surface and the mantle are both chemically active for these simulations. A sticking probability of 1 is assumed for all neutral species while desorption can occur by thermal and non-thermal (cosmic-ray, chemical desorption) processes including sputtering of ices by cosmic-ray collisions (Wakelam et al. 2021). Surface reactions formalism and more detailed description of the simulations can be found in Ruaud et al. (2015). The diffusion energies are set to be a fraction of the binding energy for the surface (0.4 times) and the mantle (0.8 times), with a diffusion barrier thickness of 0.25 nm.

Initially, we ran Nautilus for tpre = 106 years under constant physical parameters characteristic of prestellar core conditions: a density of n0 = 104 cm−3, a temperature of T0 = 10 K, and an extinction of Av = 5. We assumed a cosmic-ray ionization rate of ζCR = 1.3 × 10−17 s−1. We started this run using the same abundances as Ruaud et al. (2018), which we detail in Table 4 (with the exception of Mg that is not included in the chemical network). In the rest of the paper, we call “initial abundances” the final abundances from this run, which serve as the initial conditions for the chemical simulations along each particle trajectory. Since Nautilus does not support yet an evolving grain size-distribution (although a first attempt has been recently published by Navarro-Almaida et al. 2024), we used a unique, constant grain size that we assumed to be 0.1 μm, with a dust-to-gas mass ratio of 0.01. The bulk density of the grains is 3 g cm−3, and their surface site density of 1.5 × 1015 cm−2. In this work, we did not compute the chemical abundances in the outflow cavity, where they are set equal to the initial abundances. In this study, we considerd that the sole impact of the outflow is on temperature maps, which can in turn affect chemical abundances.

Table 4

Initial atomic abundances.

3.1.4 System evolution

At t = tff + 150 kyr, the envelope has nearly vanished with a remaining mass of 0.05 M. The central object has accreted 1.5 M, while the disk has the remaining mass of 0.45 M, and a radius of 92.3 au. Figure 9 displays the density and temperature map of the system zoomed on the inner 200 au. The protostellar radiation hardly penetrates into the outer regions of the disk, resulting in a local minimum of temperature.

The upper panel of Fig. 10 displays the density and temperature history of a particle located in the envelope at a distance of ~20 au from the central object at the final time of t = tff + 150 kyr. Figure 11 is the same for a particle ending in the disk. The envelope particle starts at a density of ~104 cm−3, which increases only by one order of magnitude over 250 kyr. The density increase then proceeds faster as the particle draws close to the central object, to reach ~108 cm−3 at the end of the simulation. The density of the disk particle starts at ~105 cm−3 and slowly increases to ~107 cm−3, until it reaches the inner envelope (≲100 au) at the time of formation of the central object (ttff = 0). This particle then enters the disk and experiences a density jump, before slowly drifting inward until the final time. The temperature of both particles is initially constant at T = Tmc = 10 K. The particles are then close enough to the central object at its formation to experience a jump of temperature, at ttff = 0 kyr. The disk particle immediately reaches T ≈ 20 K, then heats up to T ≈ 80 K at its entry in the disk. Its temperature then increases slowly while drifting inward, reaching T ≈ 120 K at the end of the simulation. The envelope particle is further away at the formation of the central object, and its temperature only jumps to T ≈ 12 K, and then heats up increasingly faster the following 150 kyr until it also reaches T ≈ 120 K.

thumbnail Fig. 9

Zoomed map of the system at t = tff + 150 kyr. Colors represent the number density of the gas, while white lines indicate iso-contours of the temperature at T=50, 75, 100 and 300 K. The red contours delimitate the envelope, the disk and the outflow.

thumbnail Fig. 10

Upper panel: density (blue) and temperature (red) history as a function of time for a particle ending in the inner envelope (x, y = 14.0, 14.0 au) at its last time-step at t = tff + 150 kyr. Bottom panel: time evolution of the gas phase abundance of several species for this particle.

thumbnail Fig. 11

Same as Fig. 10 for a particle ending in the disk (x, y = 19.1, 2.0 au).

3.1.5 Chemical abundances

The density and temperature evolution are then used as input for the chemical calculations. As illustration, the bottom panels of Figs. 10 and 11 show the time evolution of the abundance (relative to H) of several species: carbon monoxyde (CO), carbon monosulfide (CS), cyanide (CN), formaldehyde (H2CO), and methanol (CH3OH) in the gas phase for the same particles as in the upper panels. The chemical evolution of the envelope particle (Fig. 10) is slow, with variations smaller than one order of magnitude, until a few 10 kyr before the end of the simulation. Close to the protostar, the abundances then vary rapidly: the abundance of CN decreases by 5 orders of magnitude, while the abundance of other molecules increase by 1 to 4 orders of magnitude. The disk particle (Fig. 11) starts its journey closer to the center of the cloud. At the formation of the central object, the jump in temperature causes a ~1 order of magnitude increase in the gas phase abundance of H2CO and CH3OH, a decrease by the same factor for CN, while CO and CS are little affected. CO sees a decrease in abundance until the disk entry, where it suddenly increases by 2 orders of magnitude and stays constant until the end. H2CO and CS exhibit a similar behavior with jumps of 4 orders of magnitude. In the last kyrs of the simulation, the abundance of CS sharply decreases by 5 orders of magnitude. Conversely, the abundance of CN drops by 8 orders of magnitudes at the disk entry, and continues decreasing by 2 orders of magnitude over the following ~100 kyr. The density jump at the disk entry also causes a sudden decrease in CH3OH gas phase abundance by 2 orders of magnitude. As the particle drifts inward in the disk, the increasing temperature provokes a slow desorption of CH3OH in the gas phase over time. At the final time, all CH3OH molecules present on grains have desorbed and their abundance is 5 orders of magnitude higher than before the disk entry.

We performed similar calculations for all particles in the simulation box, and use the final abundance of each particle to reconstruct abundance maps. We display resulting abundance maps at t = tff + 150 kyr in Fig. 12, for those five species in the gas phase. The abundance of CO varies negligibly across the envelope. The whole computed map has a temperature larger than 30 K, which is above its desorption temperature. Conversely, CH3OH is mostly frozen on grains at temperatures below 100 K. There is a clear correlation between the regions of high methanol abundance and the temperature isocontours. This map only display the gas phase abundance of methanol; the total gas+ice abundance is roughly constant throughout the collapse. This map therefore effectively illustrates the thermal desorption of the species. H2CO and CS exhibit a similar behavior, with an increased abundance along the outflow cavity. On the contrary, the abundance of CN decreases in the high-temperature regions, especially above 50 K.

Table 5

Properties of the molecular lines in our synthetic observations.

3.2 Synthetic observations

3.2.1 Observation parameters

In this section, we present synthetic observations of the molecular emission of the species presented in Sect. 3.1: CO, CN, CS, H2CO, and CH3OH, using our simulation at t = tff + 150 kyr. For qualitative comparison, we mimicked the observation parameters used by Podio et al. (2020) to observe those five molecules toward the Class I protostar IRAS 04302+2247 with ALMA. We selected spectral windows in the band 6 of ALMA that were centered on the transition frequencies listed in Table 5. The first step is generating the emission maps using RADMC-3D. The main input parameters are the abundance maps, the inclination angle, and the spectral resolution, which we set at 141 kHz (~0.18 km s−1). The spectral window spans from −10 to 10 km s−1, which results in a sampling of ~110 channels. The emission map is then used as input for Imager to simulate ALMA observations. To match the source parameters, we assumed a 90 degrees inclination of the source (edge-on disk), a source distance of 160 pc, and a declination of +22 degrees. We simulated an observation with the C-5 configuration of ALMA with a 13 minutes integration time, resulting in a beam size of 0.32 × 0.25″. The noise in synthetic observations is purely numerical. The observing time therefore only affects the uv-coverage.

3.2.2 Results

We display the moment 0 map of the molecular emission in Fig. 13 for the inner 6″ × 6″ region. We see an X-shaped emission for CO, CS, and H2CO. This structure corresponds to the hot regions along the cavity of the outflow, as displayed for those species in Fig 12. Those X structures are extremely similar to what is observed in IRAS 04302+2247 (see Fig. 1 of Podio et al. 2020). As in Podio et al. (2020), not much can be seen in the CN emission. However, the CH3OH emission is faint in IRAS 04302+2247, while we clearly see a bright X-shape at the ~1″ scale in our simulation. The low bolometric luminosity of 0.43 L measured toward IRAS 04302+2247 (Ohashi et al. 2023) may not be enough to allow a significant desorption of methanol in the envelope.

thumbnail Fig. 12

Reconstructed maps of relative gas phase abundances of CO (top left), CN (top middle), CS (top right), H2CO (bottom left), and CH3OH (bottom right), 150 kyr after the formation of the central object. The black contours represent temperatures of 40, 50, 75,100 and 300 K. The red contours delimitate the envelope, the disk and the outflow.

thumbnail Fig. 13

Moment 0 map of the molecular emission for an edge-on configuration, zoomed on the inner 6″. The white ellipse on the bottom left represents the beam size. From left to right, top to bottom: CO 2–1, CN 2–1, CS 5–4, H2CO 31,2−21,1, CH3OH 50,5−40,4.

4 Conclusion

In this work, we presented the Analytical Protostellar Environment (APE) code, which we made publicly available. APE is a tool that facilitates chemical simulations and synthetic observations of protostellar systems. The code contains a physical model able to simulate the gravitational collapse of a dense core, and the formation and evolution of a central object and a protoplanetary disk throughout the Class 0 and I phases. We also provide scripts and interfaces to the publicly available codes Nautilus (for chemical simulations), RADMC-3D (for radiative transfer calculations), and Imager (for synthetic imaging).

We illustrated the capabilities of APE by computing the abundance maps of CO, CN, CS, H2CO, and CH3OH in a Class I protostellar system. We also performed synthetic ALMA observations of those species assuming an edge-on source. The moment 0 maps of CO, CS and H2CO show an X-shaped structure extremely similar to the emission seen toward the Class I protostar IRAS 04302+2247 (Podio et al. 2020).

Data availability

APE is publicly available on Bitbucket4. A user manual is provided with the code to detail its usage.

Acknowledgements

We thank the anonymous referee for their comments that helped us improve the clarity of the manuscript. We thank Takashi Hosokawa for kindly allowing us to publicly use and provide his tabulated simulation results. We also thank Ugo Lebreuilly for providing his simulation results for the dust evolution. This study is part of a project that has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (Grant agreement No. 949278, Chemtrip).

Appendix A Benchmark of the envelope model

Since APE serves as an alternative to MHD simulations, we compare the results obtained by both methods in this section. In classical MHD simulations, the envelope collapses, then forms an opaque first hydrostatic core with a ≲20 au radius (Larson 1969). This core contracts adiabatically for at most a few thousand years, before collapsing into a central object. A circumstellar disk forms in and around the first core and grows in size. APE does not model the first core, nor the initial growth of the disk, and the computational cost of MHD simulations increases significantly at the formation of the central object (which is the main motivation for the creation of APE). For those reasons, we restricted our comparison to the envelope before the ignition of the central object.

We used the RAMSES code (Teyssier 2002) with its ideal MHD solver (Fromang et al. 2006). The initial condition is a 2 M critical Bonnor-Ebert sphere, with an initial radial velocity of the gas matching that of APE vr(r)=GMin(r)2r.$\[v_r(r)=-\sqrt{\frac{G M_{\mathrm{in}}(r)}{2 r}}.\]$(A.1)

We performed a run with a moderate initial magnetic field (mass-to-flux ratio λ = 5). Once the initial condition is set up, the gas is subjected to the effects of gravity, thermal pressure and the Lorentz force. The temperature is imposed at T = 10 K and the extinction at Av = 3.5.

We compared the evolution of particles ending at 50 au from the center in the midplane right before the ignition of the central object. The density history of the two particles is displayed in Fig. A.1. The initial ~100 kyr are nearly identical. The formation of a central object is however ~15% longer in the MHD simulation, which results in a slightly lower density after 100 kyr. Both particles then reach a density of ~4 × 109 cm−3, at a time of ~152 kyr for the APE simulation, and ~175 kyr for the RAMSES simulation.

thumbnail Fig. A.1

Time evolution of the density for a particle ending at 50 au just before the ignition of the central object, for the APE (solid line) and the RAMSES (dashed line) simulations.

We then ran Nautilus on the two particles, using the same chemical network and initial abundances as described in Sect. 3.1.3. As example, Fig. A.2 displays the abundance evolution of the same five species considered in Sect. 3.2: CO, CN, CS, H2CO, and CH3OH. The time axis is normalized by the formation time of the central object in each simulation. Similarly to the density, the abundances are nearly identical in both simulations for the first ~100 kyr (t/tff ≈ 0.6). As the abundances decrease, differences between the two cases increase up to an order of magnitude for the simplest species (CO, CN, and CS), but are less pronounced for the two more complex species (H2CO and CH3OH) with differences less than a factor of 2.

thumbnail Fig. A.2

Time evolution of the gas-phase abundance of CO, CN, CS, H2CO, and CH3OH for APE (solid lines) and RAMSES (dashed lines). The time has been normalized with the formation time of the central object in each simulation.

In the following, we considered the full chemical network. At the final time-step, all species with non-negligible abundances (> 10−10) show differences lower than 50% between the two simulations (with 230 out of 240 being below a 10% difference). The only exception is gas-phase H, which is 10 times more abundant with APE (~10−9) than with RAMSES (~10−10). Including species with abundances above 10−15, 90% display differences smaller than 25%, and all remain within an order of magnitude.

Overall, APE successfully reproduces the chemical trends obtained from a MHD simulation, particularly for the most abundant species, whose abundances show strong convergence. This demonstrates that APE provides a reliable alternative for studying the chemical evolution of star-forming systems, at a fraction of the cost of full MHD simulations.

References

  1. Adams, F. C., & Shu, F. H. 1986, ApJ, 308, 836 [NASA ADS] [CrossRef] [Google Scholar]
  2. Adams, F. C., Lada, C. J., & Shu, F. H. 1988, ApJ, 326, 865 [NASA ADS] [CrossRef] [Google Scholar]
  3. Agúndez, M., Loison, J. C., Hickson, K. M., et al. 2023, A&A, 673, A34 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  4. Ahmad, A., González, M., Hennebelle, P., & Commerçon, B. 2024, A&A, 687, A90 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  5. Bate, M. R. 2022, MNRAS, 514, 2145 [CrossRef] [Google Scholar]
  6. Birnstiel, T., Dullemond, C. P., Zhu, Z., et al. 2018, ApJ, 869, L45 [CrossRef] [Google Scholar]
  7. Bonnor, W. B. 1956, MNRAS, 116, 351 [NASA ADS] [CrossRef] [Google Scholar]
  8. Cantó, J., Raga, A. C., & Williams, D. A. 2008, Rev. Mexicana Astron. Astrofis., 44, 293 [Google Scholar]
  9. Cassen, P., & Moosman, A. 1981, Icarus, 48, 353 [CrossRef] [Google Scholar]
  10. Coutens, A., Commerçon, B., & Wakelam, V. 2020, A&A, 643, A108 [EDP Sciences] [Google Scholar]
  11. Coutens, A., Loison, J.-C., Boulanger, A., et al. 2022, A&A, 660, L6 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  12. Crutcher, R. M. 1999, ApJ, 520, 706 [NASA ADS] [CrossRef] [Google Scholar]
  13. Dullemond, C. P., Juhasz, A., Pohl, A., et al. 2012, RADMC-3D: A multipurpose radiative transfer tool, Astrophysics Source Code Library [record ascl:1202.015] [Google Scholar]
  14. Ebert, R. 1955, Zeitschrift für Astrophysik, 37, 217 [Google Scholar]
  15. Fromang, S., Hennebelle, P., & Teyssier, R. 2006, A&A, 457, 371 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  16. Gabbasov, R., Sigalotti, L. D. G., Cruz, F., Klapp, J., & Ramírez-Velasquez, J. M. 2017, ApJ, 835, 287 [Google Scholar]
  17. Gavino, S., Dutrey, A., Wakelam, V., et al. 2021, A&A, 654, A65 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  18. Guillet, V., Hennebelle, P., Pineau des Forêts, G., et al. 2020, A&A, 643, A17 [EDP Sciences] [Google Scholar]
  19. Hartmann, L. 2009, Accretion Processes in Star Formation, 2nd edn. (Cambridge University Press) [Google Scholar]
  20. Hennebelle, P., Commerçon, B., Chabrier, G., & Marchand, P. 2016, ApJ, 830, L8 [Google Scholar]
  21. Hosokawa, T., & Omukai, K. 2009, ApJ, 691, 823 [Google Scholar]
  22. Hueso, R., & Guillot, T. 2005, A&A, 442, 703 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  23. Iqbal, W., & Wakelam, V. 2018, A&A, 615, A20 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  24. Jørgensen, J. K., van der Wiel, M. H. D., Coutens, A., et al. 2016, A&A, 595, A117 [Google Scholar]
  25. Kratter, K. M., Matzner, C. D., & Krumholz, M. R. 2008, ApJ, 681, 375 [NASA ADS] [CrossRef] [Google Scholar]
  26. Larson, R. B. 1969, MNRAS, 145, 271 [Google Scholar]
  27. Lebreuilly, U., Vallucci-Goy, V., Guillet, V., Lombart, M., & Marchand, P. 2023, MNRAS, 518, 3326 [Google Scholar]
  28. Lee, Y.-N., Marchand, P., Liu, Y.-H., & Hennebelle, P. 2021, ApJ, 922, 36 [NASA ADS] [CrossRef] [Google Scholar]
  29. Lefloch, B., Gusdorf, A., Codella, C., et al. 2015, A&A, 581, A4 [CrossRef] [EDP Sciences] [Google Scholar]
  30. Lefloch, B., Bachiller, R., Ceccarelli, C., et al. 2018, MNRAS, 477, 4792 [Google Scholar]
  31. Lenzuni, P., Gail, H.-P., & Henning, T. 1995, ApJ, 447, 848 [NASA ADS] [CrossRef] [Google Scholar]
  32. Li, Z.-Y. 2002, ApJ, 574, L159 [Google Scholar]
  33. Lynden-Bell, D., & Pringle, J. E. 1974, MNRAS, 168, 603 [Google Scholar]
  34. Manigand, S., Coutens, A., Loison, J. C., et al. 2021, A&A, 645, A53 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  35. Marchand, P., Masson, J., Chabrier, G., et al. 2016, A&A, 592, A18 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  36. Marchand, P., Guillet, V., Lebreuilly, U., & Mac Low, M. M. 2021, A&A, 649, A50 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  37. Marchand, P., Lebreuilly, U., Mac Low, M. M., & Guillet, V. 2023, A&A, 670, A61 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  38. Masson, J., Chabrier, G., Hennebelle, P., Vaytet, N., & Commercon, B. 2016, A&A, 587, A32 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  39. Mathis, J. S., Rumpl, W., & Nordsieck, K. H. 1977, ApJ, 217, 425 [Google Scholar]
  40. McGuire, B. A. 2022, ApJS, 259, 30 [NASA ADS] [CrossRef] [Google Scholar]
  41. Mouschovias, T. C., & Spitzer, L. J., 1976, ApJ, 210, 326 [NASA ADS] [CrossRef] [Google Scholar]
  42. Murillo, N. M., Hsieh, T. H., & Walsh, C. 2022, A&A, 665, A68 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  43. Nakamoto, T., & Nakagawa, Y. 1994, ApJ, 421, 640 [Google Scholar]
  44. Nakano, T., Nishi, R., & Umebayashi, T. 2002, ApJ, 573, 199 [Google Scholar]
  45. Navarro-Almaida, D., Lebreuilly, U., Hennebelle, P., et al. 2024, A&A, 685, A112 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  46. Nazari, P., Tabone, B., Rosotti, G. P., et al. 2022, A&A, 663, A58 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  47. Ohashi, N., Tobin, J. J., Jørgensen, J. K., et al. 2023, ApJ, 951, 8 [NASA ADS] [CrossRef] [Google Scholar]
  48. Ormel, C. W., & Cuzzi, J. N. 2007, A&A, 466, 413 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  49. Podio, L., Garufi, A., Codella, C., et al. 2020, A&A, 642, L7 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  50. Rivera-Ortiz, P. R., de A. Schutzer, A., Lefloch, B., & Gusdorf, A. 2023, A&A, 672, A116 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  51. Ruaud, M., Loison, J. C., Hickson, K. M., et al. 2015, MNRAS, 447, 4004 [Google Scholar]
  52. Ruaud, M., Wakelam, V., & Hersant, F. 2016, MNRAS, 459, 3756 [Google Scholar]
  53. Ruaud, M., Wakelam, V., Gratier, P., & Bonnell, I. A. 2018, A&A, 611, A96 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  54. Ruden, S. P., & Pollack, J. B. 1991, ApJ, 375, 740 [NASA ADS] [CrossRef] [Google Scholar]
  55. Semenov, D., Hersant, F., Wakelam, V., et al. 2010, A&A, 522, A42 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  56. Shakura, N. I., & Sunyaev, R. A. 1973, A&A, 24, 337 [NASA ADS] [Google Scholar]
  57. Teyssier, R. 2002, A&A, 385, 337 [CrossRef] [EDP Sciences] [Google Scholar]
  58. Tsukamoto, Y., Iwasaki, K., Okuzumi, S., Machida, M. N., & Inutsuka, S. 2015, ApJ, 810, L26 [Google Scholar]
  59. Tsukamoto, Y., Okuzumi, S., Iwasaki, K., Machida, M. N., & Inutsuka, S.-i. 2017, PASJ, 69, 95 [CrossRef] [Google Scholar]
  60. Tychoniec, Ł., van Dishoeck, E. F., van’t Hoff, M. L. R., et al. 2021, A&A, 655, A65 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  61. Vaytet, N., Commerçon, B., Masson, J., González, M., & Chabrier, G. 2018, A&A, 615, A5 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  62. Velusamy, T., & Langer, W. D. 1998, Nature, 392, 685 [CrossRef] [Google Scholar]
  63. Visser, R., van Dishoeck, E. F., Doty, S. D., & Dullemond, C. P. 2009, A&A, 495, 881 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  64. Visser, R., Doty, S. D., & van Dishoeck, E. F. 2011, A&A, 534, A132 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  65. Wakelam, V., Dartois, E., Chabot, M., et al. 2021, A&A, 652, A63 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  66. Wurster, J., Price, D. J., & Bate, M. R. 2016, MNRAS, 457, 1037 [Google Scholar]
  67. Wurster, J., Price, D. J., & Bate, M. R. 2017, MNRAS, 466, 1788 [NASA ADS] [CrossRef] [Google Scholar]
  68. Young, C. H., & Evans, Neal J., I. 2005, ApJ, 627, 293 [NASA ADS] [CrossRef] [Google Scholar]
  69. Zhao, B., Caselli, P., Li, Z.-Y., et al. 2020, MNRAS, 492, 3375 [Google Scholar]

All Tables

Table 1

APE input parameters.

Table 2

Grain sublimation parameters.

Table 3

APE computation results for various factors f limiting the time-step of the particles.

Table 4

Initial atomic abundances.

Table 5

Properties of the molecular lines in our synthetic observations.

All Figures

thumbnail Fig. 1

Schematic of an APE snapshot simulation.

In the text
thumbnail Fig. 2

Top panel: density map generated by APE. Bottom panel: zoom of the inner 200 au, with a reduced color sampling.

In the text
thumbnail Fig. 3

Normalized density profile of a Bonnor-Ebert sphere.

In the text
thumbnail Fig. 4

Density profile of a collapsing Bonnor–Ebert sphere following our model, for a 2 M sphere at time t ≈ 192 kyr (in blue). The dashed black line represents a r32$\[r^{-\frac{3}{2}}\]$ profile.

In the text
thumbnail Fig. 5

Upper panel: mass–radius relation of central objects for different accretion rates, from the tabulated results of Hosokawa & Omukai (2009). Bottom panel: same as upper panel for the mass-luminosity relation. The solid lines represent the total central object luminosity L*, while dashed lines represent only the photometric luminosity (excluding the accretion luminosity).

In the text
thumbnail Fig. 6

Grain size-distributions at various densities. The y-axis represents the mass density of the grains normalized by the mass density of the gas.

In the text
thumbnail Fig. 7

Workflow of the APE code.

In the text
thumbnail Fig. 8

Distributions of the relative differences in abundances for several values of f, using f=10 000 as reference. The horizontal black lines represent the medians of the distributions, the colored boxes range from the first to the third quartiles, and the vertical black lines span from the minimum to the maximum values. For the f = 1000 case, the colored box is not visible as its upper limit stands at a value of 0.001.

In the text
thumbnail Fig. 9

Zoomed map of the system at t = tff + 150 kyr. Colors represent the number density of the gas, while white lines indicate iso-contours of the temperature at T=50, 75, 100 and 300 K. The red contours delimitate the envelope, the disk and the outflow.

In the text
thumbnail Fig. 10

Upper panel: density (blue) and temperature (red) history as a function of time for a particle ending in the inner envelope (x, y = 14.0, 14.0 au) at its last time-step at t = tff + 150 kyr. Bottom panel: time evolution of the gas phase abundance of several species for this particle.

In the text
thumbnail Fig. 11

Same as Fig. 10 for a particle ending in the disk (x, y = 19.1, 2.0 au).

In the text
thumbnail Fig. 12

Reconstructed maps of relative gas phase abundances of CO (top left), CN (top middle), CS (top right), H2CO (bottom left), and CH3OH (bottom right), 150 kyr after the formation of the central object. The black contours represent temperatures of 40, 50, 75,100 and 300 K. The red contours delimitate the envelope, the disk and the outflow.

In the text
thumbnail Fig. 13

Moment 0 map of the molecular emission for an edge-on configuration, zoomed on the inner 6″. The white ellipse on the bottom left represents the beam size. From left to right, top to bottom: CO 2–1, CN 2–1, CS 5–4, H2CO 31,2−21,1, CH3OH 50,5−40,4.

In the text
thumbnail Fig. A.1

Time evolution of the density for a particle ending at 50 au just before the ignition of the central object, for the APE (solid line) and the RAMSES (dashed line) simulations.

In the text
thumbnail Fig. A.2

Time evolution of the gas-phase abundance of CO, CN, CS, H2CO, and CH3OH for APE (solid lines) and RAMSES (dashed lines). The time has been normalized with the formation time of the central object in each simulation.

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.