1 Introduction

The historic detection of gravitational waves from merging black holes (Abbott et al. 2016) and neutron stars (Abbott et al. 2017) highlights the importance of understanding the details of binary stellar evolution. What are the physical processes that lead to mergers of these “double-compact objects” (Kalogera et al. 2007)? Reducing the orbit such that a merger commences requires to drain orbital energy and angular momentum from the system. In the last stage before the actual merger, this proceeds due to the emission of gravitational waves—a process that is highly inefficient. Orbital decay is extremely slow. This final phase, driven by gravitational wave emission, must therefore start with a very small orbital separation; otherwise a merger could not occur within a Hubble time.

How is this possible? For some compact objects, a capture of a close companion in a dense stellar environment is conceivable. However, many of the systems that eventually merge are thought to start out as main-sequence star binaries. This, of course, implies an initial separation larger than the sum of the main-sequence star radii, so a mechanism must exist to reduce the orbital separation of the stellar coresFootnote 1 sufficiently that eventually they merge via the emission of gravitational waves.

Similar evolutionary mechanisms must be responsible for the formation of interacting binary systems involving one or two compact objects (so-called single- or double-compact binaries); see Tauris and van den Heuvel (2023) for a comprehensive discussion. Prominent examples are cataclysmic variables (e.g. Meyer and Meyer-Hofmeister 1979; Webbink 1984), Type Ia supernovae progenitors (e.g. Wang 2018), X-ray binaries (e.g. Tauris and van den Heuvel 2014), short gamma ray burst progenitors, binary pulsars (e.g. Chen and Liu 2013), and close white dwarf binaries (e.g. De Marco et al. 2011; Zorotovic et al. 2010). Here, the same argument applies: While still on the main sequence, the two stars in the progenitor binary must be sufficiently separated to avoid interaction. The observed phenomena, however, imply an orbital distance significantly smaller than such a relatively large initial separation.

It is therefore clear that the progenitors of compact binaries were much larger in the past and would not have fitted into the orbits of the systems we observe today. The requirement of sufficient separation of the stellar binary at birth, however, does not need to hold true for the subsequent evolution, where strong interaction and mass transfer is possible, in particular because the radii of stars increase substantially for later evolutionary stages. Paczyński (1976) and othersFootnote 2 realized that this is not just another nuisance in the description of the binary system, but rather the key to understanding its evolution towards a close binary: They proposed a phase in which the two stellar cores orbit each other sharing the stellar envelope and coined the name common envelope (CE) phase for it. Such an extreme case of binary stellar interaction is the “magic trick” to explain the short orbital separation of single and double-compact systems of various kinds: the orbit of the companion with the core of the “primary” star inside the common envelope causes drag (whether gravitational or hydrodynamical), which transfers orbital energy and angular momentum to the envelope material unbinding it from the system. The stellar cores approach each other, the envelope is ejected and—voilà!—a close binary system emerges.

While critical for the formation of narrow binary systems, the CE phase is also ubiquitous in stellar evolution. A substantial fraction of stars forms in multiples (e.g. Moe and Di Stefano 2017) and many of them are bound to interact during their evolution. For example, practically all massive stars are born in multiple systems and up to 70% experience binary interaction in their life (Sana et al. 2012). The chances for interaction are not as high for low and intermediate-mass stars, but the consequences are no less impactful for the evolution of these systems (De Marco and Izzard 2017).

The implications of CE interaction are far-reaching and fundamental for answering questions such as:

  • What are the progenitor systems of Type Ia supernovae?

  • What defines the rates and parameter distributions of novae and dwarf novae?

  • Can planets survive when they are engulfed by their host star?

  • How are the source systems of gravitational wave emission formed?

Answers these questions pivotally depend on understanding the post-CE separation distribution. This quantity cannot be determined reliably at the moment because of shortcomings in modeling the inspiral of the companion into the envelope of the primary, orbital tightening of the core binary system, envelope ejection, and potentially other effects in late stages of common-envelope evolution (CEE).

Theoretical modeling of CE phases in binary stellar evolution has a long history. Early attempts used one-dimensional (1D) parametrizations in the framework of classical stellar evolution theory. There are, however, reasonable doubts as to whether their results are physical. Such parametrized models have certain advantages in covering processes that act on longer timescales, but they struggle to capture what is essentially a fast, dynamical phase with no symmetry (Ivanova and Nandez 2016). Other models use parametrized prescriptions to follow the evolution of large samples of binary systems or populations. By calibrating the parameters on observational constraints, some of the predictions reach a certain level of confidence. Such population models are used, for instance, to estimate the event rate in gravitational wave detectors (e.g. Belczynski et al. 2014; Dominik et al. 2012) and to distinguish between different progenitor scenarios for Type Ia supernovae (e.g. Ruiter et al. 2009; Toonen et al. 2012).

A more direct approach to understanding the physical processes governing CEE is the goal of numerical simulations that we focus on in our review. In addition to the listed examples of astrophysical implications of CE interaction, the process itself is fascinating featuring strong nonlinear dynamical effects. Understanding the underlying physical processes and making reliable predictions for the outcome of CE events cannot be accomplished without complex three-dimensional (3D) hydrodynamics models that cover phases of CEE, because these lack obvious spatial symmetries and proceed on dynamical timescales. The aim of such simulations is to answer specific questions about details of the inspiral and envelope ejection, which then allow for tackling the higher-order questions listed above. Some of these still unanswered, specific questions are:

  • How does the system enter CEE?

  • How are orbital energy and angular momentum of the core binary transferred to the envelope?

  • What physical processes lead to the ejection of the envelope? Which energy reservoirs are tapped for accelerating the envelope material?

  • What processes determine the final orbital separation of the remnant core binary?

  • Which systems manage to eject the envelope completely?

  • What are the conditions under which the process “fails”, i.e. a merger of the core takes place without ejecting the envelope?

  • What is the morphology of the ejected envelope in the case of success? Can it explain planetary nebulae?

  • What is the role of magnetic fields in CEE?

The ultimate goal is to connect the initial conditions, i.e. the parameters of the system before entering CE interaction, with the properties of the remnant system—most importantly its orbital parameters in the case of successful envelope ejection—but also other quantities that determine its future evolution, such as left-over envelope material or a potentially forming circumbinary disk.

1.1 Observations of common-envelope evolution

The concept of CE was first envisaged by Paczyński (1976) to explain a specific star, V 471 Tau, a detached, compact binary comprising a white dwarf and a K dwarf, rare at the time and presumed to be a direct predecessor of cataclysmic variables. Only through a CE inspiral in the past evolution of the system, could today’s parameters be explained.

Over the years, many more low-mass systems were found that can only be explained with a CE interaction. Low and intermediate-mass star binaries that have gone through a CE interaction are observed as post-red giant branch, sub-dwarf B (sdB) and white dwarf (WD) close binaries, or as post-asymptotic giant branch WD binaries, with either another WD or a main sequence companion. These are the immediate progenitors of cataclysmic variables. In some cases even brown dwarfs or giant planets have been deemed capable of ejecting the CE and surviving as binaries with the core of the original giant (e.g., Geier et al. 2011; Schaffenroth et al. 2014, 2019; Vanderburg et al. 2020). Such lower mass, post-CE systems are plentiful, and their parameters can be measured with relative precision, thus providing statistical information about the outcome of orbital evolution in the CE phase (Iaconi and De Marco 2019). The direct consequences of envelope ejection can be seen in many planetary nebulae (PNe). At least one in five PNe is an ejected CE (Hillwig et al. 2016; Jacoby et al. 2021; Munday et al. 2020).

After the initial idea of a CE inspiral was fleshed out, it became clear how CE phases can explain binaries comprising the remnant of massive stars, neutron stars and black holes. Today, this group of binaries is a prime target of multimessenger astronomy. The detection statistics of gravitational-wave induced mergers of double-compact systems is strongly linked to the parameters of the CE interaction. There are other massive systems that can be identified as binaries and that must have emerged from a CE, such as low and high mass X-ray binaries, but unfortunately the CE phase is not the only event that determines the observed parameters of these systems, and therefore they are not ideal to constrain CE interaction observationally.

Additionally, thanks to time-resolved astronomical surveys, an increasing number of transient events has been discovered. Supported by pre-outburst observations, several of them have been unequivocally associated with CE interactions and stellar mergers (e.g., V1309 Sco, Tylenda et al. 2011). Others have very likely undergone a CE inspiral even if there is no definitive proof [e.g., V838 Mon, Bond et al. 2003; Goranskij et al. 2004, but see Tylenda and Soker (2006) for a discussion of alternative models]. By statistical necessity, the majority of objects detected in these brief phases of interaction are the most luminous events, which presumably derive from more massive stars (Kochanek et al. 2014). Examples include NGC 4490-2012OT1 (Smith et al. 2016) and M101-2015OT1 (Blagorodnova et al. 2017) that have been detected in external, sometimes distant galaxies.

A new field of study has emerged from these discoveries, alongside several competing classifications, nomenclatures and preliminary explanations for the observed events. Such transients are commonly known as gap transients—observed in the gap between the luminosities of novae and supernovae (Kasliwal 2012; Pastorello et al. 2019)—or intermediate-luminosity optical transients (ILOTs). These include intermediate-luminosity red transients (ILRTs) (Botticella et al. 2009) and luminous red novae (LRNe) (Munari et al. 2002) distinguished by their lightcurves and spectral behaviour. The latter are thought to be CE interactions between expanding, massive stars and companions that resulted in mergers, although in most cases it is impossible to say for sure if the binary has survived. Interestingly, while ILRTs are thought to be electron capture supernovae from super-asymptotic giant branch (AGB) stars, there are some cases where the classification is intermediate between ILRTs and LRNe (Cai et al. 2019). Finally, a distinction between LRNe and red novae (RNe) is emerging, where the latter group are a less luminous and possibly less massive counterpart of the former group (Pastorello et al. 2019).

In Sect. 7.6 we will return to these observations and consider how they can constrain the simulations that are the central topic of this review.

1.2 Terminology of common-envelope modeling

Many stars in the Universe form in binaries or higher-order multiples, and a large fraction of these engages in some kind of interaction over their evolution. The nature of such interaction can be manifold; ranging from orbital perturbations mediated by gravitational interaction, irradiation, and hydrodynamical mass-transfer processes to the most violent case: a merger of two stellar objects. CE interaction is very close to this extreme case. In a sense, it classifies as a merger of stars because at least for some period of time two (or perhaps even moreFootnote 3) stellar objects join into a single envelope. Unlike a complete stellar merger, however, this “merged” phase may be a transient phenomenon. After the ejection of the CE, separate stellar cores emerge. Special conditions are required for this to work.

An obvious prerequisite is that one of the interacting stars, which we refer to as “primary”, has to exhibit a clearly separated core–envelope structure. Otherwise, it would not make sense to speak of a common envelope in the interaction phase and to define a stellar core that emerges as part of the newly formed binary star system after the envelope ejection. This implies that the primary star has to reach an evolved, giant stage before engaging into the interaction. For a time, the companion resides inside the envelope of the giant primary star. While this companion can be a stellar object of any kind, we encounter a special case if it is another giant star. For this to happen, the initial mass ratio of the binary system has to be very close to unity so that when the primary overfills its Roche lobe as a giant, accretion onto the companion causes it to expand and overfill its Roche lobe, too. A joint CE establishes that consists of material from both stars. Still, during the interaction, two stellar cores orbit each other inside a CE. This case is sometimes (and confusingly) termed double core evolution, falling back to the term that was originally used for general CE phases. It is particularly interesting for massive stars (Brown 1995; Dewi et al. 2006) and may contribute a substantial fraction to the population of double neutron stars (Vigna-Gómez et al. 2018). Despite this ambiguity, a stellar merger with evolved giant stars provides a useful definition of CE interaction and includes the classical case as well as the merger of two giant stars.

Naturally, as the evolution into giant stages is a continuous process, the boundaries between CE interaction and stellar mergers are blurred. For massive stars in the giant stage (so-called supergiants), for instance, the separation between core and envelope is less clear than the sharp interface in low-mass red giant (RG) or AGB stars. Another example is the system V1309 Sco (Tylenda et al. 2011). It was modeled as a merger of a \(1.5 \,M_\odot \) star expanding into the Hertzsprung gap with a low-mass (\({\sim }\, 0.15 \, M_\odot \)) main sequence companion. The primary is about 40 times larger than the secondary and the system likely went through a brief common envelope, shortly followed by the disruption of the companion near the core of the primary (Nandez et al. 2014). As a Hertzsprung-gap star, the primary would have had a less clear core-envelope boundary. Therefore, the nature of the physical interaction in the later inspiral is not quite the same as for a system with a more distinguished core.

Another characteristic of CE interaction is the aforementioned interesting possibility that after envelope ejection a tight binary of stellar cores emerges. This case is sometimes referred to as successful CEE to distinguish it from the case where the energy available to envelope ejection is insufficient and only parts of it can be removed. The ultimate fate of such a system is a merger of the stellar cores inside the CE, which can also give rise to interesting phenomena: for a high-mass primary star and neutron star companion, such a scenario could lead to the formation of Thorne–Żytkov objects (Thorne and Zytkow 1975). The formation of such objects due to a “core merger-induced collapse” (CMIC) if the companion is a white dwarf composed of neon, oxygen, and magnesium has been proposed by Ablimit et al. (2022). It has been also suggested that because of the high angular momentum involved, a neutrino-cooled accretion disk forms around a neutron star or a black hole companion when merging with the core of the primary star. This accretion liberates gravitational binding energy, which to a large fraction is carried away by the neutrinos but some part may also be released as mechanical energy—perhaps in form of material accelerated in a disk wind or a jet-like outflow—feeding back on the surrounding envelope material [a scenario originally proposed by Fryer and Woosley (1998), and Zhang and Fryer (2001), to explain gamma-ray bursts]. The corresponding events have been suggested to resemble some sub-classes of Type II supernovae (such as Type IIn or Type II-P supernovae; e.g. Chevalier 2012; Schrøder et al. 2020; Soker and Gilkis 2018) and are sometimes called “common-envelope jets supernovae”Footnote 4 (Soker and Gilkis 2018; Soker et al. 2019). For low-mass stars involved in CE interactions with a white dwarf companion, a thermonuclear explosion resulting from the merger of the degenerate cores has been suggested to explain some peculiar Type Ia supernovae (Livio and Riess 2003; Sparks and Stecher 1974). This mechanism is also called the“core degenerate scenario” (e.g. Ilkov and Soker 2012; Kashi and Soker 2011; Soker et al. 2013). A similar scenario involving an intermediate-mass or massive primary star and a carbon-oxygen white dwarf companion possibly leading to peculiar Type Ia or (in the case of a collapse of the core) to a Type II supernovae has been discussed by Ablimit (2021). While technically for all these events one may speak of a mergers, the term failed CEE is commonly used for it, or sometimes, as a compromise, CE merger. It highlights the fact that a giant star was involved in the interaction. Also from a practical point of view it makes sense to discuss these cases in conjunction with successful CE interactions because they constitute an interesting limit in the parameter space of such systems.

That said, it may be useful to give examples of cases that do not qualify as CE interaction. A merger of two similarly sized (but not giant) stars, for instance between two white dwarf dwarfs [corresponding 3D simulations were pioneered by Benz et al. (1990); see, e.g., Dan et al. (2009), Dan et al. (2012) and Zhu et al. (2015) for more recent simulations], two neutron stars [e.g. Rasio and Shapiro 1992; Ruffert et al. 1996; Rosswog et al. 1999; see also Faber and Rasio (2012), Rosswog (2015), Baiotti and Rezzolla (2017), Shibata and Hotokezaka (2019), and Radice et al. (2020) for reviews], or two main sequence stars (e.g., Benz and Hills 1987; Schneider et al. 2019). Such interactions are distinct from CEE. The initial mass transfer, that invariably commences the interaction, leads to orbital decrease and soon thereafter a tidal disruption of one or both of the stars. We would be hard pressed to state which star is in which star’s envelope.

1.3 Phases of common-envelope evolution

To set the stage for our later discussion, we review some ideas on the temporal evolution of CE interaction proceeds. A classification of stages through which CEE proceeds was given by Ivanova et al. (2013). This classification was largely inspired by concepts of classical stellar evolutionary theory. Here, we focus on the computational modeling of CE interaction. In this context, it is more useful to think of CEE as a three-part interaction, paying attention to the vastly different timescales (to be defined later in our discussion) on which the stages proceed and consequently our ability to model them in numerical simulations:

  1. (i)

    The first part starts with mass-transfer triggered by a star growing into its Roche lobe, or from the synchronized orbit becoming Darwin-unstable and leading to a loss of co-rotation. The companion starts to approach the primary. This phase ends when the mass-transfer process assumes a runaway nature.

  2. (ii)

    The second part is the inspiral of the companion into the envelope of the primary. It leads to the typical structure in which two stellar cores orbit each other inside a CE. This phase is essentially dynamical.

  3. (iii)

    The third phase is a combination of the self-regulating phase [phase III of Ivanova et al. (2013)], its termination (their phase IV) and what comes after (their phase V). This phase starts with the companion–core distance stabilizing and the envelope adjusting thermally to a new equilibrium.

Our classification intentionally leaves out the long-term evolution of the binary system up to CE interaction and the fate of the system after completion of the CE phase. The former is important because it determines the global parameters of the interacting system and sets the initial conditions of the CE interaction. However, we take these as given and focus on the CE phase itself in this review. Likewise, however interesting from an astrophysical point of view, the long-term evolution of the system resulting from CEE is not the subject of our discussion.

There are a lot of subtleties to this picture and to an extent it is a matter of taste how we decide to break down the interaction into different parts. It is also clear that the last ten years of development have refined some of the ideas behind the phases listed by Ivanova et al. (2013). For example, the pre-inspiral phase is more complex than a simple unstable mass-transfer starting out at the time of Roche lobe overflow. If the mass ratio is in the proximity of the analytically-derived threshold for instability (Tout 1991), one may expect a longer phase of semi-stable mass-transfer, that only eventually leads to the formation of a CE system. Similarly, the post-inspiral phase may not or not only consist of a self-regulating phase as described in the literature. It is still unclear whether in some setups all envelope material is ejected in the dynamic inspiral phase so that a subsequent self-regulated phase does not establish. The slowing down of the inspiral observed in hydrodynamic simulations is more due to the companion bringing local gas into co-rotation, than an evacuation of the orbit (at least for lower mass stars; Reichardt et al. 2019). And the evolution of the orbit after the end of the dynamical inspiral may have more to do with the distribution and evolution of angular momentum of the gas as the inner envelope contracts. It is also possible that the evolution in late CE phases involves phases of mass transfer between the remaining cores or that a circum-binary disk forms.

It is likely not fruitful to complicate the nomenclature while a clearer picture has not yet emerged. So for now we elect to think about these three phases in lose terms as

  1. (i)

    the pre-CE phase,

  2. (ii)

    the inspiral phase, and

  3. (iii)

    the post-inspiral phase.

While the first two proceed largely on dynamical timescales (potentially longer in the pre-CE phase), the post-inspiral phase may include dynamical effects as well as processes that take place on longer, thermal timescales. We use this simple subdivisions to provide a reference frame for the discussion that follows. While classical 1D models of stellar evolution are suitable for addressing processes on longer thermal timescales, the decisive part of CE is part (ii) of our classification. Some aspects of parts (i) and (iii) proceed on dynamical timescales, which need to be addressed with the hydrodynamical simulations we focus on in our review.

1.4 Structure of this review

Our review concentrates on advances in the understanding of the common envelope interaction based on multidimensional hydrodynamic simulations. In Sect. 2 we set this discussion into context by reporting the current stance on the common-envelope interaction. It derives from years of modelling using distinct approaches: parametric formalisms (Sect. 2.1) use primarily energy and angular momentum considerations to connect an initial stellar binary system to the outcome of the interaction. One-dimensional “mechanical” models as described in Sect. 2.2 try to determine the drag force experienced by the companion when spiralling into the envelope of the primary star. Integrating a simple equation of motion results in a model for orbital evolution that can be coupled energetically to the envelope whose evolution is then followed with a classical one-dimensional stellar evolution code. Such CE models are of interest not only from a historical perspective. They may help to interpret the general behaviour of more complicated hydrodynamic models and to derive a predictive model from them to be used in binary stellar evolution theory. The development of 3D hydrodynamic models is only briefly mentioned in Sect. 2.3, because they are at the core of the remainder of this review.

In Sect. 3, we discuss the physics that governs CEE and its modeling. This section provides the physical basis of numerical implementations but also points out the modeling challenges caused by physical effects. After introducing the fundamental (but probably insufficient) gravo-hydrodynamic model that describes CE interaction as arising exclusively from hydrodynamic and gravitational interaction in Sect. 3.1, we explain why multidimensional simulations of CE phases are required to properly represent the relevant physical processes in Sect. 3.2. The question of why in such simulations it remains difficult to decide on the most pressing problems—envelope ejection and final orbital separation of the remnant binary system—is discussed in Sect. 3.3. Physical phenomena that should be included in CE simulations are mentioned in Sect. 3.4. We conclude Sect. 3 with pointing out why the dynamic inspiral phase—although demanding to model and decisive for the outcome of CE interaction—is not the full story and the phases preceding and following it have to be taken into account in order to establish a comprehensive model of CEE.

Approaches to numerical implementations of CE models are reviewed in Sect. 4 with a focus on computational fluid dynamics (Sect 4.1), self-gravity (Sect. 4.3) and problems of energy and angular momentum conservation (Sect. 4.4.3). Different discretization approaches have been used to model CEE and we try to point out advantages and drawbacks of specific methods. Apart from some specific drawbacks of certain schemes, there are general problems arising from the multi-physics and multi-scale nature of the problem that have posed challenges to virtually all CE simulations to date, and we discuss them, too.

A related topic is the setup of 3D hydrodynamic CE simulations. It is sufficiently important, but also delicate in its treatment, to deserve the separate Sect. 5.

The actual 3D hydrodynamic CE simulations published so far are reviewed in Sect. 6. After discussing simulations pertaining to the pre-CE phase (i) of our classification in Sect. 6.1, we give some account of simulations that focus on resolving the details of the interaction between the companion and the gas of the CE in Sect. 6.2. While in these—as a necessary compromise for reaching high spatial resolution—only some part of the system is included in the simulated domain, global CE simulations try to follow the evolution of the entire system through the inspiral phase (ii). As discussed in Sect. 6.3, these have been developed over the past decades, and we give some account for the historical development of ideas and techniques. At the moment, a rapid increase in the quality of such hydrodynamic simulations is observed that originates from a combination of increasing computational power and new numerical modeling techniques.

In Sect. 7 we draw conclusions (Sect. 7.1) and give future perspectives for CE modeling. We discuss physical modeling aspects (such as missing physical effects, Sect. 7.2) as well as numerical issues (e.g. Sect. 7.3 on unresolved numerical problems). The post-inspiral phase (iii) is difficult to capture in 3D hydrodynamic approaches. Therefore, such simulations have to be augmented with 1D classical treatments of stellar evolution as discussed in Sect. 7.4. An ultimate goal of CE modeling is to connect directly to binary evolution calculations (Sect. 7.5) and to astronomical observations (Sect. 7.6).

2 Current theoretical understanding of common-envelope interaction

In the previous section, we have introduced the CE phase as a necessary model to explain a number of observed systems, and we have emphasized the importance of this phase to explain and connect a number of new observations, such as gravitational wave detections. In this section, we report on the progress that has been made to elucidate the details of this interaction since the days when it first was proposed in the late 1970s. Attempts to model CEE can be classified into three categories: parametric formalisms, one-dimensional (1D) “mechanical” models and 3D hydrodynamic simulations. In Sects. 2.1 and 2.2 we discuss the former two categories. This is meant to summarize approaches that can be seen as complimentary to the 3D hydrodynamic simulations. While potentially useful for the interpretation and—potentially—for casting the results of such simulations into a simpler framework applicable in classical stellar evolution approaches, they lack predictive power and do not require sophisticated computational methods. Arriving at 3D hydrodynamic simulations of CEE in in Sect. 2.3 sets the stage for an in-depth discussion of these models in the following sections of our review.

It has to be pointed out, however, that none of the three approaches has, to-date, provided a satisfactory picture of the interaction, nor have they enabled a predictive model of CEE. Nevertheless, they have laid a solid foundation for the modern efforts, which will hopefully lead to the next wave of breakthroughs.

2.1 Parametric models: the energy (\(\alpha _{\mathrm{CE}}\)) and angular momentum (\(\gamma \)) formalisms

Parametric formalisms for modeling CE phases are based on general considerations of the energy or angular momentum budget in the interacting systems. They determine the orbital energy and angular momentum required to achieve envelope ejection. This simple estimate allows to determine whether successful CEE is possible or a CE merger is more likely. From the energy or angular momentum budgets, the formalisms allow to derive the orbital parameters of the surviving binary system. This way, they provide the end stage of CEE for a given initial system without attempting to model the dynamical processes linking them. Therefore, such models give little insight into the physics of CE phases. Their predictions seem questionable, but they allow us to construct population models to explain observations and they provide guidance for multidimensional simulations of CEE.

The energy formalism (van den Heuvel 1976; Webbink 1984) is the coarsest parametrization of CEE. It equates the binding energy of the envelope, \(E_\mathrm{bind}\), with the loss of orbital energy, \({\Delta } E_\mathrm{orb}\), during the inspiral

$$\begin{aligned} E_\mathrm{bind} = \alpha _\mathrm{CE} {\Delta } E_\mathrm{orb}, \end{aligned}$$
(1)

where the efficiency parameter \(\alpha _\mathrm{CE}\) accounts for the fact that only some of the deposited orbital energy may be needed to unbind the entire envelope with the remainder being expended to accelerate all or part of the envelope to speeds in excess of the escape velocity, or being radiated or convected away. This would imply values of \(\alpha _\mathrm{CE}\) in the range from 0 to 1. Accounting for the fact that other energy reservoirs than the orbital energy of the companion may be tapped to unbind the envelope, \(\alpha _\mathrm{CE}> 1\) is formally possible.

A reliable determination of \(\alpha _\mathrm{CE}\) is required to turn the energy formalism into a predictive model, but this is difficult to reach. In fact, many questions have been raised about the effectiveness of using this parametrization to describe the event. What exactly is the value of \(\alpha _\mathrm{CE}\)? Should be a function of parameters, or of time? Ivanova et al. (2013) point out that \(\alpha _\mathrm{CE}\) being exactly equal to one is an extreme fine-tuning problem. It could be a function of stellar and binary parameters, but has traditionally been set to a constant value for use in population synthesis models that need to predict the final separation of systems given their envelope binding energy (e.g., Toonen et al. 2018). Some population studies tried to use a functional value of \(\alpha _\mathrm{CE}\) (Politano and Weiler 2007), but this has not enlightened the discussion. Observational studies based on close binaries involving white dwarf stars (particularly single-degenerate systems, where the companion is a main sequence star) have attempted a calibration of \(\alpha _\mathrm{CE}\). Some of these studies proposed a particular constant value for \(\alpha _\mathrm{CE}\) (Zorotovic et al. 2010, see Fig. 1) while others advocated a variable value (De Marco et al. 2011). In the end, all these approaches are plagued by the large uncertainties introduced in the many steps required to reconstruct the parameters of the white dwarf progenitor star.

Fig. 1
figure 1

Values of \(\alpha _\mathrm{CE}\) derived by reconstructing or measuring the binding energy, the initial and the final separations of observed compact single degenerate post-CE binaries. Colors indicate the nature of the primary star in the progenitor system: red dots mark RG stars and blue dots AGB stars. The results are plotted as a function of companion mass \(M_2\) (left panel) or of the period after the CE interaction \(P_\mathrm{CE}\) (right panel). Image adapted from Zorotovic et al. (2010)

The energy formalism involves uncertainties that go beyond the tunable efficiency parameter. They relate to the definition of the binding energy of the envelope. Even if a non-parametric expression can be used, for example by calculating the binding energy from 1D stellar structure models, according to

$$\begin{aligned} E_\mathrm{bind} = \int _{M_\mathrm{core}}^{M_\star }\left[ - G \frac{M(r)}{r} + \alpha _\mathrm{th} u \right] \mathrm{d} m \end{aligned}$$
(2)

(Dewi and Tauris 2000), there is always the issue of the mass coordinate \(M_\mathrm{core}\) at which the core of the primary star (of total mass \(M_\star \)) ends and its envelope (of mass \(M_\mathrm{env}\)) begins (e.g. Dewi and Tauris 2000; De Marco et al. 2011; Kruckow et al. 2016). The choice of this parameter greatly alters the result. For the outcome of CE interaction, the mass coordinate down to which the envelope has to be removed so that the remaining object does not re-expand—sometimes called bifurcation point—is of particular interest. It sets the minimum orbital separation that the system has to reach in order to terminate CEE (Deloye and Taam 2010; Ge et al. 2010; Marchant et al. 2021; Tauris and Dewi 2001; Vigna-Gómez et al. 2022).

The first term in the integral of Eq. (2) is clear: it is the gravitational binding energy of the envelope gas with G denoting the gravitational constant. The specificFootnote 5 internal energy u in the second term, however, is a bit ambiguous. It should contain all other energies of the envelope that potentially decide on its binding status, such as the thermal energy of the gas, the energy of the radiation field (expressed via the Stefan–Boltzmann law), the ionization energy of the atoms, the dissociation energy of molecules (Dewi and Tauris 2000). The problem with including these energies is that in order to support envelope ejection, they must be converted into kinetic energy of the gas during CE interaction. Because it is unclear for which of these energies and to which extent this is the case, a fudge factor \(\alpha _\mathrm{th}\) was introduced (Dewi and Tauris 2000; Han et al. 1995). Unfortunately, the introduction of two tunable parameters, confusingly both called \(\alpha \) but with partially different meanings,Footnote 6 leads to degeneracies in the formalism. The variation captured in \(\alpha _\mathrm{th}\) could as well enter the global \(\alpha _\mathrm{CE}\). In order to express the binding energy as a function of the structure of the envelope in a simple way, the structural parameter \(\lambda \) was introducedFootnote 7 by de Kool et al. (1987) via

$$\begin{aligned} E_\mathrm{bind} = -G \frac{M_\mathrm{env} (M_\mathrm{env} + M_\mathrm{core})}{\lambda R}, \end{aligned}$$
(3)

with the stellar radius R. The structural parameter \(\lambda \) scales the radius of the star to represent its degree of internal concentration. This parameter can be determined by fitting to 1D stellar structure models, or it can remain a free parameter (often used in the combination \(\alpha \lambda \), that summarizes both the binding energy and the envelope ejection efficiency). Obviously, the value of \(\lambda \) for a given stellar structure depends on how the binding energy of the envelope is defined—and thus on the uncertainties captured in \(\alpha _\mathrm{th}\) in Eq. (2). For example, using the \(\lambda \) values from the table of Loveridge et al. (2011) requires to adopt their analytical representation for the binding energy, which differs from that of other authors [see the discussion in Iaconi and De Marco (2019)].

Returning to the question of which parts of internal energy can support envelope unbinding (which would justify their inclusion in the second term in the integral of Eq. (2) as counteracting the first gravitational binding energy term), ionization energy of the envelope gas seems to be particularly relevant. It has first been argued by Han et al. (1995) that as material in the expanding envelope falls below the ionization threshold, the released recombination energy can be used to expand or even eject the envelope. Its inclusion in the energy budget effectively implies that the binding energy of the envelope is less negative, or indeed even positive, in which case \(\alpha _\mathrm{CE}\) is larger than unity. The exact fraction of recombination energy that is used to do work is in question at the moment because recombined hydrogen is far more transparent to photons than ionized hydrogen, implying that a fraction of the hydrogen recombination energy could escape as radiation instead of being thermalized. Helium recombination energy, in contrast, may be used more efficiently as its release happens deeper in the star, in layers that stay optically thick for longer. Although several treatments of this phenomenon have been presented (e.g., Ivanova 2018; Soker et al. 2018), the answer appears to be outside the ability of analytical theory, and gives another reason to recur to simulations that include radiation transport. Additional processes that may be relevant but are not accounted for in the simple energy formalism include nuclear energy generation, tidal heating, energy released by the accretion of material onto the companion star, radiation losses and magnetic field generation (Ivanova et al. 2013).

Instead of considering energy balance, Nelemans et al. (2000) used the angular momentum balance to relate the pre- and post-CE states of the system. Assuming a linear reduction of angular momentum \({\Delta } J\) with mass loss \({\Delta } M\) (which could be equated to the envelope mass for full envelope ejection), this gives

$$\begin{aligned} \frac{{\Delta } J}{J} = \gamma \frac{{\Delta } M}{M}, \end{aligned}$$
(4)

again introducing a tunable parameter \(\gamma \). The motivation of this angular momentum, or gamma-formalism was to model the evolution of double helium white dwarfs, which requires \(\gamma \approx 1.75\) (Nelemans et al. 2001a, b; Nelemans and Tout 2005). The authors argued that explaining these systems with the energy formalism fails, although Webbink (2008) remarks that the reason is that the first of the two mass transfer phases in the systems discussed by Nelemans and Tout (2005) was not a common envelope, but a quasi-conservative mass transfer phase. While this explanation is not perfectly satisfying, as Webbink (2008) also discuss, the main problem with the gamma-formalism stems from its lack of predictive power. The value of \(\gamma \) is in fact constrained to lie in the narrow range between \(\nicefrac {5}{3}\) and \(\nicefrac {5}{8}\), within which it predicts a wide range of values for the final orbital separation of the post-CE core system. An updated formalism based on angular momentum conservation in the CE system was recently proposed by Di Stefano et al. (2023).

Parametric models provide a shortcut through the complex CE interaction for population synthesis studies. The validity of the energy and angular momentum formalisms is still to be confirmed with simulations that capture the details of the actual physical interaction. It is therefore important to point out the fundamental differences and the relations between these formalisms and detailed hydrodynamic simulations of CE interaction. The simplified descriptions are based on the global budgets of conserved quantities, but they do not specify where energy is injected and what fraction of it is used for unbinding the envelope. They assume certain initial and end stages without modeling the dynamical processes linking them and therefore give little insight into the physics of CEE. But even within the global view of parametric models, questions arise: Are the efficiency parameters universal? If not, how do they depend on the parameters of the initial models, such as the mass ratio of the stellar components, the evolutionary state of the primary star, or even the plunge-in time? Consequently, parameters such as \(\alpha _\mathrm{CE}\) or \(\gamma \) by themselves cannot shed much light on the physical processes and they are of little use to constrain 3D hydrodynamic models. Conversely, a goal of more advanced simulations of CEE is to fix or predict parameters like \(\alpha _\mathrm{CE}\) to enable their further use in parametric studies. A full treatment with detailed numerical simulations is ultimately required to validate such parametrizations and—if possible—generate prescriptions for parametrized approaches that supply them with predictive power.

2.2 One-dimensional inspiral models

A more detailed description of CE phases than that provided by the simple parametric formalisms discussed in Sect. 2.1 is obtained from 1D stellar structure models that integrate the change of orbital separation during the inspiral of the companion into the envelope of the primary star as obtained from a parametrized approach to the inspiral (e.g. Alexander et al. 1976; Fragos et al. 2019). These models do not provide a self-consistent description of the drag forces acting on the stellar cores. With an assumed drag force model, they integrate a 1D equation of motion for the inspiral of the companion into the envelope of the primary star. A coarser approach summarizes the inspiral by a bulk mass-loss rate that simply removes the envelope (Clayton et al. 2017; Xiong et al. 2017). Before we can give details of these models, we need to discuss analytical approximations of the gravitational drag force.

2.2.1 Analytical approximation of the gravitational drag

The main energy reservoir driving the CE interaction is the “orbit" of the initial binary system. The mechanism of the transfer of orbital energy to the envelope gas of the primary star is mainly due to the interaction between the companion and the envelope as well as the core of the giant and the envelope.

Quantifying the drag around stellar cores in CEE is a difficult task. Several effects contribute to the total force (Livio and Soker 1984b): dynamical gravitational braking due to deflection of surrounding gas that transfers momentum onto the companion, drag due to accretion (or evaporation) onto (from) the companion, viscous hydrodynamical or turbulent friction, and tidal forces. In the case of light companions such as massive planets and brown dwarfs, it is easy to see analytically that hydrodynamic friction onto the companion easily competes with gravitational friction, complicating the inspiral (Staff et al. 2016b), but for most other situations, gravitational drag dominates.

When a body moves through gas, gravitational interaction leads to a deflection of the surrounding material into a wake behind the body. Some part of the gas is accreted onto the gravitating object [see Edgar (2004), for a detailed and pedagogical derivation]. This accretion flow was first studied by Hoyle and Lyttleton (1939), who, under the assumption of a sufficiently rarefied gas, considered the problem in terms of a collisionless system. Gas particles around the moving object—modeled as a point mass—are deflected by its gravity and approach the axis of its motion (in this case the symmetry axis of the problem) downstream of it in a ballistic trajectory. If gas particles are gravitationally bound to the object (i.e. in absolute value their kinetic energy is smaller their gravitational potential energy) they will be accreted with a rate that depends on the distance from the object at which they reach the collimation axis. This, in turn, specifies a critical impact parameter \(R_\mathrm{a}\) around the moving object inside of which the gravitational deflection directs particles to a point on the axis where they are bound. From this simple picture, an accretion rate is derived:

$$\begin{aligned} {\dot{M}}_\mathrm{HL} = \pi R_\mathrm{a}^2 \rho _\infty v_\infty , \end{aligned}$$
(5)

where \(\rho _\infty \) and \(v_\infty \) denote the density and velocity upstream of the gas (Hoyle and Lyttleton 1939; Edgar 2004). The subscript ‘\(\infty \)’ indicates that the values are measured sufficiently far away from the moving object so that they are not affected by its gravitational attraction. The critical impact parameter is usually called the accretion radius and it is given by

$$\begin{aligned} R_\mathrm{a} = \frac{2 G M}{v_\infty ^2}. \end{aligned}$$

Here, G is the gravitational constant and M is the mass of the accreting object. Bondi and Hoyle (1944) extended the analytic treatment of Hoyle and Lyttleton (1939) by relaxing the assumption of a collisionless system. Collimation of the flow to the downstream axis of motion by gravitational deflection increases the density in a collisionless system to infinity, which is unphysical. Instead, a hydrodynamic pressure builds up and a wake of finite density forms behind the object, which Bondi and Hoyle (1944) called an accretion column. The finite density of the wake reduces the mass accretion rate to (Bondi and Hoyle 1944; Edgar 2004)

$$\begin{aligned} {\dot{M}} = \alpha \pi R_\mathrm{a}^2 \rho _\infty v_\infty , \end{aligned}$$
(6)

where, according to Bondi and Hoyle (1944), the factor \(\alpha \) ranges between \(\nicefrac {1}{2}\) and 1. The setup considered by Hoyle and Lyttleton (1939) applies to highly supersonic velocities of the gravitating object with respect to the gas, but it fails in cases of slow motion. A different setup that avoids dynamical effects was considered as a limiting case by Bondi (1952): a static gravitating object inside a gas that is initially at rest and from which it accretes in a spherically symmetric way. This led Bondi (1952) to introduce a characteristic accretion length scale,

$$\begin{aligned} R_\mathrm{B} = \frac{G M}{c^2_\infty }, \end{aligned}$$

where \(c_\infty \) denotes the sound speed far away from the object. Outside of this Bondi radius the accretion flow is subsonic and the density is uniform; inside of it the gas becomes supersonic and accretes onto the object in free fall (Edgar 2004). The nature of the flow—subsonic or supersonic—is characterized by the Mach number,

$$\begin{aligned} Ma = \frac{v}{c}. \end{aligned}$$
(7)

The resulting accretion rate onto the static gravitating object is given by (Bondi 1952)

$$\begin{aligned} {\dot{M}} = 4 \pi \lambda R_\mathrm{B}^2 \rho _\infty c_\infty , \end{aligned}$$
(8)

with an order unity non-dimensional parameter \(\lambda \). This parameterFootnote 8 plays a role analogous to \(\alpha \) in Eq. (6). The similarity of Eq. (8), valid for the limiting case of a Mach number \( Ma _\infty = 0\), with Eq. (6), that applies to the case of \( Ma _\infty \gg 1\), led Bondi (1952) to propose the interpolation

$$\begin{aligned} {\dot{M}}_\mathrm{BH} \sim \frac{\pi (G M)^2 \rho _\infty }{\left( c^2_\infty + v^2_\infty \right) ^{3/2}}, \end{aligned}$$
(9)

often called to as Bondi–Hoyle accretion rate. Following Edgar (2004) we will refer to the general framework as the Bondi–Hoyle–Lyttleton (BHL) formalism. The considered setups cannot be steady: material is accreted onto the gravitating object, which not only increases its mass, but also leads to a transfer of momentum. The momentum transfer corresponds to a drag force. Dimensional considerations very approximately suggest the relation (Edgar 2004)

$$\begin{aligned} F_\mathrm{drag} = M {\dot{v}}_\infty \sim {\dot{M}} v_\infty , \end{aligned}$$
(10)

so that the accretion rates discussed above can be translated into corresponding drag forces that act on a gravitating object moving though gas. It is important to note that the origin of this drag force is not a direct friction of the gas exerted on the moving object—in the model the object is a point mass and does not have a surface—but rather an effect of the material deflected into and accreted from its wake (Edgar 2004). While, according to Eq. (5), the drag force in the Hoyle-Lyttleton formalism decreases monotonically with the Mach number of the relative motion, the interpolation of Bondi [Eq. (9)] predicts a peak in it at \( Ma _\infty = \sqrt{\nicefrac 12}\) (see Fig. 2).

Fig. 2
figure 2

Drag force as a function of Mach number according to Eqs. (5), (9), (1214) assuming \(r_\mathrm{max}/r_\mathrm{min} = 20\) and the expression given by Kim and Kim (2007) with \(r_\mathrm{max}/r_\mathrm{min} = 10\). Image modified from L. Thielbeer, Bachelor thesis, Heidelberg 2021

This, however, has an additional effect: more mass is present on the downstream side of the moving object than upstream of it and this causes a backward-directed gravitational pull on it—an effect that is usually referred to as dynamical friction and was first studied by Chandrasekhar (1943) under the assumption of a collisionless system. Dokuchaev (1964) extend the discussion to a collisional fluid dynamical system. For the resulting drag force in the hypersonic case, Ruderman and Spiegel (1971) proposed:

$$\begin{aligned} F_\mathrm{drag} = {\dot{M}} v_\infty \ln \left( \frac{r_\mathrm{max}}{r_\mathrm{min}}\right) . \end{aligned}$$
(11)

Because of its similarity to the formalism describing Coulomb collisions in plasma physics, the logarithm in this expression is usually called the Coulomb logarithm. It introduces two length scales, \(r_\mathrm{min}\) and \(r_\mathrm{max}\). They result from integration boundaries that represent the minimum and maximum radius of gravitational interaction of the moving object with the gas. Unfortunately, there is no clear definition of what these scales should be and their choice remains somewhat arbitrary. In the hypersonic case, the density asymmetry is a maximum because the material is collimated in the region trailing the moving object. For lower velocities, this is no longer the case and in the subsonic regime the dynamical drag should be smaller. Therefore, the Coulomb logarithm should involve a quantity that characterizes the flow. Rephaeli and Salpeter (1980) suggested a form for the supersonic case that depends on the Mach number of the flow, \( Ma \), but they argued that in the subsonic case the dynamical drag should vanish. Based on a linear perturbation analysis, Ostriker (1999) derived an expression for the drag force

$$\begin{aligned} F_\mathrm{drag} = \frac{\pi R_\mathrm{a}^2 \rho _\infty }{v_\infty ^2} I \end{aligned}$$
(12)

with the Coulomb logarithm

$$\begin{aligned} I_\mathrm{subsonic} = \frac{1}{2} \ln \left( \frac{1 + Ma }{1 - Ma } \right) - Ma \end{aligned}$$
(13)

for subsonic relative velocities and

$$\begin{aligned} I_\mathrm{supersonic} = \frac{1}{2} \ln \left( 1 - \frac{1}{ Ma ^2} \right) + \ln \left( \frac{v_\infty t}{r_\mathrm{min}}\right) \end{aligned}$$
(14)

for supersonic velocities, where \(r_\mathrm{min}\) is the effective size of the moving object. The resulting drag force is plotted in Fig. 2 as a function of the Mach number.

Still, the specification of the upper integration limit for the gravitational interaction in the supersonic case remains problematic for the application of this formalism to CEE. Ostriker (1999) considered a perturber moving through a uniform gas on a straight line over some finite period of time t and integrate over the path it travels. Kim and Kim (2007) investigated the drag force on a perturber moving on a circular orbit in a uniform gaseous medium. The main effect of this change in geometry is that a trailing tail forms behind the perturber in which the density distribution is asymmetric. Therefore, the drag force has components in lateral as well as radial direction, although Kim and Kim (2007) found that the latter contributes little to the orbital decay. Based on a semi-analytic approach, Kim and Kim (2007) provided fits for I in Eq. (12) in different flow regimes with a functional dependency on the Mach number that resembles the form of Ostriker (1999), see also Fig. 2.

In addition to shrinking the orbital separation between the stellar cores and transferring angular momentum and orbital energy to the envelope so that it is ejected, drag also affects the eccentricity of the core binary system. Szölgyén et al. (2022) argue that while the hydrodynamic drag acting on the companion tends to circularize the orbit, gravitational drag can both enhance or decrease eccentricity, depending on the density structure of the envelope.

The analytic expressions for the drag force discussed here are important to understand the underlying effects and the functional dependencies on characteristic quantities, chiefly the Mach number of the relative velocity between perturber and gas. They are, however, not fully self-consistent because the derived relations are proportional to the drag force up to multiplicative factors, that, at best, are constants. Whether these constants are universal or whether they depend on details of the envelope structure and the inspiral of the companion has to be determined in 3D hydrodynamic simulations. In Sect. 6.2 we discuss further attempts at modelling the gravitational drag using hydrodynamic simulations that do not necessarily comprise the entire CE system but rather simulate objects in “wind tunnels”. In the future, such simulations may join forces with global CE simulations and 1D mechanical models to build a more complete understanding of the entire interaction.

2.2.2 Parametrized 1D models of dynamical common-envelope inspiral

Among the first computational models of CE interaction were approaches that follow the inspiral of the companion into the envelope of the primary and, in most cases, the associated energy deposition into the envelope gas with 1D stellar evolution codes [see Meyer and Meyer-Hofmeister (1979) and Taam et al. (1978)]. These approaches determine drag forces and energy (and/or angular momentum injection) according to local conditions as encountered in a 1D structure model of the primary star’s envelope. This formulation allows for a simple 1D “mechanical” model of the inspiral phase, i.e. Phase (ii) of our classification in Sect. 1.3. It is based on an equation of motion for the companion under the action of a gravitational force and a drag force,

$$\begin{aligned} \ddot{{\varvec{r}}} = - \frac{G \left( M_\star ^* + M_2\right) }{r^3} {\varvec{r}} + \frac{1}{M_2} {\varvec{F}}_\mathrm{drag}, \end{aligned}$$
(15)

where \({\varvec{r}}\) is the radius vector pointing from the center of the primary star to the companion of mass \(M_2\) (Alexander et al. 1976). The mass of the primary star inside the radius \({\varvec{r}}\) is denoted as \(M_\star ^*\).

Obviously, such a model is a gross simplification of the physical processes at work in CEE. It assumes a symmetry of the setup that diverges from reality, where the envelope is deformed by the gravitational interaction. Moreover, for the determination of the orbital shrinkage and the associated energy (and angular momentum) deposition due to drag, it considers only the motion of the companion in the envelope of the primary, whose core is assumed to be fixed in space. This setup thus misses the drag force that acts on the core of the primary star when it orbits the center of mass of the system and thus also moves relative to the envelope gas.

Nonetheless, 1D “mechanical” models extend beyond the simple arguments of energy or angular momentum conservation used in the formalisms discussed in Sect. 2.1. They attempt a physical description of the dynamical interaction between companion and envelope, albeit in a parametric way: The inspiral of the companion into the envelope is followed according to a drag force acting on it. This model raises questions: (i) What exactly is the nature of the interaction between the companion and the envelope gas and how can the drag force \(F_\mathrm{drag}\) perturbing the orbital motion in Eq. (15) be modeled? (ii) How does the envelope react to the injection of energy and angular momentum and what are the consequences of structural changes for the drag force?

As discussed in Sect. 2.2.1, Question (i) has been addressed in analytic treatments in the framework of linear theory, resulting in scaling relations (e.g. Dokuchaev 1964; Ostriker 1999). The semi-analytical model of Kim and Kim (2007) extends the original setup of linear motion to the more appropriate case of circular orbits. The omission of nonlinear effects and density gradients in the envelope is accounted for by fudge factors that have to be determined from numerical simulations. We discuss 3D simulations which attempt to quantify the gravitational drag force in Sect. 6.2. They have been calculated either in wind-tunnel type models [where high spatial resolution can be achieved around the point mass that acts as the inspiralling companion, see MacLeod and Ramirez-Ruiz (2015a) MacLeod et al. (2017b), and De et al. (2020)], for massive perturbers on circular orbits in a gaseous medium (Kim 2010), or in a full CE simulation where the reaction of the envelope to the inspiral can be gauged, but the resolution is inferior (Chamandy et al. 2019; Reichardt et al. 2019). Parametric approaches to the description of the drag force have been used relatively rarely in 1D “mechanical” models. Perhaps the most modern and comprehensive approach was that of Fragos et al. (2019), who used the parametrization of the gravitational drag determined by the 3D hydrodynamic models of MacLeod and Ramirez-Ruiz (2015a).

Question (ii) concerns the expansion and change of structure of the envelope. In the simplest approach, the envelope is treated as static and unperturbed by the inspiral, as assumed, for instance, in the study of MacLeod and Ramirez-Ruiz (2015b). In principle, however, the co-evolution of orbit and envelope can be followed in 1D hydrodynamic stellar evolution models. The idea is to inject the orbital energy and/or angular momentum released by the drag force into the stellar envelope and to model its response in a 1D hydrodynamic stellar evolution code. Different groups have developed recipes for this: Some inject released orbital energy into the thermal energy of the envelope, while others model angular momentum transfer to envelope material that also increases its kinetic energy. The employed 1D parametrizations cannot self-consistently determine what fractions of energy and angular momentum are to be injected into each of these reservoirs. Consequently, the implementations vary, but the general approach has been followed in a number of early CE studies (Delgado 1980; Livio and Soker 1984a, b; Meyer and Meyer-Hofmeister 1979; Soker et al. 1984; Taam et al. 1978; Taam 1979). In the late 1980s and the 1990s, 1D “mechanical” models were abandoned because of the asymmetries observed in 3D hydrodynamic simulations that called the assumption of spherical symmetry into question. The work of Podsiadlowski (2001), however, revived the method.

The list of deficiencies of 1D “mechanical” CE models’ is long: The assumed spherical symmetry in the parametrized models is a gross simplification. It implies a local transfer of orbital energy and angular momentum and injects them into a spherical shell. In reality, however, the gravitational perturbation of the envelope is non-local and the energy is not deposited into spherical shells. In fact, the plunge-in of the companion quickly destroys any sphericity of the primary star’s envelope. Moreover, the orbit in the 1D parametrized models remains circular by necessity, with concomitant non-conservation of angular momentum.

Despite all these shortcomings, however, such models have their value and hold promise for capturing effects that would be very difficult to include in 3D hydrodynamic simulations of CEE. Their recent application is therefore motivated by the need to bridge scale gaps that are hard to overcome in 3D hydrodynamic models.

An example is the inspiral of neutron stars into a massive red supergiant primary star, which pose a strong spatial scale challenge. This was addressed with a 1D parametrized model by Fragos et al. (2019) generating information about the final product: a binary comprising a \(2.6 \,M_\odot \) helium star and a neutron star at a separation of 3.3 to \(5.7 \,R_\odot \).

Clayton et al. (2017) explore the evolution of CE systems after the inspiral phase (ii) when entering post-inspiral evolution [Phase (iii) of our classification in Sect. 1.3], which poses a time-scale challenge. Generally, during the slower phases, several physical processes such as radiation transfer, convective energy transport, and nuclear burning, can have a substantial effect on the interaction and need to be modelled. These longer phases are themselves needed to understand the interaction as a whole, so the role of 1D parametrized models could be critical and was advocated as the most important step to further progress by Ivanova et al. (2013).

2.3 Three-dimensional hydrodynamic models

The concept of CE interaction is deceivingly simple, but the details are complex. As discussed above, finding a trustworthy way to parametrize actual CEE turns out to be extremely challenging. Given a set of initial binary parameters, parametric formalisms and 1D models are still unable to reliably predict the outcome of the interaction.

This is why the first 3D hydrodynamics attempts started as early as 1987 (de Kool 1987). After early works [see also Livio and Soker (1988) and Terman et al. (1994)], efforts with modern codes are those of Rasio and Livio (1996), who used a smoothed particle hydrodynamics (SPH) technique and of Sandquist et al. (1998), who used a static nested-grid technique (see Sect. 6.3 for details). These simulations generated a number of useful pieces of information, but they must be considered as being at the toy-model level from today’s perspective, mostly because the vast ranges of spatial and temporal scales to be resolved was unmatched by early computational resources.

A second wave of models involved a new suite of codes, both using Eulerian grid and SPH techniques (Passy et al. 2012; Ricker and Taam 2008, 2012). These modern efforts were fortunately soon followed by a number of additional simulations, which somewhat expanded the considered parameter space, and involved yet more codes and techniques (e.g., Chamandy et al. 2018; Iaconi et al. 2017a; Nandez et al. 2014; Ohlmann et al. 2016a, b; Prust and Chang 2019; Reichardt et al. 2019).

The main appeal of 3D hydrodynamic simulations is that they can in principle model the interaction between the stellar cores and the envelope gas in a self-consistent way, although scale problems and resolution issues seriously hinder this prospect. Moreover, 3D simulations of the fast inspiral revealed just how non-spherical the CE interaction is, with outflows relatively close to the equatorial plane, and they revealed the complex flow structures involved in Phase (ii) of CE interaction. They also clearly showed that ejecting the envelope using only orbital energy is very difficult, if not impossible, and paved the way to a deeper understanding of the energy exchange, including the impact of recombination energy on the expanding envelope. While—contrary to initial, perhaps naïve, hopes—3D hydrodynamic CE simulations have not provided a convincing value of \(\alpha _\mathrm{CE}\) for the energy formalism discussed in Sect. 2.1, they do provide a far deeper understanding of the parameter itself. These and other discoveries, which will be described in detail in Sect. 6.3, have convinced many groups to pursue this investigation avenue. Computers and numerical techniques are, after all, advancing rapidly and enable ever more complex simulations. Yet, this enthusiasm also gives way to the realization that, in the end, it might be a clever combination of techniques that will take the podium.

3 Physical modeling and challenges

The system to be modeled consists of (at least) two stellar objects, a giant star and a companion (which can be a star but also a compact object or even a planet). This implies that the objects themselves can be described with a combination of fluid dynamics, thermodynamics, and gravity. The main problem for simulating the evolution of CE systems arises from the discrepancy of scales—most obvious in the required distinction of an extended envelope from a small core in the structure of the giant primary stars (see also Sect. 1.2).

Thus, before turning to the numerical implementation, the physical model for CEE has to be set out. We review it here together with the challenges that arise from the physical modeling itself—numerical implementation problems often resulting from the chosen physical model will be discussed in Sect. 4.

3.1 The gravo-hydrodynamic model

Astrophysical models are commonly plagued by the different nature the various physical processes at play and the wide ranges of spatial and temporal scales on which they act. Models of CE phases are no exception. In fact, CEE is driven by a complex interaction of physical phenomena combining fluid dynamics, thermodynamics, atomic physics, magnetic fields, radiation, accretion physics, and perhaps other effects. While some of the approaches discussed in Sect. 2 are based on coarse approximations, we are interested here in a modeling basis that rests on fundamental physical principles and avoids approximations.

The most basic model of CEE—which we will refer to as gravo-hydrodynamic model in the following—implements the equations of fluid dynamics, most commonly the Euler equations,Footnote 9 combined with a gravitational source term. The first of them is a scalar equation,

$$\begin{aligned} \frac{\partial \rho }{\partial t} + \nabla \cdot (\rho {\varvec{v}}) = 0, \end{aligned}$$
(16)

with \(\rho \), t, and \({\varvec{v}}\) denoting mass density, time, and velocity, respectively. It expresses mass conservation. The second (vector) equation is the momentum balance,

$$\begin{aligned} \rho \frac{\partial {\varvec{v}}}{\partial t} + \rho \left( {\varvec{v}} \cdot \nabla \right) {\varvec{v}} + \nabla P = - \rho \nabla {\Phi }, \end{aligned}$$
(17)

which accounts for pressure forces \(\nabla P\) in the momentum flux and includes gravity (with the gravitational potential \({\Phi }\)) as a source term. Finally, energy balance is expressed in terms of the specific total energy density,

$$\begin{aligned} e_\mathrm{tot} {:}{=}\frac{1}{2} |{\varvec{v}}|^2 + \frac{\epsilon }{\rho }, \end{aligned}$$
(18)

where \(\epsilon \) denotes the density of the internal energy. This gives the last (again scalar) equation

$$\begin{aligned} \frac{\partial \rho e_\mathrm{tot}}{\partial t} + \nabla \cdot (\rho e_\mathrm{tot} {\varvec{v}}) + \nabla \cdot (P{\varvec{v}}) = - \rho {\varvec{v}} \cdot \nabla {\Phi }. \end{aligned}$$
(19)

Equations (16), (17), and (19) are formulated for a fixed frame of reference. This is called Eulerian specification. An alternative is obtained from transforming the system into a frame of reference co-moving with the fluid. This is achieved by introducing the substantial (or Lagrangian) derivative

$$\begin{aligned} \frac{\mathrm{D}}{\mathrm{D}t} {:}{=}\frac{\partial }{\partial t} + {\varvec{v}} \cdot \nabla . \end{aligned}$$
(20)

After this transformation, the Euler equations in Lagrangian specification read

$$\begin{aligned} \frac{\mathrm{D}\rho }{\mathrm{D}t} + \rho \nabla \cdot {\varvec{v}}= & {} 0, \end{aligned}$$
(21)
$$\begin{aligned} \rho \frac{\mathrm{D}{\varvec{v}}}{\mathrm{D}t} + \nabla P= & {} - \rho \nabla {\Phi }, \end{aligned}$$
(22)
$$\begin{aligned} \rho \frac{\mathrm{D}e_\mathrm{tot}}{\mathrm{D}t} + \nabla \cdot P {\varvec{v}}= & {} - \rho {\varvec{v}} \cdot \nabla {\Phi }. \end{aligned}$$
(23)

A special case is encountered for situations where gravity is exactly balanced by the pressure gradient. In this case, the acceleration in Eq. 22 vanishes. This mechanical equilibrium is an excellent approximation for the stratification of stellar envelopes in long-lasting stages of stellar evolution. It is called hydrostatic equilibrium (HSE):

$$\begin{aligned} \frac{\nabla P}{\rho } = - \nabla {\Phi }. \end{aligned}$$
(24)

The gravitational potential is determined by Poisson’s equation:

$$\begin{aligned} {\Delta } {\Phi } = 4 \pi G \rho , \end{aligned}$$
(25)

where G is Newton’s gravitational constant.

The Euler equations form a system of hyperbolic partial differential equations and thus pose an initial value problem. For their solution, initial conditions must be supplied. We devote Sect. 5 on how to set up CE simulations. To close the system of Eqs. (16), (17), and (19), an equation of state is needed that relates pressure, density and internal energy. The equation of state is an essential part of our model system. It accounts for micro-physical interaction between the constituents of matter in the effective macroscopic framework of thermodynamics. In the simplest case, an ideal gas is assumed as a model for stellar material, but radiation pressure can be added via the Stefan–Boltzmann law in a straightforward way.

Obviously, the physical model described by this set of equations is not very specific for the problem at hand—the same set of equations forms the basis for the theoretical treatment of many astrophysical objects ranging from planets to the large-scale structures in the Universe.Footnote 10 Despite its generic nature, however, the gravo-hydrodynamic model captures the gravitational and hydrodynamic interaction between the orbiting cores and the envelope. Setting up a CE model in this framework, gravitational (and also hydrodynamic) drag is naturally included. The model thus self-consistently accounts for the transfer of orbital energy and angular momentum from the core binary to the envelope gas—one of the most important processes in CEE. In addition, the model also captures convection if it occurs in the stellar envelope.

From a physical point of view, the gravo-hydrodynamic model does not pose particular challenges, but analytic solutions of the system of coupled nonlinear hyperbolic partial differential equations are virtually impossible for complex setups. Therefore, numerical approaches are needed and—as discussed in Sect. 4—neither fluid dynamics nor gravitational interaction are easy to deal with computationally.

Fig. 3
figure 3

Density on slices through the orbital plane (top row) and perpendicular to it (bottom row) in a 3D hydrodynamic simulation of CE inspiral of a \(0.49 \, M_\odot \) companion (marked with a \(\times \) symbol) into a \(0.97 \, M_\odot \) early AGB star (core marked with a + symbol; Model O.50 of Sand et al. (2020), courtesy of Christian Sand. The times of the snapshots after initiation of the CE interaction are indicated in the respective upper panels

3.2 Why do we need multi-D hydrodynamical simulations?

In Sects. 2.1 and 2.2 we have listed the shortcomings of parametric and 1D mechanical models and in Sect. 2.3 we have explained that combining these models with 3D hydrodynamics models can fill in the glaring gaps in our understanding of CEE. This in particular applies to the inspiral of the stellar cores into the CE, i.e. Phase (ii) of our classification in Sect. 1.3: Only 3D hydrodynamic approaches capture the physics of the interaction between the stellar cores and the envelope material consistently. They resolve the flow around the cores and the changes in the structure and morphology of the envelope. Adopting the gravo-hydrodynamical model described in Sect. 3.1, 3D simulations are able to tell where and how the transfer of orbital energy and angular momentum from the core binary onto the envelope material takes place. In this sense, 3D hydrodynamic simulations are the key to understanding the elusive physics of CE interaction.

As CEE progresses, the envelope will strongly diverge from spherical symmetry. In an edge-on projection, the density structure of the envelope assumes a toroidal shape (Fig. 3, bottom row). It is immediately clear that perturbations induced to the envelope by the inspiralling core binary system cannot be captured by spherically symmetric models. In addition to the toroidal deformation of the envelope, there is a pronounced spiral shock structure issuing from the core binary that dominates the density structure (Fig 3, top row). In later phases of the evolution, shear-induced hydrodynamic instabilities become visible (Fig. 3, snapshots at \(600\, \mathrm{d}\) and at \({1200} \, \mathrm{d}\)). While all this does not necessarily mean that the basic results of the interaction such as envelope ejection and orbital decay of the core binary system cannot be represented in 1D models or parametric formalisms, it seems unlikely that the complex hydrodynamic flows observed in CEE would give rise to universal parameters and thus self-consistent predictive prescriptions in such approaches. Full 3D hydrodynamic models remain indispensable and may be needed to calibrate the simplified models in very fragmented ranges of parameter space.

Moreover, as discussed in Sect. 2.2.1, determining the drag around an obstacle is an extremely challenging problem of 3D hydrodynamics. A reliable description of accretion and deflection of material around the companion star in CEE and the formation of a turbulent wake behind it are of fundamental importance to predict the envelope ejection efficiency and the orbital shrinkage. In complex setups with non-uniform background densities and circular orbits, 3D hydrodynamic simulations are required to capture the effects in a quantitative way.

Clearly, 3D simulations of the inspiral phase of CEE are a fundamental building block for developing a comprehensive model of this important phase of binary stellar evolution and they are the focus of our review. However, despite their obvious advantages, it is unlikely that they are sufficient. Adopting a fully 3D geometry requires to take a huge leap in the methods and in the computational resources spent on the modeling. Even pushing techniques, algorithm efficiency and computational resources to the limit, there are some inherent difficulties that make it impossible to carry out full 3D hydrodynamic simulations for all the relevant timescales involved in the problem in the foreseeable future—in particular if pre-CE and post-inspiral phases [Phases (i) and (iii) defined in Sect. 1.3] are to be part of the model. So, while in principle the 3D hydro-gravitational model takes into account the interactions between envelope gas and core/companion system, limitations such as resolution may curtail the initial advantages; see also Sect. 7.3.

3.3 CE ejection and the end of the dynamical inspiral

Simulating envelope ejection is a main goal of the numerical modeling of CEE, but it is also one of the most elusive aspects of the interaction. In models, complete envelope removal seems hard to achieve. What are the physical aspects that determine the process and why is it challenging to incorporate them into numerical simulations? The question of envelope ejection is fundamentally related to the question of the final orbital separation of the stellar cores after completing CEE, although, as discussed in Sect. 7.4, it may not be the only process determining it.

The gravo-hydrodynamic model implements the basic mechanism of CEE: orbital shrinkage and unbinding of envelope gas due to transfer of energy and angular momentum from the core binary to the envelope. In its simplest version, it describes the stellar envelope material with an ideal gas equation of state, in some cases adding radiation pressure. This model, however, fails in all 3D simulations that have been carried out so far. The orbital shrinkage stalls or retards when a significant fraction of the envelope is still bound (see Fig. 4 for an example). This leads to the question of how to measure the efficiency of envelope unbinding in a numerical simulation. In a common approach, material is counted as bound if its total energy, determined as the sum of its gravitational potential energy and its kinetic energy is negative. In Sect. 3.4.1, we discuss other forms of energy that could enter this estimate, but here we note that generally arguments based on energy criteria may overestimate the amount of unbound material: Whether or not material is ejected depends not only on its energy but also on its location within the complex perturbed envelope where the total energy is positive. If surrounded by bound material, an unbound fluid element may dissipate its energy without being ejected.

Fig. 4
figure 4

Simulation of CEE in the gravo-hydrodynamic model for a system with a \(1.0 \, M_\odot \) early-AGB primary star with a companion of mass ratio 0.5. An ideal-gas equation of state was assumed in envelope material (Simulation I.50 of Sand et al. (2020), see Sect. 6.3.4). Shown are the orbital evolution (solid line, right axis) and the fraction of unbound envelope mass (dotted line, left axis) according to the criterion of counting gas in a cell as unbound if its kinetic energy is larger than its gravitational binding energy. Image courtesy of Christian Sand

The failure of the basic gravo-hydrodynamic CE model to eject the envelope shows that at some point in the evolution the energy transfer from the cores to the gas becomes inefficient. The fact that the orbital decay ceases (or becomes very slow) indicates a weaker drag acting on the cores. There are several effects that can potentially contribute to this phenomenon:

  • The inspiral of the companion and the associated transfer of orbital energy from the core binary to the surrounding gas perturb the HSE of the envelope such that it expands globally. In the vicinity of the cores, the bow shocks caused by the supersonic orbital motion heat the gas while at the same time the gas is dragged along by the companion and spun up. This injection of energy and angular momentum causes envelope expansion. As a result, the density in the vicinity of the cores decreases with an overall reduction of the drag force. In the analytic treatment of Eqs. (9) and (11), the effect corresponds to \(\rho _\infty \rightarrow 0\). Thus, orbital energy release has two counteracting implications: it drives expansion of the envelope and makes its ejection possible in the first place, but, at the same time, dilution of the gas around the stellar cores reduces the efficiency of energy conversion. This makes it hard to predict whether envelope ejection will succeed in the gravo-hydrodynamic model.

  • The perturbation of the envelope injecting angular momentum as described above may bring the gas into co-rotation with the core binary. For a vanishing relative velocity between core and gas, \(v_\infty \rightarrow 0\) or, equivalently \( Ma \rightarrow 0\), the drag force vanishes, see Eqs. (9), (10), (11), and (12). For example, Reichardt et al. (2019) found that establishing co-rotation stalls their inspiral of a \(0.6\, M_\odot \) point mass companion into the envelope of a \(0.88\, M_\odot \) RG star. Similarly, Iaconi et al. (2018) analyzed the reason for the halting of the inspiral in two simulations with giants of different masses (0.88 and 2.0 \(M_\odot \)) and a range of companions (from 0.1 to 0.9 \(M_\odot \)). They found that only the heavier companions can evacuate the orbit and bring gas into co-rotation. The lighter companions struggle to do either (see Fig. 5). They also found that for lighter envelopes (lighter primaries) it takes a more massive companion to evacuate the orbit and/or bring the gas into co-rotation.

  • The Mach number of the orbital motion may decrease because the local sound speed increases when the companion reaches the inner, high-temperature parts of the envelope. Except for the Hoyle–Lyttleton formalism [Eq. (5)], all analytic treatments discussed in Sect. 2.2.1 include the subsonic regime, where the drag force decreases. In these models, the drag acquires a maximum value at some finite Mach number and vanishes for \( Ma \rightarrow 0\), see Fig. 2. The more elaborate treatments of Ostriker (1999) and Kim and Kim (2007) predict a maximum of the drag force in the range \(1< Ma < 2\). Staff et al. (2016b) showed that a transition through the sonic point may be responsible for the reduction of the the gravitational drag in their simulation. This was not observed in the simulations of Iaconi et al. (2018), possibly due to the fact that even their lightest companions were chosen substantially more massive than the planets studied by Staff et al. (2016b).

  • Another explanation of why the orbital separation stabilizes, is that the gravitational force between the cores increases as the cores approach each other. Therefore, one needs a larger drag force to noticeably perturb the orbital separation. Thus when the cores approach each other, maintaining the same rate of inspiral requires a larger and larger force, just when in fact orbit evacuation and a reduction of the velocity contrast is reducing the drag.

Fig. 5
figure 5

Parameters playing a role in the gravitational drag in simulations of CE interaction of a \(0.88 \, M_\odot \), \(90 \, R_\odot \) RGB primary star (top row) and a \(2.0 \, M_\odot \), \(66 \, R_\odot \) RGB primary star (bottom row) with a \(0.6 \, M_\odot \) companion. The vertical lines approximately represent the points where the rapid inspiral terminates. Left column: companion velocity (solid line), local average gas velocity projected on the direction of the companion velocity (dashed line), and local average gas velocity perpendicular to the direction of the companion velocity (dotted line). Right column: companion Mach number (solid line) and normalized average gas density in the companion’s proximity (dashed line). Image adapted from Iaconi et al. (2018)

It is conceivable that all of these effects in combination play a role and conspire to halt the orbital decay. For a better physical understanding, an analysis of the relative contribution and relevance of the processes remains essential and it has to be based on 3D hydrodynamic simulations. This should be possible, because all listed effects are in principle accounted for in the context of the gravo-hydrodynamic base model of CEE.

It is possible, indeed likely, that the dynamics of the envelope would be different if physical effects beyond the simple gravo-hydrodynamic model were accounted for. As discussed in Sect. 2, an important phenomenon is the change in ionization as the envelope expands and cools below the ionization temperatures of hydrogen and helium. The released ionization energy can lead to a substantial increase in envelope unbinding and—for some systems—can even achieve complete envelope ejection (Nandez and Ivanova 2016; Ondratschek et al. 2022; Ohlmann 2016; Reichardt et al. 2020; Prust and Chang 2019; Sand et al. 2020).

While the debate continues on how much of the recombination energy can actually contribute to envelope unbinding (Ivanova 2018; Soker et al. 2018), we question how the end of the inspiral actually takes place and the extent to which it can be simulated by explicit simulations. It is likely that even if the envelope is not entirely ejected, material may be “lifted” sufficiently to stall the inspiral. Some of this material could, however, fall back rapidly, even dynamically/ballistically and the inspiral could resume.

As the non-ejected envelope contracts, a “self-regulated inspiral” could be established (Ivanova et al. 2013; Meyer and Meyer-Hofmeister 1979): the envelope adjusts such that orbital energy is released at the same rate as convection in the remaining envelope can transport it to the surface where it is radiated away. If the heating becomes too weak, slow contraction revives the interaction of cores and gas, while too strong an interaction leads again to an expansion and dilution of the gas. In this sense, an equilibrium between orbital energy release and energy transport to the stellar surface is established and it is kept stable by self-regulation. This is certainly a slow process and the orbital evolution in the self-regulated inspiral regime is difficult or impossible to follow in 3D hydrodynamic simulations. Another complication is that the in-falling gas would have substantially more angular momentum, making the final stable configuration difficult to predict. It is possible that instead of a self-regulated envelope, a circumbinary disk could forms that interacts with the orbit of the stellar cores and modifies its parameters. Clearly, understanding the end of the inspiral extends beyond the applicability of the basic gravo-hydrodynamic model of CEE.

3.4 Why are common-envelope phases a multi-physics problem?

The basic gravo-hydrodynamic description of CEE certainly does not capture all effects associated with this phase of binary stellar evolution. A model extension to account for additional physics must be decided according to its relevance for specific aspects of CEE: some effects may pertain to the dynamical inspiral [Phase (ii)] itself, others to the pre-CE or post-inspiral phases [Phases (i) and (iii)], or even to later phases such as the shaping planetary nebulae expected to form in connection with envelope ejection of some stars. Including additional effects requires to modify the set of model equations (16), (17), and (19).

Even without diverging very far from the basic gravo-hydrodynamic model as discussed in Sect. 3.1, the results of simulated CEE can change dramatically. Modeling the envelope of giant stars and their CE as ideal gas is reasonable and commonly used in simulations for lower mass stars, while for massive stars radiation pressure needs to be taken into account. This can be done with an additive term in the equation of state.

In the following, we discuss changes in the ionization structure of the envelope gas and magnetic fields as important ingredients for model extensions. Other phenomena that are not part of the basic gravo-hydrodynamic model of CEE but still may be relevant include nuclear reactions that may occur in dense accreted material, neutrino cooling in the vicinity of compact object companions, accretion of material, jet formation, evaporation of the companion, and perhaps even relativistic effects. A rigorous assessment of the relevance of these effects for CEE is still missing, but some aspects of accretion onto the stellar cores, the potential formation of a disk and jet-like outflows have been explored in more detail (e.g. Chamandy et al. 2018; Hillel et al. 2022; López-Cámara et al. 2019, 2020, 2022; MacLeod and Ramirez-Ruiz 2015a, b; Moreno Méndez et al. 2017; Schreier et al. 2019, 2021, 2023; Shiber et al. 2019; Soker 2016b; Zou et al. 2022).

These examples illustrate that CEE is a pronounced multi-physics problem. Progress in understanding the dynamical evolution of the system cannot only achieved by improving the numerical methods for simulating it. The extension of the gravo-hydrodynamic base model with additional effects is essential to reach a reliable physical description.

3.4.1 Ionization and recombination effects

Over the past decades it has been realized that ionization effects play an important role in CEE (Ivanova et al. 2015). As the envelope is lifted and starts to expand due to the perturbation by the inspiralling companion, its outer layers may gradually fall below the ionization thresholds of hydrogen and helium and previously ionized material recombines.

Fig. 6
figure 6

Fraction of unbound envelope mass (dotted lines, left axis) and orbital evolution of the cores (solid lines, right axis) for Simulation I.50 of Sand et al. (2020) as shown in Fig. 4 (blue color). In addition, in red color we plot the same quantities, but this time for Simulation O.50 of Sand et al. (2020), that accounts for changes in the ionization of envelope material. Image courtesy of Christian Sand

This is a micro-physical matter effect leading to a source term in the energy equation of fluid dynamics (19). A simple model assuming local thermodynamic equilibrium is given by the corresponding Saha equation, but a general treatment would be achieved by implementing a detailed network accounting for changes in the ionization states and releasing the corresponding recombination energies. As a consequence, temperature and pressure of the gas change and this may cause a transfer into kinetic energy finally supporting envelope ejection. Instead of solving the equations explicitly, the ionization of matter as a micro-physical effect can be absorbed in a suitable equation of state, for instance the opal equation of state of Rogers et al. (1996) and Rogers and Nayfonov (2002) or its derivative in the mesa code (Paxton et al. 2011), see Sect. 4.2. Thus, while formally sticking to the basic gravo-hydrodynamic CE model, important physical effects can be incorporated via the equation of state.

The consequence of including ionization effects in CE simulations is shown in Fig. 6. Compared with the basic gravo-hydrodynamic model, envelope ejection increases dramatically. Whether or not the released recombination energy can—at least in parts—support envelope ejection depends on its ability to thermalize. Instead of adding to the thermal energy, it may be transported outwards by radiation [Grichener et al. (2018), but see Ivanova (2018)] or convection (Sabach et al. 2017) and lost from surface of the envelope. Wilson and Nordhaus (2019) point out that convection may also remove energy released by the orbital decay directly so that deeper inspiral of the companion is necessary to eject the envelope. While convection is in principle part of the basic gravo-hydrodynamic model (but may not be sufficiently resolved in 3D hydrodynamic simulaitons of CEE), radiation transport constitutes an extension of the model. Because all simulations that successfully expel the CE rely on the contribution of recombination energy to the unbinding of material, it is urgent to include radiation transport into the modeling. Without radiation transport the use of a tabulated equation of state that includes the release of recombination energy may severely overestimate the envelope unbinding, because a (large) fraction of that energy might instead leak out of the star.

This illustrates the ambiguity of defining the unbound fraction of envelope material. Should thermal and ionization energy be counted in into the energy budget? Certainly, the criterion comparing the gravitational binding energy with the kinetic energy of the gas only is the most conservative choice, although it may still overestimate the effect of released recombination energy if no radiation transfer is included. Counting in the thermal energy of the gas is a widely accepted approximation, while including the ionization energy in addition marks the most optimistic case. The approximation relying on kinetic energy only is illustrated in Fig. 6.

Recombination energy, if it can be fully used to expand the envelope, acts in the immediate post-inspiral phases when the envelope is expanding substantially. During these phases it has been demonstrated that the conditions in the envelope are ideal for dust formation (Glanz and Perets 2018; Iaconi et al. 2020; Reichardt et al. 2020) which would likely have an impact on the dynamics of the envelope by the increase in opacity. Dust-driven winds are extremely effective in reducing the envelope mass of AGB stars over short timescales with mass-loss rates as high as \(10^{-4}\) to \(10^{-3} \,M_\odot \, \mathrm{yr}^{-1}\) Kwok et al. (1978) and these stars are not dissimilar in mass and size to those typical simulated in the context of CEE.

3.4.2 Magnetic fields

A second prominent example of a physical phenomenon that should be considered, are magnetic fields. These can be accounted for by extending to the equations of magneto-hydrodynamics (MHD); see, e.g., Campbell (2018) for a detailed treatment of MHD in binary stars. Apart from the very challenging numerical implementation of MHD, the presence of magnetic fields makes the range of physical phenomena extremely rich and complex. In addition to hydrodynamic flow instabilities, MHD instabilities can play a role. It has been discussed whether the action of magnetic fields can help with envelope ejection. While magnetic fields do not introduce a new energy source—they can only be amplified at the expense of kinetic energy of the gas—they can redistribute energy and angular momentum in the envelope. Based on analytic considerations, Regős and Tout (1995) argued that magnetic fields should be strongly amplified in CE inspirals, while Tocknell et al. (2014) used jet-like features observed in post-CE planetary nebulae as an indication that strong fields must have been present in the late CE stages. The first MHD simulation of CEE was presented by Ohlmann et al. (2016b), see also Sect. 6.3.4. It showed that the accretion flow around the companion star leads to strong amplification of magnetic fields (see left and middle panels of Fig. 7). The reason is proposed to be the magnetorotational instability (MRI; Balbus and Hawley 1991). In late phases, the amplified magnetic field disperses over the entire CE (Fig. 7, right panel). Despite the strong amplification, however, magnetic fields are not dynamically relevant in the situation modeled by Ohlmann et al. (2016b). Still, they may play a role in transport processes and in shaping the ejected envelope material as shown in the MHD simulations of Ondratschek et al. (2022).

Fig. 7
figure 7

Image [top] courtesy of Sebastian Ohlmann; [bottom] reproduced with permission from Ohlmann et al. (2016b), copyright by the authors

Magnetic field energy over time (top) and radial magnetic field strength \(B_r\) in the orbital plane (bottom) of the high-resolution simulation of Ohlmann et al. (2016b) with a seed field of \(10^{-6} \, \mathrm{G}\). The times at which the snapshots were taken are indicated in the panels. Note that the left and middle panel show the vicinity of the companion (marked with a \(\times \) symbol). The position of the core of the RGB primary star is marked by a \(+\) symbol and visible in the right panel.

3.5 Why are common-envelope phases a multi-scale problem?

Like many other problems in astrophysics, CEE is plagued by severe multi-scale challenges. These can be divided into two categories: a spatial and a temporal scale challenge.

The spatial scale problem is rather obvious and caused by the discrepancy in sizes between the core of the primary star and the companion on the one side and the total radius of the primary star on the other side. Although typical values vary somewhat, for red giant branch (RGB) and AGB stars core radii, \(R_\mathrm{core}\), are around \(0.03\,R_\odot \) while the size of the stars, \(R_\star \), are between \({\sim } \, 20 \, R_\odot \) and \({\sim } \, 600\, R_\odot \). This gives a range of scales extending over up to four orders of magnitude, which is a lot but not overly impressive in comparison with other astrophysical scale challenges. For red supergiants, the cores have a radius of \(\sim \, 0.07 \,R_\odot \) and stellar radii are hundreds to thousands of solar radii. Companions can be of various nature, but cases of interest include objects as small as planets, white dwarfs, and neutron stars, thus extending the scale range to eight orders of magnitude. A special case are systems with black hole companions. The orbital separation in the pre-CE stage and the expansion of the envelope in the CE interaciton extend the range of relevant spatial scales involved in the problem even more.

The temporal scale challenge is usually discussed in terms of the relevant characteristic timescales of the involved objects. One of these is given by the mechanical structure of the envelope. It can be defined as the free-fall timescale,

$$\begin{aligned} \tau _\mathrm{ff} \sim \frac{\pi }{2} \frac{R_\star ^{3/2}}{\left[ 2 G (M_\mathrm{core} + M_\mathrm{com}) \right] ^{1/2}}, \end{aligned}$$
(26)

with the gravitational constant, G, the core mass of the primary star, \(M_\mathrm{core}\) and the mass of the companion, \(M_\mathrm{com}\). Note that \(\tau _\mathrm{ff}\) differs from the orbital period of the companion at a distance of \(R_\star \),

$$\begin{aligned} \tau _\mathrm{orbit} = 2\pi \frac{R_\star ^{3/2}}{\left[ G\,(M_\mathrm{core} + M_\mathrm{com})\right] ^{1/2}}, \end{aligned}$$
(27)

only by a factor of \(2^{-5/2}\). Both are due to the gravitational force and estimate the timescale of changes to the system driven by gravitational forces, that has to be captured in simulations of CEE. The dynamical timescale \(\tau _\mathrm{dyn}\), in contrast, estimates the timescale of changes induced by hydrodynamic pressure effects. It is given by the sound crossing time over the system,

$$\begin{aligned} \tau _\mathrm{dyn} \sim \frac{R}{c_\mathrm{sound}}, \end{aligned}$$
(28)

with the sound speed, \(c_\mathrm{sound}\). Close to hydrostatic equilibrium, pressure effects should compensate gravity and thus \(\tau _\mathrm{dyn} \,{\sim }\, \tau _\mathrm{ff} \,{\sim }\, \tau _\mathrm{orbit}\).

The dynamical timescale of the envelope of RGB and AGB stars can be estimated to be \(\tau _\mathrm{dyn, envelope} \, {\sim } \, 50 \, \mathrm{d}\) by adopting \(R = R_\star \) and a typical sound speed of \({\sim }\, 10 \, \mathrm{km} \, \mathrm{s}^{-1}\). The cores of RGB or AGB stars and their envelopes have starkly different thermodynamic properties. The temperature in the cores is about four orders of magnitude higher than in the envelopes and their densities exceed the envelope densities by \({\sim } \, 10\) orders of magnitude. Therefore, the sound speed exceeds \(10^3 \, \mathrm{km} \, \mathrm{s}^{-1}\) in the core of such stars, and the dynamical timescale is as short as \(\tau _\mathrm{dyn, core} \, {\approx } \, 20 \, \mathrm{s}\).

Some late episodes of CEE may rely on thermal readjustment of the envelope which is associated with the much longer thermal (Kelvin–Helmholtz) timescale,

$$\begin{aligned} \tau _\mathrm{KH} \sim \frac{G M_\star ^2}{R_\star L_\star }, \end{aligned}$$
(29)

where \(L_\star \) is the luminosity of the star. For RGB and AGB stars with \(L_\star \, {\sim } \, 3000 \, L_\odot \), the thermal timescale \(\tau _\mathrm{KH} \, {\sim }\, 10^4 \mathrm{yr}\), leading to a timescale discrepancy compared with \(\tau _\mathrm{dyn, envelope}\) of \(10^5\). For late CEE stages, however, the relevant thermal timescale is that of the remaining envelope when part of the material has already been removed, which may differ significantly from our estimate for unperturbed stars.

3.6 The need to simulate the pre-common envelope and post-inspiral phases

We conclude our summary of the physical challenges to simulating CEE by discussing the phase that leads to the dynamical inspiral—Phase (i), pre-CE evolution—and the phase that follows it—Phase (iii), post-CE evolution. Both of them are likely to take place on thermal, rather than dynamical timescales. This fact alone makes them difficult to treat numerically. The need to simulate both of these phases stems from the suspicion that what precedes the inspiral may change the playing field for the inspiral itself and that what follows the inspiral ultimately settles the final orbital separation for the surviving binary or even determines whether a binary survives at all. Here, we quickly set the stage for the physical challenge presented by these phases.

Before engaging into the inspiral phase of CEE, binary interactions may substantially affect the parameters of the system. Pre-CE evolution is likely to involve mass loss from the system, and this effect can be critical in determining whether or not the system enters CEE in the first place (e.g. Ivanova et al. 2013). Moreover, mass loss can change the angular momentum budget of the system and the binding energy of the primary’s envelope. An extreme case of binary interaction preventing CEE is proposed by Soker (2015), who argues that if the companion grazes the envelope of the giant primary star and accretes mass at a sufficiently high rate, it can launch jets that remove material and angular momentum. Additionally, mass and angular momentum can be lost through the second Lagrange point. This way, the envelope is ablated as the companion approaches the core of the primary star without ever entering a CE phase. The orbital decay is very slow and if existing, it is driven by tidal interaction although the companion is never deeply immersed in the envelope. Soker (2015) call this alternative to CEE “grazing envelope evolution” (GEE) and Sabach and Soker (2015) discuss the scenario in the context of triple star systems. Mass loss is also thought to lead to observable features, some of which have been connected to the LRN class of optical transients (see MacLeod et al., 2017b; Pejcha, 2014; Soker and Tylenda, 2006; Soker, 2015, 2016a and Sect. 7.6).

Once the primary star overfills its Roche lobe, mass transfer sets in. Whether or not this leads to the formation of a CE depends on the dynamical stability of this mass transfer, which is determined by the relative readjustments of the Roche lobe to mass transfer and the donor (primary) star’s structure to mass loss: if the donor expands relative to its Roche lobe, mass loss becomes unstable and a runaway in the mass transfer rate sets in. The details involve several complications—for a discussion we refer to Ivanova et al. (2013)—but stability analyses usually determine a critical mass ratio of donor and accretor (i.e. companion) \(q_\mathrm{crit}\) for stability, which itself depends sensitively on the type of donor (Hjellming and Webbink 1987).

This, however, is not the only criterion determining the events preceding the fast inspiral. Tides dominate the early phases of interaction, even before Roche lobe contact. Giant stars expand and when their companions are located within a distance of some stellar radii (Madappatt et al. 2016; Mustill and Villaver 2012; Soker 1994, the exact number is uncertain and can vary), interaction between the two tends to synchronize and circularize the orbit. While the timescales for these processes are reasonably well understood [see Zahn (1977)], the concomitant stellar evolution alters the playing field. In particular, an instability occurs when the angular momentum of the giant is larger than a certain fraction of the orbital angular momentum (Darwin 1879). This tends to destabilize a tidally relaxed system leading to a reduction of its orbital separation. All in all, a complex interplay between tidal instability, mass-transfer instability, and stellar evolution set the initial conditions of the subsequent fast inspiral. While not all of these processes take place on the Kelvin–Helmholtz timescale characterizing changes in the thermal structure of the star—tidal interaction for instance is a dynamical process—the timescales of these phenomena are likely still too long to be modelled by global 3D simulations.

After the dynamical inspiral stalls, a number of physical processes [see Table 1 of Soker (2017), for an overview of some of these] will take hold that operate on lengthening timescales. While some of the current 3D hydrodynamic simulations indicate successful envelope ejection, a general problem seems to be that the orbital separation reached over the simulation time is too large compared with observations of post-CE binaries (e.g. Iaconi et al. 2017b; Kramer et al. 2020). This may be associated with shortcomings in the physical modeling or numerical deficiencies in the simulations, but there is a fair chance that the system parameters are affected by processes that act on timescales longer than the simulation period. Self-regulated inspiral (see Sect. 3.3) is one possibility, but even if most of the envelope was unbound, some returning gas could interfere with the orbit once more, or form a disk around the binary which could alter the orbital parameters. If most of the envelope is still bound, the binary will presumably go through a renewed phase of inspiral. If the new delivery of orbital energy is still not sufficient to unbind the remaining envelope, then a merger of the stellar cores may be the final outcome of the interaction. The newly formed star would then relax on thermal timescales as it radiates the excess energy. However, the orbital angular momentum would have to find a final resting place in the envelope, redistributing itself in some way. Another possibility is that—instead of merging—the companion is destroyed during deep inspiral into the CE. This is in particular possible for low-mass companions such as brown dwarfs or giant planets (Jia and Spruit 2018; Kramer et al. 2020; Livio and Soker 1984b; Nelemans and Tauris 1998; Soker 1998b)

Modelling the immediate pre- and post-inspiral, i.e. the parts of Phases (i) and (iii) that are closest to Phase (ii), with global 3D simulations is not impossible, as we will discuss in Sects. 6.1 and 7.1, but some simplifications must be incorporated, which may or may not alter the results. The longer timescales likely will need different modelling approaches and, ideally, these will be interfaced with global simulations that best model the dynamical phase (see Sect. 7.4). After discussing the physical challenges we face in formulating a full description of CEE, we turn to modelling problems that arise from numerical obstacles in the following section.

4 Numerical approaches and limitations

Once the physical model is fixed—which, as discussed above, is highly non-trivial—a valid numerical discretization of the underlying equations is bound to converge to the correct result of that model. In the ideal world of infinite numerical resolution, any consistent and stable numerical scheme should give the same answer.Footnote 11 This, however, is far from reality: the discrepancy of relevant spatial and temporal scales implies that such a convergence cannot be reached easily. While some effects are treated accurately by numerical approaches, others can only be approximated. Gas flows in the envelope are usually resolved, but effects closer to the cores are increasingly difficult to represent correctly. The challenge is to find appropriate approximations. Various choices are made which may interfere with the original physical modeling so that differences in the numerical results are to be expected. The goal, however, is to reach convergence to the correct results in some key quantities.

Implementing the basic gravo-hydrodynamic model of CEE as defined in Sect. 3.1 requires two ingredients: (i) a solver for the Euler equations of fluid dynamics (16, 17, 19), and (ii) a self-gravity solver that accounts for the Poisson equation (25). Both are in the standard repertoire of computational astrophysics, but also mark some of the more challenging aspects of it. We review methods to obtain solutions to the hydrodynamics in the presence of gravity in Sects. 4.1 and 4.3, but omit implementation details; these can be found in the literature. Instead, we focus on some of the more specific aspects arising from the application of standard techniques to CEE simulations.

It is likely that physical effects beyond the basic gravo-hydrodynamic model become more commonly included in future simulations of CE interaction. These would deserve a dedicated discussion in this section. A prominent example is radiation transfer, which, however, has not yet been established as a standard in the simulations and we therefore refrain from including it at the moment. The same applies to magnetohydrodynamic simulations of CEE, that thus far have only been carried out by a single group (Ohlmann et al. 2016a) with one specific way of treating magnetic field. While we mention these simulations in Sect. 6.3.4, a review of different approaches is not yet called for.

4.1 Computational fluid dynamics

There are numerous approaches to discretize the Euler equations of fluid dynamics. A fundamental distinction is the frame of reference in which the basic equations are formulated. One possibility, where a fixed lab frame of reference is chosen, is given in Eqs. (16, 17, and 19). Discretizing this formulation gives rise to the so-called Eulerian schemes for solving the equations of fluid dynamics. Alternatively, discretization of Eqs. (21, 22, and 23) in Lagrangian specification with a co-moving frame of reference results in Lagrangian schemes of computational fluid dynamics. Lagrangian approaches are particularly well-suited to simulations of interactions between astrophysical objects—not only in the context of CEE, but in various other setups reaching from the simulation of mergers of compact objects [see Rosswog (2015), for a review] to mergers and evolution of galaxies in cosmological contexts (e.g., Croft et al. 2009; Liu et al. 2016; Stinson et al. 2013).

Both the Eulerian and the Lagrangian approaches have their particular strengths and weaknesses. Whether these play out in specific applications depends on the context, the setup, and the research questions to be answered. CEE is in some sense a prototypical “Lagrangian problem”: two main objects orbiting each other and a rotating stellar envelope embedded in vacuum make methods following the fluid flow attractive. The main advantage of Lagrangian methods is that the geometry is adapted to the problem at hand. Following the motion of the fluid, advection errors are minimized. This reduces common problems with angular momentum conservation (see Sect. 4.1.2) and diffusion over the surfaces of the stellar objects. This said, it is not a priori clear that Lagrangian schemes perform best in all respects. This is related to the problem that in Lagrangian specification a grid-based discretization approach leads to complicated grid geometries and the danger of tangling if the grid is to be advected along with complex 3D hydrodynamic flows. Therefore, a grid-free Lagrangian approach is commonly chosen (see Sect. 4.1.2), which, however, lacks the precision of grid-based computational fluid dynamics. Eulerian approaches do not face this problem. Their grid-based discretizations are unproblematic and they benefit straightforwardly from the accuracy of Riemann-based hydrodynamics solvers (see Sect. 4.1.1). Therefore, no general statement is justified giving preference to one or the other method and we discuss their application in the context of particular simulations in Sect. 6. CE simulations with moving-mesh codes (see Sect. 4.1.3) combine the advantages of a (nearly) Lagrangian scheme with the accuracy of a grid-based discretization of the equations of fluid dynamics.

4.1.1 Eulerian, grid-based methods

There are various general strategies to discretize and solve the Euler equations in Eulerian specification (Eqs. 16, 17, 19), once initial conditions are specified. Overviews are given in standard textbooks, such as Ferziger et al. (2020).

In astrophysical applications, finite-volume methods have defined the quasi-standard for the past decades. They discretize space into computational grid cells and assign cell-averages of the conserved hydrodynamic quantities to their centers. Reconstructing these averaged conserved quantities to the cell edges introduces jumps over the interfaces between neighboring cells. Such initial conditions with one discontinuity define Riemann problems. In Godunov schemes (Godunov 1959), they are solved to determine the numerical fluxes, which are used to update the cell-averaged conserved quantities.

This discretization of the equations of fluid dynamics in space has to be augmented with a discretization in time. To this end, two main classes of approaches exist: explicit and implicit time discretization schemes. The former determine the state at the new timestep from the state at the current timestep while the latter solves for the state at the new timestep from the given current and the new state, which requires a numerically expensive matrix inversion. While implicit time discretization can be unconditionally stable, explicit time stepping is restricted by the so-called Courant-Friedrichs-Lewy (CFL) condition (Courant et al. 1928). It states that for stability of the scheme, the time step has to be chosen smaller than the crossing time of the fastest wave emerging from the Riemann problem over a grid cell. A rough estimate for this would be the sound crossing time over a cell. So far, all hydrodynamic schemes employed for simulations of CE interaction use explicit time discretization and their time stepping is therefore subject to the CFL condition.

Different methods exist to ensure higher-order accuracy with specific reconstruction and time integration schemes and for enhancing the efficiency with approximate Riemann solvers. For the details of such methods, we refer to textbooks such as that by Toro (2009). The resulting high-resolution shock capturing methods are advantageous for following the spiral shocks in the CE. Fundamentally, this property results from the fact that finite-volume methods derive from the integral form of the equations of fluid dynamics that in contrast to the differential form as in Eqs. (1619) allows for discontinuous (so-called weak) solutions. Shocks are possible in the solutions of the Riemann problems at the cell interfaces. Depending on the quality of the employed approximate Riemann solver and the numerical dissipation of the scheme, however, shocks are usually smeared out over a few grid cells. In addition to the shock-capturing feature, Godunov methods are known to reproduce phenomena such as hydrodynamic instabilities and turbulence very well.

The orbital motion of the cores and the rotation of the envelope, however, imply that matter will be dragged over the spatially fixed discretization grid. Transforming into a rotating frame of reference can alleviate the problem, but because of the strongly differential motion of the involved matter the problem cannot be completely eliminated. This situation leads to advection errors that can only be mitigated with high spatial resolution, which renders Eulerian grid-based approaches to simulate CEE a computationally expensive choice.

Covering the required large domains with equally-sized grid cells for discretization would either lead to low resolution of important parts of the system in case of large grid cells or excessive computational cost when trying to resolve the relevant spatial scales. For this reason, non-uniform grids concentrating resolution in the center around the core binary system or, even better, adaptive mesh refinement (AMR) techniques (e.g. Berger and Oliger 1984; Berger and Colella 1989) are commonly employed in CE simulations. AMR methods subdivide grid cells once pre-defined refinement criteria are met and they de-refine when they are no longer fulfilled. Multiple levels of refinement are possible so that very high spatial resolution can be reached in some patches of the domain. In CE simulations, mesh refinement is successfully applied around the cores to reduce the advection errors. While not as excessive as global fine resolution, AMR still comes at the price of the higher computational effort associated with larger cell numbers and shorter numerical timesteps in smaller cells required by the CFL condition plus a significant overhead for the bookkeeping of the complex AMR grid structure.

Nonetheless, once the resolution is high enough to ensure reasonable conservation of angular momentum, Eulerian grid-based approaches show excellent reproduction of hydrodynamical effects such as shock waves and instabilities. Moreover, their methodology offers more flexibility for extending the physical modeling base. Magnetohydrodynamics, for instance, is best implemented in grid-based techniques and the formulation of subgrid-scale models for unresolved physical effects is an attractive perspective for the future development of CE simulations.

4.1.2 Lagrangian, smooth particle hydrodynamics

The problem of growing complexity of a computational grid with the evolution of the fluid-dynamical system in Lagrangian approaches is avoided in SPH methods [Gingold and Monaghan 1977; Lucy 1977; for reviews see Monaghan (1992), Price (2012), Springel (2010b), and Rosswog (2015)]. A particle-based discretization of the mass distribution is applied instead of a computational grid. The pressure gradient appearing in Eq. (22), however, raises the question of evaluating the gradients of quantities in a particle representation of matter. To address this problem, the particles are not understood as point masses in SPH schemes, but they rather mark the centers of smoothed-out distributions of the conserved hydrodynamic quantities. The amount of smoothing is quantified by the choice of a smoothing kernel, W(rh), which assigns quantities to a location at a distance of \(r = | {\varvec{x}} - {\varvec{x}}_i |\) from the SPH particle at point \({\varvec{x}}_i\) and is characterized by a certain smoothing length, h. The mass density at point \({\varvec{x}}\), for instance, is obtained from summing over all N SPH particles:

$$\begin{aligned} \rho ({\varvec{x}}) = \sum \limits _{i = 1}^{N} m_i W(|{\varvec{x}} - {\varvec{x}}_i|, h). \end{aligned}$$
(30)

The mathematical form of the smoothing kernel is arbitrary, but has to obey the normalization conditions of giving 1 when integrated over all space and degenerating to Dirac’s delta function for \(h \rightarrow 0\). An efficient choice are kernels with compact support. They restrict the overlap to nearby particles and thus reduce the terms that have to be evaluated for the sum in Eq. (30). A popular form is the spline kernel of Monaghan and Lattanzio (1985),

$$\begin{aligned} W(r, h) = \frac{1}{\pi h^3} {\left\{ \begin{array}{ll} 1 - \frac{3}{2} \frac{r}{h}^2 + \frac{3}{4} \frac{r}{h}^3 &{} \text{ if } 0 \le \frac{r}{h} \le 1;\\ \frac{1}{4} (2 - \frac{r}{h})^3 &{} \text{ if } 1 \le \frac{r}{h} \le 2;\\ 0 &{} \text{ otherwise, } \end{array}\right. } \end{aligned}$$
(31)

but there are various alternatives to this choice (e.g. Dehnen and Aly 2012). At any given point in space, the hydrodynamic quantities thus defined can be determined by summing over contributions with overlapping smoothing kernels. Therefore characteristic size of the kernel determines the spatial resolution in SPH simulations. For all practically useful kernel functions, the standard deviation of the kernel is very similar to the chosen smoothing length. Efficient SPH implementations employ variable smoothing lengths assigning an \(h_i\) to each particle such that quantities are determined by summing over similar numbers of neighboring particles independently of the local density. Hence, \(h_i\) is an approximate measure of the linear resolution at the location of particle i.

This particle-based discretization leads to a set of ordinary differential equations, the equations of motion of SPH (Lucy 1977; Gingold and Monaghan 1977; Monaghan 1992), that have to be solved numerically. Stability of explicit time integration is again determined by the CFL condition, requiring timesteps smaller than the sound crossing time over a smoothing length (Gingold and Monaghan 1977; Lucy 1977).

SPH methods allow to exploit the advantages of Lagrangian schemes in CE simulations and they have been employed extensively for this purpose. Their main benefit is that they avoid advection errors. This leads to exact conservation of angular momentum (see also Sect. 4.4.3). Reaching an acceptable degree of angular momentum conservation with Eulerian grid-based approaches (which is fundamental for CE simulations) requires high spatial resolution of the rotating objects which often can only be reached with AMR techniques. This makes these schemes computationally more expensive than SPH-based simulations.

Another feature of Lagrangian schemes is Galilean invariance—the solution is not affected by the presence of bulk velocities. Violation of Galilean invariance may suppress hydrodynamic instabilities when altering the background velocity and keeping the spatial resolution fixed. Again, Galilean invariance in Lagrangian schemes results from avoiding advection errors and distinguishes SPH from grid-based approaches.

Conceptually, SPH is very similar to numerical schemes for simulating the evolution of collisionless N-body systems under the action of gravity. The only differences in the underlying equations are the terms involving pressure. For such systems, efficient methods have been developed to calculate self-gravity (see Sect. 4.3) and these are exploited in the SPH-based simulations of CEE, where this effect is fundamental for the dynamics.

Another advantage is that no pseudo-vacuum has to be introduced for embedding the system of interest. SPH particles are placed where the matter of the object of interest is located. The computational domain is arbitrary, free boundary conditions are natural to the scheme and without excessive computational cost the computational domain can be large enough so that no material leaves and conservation of global quantities can be checked. The placement of particles exclusively inside the objects of interest in combination with summing up the contributions to conserved quantities from neighboring particles, however, introduces an imbalance that causes an artificial surface tension in SPH.

Despite these advantages, there is a potential problem with SPH schemes. They are based on a discretization of Eqs. (2123)—a differential form of the equations of fluid dynamics—and therefore allow only for differentiable (so-called strong) solutions and not for discontinuities such as shocks. In order to treat shocks in SPH, artificial viscosity has to be introduced to broaden the shock to a numerically resolvable continuous structure (Monaghan and Gingold 1983). This at the same time allows for the necessary dissipation of energy in the shock. A careful choice of the form of the artificial viscosity is required to avoid undesired effects such as dissipation in non-shocked regions or violation of angular momentum conservation. A correct representation of pre- and post-shock states is possible within the SPH framework, but high resolution (i.e. a local high density of particles) is required to keep the shock structure reasonably thin. In contrast, no artificial viscosity is needed in finite-volume Godunov schemes to represent shocks.

The SPH discretization into particles naturally and necessarily follows the mass distribution of the considered system. As opposed to other astrophysical application examples of SPH, this is a clear disadvantage in CE simulations, where the features in the gas dynamics in a rather dilute envelope may need to be followed.

Still, with limited computational resources, SPH simulations of CEE published so far show better performance than their grid-based Eulerian counterparts. They are able to follow the gross dynamics of the system with a fairly low number of particles without sacrificing angular momentum conservation. However, reaching fine resolution in the fluid flows and resolving instabilities requires a drastic increase in the number of particles so that there seems to be some break-even point where grid-based Eulerian techniques become more efficient.

4.1.3 Moving-mesh approaches

A rather recent development is the use of moving-mesh hydrodynamics codes for CE simulations. The first of such simulations—based on the arepo code developed by Springel (2010a) for cosmological simulations with the modifications of Pakmor et al. (2016) to ensure second-order accuracy of the scheme—was presented by Ohlmann et al. (2016a). A number of follow-up studies expanded on this including additional physical effects and testing parameters of the setup model (Kramer et al. 2020; Ohlmann et al. 2016b; Sand et al. 2020). An independent implementation of the moving-mesh technique in the manga code was used for CE simulations by Prust and Chang (2019).

Fig. 8
figure 8

Image reproduced with permission from Springel (2010a), copyright by the author

Simulation of a Kelvin–Helmholtz instability between two shearing fluids with the code arepo in a low-resolution (50 \(\times \) 50) to illustrate the Voronoi mesh overlaid in black in the lower half of the box.

The moving-mesh method can be seen as combining advantages of the Lagrangian particle-based SPH technique and Eulerian grid-based approaches. A Voronoi tessellation of space based on a set of discrete points is used to construct a complex unstructured mesh of polyhedral cells, see Fig. 8. As in conventional, finite-volume grid-based codes, numerical flux functions across the thus defined cell boundaries are computed in a Godunov-type approach using Riemann solvers. These provide a scheme to update the cell-averaged values of conserved hydrodynamical quantities. The mesh-generating points can in principle be moved arbitrarily or even kept fixed—in which case the scheme recovers an Eulerian grid-based approach to numerical fluid dynamics. Advecting the points with the fluid flow, however, yields a nearly Lagrangian method. Its advantages of reducing advection errors, conserving angular momentum, and guaranteeing Galilean invarianceFootnote 12 are combined with the superior shock capturing capabilities and the improved reproduction of hydrodynamic instabilities of grid-based Godunov-type schemes. For a detailed discussion of the advantages of the moving mesh scheme, we refer to the original publication of the arepo code (Springel 2010a).

While moving-mesh methods overcome the notorious problems of grid tangling in grid-based Lagrangian schemes, some measures of correcting stretched cell shapes that would result from complex flows are still required to guarantee numerical benignity (Springel 2010a). Therefore, the resulting moving-mesh schemes are not exactly Lagrangian but very close to it.Footnote 13 The Godunov-type finite-volume scheme for updating the cell values is based on the integral form of the Euler equations of fluid dynamics. It eliminates the need of an artificial viscosity as in SPH schemes. Moreover, it avoids the inherent sampling noise errors in the gradient estimates of SPH (Pakmor et al. 2013).

Based on a finite-volume discretization, moving-mesh schemes retain the versatility of Eulerian approaches with respect to the implementation of additional physical effects. Magnetic fields, for example, can be accounted for Pakmor et al. (2011) and Pakmor and Springel (2013). The first 3D MHD simulations of dynamical CE interaction were performed by Ohlmann et al. (2016b) with the moving-mesh code arepo. Unresolved effects can in principle be included via subgrid-scale models. While utilized extensively in cosmological simulations with arepo (e.g. Vogelsberger et al. 2013), this capability has not been exploited yet in simulations of CEE.

The flexibility of mesh construction can be used to implement AMR capabilities that, in contrast to SPH approaches, are not limited to improving the resolution of high-density regions. This is of particular interest in CE simulations because here the focus is on resolving effects in the rather dilute envelope gas. By adding grid generation points, cells can be split up and the resolution is increased locally; removal of grid generation points reverses this procedure. This spatial adaptivity can be combined with adaptive individual time stepping (as implemented in arepo and manga), which significantly enhances the computational efficiency because it pays attention to the temporal multi-scale nature of the problem as discussed in Sect. 3. A moving, adaptively refined mesh as implemented in arepo and manga is a powerful approach to simulate CEE, where certain parts of the envelope, particularly the regions around the cores, benefit from higher spatial resolution, while other parts of the envelope can be represented with less computational effort.

Another advantage of the currently employed moving-mesh codes is that they were derived from powerful particle-based codes, that had been written for simulations of self-gravitating systems. The efficient parallel implementation of the tree-based gravity solver of gadget-2 (Springel 2005) carries over to arepo, and that of ChaNGa (Menon et al. 2015) to manga.

The origin of the moving-mesh codes from tools to simulate galaxy evolution in a cosmological context required some modifications. Methods for capturing the relevant conditions and effects in stellar matter had to be implemented (Ohlmann et al. 2017; Pakmor et al. 2013; Prust and Chang 2019), see Sects. 5.3 and 6.3.4.

4.2 Implementing the equation of state

As mentioned in Sect. 3.1, an equation of state relating pressure to density and internal energy (and possibly other quantities such as chemical composition and ionization state) has to be provided in order to close the fluid dynamics equations set.

Realistic treatments of matter require the inclusion of various effects. Already when augmenting an ideal-gas equation of state with radiation pressure, the computational effort increases significantly. The reason is that the equation of state derived from statistical physics and thermodynamics usually provides pressure and internal energy as a function of density and temperature. A fluid-dynamical model, however, follows the conserved hydrodynamic quantities, i.e. density and total energy, from which the kinetic energy can be subtracted to obtain the internal energy of the gas. While an ideal-gas equation of state can still be inverted analytically to give pressure as a function of density and internal energy, this is no longer possible when including radiation pressure and therefore an iteration is required. Since the equation of state is called at least in every hydrodynamic update of each computational cell, the computational expense of this iteration affects the total demand of the simulation significantly.

The situation becomes even more critical when more complex physical effects are included such as degeneracy or ionization. In such cases, modern implementations revert to tabulated data. The look-up of table values and interpolation between them can add substantial computational cost to the hydrodynamics scheme.

As discussed in Sect. 3.4.1, in the context of CE simulations, ionization effects are of particular interest. When envelope gas expands and cools down below the ionization thresholds of hydrogen and helium, the corresponding recombination energies are released into thermal energy. Assuming local thermal equilibrium, the effect can be included into the equation of state as done by virtually all 3D hydrodynamic CE simulations that accounted for these effects. This approach does not provide the detailed ionization structure of the gas, which would require the solution of the Saha equation or a detailed ionization network; however, for CE simulations this is not of immediate interest. As an input, the equation of state is given the local density and the internal energy of the gas (that corresponds to the sum of thermal and ionization energy). From this, temperature and pressure are determined. This can result in a local over-pressure when recombination energy is released, giving rise to expansion and acceleration of material. If no losses due to cooling or radiation are included, all released recombination energy is transferred to kinetic energy of the envelope gas. The processes determining the equation of state are complex and therefore the native implementation of the opal equation of state (Rogers et al. 1996; Rogers and Nayfonov 2002) or its derivative in mesa (Paxton et al. 2011) rely on pre-computed tabulated data.

As a side remark, we mention that applying such more elaborate equations of state requires to use suitable exact Riemann solvers (see, e.g., Chen et al. 2019; Colella and Glaz 1985) or approximate Riemann solvers for Eulerian grid-based methods. This is accounted for in most implementations of modern astrophysical hydrodynamics codes.

4.3 Modelling self-gravity

Gravitational forces define the CE interaction. They mediate (1) the binding of the stellar components and the binding of the progenitor binary system, (2) the interaction and orbiting motion of the stellar cores, and (3) the interaction of the cores and the envelope gas giving rise to drag and energy transfer. This highlights the importance of treating gravity accurately and efficiently in CE simulations. As a long-range force, gravity enters the modeling as a source term in the momentum [Eqs. (17) and (22)] and energy equations [Eqs. (19) and (23)]. Source terms are often discretized separately from the equations of fluid dynamics in an operator splitting approach. For the case of gravity, there are two basic choices: the gravitational potential can be determined by solving the Poisson equation (25) in the continuum model of matter, or the gravitational forces are computed directly from Newton’s law of gravity between point masses in particle-based discretizations of matter. We note that this choice is independent of the discretization of the equations of fluid dynamics. While SPH codes preferably use a particle-based discretization for modeling gravity, mapping to grids in the particle-mesh method is also employed occasionally. Grid-based Poisson solvers seem a natural choice for grid-based discretizations of the equations of fluid dynamics. However, since stellar cores are often modelled as point masses, grid-based schemes are sometimes coupled with particle-based gravity solvers instead.

Approximations, such as a gravitational potential that is constant in time or one that is derived from a low-order multipole expansion of the overall gravitational potential, are inappropriate for capturing CE dynamics—a full treatment of self-gravity of the involved envelope gas and stellar cores is inevitable. The Poisson equation of Newtonian gravity (25) poses an elliptic problem and is numerically very challenging. A direct summation of the gravitational forces gives rise to algorithms that scale with the square of the number of cells or particles N quickly leading to prohibitive costs in highly-resolved simulations. In the following, we discuss various approaches employed in CE simulations to reduce this \({\mathcal {O}}(N^2)\) operation count to a more modest algorithm complexity, such as \({\mathcal {O}}(N \log N)\).

4.3.1 Tree methods to calculate self-gravity

In particle-based discretizations, a preferred method for calculating self-gravity of astronomical objects is a tree-based approximation (Barnes and Hut 1986). The method is based on the fact that the individual contribution of distant particles to the force of a target particle is negligible, so that it is sufficient to treat the collective effect of distant particles in an approximate way, i.e. as a low-order multipole of the gravitational potential. The interaction with close particles, in contrast, is treated accurately. To distinguish close from distant particles, a tessellation of space in a tree hierarchy is constructed. For details, we refer to the literature (e.g. Appel 1985; Barnes and Hut 1986). This method reduces the complexity of the algorithm to the desired \({\mathcal {O}}(N \log N)\).

Tree-based methods are commonly employed in CE simulations. They are a natural choice when particle-based, Lagrangian schemes (SPH) are used to solve the equations of fluid dynamics, because they can also help to efficiently search for neighbor particles as required for kernels with compact support (see Sect. 4.1.2). But also in grid-based approaches to fluid dynamics, a particle-based discretization may be used to model the gravitational interaction. This is popular in particular in the context moving-mesh methods. A problem with tree-based methods, however, is that they introduce asymmetries. The approximate treatment of the gravitational interaction of a target particle with distant particles violates Newton’s third law (actio equals reactio). This is in conflict with global momentum conservation and introduces spurious motions. Indeed, many CE simulations performed with this methods exhibit a slow drift of the center of mass of the system. There are ways to alleviate this problem. The important notion is that random force errors would cancel during the simulation. The overall drift and momentum conservation violation results from correlations between the errors (Springel et al. 2021). These correlations can be broken, and for this purpose Springel et al. (2021) propose to randomize the relative location of the particles with respect to the computational box.

4.3.2 Alternative methods to calculate self-gravity

An approach that appears as a natural choice in the context of grid-based discretizations, but is also used with a particle-based schemes [see Taam and Ricker (2006)], are Fourier methods. Solving the Poisson equation (25) with a Green’s function gives

$$\begin{aligned} {\Phi } ({\varvec{r}}, t) = - G \int \frac{\rho ({\varvec{r}}', t)}{| {\varvec{r}} - {\varvec{r}}' |} \mathrm{d}^3 r', \end{aligned}$$
(32)

which corresponds to a convolution of the Green’s function for the Laplacian with the inhomogeneity of the equation, i.e. the density. In Fourier space, this reduces to a simple multiplication and the required discrete Fourier transforms can efficiently carried out with the Fast Fourier Methods (FFM). Similar to the tree-based methods, this reduces operation count for calculating gravity in an N-body system to \({\mathcal {O}}(N \log N)\).

A fast grid-based approach that reduces the effort to at least \({\mathcal {O}}(N \log N)\) is the multigrid technique (Brandt 1977). It accelerates iterative relaxation methods for solving the Poisson equation (Press et al. 2007). Changing the elliptic original problem into a pseudo-time dependent expression, a diffusion equation is obtained that—when relaxed to equilibrium where the pseudo-time derivative vanishes—yields the solution of the original problem. Starting from an initial guess for the gravitational potential, the relaxation is achieved in an iteration. The error in the initial guess can be seen as being distributed over the domain with various modes of different wavelength. Since standard relaxation schemes couple only neighboring cells, short-wavelength errors are quickly eliminated, but damping the long-wavelength error components takes many iteration steps. This is avoided by mapping to a hierarchy of subsequently coarser grids where the original long-wavelength components are short compared to the grid spacing and can be damped out in few relaxation steps. Subsequent projection back to the original fine grid combined with further relaxation steps and cycling through this hierarchy of grids efficiently produces the desired equilibrium solution. The multigrid method is has been used in CE simulations by Ricker and Taam (2012).

4.3.3 Gravitational softening

If the Poisson equation (25) is discretized on a grid together with the equations of fluid dynamics, the grid spacing limits the spatial resolution for both the hydrodynamic quantities and the gravitational potential. As discussed above, however, self-gravity can also be solved in a particle-based discretization, independently of the discretization choice for the hydrodynamic part of the model; and even in grid-based approaches the stellar cores are often modeled as point masses. Particles can get arbitrarily close and one may expect an arbitrarily fine spatial resolution in the discretization of gravitational interaction—a potential advantage when combined with a particle-based or moving-mesh discretization of fluid dynamics. As particles approach each other, however, the gravitational forces between them grow without limits requiring the scheme to take ever smaller timesteps. This produces undesirable time sinks in the numerical scheme.

Therefore, a fix is commonly employed: the gravitational potential is unphysically altered to flatten for short distances, so that the force approaches zero instead of scaling with the inverse of the squared distance. Different functional forms are employed in practice, but the simplest softened gravitational potential—sometimes called the Plummer form of softening (e.g., Dehnen 2001; Price and Monaghan 2007)—reads

$$\begin{aligned} {\Phi }_\mathrm{soft} (r) {:}{=}- \frac{G m}{\sqrt{r^2 + r_\mathrm{soft}^2}}, \end{aligned}$$
(33)

where r denotes the distance to the particle of mass m, and \(r_\mathrm{soft}\) is the parameter altering the physical law—the so-called softening length.

In grid-based discretizations of fluid dynamics combined with particle-based gravity solvers, the size of the grid cells \(\delta \) provides an obvious choice for the scale of the gravitational softening. However, the softening parameter does not necessarily have to be a constant but it may depend on the distance r. Ruffert (1993) suggested the form

$$\begin{aligned} {\Phi }_\mathrm{Ruffert} (r) {:}{=}- \frac{G m}{\sqrt{r^2 + \epsilon ^2 \delta ^2 \exp [-r^2/(\epsilon \delta )^2]}}, \end{aligned}$$
(34)

with \(\epsilon = 1.5\).

In SPH approaches, the only sensible scale for the softening length is the SPH smoothing length. This can be implemented by using a general formulation for force softening (Dehnen 2001; Price and Monaghan 2007) with the gravitational potential due to all particles \(i = 1 \ldots N\),

$$\begin{aligned} {\Phi } ({\varvec{r}}) = - G \sum \limits _{i=1}^N m_b \phi (|{\varvec{r}} - {\varvec{r}}_i|, h). \end{aligned}$$
(35)

The softening potential kernel \(\phi \) is related to the SPH smoothing kernel (31) via the Poisson equation

$$\begin{aligned} W(r, h) = - \frac{1}{4 \pi r^2} \frac{\partial }{\partial r} \left( r^2 \frac{\partial \phi }{\partial r}\right) \end{aligned}$$
(36)

(Price and Monaghan 2007). As a consequence, the gravitational potential is softened with a spline function. Such a choice seems preferable because, in contrast to the expressions (33) and (34), splines reproduce the exact gravitational potential outside a finite radius.

Fig. 9
figure 9

Image reproduced with permission from Passy et al. (2012), copyright by AAS

Exact gravitational potential compared with the softened potential according to Eq. (34), labeled as “Ruffert (1993)” and Eqs. (35, 36, 31) labeled as “Monaghan (1992)” in arbitrary units with \(h = \epsilon \delta = 1\).

While alleviating the time sink problem, a consequence of gravitational softening is that inside \(r_\mathrm{soft}\) the simulated dynamics is altered and less trustworthy. The physical law of gravitational interaction is modified, most strongly at distances shorter than the softening length. This is no fundamental problem for simulating self-gravitating fluids in SPH approaches or grid-based methods combined with particle-based discretization of gravity. The scale down to which fluid dynamics is resolved usually corresponds to the scale of the softening; therefore, the gravitational interactions are sufficiently well modeled.

In the context of CE simulations, however, the stellar cores are usually represented as point particles (in the case of SPH approaches, they are not to be confused with the SPH particles; see Sect. 5.2). These core particles are distinct from the envelope gas. They interact via gravitational forces but not via hydrodynamical effects. Since the core particles comprise a substantial fraction of the total mass of the system in two points, the associated gravitational potentials fall off very steeply close to them. Gravitational softening must be applied to the core particles in order to avoid fatal time sinks. For this, a softening length has to be set. Again, depending on the discretization approach of the hydrodynamics in the envelope gas, assigning \(r_\mathrm{soft}\) to either the grid spacing scale or the smoothing length would be desirable. This, however, requires to follow the very steep gradient of the potential close to the core particle, which makes the numerical representation of mechanical equilibrium configurations (such as required in the setup of CE simulations, see Sect. 5.3) challenging. The pressure gradient counteracting gravity has to be resolved in the hydrodynamic part of the simulation and the required fine resolution leads to unacceptably small time steps. In this situation, a softening according to Eq. (34), has a practical advantage over the physically more accurate spline softening: at close distances it is shallower (see Fig. 9) and a shallower gradient can be resolved with fewer discretization elements.

Whatever choice is made for the functional form of the softening, however, setting the gravitational softening to the scale of the hydrodynamic discretization elements does not ensure sufficiently large time steps for currently affordable simulations. Therefore, CE simulations usually shy away from a safe choice of gravitational softening parameters—from a computational point of view, the softening length should be large to reduce the computational cost of the time integration. But large \(r_\mathrm{soft}\) implies a large region around the core particles in which the gravo-hydrodynamical interaction is suspicious. The dynamics around the cores are the driver for CEE and should be modeled as accurately as possible. In fact, Reichardt et al. (2020) found that smaller softening lengths in their simulations lead to faster interaction and earlier unbinding of the envelope material. Staff et al. (2016a) carried out a similar test using an Eulerian grid-based hydrodynamics code and the interaction seems to be strengthened for smaller softening lengths leading to a slight increase in the final orbital separations of the cores and slightly more unbound mass. In virtually all CE simulations softening length for the core particles is set according to computational efficiency considerations at the expense of physical accuracy. Therefore, careful convergence tests are necessary.

4.4 Advantages and drawbacks of hydrodynamic simulation methods

In this section, we summarize some advantages and drawbacks of each of the three main techniques used in 3D hydrodynamic CE simulations: SPH, Eulerian grid-based schemes, and moving-mesh approaches. Only few direct comparisons have been carried out (most notably (Passy et al. 2012), who compare SPH and Eulerian grid-based simulations), and the available results do not point to major systematic discrepancies between simulations employing different numerical methods. It is far more likely that different results are obtained because of individual choices within each method. This, of course, is not a universally true statement but merely an assessment of the current state-of-the-art. As long as the physical models and implementation details of the methods dominate, the specific features of the fundamental schemes may remain hidden.

For future developments, however, it is important to be aware of the different capabilities of the methods. The current status of CE simulations, discussed in Sect. 7.1, merely scratches the surface of the problems involved in this complex phase of binary stellar evolution. The basic question of whether envelope ejection is possible under certain modeling assumptions can be addressed with different numerical schemes. For the current simulations, this choice affects mostly the efficiency of CE simulations: The spatial resolution required to capture certain physical processes depends on the discretization method and it differs with its choice. As a consequence, this affects the fidelity of the simulations that can be carried out with given computational resources.

This situation may be regarded as an indication of the immaturity of the field of CE simulations: A detailed understanding of CEE requires improved simulations and the different features of methods will play out more in the future. Each technique has particular drawbacks that may compromise the fidelity of the simulated parameters of the CE interaction. Generally, the important aspects to consider are accuracy, efficiency and parallelizability, boundary conditions and flexibility with the geometry of the setups, conservation properties, and general versatility when it comes to include additional physics.

4.4.1 Boundary conditions and setup geometries

The system to be modeled consists of two stars orbiting each other and engaging into a dynamical interaction. This setup is far from a spherically-symmetric configuration. Because of the lack of spatial symmetries in CEE, special grid geometries (such as a spherical grid) do not provide any advantage and there are no obvious boundaries of the domain of interest such as stellar surfaces. Eulerian grid-based CE simulations are usually conducted on Cartesian meshes in cubical boxes. This leads to conflicts with the fact that the considered CE systems are to a good approximation embedded in vacuum.Footnote 14 Empty grid cells cause numerical problems and therefore “true” vacuum cannot be represented straightforwardly in grid-based approaches—a problem for both Eulerian and moving-mesh discretizations. Therefore, cells that are located outside of the system are usually filled with a low-density pseudo-vacuum in the hope that it does not affect the dynamics of the simulated CE interaction. If hot enough, however, this pseudo-vacuum may have a welcome effect on the initial setup: it can reduce the steep pressure gradient at the surface of the primary star and therefore stabilize the stellar model against the dispersion observed in the case of insufficient spatial resolution of the gradient. But this comes at the price that observables cannot be meaningfully be extracted from such simulations [see Galaviz et al. (2017), for a detailed discussion]. Moreover, if too hot, pseudo-vacuum cells may reduce the CFL timestep. Therefore, it is advisable to keep the pseudo-vacuum as cold as possible. With certain setup procedures (see Sect. 5.3), this is possible.

In grid-based CE simulations, the simulated domain has to be finite in its spatial extent and therefore outer boundary conditions at the edges of the computational domain have to be implemented in a way such that they do not interfere with the modeled system. Certainly, no material should flow into the simulation box, but, in principle, outflow of material would be acceptable. A loss of material, however, makes checking for conservation of mass, energy, angular and linear momentum inaccurate and thus the simulations cannot be fully validated using these global criteria. For this reason, the domain sizes are usually chosen so large that even with successful envelope ejection no material leaves the domain. This requires to fill large volumes outside of the interacting system with pseudo-vacuum, which can have some unwanted dynamical effects on the simulation [for a discussion see Chamandy et al. (2019) and Iaconi et al. (2018)]. To minimize such artifacts, the pseudo-vacuum should contain as little mass as possible—i.e. for the desired large domain sizes it should have very low densities.

Representing CE systems on a static grid as in the Eulerian approaches causes strong advection errors, implying violation of conservation properties. The only cure to this is an increase in spatial resolution—a common numerical approach to alleviate problems. Because of the spatial scale problem (Sect. 3.5) and in the light of the desire to make the simulation domain as large as possible to avoid interaction with the boundaries, this is only promising if high spatial resolution is only realized certain, temporarily changing parts of the domain. Therefore, as discussed in Sect. 4.1.1, AMR techniques are widely used in CE simulations.

SPH methods do not require sophisticated outer boundary conditions. Empty spaces between the objects of interest are possible and no pseudo-vacuum is needed. The artificial surface tension mentioned in Sect. 4.1.2 supports the surface of the primary star model and no advection errors disperse the stellar material. These features make SPH codes a natural choice for simulations of CEE simulations. However, as discussed in Sect. 4.1.2, these have drawbacks when it comes to resolving low-density envelope material and hydrodynamic processes in it.

For this reason, moving-mesh approaches present a favorable compromise. They combine the accuracy of grid-based discretizations with the flexibility of a Lagrangian method. With their spatial discretization based on grid-generating points, adaptive mesh refinement is straightforward and sufficiently large computational domains pose no problem. The need of grid-based methods to fill voids with pseudo-vacuum, however, persists.

4.4.2 Accuracy, efficiency, and versatility

A satisfying flow representation can in principle be achieved with any converging scheme. The key question, however, is the numerical resolution required to reach a certain level of accuracy—and this is where the schemes differ fundamentally. In this context, it has to be pointed out that an often used comparison between the number of particles in an SPH simulation and the number of cells in a Godunov-like grid-based simulation is misleading. Whereas SPH methods average over the particles within the smoothing kernel, Godunov schemes compute the fluxes of hydrodynamic quantities between cells and reach an effective resolution defied by the grid scale. The effective spatial resolution of SPH simulations with the same number of particles is usually lower by a factor of a few.

Generally, finite-volume grid-based discretization techniques are superior over SPH methods in resolving hydrodynamic flow features accurately. However, at low resolution, SPH methods often have to be given preference. They yield robust results and, in the context of CE simulations, are capable of determining global properties of the evolution with rather little computational cost. While grid-based simulations have to cover vast amounts of pseudo-vacuum with the same effort as the actual stars, SPH focuses the resources on modeling the physical objects of interest.

While AMR techniques alleviate the problems with grid-based CE simulations, they introduce a significant computational overhead and require some implementation effort. Still, Eulerian grid-based simulations reach an accuracy that is very hard to match with SPH techniques. These tend to under-resolve low-density regions. Moreover, implementing additional physics such as magnetic fields and other effects seems more natural on a given grid than in the SPH approach, although it is not impossible there either (Price 2012). Subgrid-scale models representing unresolved physical effects require a well-defined grid-scale to connect to.

As mentioned before, moving-mesh techniques combine the best of both worlds: the accuracy and versatility of grid-based finite-volume methods with the geometric flexibility of a Lagrangian method. A drawback is the complex grid-generation procedure that tessellates space in every timestep. This overhead renders moving-mesh approaches computationally more expensive than SPH but they are still superior over Eulerian grid-based approaches in terms of efficiency.

4.4.3 Energy and angular momentum conservation

Many hydrodynamics codes guarantee conservation of total (i.e. kinetic plus internal) energy and linear momentum. For finite-volume schemes, cell-averaged conserved quantities are updated via fluxes over the cell edges. What leaves one cell enters its neighbor. This is the reason why finite-volume approaches conserve momentum and energy globally (but not necessarily locally)—inside the domain, net loss or gain in conserved quantities is impossible. In the case of SPH, mass and energy are directly ascribed to the discretizing particles and as long as no particle is lost, these quantities are conserved in this scheme, too. Conservation of total energy and linear momentum, however, is not sufficient for reliable CE simulations for two main reasons.

The first reason is that for the problem at hand, angular momentum conservation is critical. In contrast to linear momentum and energy balance, the Euler equations of fluid dynamics—(16) to (19) or (21) to (23)—do not explicitly include angular momentum balance, but only imply it. Whether or not these quantities are conserved in numerical simulations depends critically on the discretization approach. In grid-based Eulerian schemes, angular momentum conservation is not guaranteed due to the inherent advection errors. These can be decreased by adapting the geometry of the spatial discretization to the expected flow, but this is neither universal nor always possible in complex astrophysical situations. As emphasized above, the flows in CEE certainly lack clear symmetries that could be exploited. Therefore, the only way to improve angular momentum conservation in these approaches is a costly increase of numerical resolution. As discussed in Sect 4.1.2, Lagrangian schemes are superior in conserving angular momentum because they avoid advection errors by construction. In fact, a variational derivation of the SPH method (e.g. Monaghan and Price 2001; Springel and Hernquist 2002) proves this feature: Within the framework of Lagrangian mechanics, the equations of fluid dynamics can be derived from a Lagrangian (Eckart 1960) via a variational principle. Instead of discretizing the resulting partial differential equations, however, one can discretize the Lagrangian in a particle-based approach and then derive the (discretized) SPH equations directly. Symmetries of the original and discretized Lagrangians give rise to conservation properties: the absence of explicit time dependence implies energy conservation, their translational invariance gives linear momentum conservation, and—most importantly—their rotational invariance leads to angular momentum conservation, not only at the level of the partial differential equations, but also for the discretized equations.

The second problem is that while total energy and linear momentum conservation is—for conservative schemes—guaranteed for the numerical implementation of the equations of fluid dynamics without source terms, they do not generally hold in cases where external forces are discretized in different approaches than the hydrodynamic quantities. This is the case for gravity—which, as for many astrophysical problems, is of fundamental importance for CEE. The basic gravo-hydrodynamic model relies on an exact treatment of the conversion of gravitational binding energy and orbital energy to internal energy and acceleration of the envelope gas. Mismatches between the discretizations of the hydrodynamic variables and the gravitational potential can lead to problems with maintaining the expected mechanical equilibrium in stars (see Sect. 5.3), but they may also lead to accumulating errors in the conserved quantities over long simulation periods modeling the CE interaction. Apart from these more subtle issues, the very treatment of self-gravity already poses challenges to numerical schemes. As argued in Sect. 4.3, an exact direct summation over all contributions of N discrete elements (cells in grid-based approaches, or particles in the corresponding schemes) falls into the rather unacceptable \({\mathcal {O}}(N^2)\) time complexity class. Therefore, approximate algorithms, such as discussed in Sects. 4.3.1 and 4.3.2, are preferred. The employed approximations induce errors that potentially can accumulate over the duration of the simulations—not only in the energy but also in linear angular momentum. The center-of-mass of the considered setup can start to drift. Apart from these numerically and algorithmically caused errors, the softening of the gravitational potential (Sect. 4.3.3) alters the interactions at the fundamental physical modeling level. Still being a central force field, conservation of energy should not be affected, but changes due to adaptive gravitational softening lengths may cause problems because they artificially modify the shape of the gravitational potential in time.

Fig. 10
figure 10

Image reproduced with permission from Sandquist et al. (1998), copyright by AAS

Evolution of energy and angular momentum in two simulations (panels a and b) of Sandquist et al. (1998) with different initial parameters. Shown are different components: the kinetic energy of the core particles and the gas (\(E_\mathrm{K,c}\) and \(E_\mathrm{K,g}\), respectively), the internal energy of the gas (\(E_\mathrm{I,g}\)), energy lost from the simulated domain (\(E_\mathrm{lost}\)), potential energies from gravitational interaction between gas and gas (\(E_\mathrm{G,gg}\)), gas and core particles (\(E_\mathrm{G,gc}\)), and between the core particles (\(E_\mathrm{G,cc}\)), the z-components of the total angular momentum (\(L_\mathrm{tot}\)), the angular momentum of the gas (\(L_\mathrm{gas}\)), and the core system (\(L_\mathrm{orb}\)), and the angular momentum lost from the domain (\(L_\mathrm{lost}\)). By the end of the simulations, conservation of total energy and angular momentum was violated at the \(\sim \)10% level.

Numerical errors in the conservation of angular momentum and energy are an unavoidable compromise when striving for efficient simulations. It is, however, essential to monitor them. Energy errors are particularly critical in simulations of CEE, because one of the goals is to determine the unbinding of the envelope, which is rather loosely bound in the giant primaries anyway. It has to be ensured that any unbinding of material is physical and not caused by numerical inaccuracies. The question of what level of non-conservation can be tolerated is an important one. Sandquist et al. (1998) published their conservation of energy and angular momentum showing that over their entire simulations they tolerated a change of approximately 10%, see Fig. 10. There is no strict quantification of an acceptable level and it might affect different output quantities differently. Clearly, if at the end of a numerical simulation the binding energy of remaining envelope gas is of the same order of magnitude as the accumulated energy error, little can be said about the success of envelope ejection. It is, therefore, mandatory to track the conservation of energy and angular momentum and the results should be published alongside with the simulations.

Generally, more work is called for to identify and localize the numerical problems that violate energy and momentum conservation. This most likely requires extensive resolution studies.

4.4.4 Code speed and scalability

Performing 3D hydrodynamic simulations of CEE is computationally very challenging. The system has to be followed over long periods of time with high accuracy, i.e. many numerical time integration steps are to be performed and the spatial resolution has to be sufficiently high. Clearly, such simulations require high performance computing (HPC) resources and are only possible when employing parallelization techniques. Therefore, scalability to large numbers of computational cores to be used in parallel is an important criterion when choosing a code for CE simulations.

Parallelization in the spatial domain is standard for the codes currently used for CE simulations. In finite-volume approaches, the hydrodynamics solvers can usually be parallelized on distributed-memory machines with some acceptable communication overhead. Distributed-memory parallelization is more challenging for particle-based discretization approaches as used for modeling self-gravity (see Sect. 4.3.1) or the hydrodynamics itself (see Sect. 4.1.2). For this reason, some of the SPH codes employ shared-memory parallelization (e.g., phantom; Price et al. 2018), which restricts the simulations to a moderate number of computational cores, but there are also SPH implementations with distributed-memory parallelization, e.g. gadget-2 (Springel 2005) and snsph (Fryer et al. 2006). In moving-mesh approaches, the grid generation poses an additional challenge to efficient parallelization.

For an approximately fixed spatial resolution and a given numerical algorithm, the speed-up that can be reached with parallelization is limited by Amdahl’s law (Amdahl 1967) or similar considerations. Beyond this limit, an increase of the number of employed compute cores no longer reduces the execution time proportionally. Therefore, it is not only scalability of the employed code that determines the feasibility of a certain CE simulation, but also its overall efficiency, i.e. the required wall-clock time to perform a time integration step for a given number of discretization elements in a fixed parallel setup. A common experience in code development is that these aspects—scalability and overall efficiency—are competing. A higher efficiency often causes load-imbalances and thus comes at the expense of parallel scalability. This does not necessarily imply a disadvantage of the respective code for performing CE simulations. Some of the codes employed for such simulations have been developed originally for extensive cosmological simulations and are highly optimized for efficiency; for example the arepo code of Springel (2010a) has been used for the groundbreaking Illustris project (Vogelsberger et al. 2014).

Ideally each simulation would report the total number of CPU-hours, the number of nodes and cores it was executed on, wall-clock times, and the computer specifications. It is assumed that at least a fraction of the publications would be presenting simulations at the limit of what is feasible. For example the 1 million particle simulation presented by Iaconi et al. (2017b) was at the limit of feasibility for the OpenMP, shared memory code phantom.

4.5 CE phases accessible to 3D hydrodynamic simulations

The numerical methods for 3D hydrodynamic simulations discussed here can be used to follow the dynamical part of CE interaction. This includes the initiation of CEE (perhaps only the last part of Phase (i) of our classification in Sect. 1.3, but not the complete pre-CE evolution) and the plunge in and inspiral of the companion, classified as Phase (ii).

Phase (iii), however, is characterized by different timescales involving the long \(\tau _\mathrm{KH}\), which, as discussed in Sect. 3.5, differs from the dynamical timescale of the envelope of RGB and AGB stars by five orders of magnitude. The discrepancies in relevant timescales are a serious challenge to hydrodynamic simulations and it seems unlikely that the long-term CEE can be followed in 3D hydrodynamic simulations. A reasonable resolution of the objects of interest requires about \(10^2\) to \(10^3\) discretization elements (grid cells or softening lengths) per spatial dimension. Taking the dynamical timescale as a proxy for the CFL time step restriction in these discretization elements shows that covering timescales relevant for modeling Phase (iii) requires at least \(10^7\) to \(10^8\) time integration steps with hydrodynamic schemes, which makes such simulations unrealistic.

A solution to this problem would be to couple 3D hydrodynamic simulations of the inspiral phase (ii) with classical 1D stellar evolution models to describe the subsequent evolution. While the 3D simulations provide the initial conditions, mapping them in a useful way to 1D is highly non-trivial. We discuss this problem further in Sect. 7.5.

5 Initial conditions and setups of common-envelope simulations

We now turn to the question of what hydrodynamic simulations of CEE are possible based on the physical foundations discussed in Sect. 3 and the numerical approaches described in Sects. 4.1 and 4.3 with available computational resources. We start with the construction of a sensible initial model for global 3D hydrodynamic simulations of Phase (ii) of CEE according to our classification in Sect. 1.3. This is not only difficult from a technical point of view, but we also have to ensure that such a model represents a reasonable end point of the evolution preceding the CE interaction, i.e. at the end of Phase (i).

The high densities in the cores of giant stars are the reason why degeneracy effects play a role in them, which cannot be described by a classical ideal-gas equation of state. Core material must be treated instead as an ideal quantum gas. This is no fundamental problem. The hard limit of what can be accommodated in simulations is set by the scale problems discussed in Sect. 3.5.

5.1 Can the stellar cores be resolved?

At the first glance, the spatial scale discrepancy between the radius of the core, \(R_\mathrm{core}\) and the outer envelope of a giant star, \(R_\star \), of about four orders of magnitude (see Sect. 3.5)—and for some special cases of early-stage giants perhaps even less—seems challenging but not impossible to represent in numerical treatments. However, a closer look quickly reveals that simulations in which these components are fully resolved are quite unrealistic. A representation of the core structures would require to resolve spatial scales at least a factor of 10 to 100 below \(R_\mathrm{core}\). Thus, a reasonable resolution of the core leads to a spatial scale difference of about \(10^5\) between the integral scale of the primary star and the sizes of discrete elements relevant for the CFL condition. Still, this is extremely challenging but not completely hopeless to be resolved in future simulations.

A computational domain that allows to capture the expansion of the envelope during CEE without losing material over its boundaries (which, as discussed in Sect. 4.4.1 would make it hard to track the conservation properties of the simulation) has to extend by several orders of magnitude beyond the radii of the giant stars. Covering such domains uniformly with the finest required resolution requires computational resources far beyond those of the foreseeable future. Adaptive resolution refinement as inherent to SPH methods or included in grid-based approaches via AMR techniques can alleviate the problem somewhat but not sufficiently to render fully resolved simulations a realistic option.

There is yet another, more restrictive reason why CE simulations with resolved cores are unrealistic. It arises from the timescale problem mentioned in Sect. 3.5. The dynamical timescale defined in Eq. (28) is the relevant quantity for estimating the computational cost of the simulation. Generally, hydrodynamic simulations aim to follow the evolution of the modeled system over a duration close to \(\tau _\mathrm{dyn}\), which therefore sets a coarse order-of-magnitude estimate for the required number of time integration steps. This argument, however, can be formalized further. As discussed in Sects. 4.1.1 and 4.1.2, the CFL condition states that numerical stability of hydrodynamic schemes in explicit time discretization necessitates discrete time integration steps smaller than the sound crossing timeFootnote 15 over a grid cell in grid-based discretizations, or a smoothing length in SPH. As estimated in Sect. 3.5, the dynamical timescale of the envelopes of RGB or AGB stars is about 50 days. In the cores of such stars, \(\tau _\mathrm{dyn, core}\) is only \({\approx } \, 20 \, \mathrm{s}\) (see Sect. 3.5), i.e. it is lower than \(\tau _\mathrm{dyn, envelope}\) by five orders of magnitude. When covering the radius of the core with 100 resolution elements (grid cells or SPH smoothing lengths), the CFL condition dictates timesteps that are seven orders of magnitude smaller than the dynamical timescale of the envelope. Global CE simulations striving to resolve the core of the primary star while also following the evolution for a dynamical timescale of the envelope therefore face a temporal scale discrepancy of \(10^7\), i.e. ten million numerical time integration steps are necessary to follow the system even over only one \(\tau _\mathrm{dyn, envelope}\). Even in the most optimistic cases with a low spatial resolution of the stellar core, the timescale difference does not reduce below five orders of magnitude. Therefore, at best for some very favorable configurations fully resolved 3D hydrodynamic simulations of CEE can possibly attempted with future computational hardware, but this will not become a standard approach anytime soon.

Local time stepping focuses the computational resources on the stellar core—meaning that not the entire domain is evolved in each small time step. Nonetheless, the effort needed to follow the evolution of the envelope remains prohibitive. The CFL condition can be relaxed for unconditionally stable implicit time integration schemes, but such schemes are computationally costly and difficult to implement, so that they have not yet been applied to simulations of CEE. Moreover, although stability is not a concern in time-implicit schemes, accuracy of the solution is still important. If hydrodynamic flows inside the core are to be resolved, a CFL-like condition applies that replaces the sound speed with the flow speed and a substantial gain is only achieved for strongly subsonic flows.

5.2 Representing the cores of the primaries and the companions

As discussed in the previous section, the question of resolving the core of the giant star is not primarily a spatial scale problem; the limiting factor is the timescale problem introduced by the core of the primary star. Depending on its nature, one may hope to resolve the companion. While compact objects such as white dwarfs or neutron stars are too small to achieve sufficient resolution, a main sequence companion may come into reach for future simulations. Still, for a reasonably resolved sun-like companion star, the timescale discrepancy of \({\sim }\, 10^5\) remains extremely challenging.

When CE interactions take place between a primary star that has just initiated its expansion, and a main sequence companion, simulations may be able to represent both stars in their entirety. An example are simulations of the transient V1309 Sco, whose progenitor system is thought to have comprised a slightly enlarged (\({\sim } \, 4 \,R_\odot \)) \(1.5 \, M_\odot \) post-main sequence primary and a \(0.15 \, M_\odot \) main sequence companion (Tylenda et al. 2011). Nandez et al. (2014) carried out a number of simulations of this system using, for some of them, a full representation of the two stars. These simulations were conducted with an SPH code and extremely low particle numbers of \({100\,000}\) to \({200\,000}\) for the primary star and 5000 to \({20\,000}\) for the companion. Lacking a credible convergence test, caution is required in the interpretation of the results. However, in principle one may attempt such simulations with higher resolution. This setup, however, is already at the rather blurred boundary between CEE and stellar mergers and may, because of the lack of a clear core-envelope structure, not completely qualify as CE interaction (see our discussion in Sect. 1.2). For completeness we should mention again that stellar interaction simulations with both stars fully represented are also carried out for compact objects such as white dwarfs and neutron stars, as well as for massive main sequence stars, where the two stars have comparable sizes (see Sect. 1.2 for examples). However, these interactions, which result in mergers, do not follow the same path as the CEE described here in that one of the stars is usually tidally shredded rather than moving into the envelope of the other.

For more standard CE setups, the timescale problem arising from the extremely compact nature of the core of the primary giant star remains an insurmountable obstacle to global, fully resolved simulations of well-defined CE interactions in the foreseeable future. There are two ways of dealing with this fundamental problem.

When CEE results in the survival of the binary and the ejection of the envelope, simulations should aim to accurately reproduce the core–envelope interaction, the timing and mechanism of envelope ejection and the post-ejection orbital separation of the cores. In this first case, the stellar cores are largely unaffected by the inspiral. Resolving their internal structure is therefore less important than a precise representation of the envelope of the primary star that later becomes the common envelope. It is therefore common practice to replace the cores by a simple model while trying to capture the physics of the envelope on the simulation domain. This is usually achieved by substituting the core of the primary star and also the companion with point particles that interact mutually and with the envelope gas only via gravity. In this context, such point masses are often referred to as core particles. The main drawback of this approach is that only the gravitational interaction of the cores with the envelope is modeled and any hydrodynamic interaction, such as accretion, expansion, evaporation, and jet formation is ignored. Yet such phenomena may strongly affect the envelope gas. Therefore, subgrid-scale models have been employed to represent them in global CE simulations (e.g. Chamandy et al. 2018; Zou et al. 2022).

If, however, the evolution of the large envelope is not the primary interest of the simulation, a second option is to follow inner parts of the system with resolved cores. This may apply to systems where additional simulations capturing the envelope or other considerations lead to the conclusion that envelope ejection fails and a merger of the cores or an evaporation of the companion is the focus.

A clear core–envelope structure of the primary star is a prerequisite for replacing its core by a point particle. But an exact definition of a sharp core–envelope boundary is difficult to give. Depending on the evolutionary stage of the giant and the mass of the star, the boundary may be set according to different parameters. Supergiant stars usually have a less clearly defined core–envelope structure than RGB or AGB stars. From a stellar evolution point of view, chemical composition may provide a useful discrimination: the core may have undergone nuclear burning and the mass fractions of the corresponding “ashes” could be used to indicate the core–envelope boundary. Shell burning, however, leads to ambiguities. For the CE dynamics, it would be more useful to determine the point down to which the envelope material has to be removed so that the remaining bound objects does not re-expand, i.e. the bifurcation point (see Sect. 2.1).

The strategy of a simplified representation of the cores has been implemented in various ways. In SPH simulations, a definition of a core particle is rather straightforward because the envelope material is also discretized as particles.

Grid-based approaches, in contrast, require somewhat more thought. One option here is to plainly ignore the problem when mapping the stellar structure from the initial 1D model to the hydrodynamic computational domain. Such setups do not use core particles. The core of the primary star is simply taken to be part of the central grid cell that comprises the stellar core and some envelope material. In principle, mass flows into and out of this central cell are possible. The density in the central cell containing the core is bound to be high, but its value depends on the spatial resolution. This rather ambiguous and resolution-dependent representation of the stellar core makes convergence studies difficult and must therefore be discarded in modern 3D hydrodynamic simulations of CEE.

The introduction of a core particle alone, however, does not solve the problem satisfactorily straight away. It introduces two ways of treating stellar material—a particle modeling the core and a grid-based discretization of the envelope. These need to be defined and coupled in a physically consistent way. A naïve approach that simply assigns the mass of the stellar core to the particle leaves a resolution-dependent amount of envelope material in the central grid cell. This high-density material is usually not sufficiently resolved to guarantee a correct treatment of core-envelope interaction. Leaving the envelope profile unaltered, as was common practice in many simulations of dynamical inspiral in CEE, leads to perturbations of the HSE in the envelope structure of the primary star and generates spurious velocities. As a resolution-dependent model, numerical convergence of the results of CE simulations is hard to establish with such a setup.

Fig. 11
figure 11

Image reproduced with permission from Ohlmann et al. (2017), copyright by ESO

Radial profiles of density (top left), internal energy (bottom left), pressure (top right), and derivative of pressure (bottom right) of an original mesa model for a \(2\,M_\odot \) RGB star with reconstructed profiles (“opal”), in which the cores were cut out at the indicated percentage of the total stellar radius.

For this reason, Ohlmann et al. (2017) proposed a procedure to cut the original stellar profile (that in practical simulations often results from preceding 1D stellar evolution calculations) at a certain chosen radius into a thus defined “core” and an “envelope”. The “core” is then represented by the core particle and the “envelope” is constructed on the grid in a way that preserves its expected HSE according to Eq. (24) before the onset of CE interaction. The hydrostatic stratification of the gas discretized on the grid is reconstructed with a modified Lane–Emden equation (Ohlmann et al. 2017). In contrast to the original Lane–Emden equation for polytropic stellar models (see, e.g., Kippenhahn et al. 2012), it includes the gravitational force \(g_\mathrm{core}(r)\) due to the core particle as a function of radius r in addition to self-gravity of the envelope gas:

$$\begin{aligned} \frac{1}{r^2}\frac{\mathrm{d}}{\mathrm{d} r} \left[ \frac{r^2}{4 \pi G \rho } \frac{\mathrm{d} P}{\mathrm{d} r} + \frac{r^2 g_\mathrm{core}(r)}{4 \pi G}\right] + \rho = 0 \end{aligned}$$
(37)

This procedure provides a reliable and resolution-independent reconstruction of the envelope profiles (see Fig. 11). The important parameter of this setup model is the cut radius below which material is assigned to the core and represented by a particle. This radius is chosen according to physical considerations and numerical necessities. As discussed in 5.1, a resolved physical core would act as a time sink in numerical simulations and this is also true for the higher-density regions around the core. Resolving the bifurcation point on the grid would be desirable, but it often is located in high-density material. Extending the correct envelope gas representation to this point can result in unacceptable computational costs and compromises are made. According to Eq. (37), the core particle is still embedded in gas within the cut radius, but its density profile does not provide a realistic representation of the envelope close to the core. In fact, depending on the choice of the cut radius, some envelope material is absorbed in the core particle. Despite these deficiencies, the setup procedure of Ohlmann et al. (2017) provides a well-controlled setup with a clearly-defined, if not entirely astrophysical core–envelope boundary. This has not been the case in many other setups employed before.

SPH based setups for CE simulations face a similar problem. The envelope gas represented by SPH particles in the vicinity of the distinct (gravitation-only) core particles and within their gravitational softening radii is not necessarily in HSE when they are placed randomly. To ensure equilibrium, a distribution of SPH particles in this region can be chosen that represents a density profile according to Eq. (37). Whether or not such a structure captures a realistic core–envelope transition has to be tested and may depend on the number of SPH particles as well as on the value of the softening length (Reichardt et al. 2020).

Although the fluid-dynamical treatment of the core material is discarded for efficiency reasons, it is important to capture the gravitational effects of the cores as precisely as possible. In a fully particle-based implementation in the framework of SPH this is relatively simple; the numerical treatment of self-gravity derives from N-body simulations and is well-suited to deal with the problem. When combining a grid-based discretization of the envelope gas with a particle representation of the cores, however, the treatment of self-gravity is less obvious. One option is to model the gravitational interaction of the gas cells in a particle-based approach, such as using the tree method (see Sect. 4.3.1). To alleviate the inherent asymmetries of tree methods, a direct summation of the contributions to gravitational forces from the core particles is possible. Calculating the gravitational interaction between the core particles and between core particles and gas cells exactly adds a tolerable computational overhead only as long as the gravitational interaction of the many gas cells is treated in an approximate \({\mathcal {O}} (N \log N)\) approach. This is implemented for instance in the moving-mesh CE simulations of Ohlmann et al. (2016a).

A full, grid-based treatment of gravity employing Fast Fourier techniques or multigrid methods (see Sect. 4.3.2), in turn, requires to map the masses of core particles onto the grid, for instance with a cloud-in-cell algorithm (Taam and Ricker 2006). To avoid force anisotropies, a large number of particles moving rigidly together can be chosen to represent the cores (Ricker and Taam 2008, use \(10^5\) particles per core).

The approach of replacing the cores by point masses naturally removes the timescale problem. It seems, however, likely that future generations 3D hydrodynamic CEE simulations will strive to improve the representation of the cores. Even if resolving them spatially remains out of reach, subgrid-scale models may help to refine the implementation of physical properties of the cores and associated effects such as hydrodynamic friction, mass accretion, or evaporation.

5.3 Setting up the primary star in hydrostatic equilibrium

The first step in simulating CEE is to set up a model for the primary star. This step requires some diligence. Although reaching envelope ejection in CE simulations remains a challenge, primary stars are giants and have rather loosely bound envelopes. It is far from trivial to keep them stable over many dynamical timescales in 3D hydrodynamic simulations.

Usually, the initial model for the primary star is obtained from a 1D stellar evolution calculation. Such calculations and their results differ in many aspects from the representations of stars in multidimensional hydrodynamic treatments. Two of them are of particular significance when mapping models of primary stars into CE simulations. (1) Due to their 1D nature, stellar evolution calculations can afford much higher resolutions in spatial or mass coordinates. This is additionally supported by the common choice of a Lagrangian frame of reference. (2) Classical 1D models are constructed under the assumption of a mechanical equilibrium in the stellar structure.

Aspect (1) directly links to the question of how to geometrically place the discretization elements in the different 3D hydrodynamic approaches. Adapting the geometry of the discretization scheme to the shape of the simulated system becomes increasingly important with lower spatial resolution. While observing the overall spherical symmetry of a stellar model, spherical grids are plagued by their axial and central coordinate singularities and are ill-suited for the later simulation of the binary system evolution. In contrast, the geometry of Cartesian meshes is not adapted to the spherical symmetry of the stellar model and their spatial resolution is anisotropic with preferred axis directions. Adaptive mesh refinement techniques can alleviate the geometry problems somewhat.

Particle-based discretizations follow the mass distribution inside the envelope by construction and may therefore provide poor spatial resolution at certain locations (most obviously near the stellar surface). Still, the mesh-free approach of SPH and moving-mesh discretizations of hydrodynamics automatically adapt to the geometric properties of the simulated object as it evolves. This advantage, however, comes at a price to pay at the initial setup: unstructured moving meshes and random placements of particles in SPH lack any symmetry. Mapping a spherical stellar model onto them introduces noise resulting in spurious velocities in the material. Ohlmann et al. (2017) tested a variety of grid structures for placing the discretization elements in the initial setup—a regular cubic grid, a nested cubic grid, an adaptive cubic grid, and a grid based on a HEALPix tessellation (Górski et al. 2005; Pakmor et al. 2012). For reasons discussed below, however, they found that the initial grid geometry has little effect on the simulation results.

Aspect (2) is related to the problem of ensuring HSE in hydrodynamic simulations. Except for the explosive termination phases, stellar structures remain very close to HSE throughout the evolution of the star. This, to good approximation, should hold true for the envelope of the primary star at the onset of CEE. Simulations of the dynamic inspiral phase aim to determine the response of the CE to the perturbations caused by the orbiting stellar cores. A key requirement for this is that the employed numerical model is able to maintain HSE in the unperturbed envelope—any change in the envelope structure should originate from the core inspiral and not from numerical errors. This is challenging because, in contrast to the classical stellar structure calculations providing the initial model for the primary star, HSE is not explicit at the level of the fundamental equations in a hydrodynamic model. It rather constitutes a special solution and there is no guarantee that the delicate balance between pressure gradient and gravity in the loosely bound envelope of a giant star is maintained over many dynamical timescales by the approximate numerical schemes. Moreover, the goal is not to force the setup into some arbitrary HSE configuration but to reproduce the original stellar model as exactly as possible in the multidimensional hydrodynamic simulation.

To enable the correct HSE in the numerical model, the gravitational force as well as counteracting pressure gradient should be reproduced accurately. Since both effects are discretized independently (see Sects. 4.1 and 4.3), there is little hope for errors to cancel reliably.Footnote 16

A minimal requirement for global stability of the stellar model is a sufficiently precise numerical representation of the pressure gradient. To this end, a pressure scale height should be resolved by a certain number of discrete elements (grid cells or particles). Depending on the discretization approach, this can be a difficult task. For finite-volume hydrodynamic schemes, it is possible to estimate the resolution required in order to keep the Mach number of spurious velocities below a certain threshold (Zingale et al. 2002). The result depends on the chosen scheme and the order of reconstruction, but generally a resolution of several cells per pressure scale height is required for reasonably low velocity perturbations. For the solver implemented in the arepo code, Ohlmann et al. (2017) estimated the Mach number of velocity fluctuations when resolving a pressure scale height \(H_p\) with a grid spacing \({\Delta }\) to be

$$\begin{aligned} Ma = \frac{C_\mathrm{CFL}}{12 \gamma } \left( \frac{{\Delta }}{H_p} \right) ^3 + {\mathcal {O}} \left[ \left( \frac{{\Delta }}{H_p} \right) ^4 \right] , \end{aligned}$$
(38)

where \(C_\mathrm{CFL} < 1\) is the fudge factor introduced into the necessary but not sufficient CFL criterion to stabilize the scheme and \(\gamma \) is the adiabatic index of the gas. To stabilize the hydrostatic stratification with this scheme assuming \(\gamma = \nicefrac {5}{3}\) and \(C_\mathrm{CFL} = 0.4\) down to a Mach number of \(10^{-2}\), one pressure scale height must be resolved with more than three cells (Ohlmann et al. 2017).

Particular problems arise near the core of the giant star and at its surface, where the pressure gradients are steep. Here, adaptive mesh refinement techniques can help to alleviate the resulting computational costs. Ohlmann et al. (2016a) found that HSE can be maintained only when retaining a certain number of grid cells inside the softening length around the core particle of the primary star model. The rather steep density gradient has to be sufficiently resolved. A universal criterion for the necessary resolution, however, is difficult to establish as it is expected to not only depend on the parameters of the star but also on the numerical methods and their implementation (e.g. the order of spatial reconstruction). Sand et al. (2020), for example, found that a higher resolution is required in the case of AGB primary stars as compared with the RG models of Ohlmann et al. (2016a).

Reaching a sufficient resolution of the pressure gradient near the surface of the star is a harder task because of the even steeper pressure gradient encountered here. It turns out, however, that this is less critical for the overall stability of the modeled stellar envelope than resolving the region around the core. Small departures from equilibrium are often tolerable because they only lead to a slight expansion of the very outer stellar layers that contain little material. Insufficient resolution of the outer layers, and a correspondingly large mass loss over the surface, however, may cause a progressive dilution of the inner parts of the star. Moreover, similar to the problems noted by Galaviz et al. (2017), the lost material may affect the prediction of the color and the lightcurve of the simulated CE event.

In low-resolution CE simulations with grid codes, a practical way to stabilize the surface of the primary star is to impose a high temperature in the pseudo-vacuum embedding the star such that it is in pressure equilibrium with the surface layers (e.g., Chamandy et al. 2018; Passy et al. 2012; Sandquist et al. 1998). This, however, may lead to problems with predicting observables from CE simulations, because the artificially hot pseudo-vacuum prevents a useful estimate of a photospheric temperature (Galaviz et al. 2017). By construction, SPH codes have low resolution in the low density regions of the surface. However, they tend to retain the stellar shape without the addition of a hot pseudo-vacuum. In SPH schemes, hydrodynamic quantities and their gradients are computed by summing over contributions from a certain set of neighboring particles. At the surface of an object, this leads to a one-sided evaluation of properties that can cause an artificial “surface tension” (e.g. Springel 2010b). On the one hand, this may help to prevent the slow leakage of low-density material. On the other hand, however, the artificial surface tension may affect the modeling of the phase directly preceding the plunge-in of the companion into the envelope.

A careful preparation of the 3D stellar model involves not only the mapping from the original 1D structure but in addition it requires a damping to ensure initial HSE in the discretized structure. In particular, the arbitrary initial placement of the grid-generating points in moving-mesh hydrodynamics schemes and of the particles in SPH requires care to not disturb local HSE conditions, which would lead to spurious velocities in the envelope of the primary star. But also Eulerian grid-based simulations should be damped to HSE because of the change in resolution in the mapping process. The damping can be implemented as an artificial friction term (Pakmor et al. 2012; Rosswog et al. 2004) proportional to

$$\begin{aligned} \dot{{\varvec{v}}} = - \frac{1}{\tau } {\varvec{v}}, \end{aligned}$$
(39)

where \(\tau \) is the timescale over which the velocities are damped. Following Pakmor et al. (2012), Ohlmann et al. (2017) perform the damping with a constant \(\tau \) over several dynamical timescales of the object, reduce the damping over a certain period and then follow the undamped evolution over some dynamical timescales to ensure stability of the obtained configurations, see Fig. 12. The necessary damping step is the reason why the choice of the initial grid geometry is unimportant as long as it provides a reasonable representation of the structure: The adaptive moving mesh or the positions of the SPH particles adjust themselves in the damping process and attain a structure that is largely independent of the initial choice. The purpose of the relaxation step is to approach the lower limit for the Mach numbers of spurious motions implied by criteria such as Eq. (38). Similar damping procedures have been applied successfully for many years, starting with (Ricker and Taam 2008) and they are used time and again from Passy et al. (2012) to Ohlmann et al. (2017), Chamandy et al. (2018), and Prust and Chang (2019).

Fig. 12
figure 12

Image reproduced with permission from Ohlmann et al. (2017), copyright by ESO

Relaxation of the setup model shown in Fig. 11. Shown are the radial profiles of the Mach number (top left), the density (bottom left), the two terms in the equation of HSE (24) (top right) and the relative error in HSE for different times during the relaxation procedure. The density profile is well-preserved and the deviation from HSE is at the percent level within the stellar structure (but not in the pseudo-vacuum embedding it). The Mach number increases but stays reasonably low inside the stellar envelope.

An additional problem arises when a correct representation of the thermal structure of the 1D stellar model in the hydrodynamic simulation setup is intended. This usually implies the need to use exactly the same equation of state in both the stellar evolution code providing the 1D model and in the hydrodynamic code. With minimal changes in the hydrodynamical structure, however, it is possible to preserve the correct convective properties of the envelope when using the setup procedure proposed by Ohlmann et al. (2017) based on Edelmann et al. (2017).

Ohlmann et al. (2017) list five quality criteria for the representation of primary stars in 3D hydrodynamic CE simulations:

  1. 1.

    Correct representation of the mechanical structure: deviations from the original 1D model in the pressure and density profiles should be small.

  2. 2.

    Correct representation of the HSE: the difference between both sides of Eq. (24) should be small.

  3. 3.

    The Mach numbers in the envelope of the primary star model should be small compared to the Mach numbers expected in the later CE evolution.

  4. 4.

    Correct thermal structure of the envelope: if the convective structure of the primary star is retained in the mapping and relaxation procedures, a stationary state of convection should be reached in the model.

  5. 5.

    Stability against large-scale oscillations: If the original primary star is not pulsating, the potential energy of the model should be constant.

These criteria should be checked carefully before adding a companion and starting the actual CE simulation. Again, we advocate to perform such tests as a standard procedure when performing CE simulations and to document the results in the related publications.

5.4 Setting up the binary system

After setting up a primary star model and checking its stability, a companion is added. This requires to choose the parameters of the progenitor system, such as the initial orbital separation, the spin of the two stars, and the eccentricity of the orbit. Physically, these parameters are determined by the evolution of the progenitor binary system and set by choosing the time at which the simulation of this system is started. From this point of view, initializing the actual CE simulation as early as possible seems advisable in order to capture the formation of the CE correctly. The pre-CE evolution, however, takes place on timescales that are not easily accessible to 3D hydrodynamic models (see Sects. 3.6 and 4.5). Therefore, an initial condition for the binary evolution must be constructed that reproduces an expected structure at a certain stage of the pre-CE evolution. Starting at the onset of Roche lobe overflow appears to be a natural choice: The initial system is set up at the time when the primary, with radius \(R_\star \), just fills its Roche lobe, whose radius, \(r^\mathrm{Roche}_\star \), can be approximated by

$$\begin{aligned} R_\star = r^\mathrm{Roche}_\star = a \, \frac{0.49 \, q^{2/3}}{0.6 \, q^{2/3} + \ln (1+ q^{1/3})}, \end{aligned}$$
(40)

where \(q = M_\star / M_\mathrm{comp}\) is the mass ratio of the primary star to the companion (Eggleton 1983). This determines the initial orbital separation, a.

We could ask whether starting the simulation at onset of Roche lobe overflow, as, e.g., in Rasio and Livio (1996) and Nandez et al. (2014), is actually necessary. After all, we do not know whether the simulations capture correctly the transition between stable Roche lobe overflow and the onset of instability and inspiral. Following this argument, the choice for the starting point of 3D hydrodynamic CE simulations is often made according to practical considerations. A too large initial separation makes the simulations very expensive. Many orbits of the binary have to be followed from before the onset of mass transfer until the actual plunge-in of the companion into the envelope of the primary. This is possible provided that the employed hydrodynamics scheme preserves angular momentum well, which, of course, is desirable. With this, we face the paradoxical situation that the better the codes reproduce physical conservation laws, the more expensive the simulations become. As a compromise, many simulations position the companion near the surface of the primary (e.g., Ohlmann et al. 2016a; Sandquist et al. 1998). The companion could even be initially placed inside the envelope—a choice motivated with the argument that there is very little binding energy in the outer layers (Law-Smith et al. 2020). The danger with this approach is that a simple binding energy argument is insufficient. The inspiral is a dynamical process driven by the drag force. Therefore, an extreme choice may select an orbital separation of the initial core binary system that seems energetically plausible but is never reached in the actual dynamical evolution because the envelope is lifted earlier and the drag force vanishes.

Placing the companion close to the primary star—be it at Roche lobe filling distance or closer—raises the question of how to define a consistent setup configuration. It implies that early tidal effects are missed. For a late initiation of the simulation, the primary star cannot be assumed to be spherical, but many simulations start out with exactly this assumption. From a practical point of view, a spherical setup of the primary star has the advantage that sufficient stability of its envelope can be guaranteed, e.g. by the procedures described in Sect. 5.3. This allows to separate physical effects during the CE evolution from numerical artifacts, which would be more difficult to ensure in a binary setup. Therefore, the assumption of a spherical primary star gives rise to numerically well-defined initial conditions for CE simulations. Still, concerns remain as to whether this is a physically valid approach.

There are methods that allow to initiate the binary with a separation larger than Roche lobe contact and to follow the evolution in a numerically efficient way. After creating a stable model of a spherical primary star as in Sect. 5.3, another step is taken before simulating the plunge-in of the companion. This intermediate step aims at relaxing the envelope of the primary star into the potential of the binary system close to the onset of mass transfer. For white dwarf merger simulations, such a procedure has been suggested by Dan et al. (2011). The idea is to place the spherical stellar models in orbit with a companion at an orbital separation large enough that the tidal interaction is negligible. The computational cost of following the slow inspiral due to gravitational wave emission is prohibitive. To speed up the orbital evolution, the distance is artificially decreased on a timescale that is substantially longer than the dynamical timescale of the stars. This allows the stellar structures to adapt to the changing potential. Such initial models, however, are not common in CE simulations yet. Retaining force balance in the loosely bound envelopes of giant stars is more challenging than in the compact structures of white dwarfs.

Even agreeing to start all simulations at the time of Roche lobe overflow, we next would need to decide on the rotation of the interacting stellar objects. Since the companion and the core of the primary star have to be treated as point particles (see Sect. 5.2), this question boils down to the rotation of the envelope of the primary. The general idea of the onset of CEE is a loss of co-rotation between the orbit of the binary companion and the envelope of the primary. This triggers the inspiral, because for the drag force to act, a non-vanishing relative velocity between the companion and the envelope material is necessary. It remains unclear, however, how much co-rotation is to be expected in the epoch the simulation is initialized (provided, of course, that this initialization reflects a physical evolution stage in the first place). Moreover, not all progenitor systems may reach full co-rotation before entering CEE. In simulations, anything between full co-rotation and a non-rotating primary star has been used. It may be surprising that even full co-rotation leads to inspiral, but this is due to non-relaxed initial conditions in the binary potential which quickly re-arrange the density distributions so that tidal forces can act.

The issue of primary-star rotation and the extent of primary–orbit co-rotation goes hand in hand with the issue of stabilization of the binary in a certain rotating configuration. While the primary is always stabilized as a single star in the inertial frame (see Sect. 5.3), some simulations also stabilize the binary in the rotating frame (Rasio and Livio 1996). Nandez et al. (2014) and following papers stabilize the binary in the corotating frame using the method of Lombardi et al. (2011), but such a method is not universally adopted by all simulations. Reichardt et al. (2019) evolved a Roche lobe contact system in the rotating frame, but like Sandquist et al. (1998), they did not stabilize the binary in that frame, effectively spinning up a star that was in equilibrium only when non-rotating.

An additional, dynamically important but poorly constrained parameter is the initial eccentricity of the system. Many simulations assume circularization of the orbit prior to the onset of CEE, and this is also supported by simulations (MacLeod et al. 2022), but cases with eccentric initial orbits have also been considered in numerical simulations (Glanz and Perets 2021a; Staff et al. 2016a). Eccentric post-CE binaries are observed and may result from pre-existing eccentricity or generation of eccentricity during the CE interaction. In simulations with the companion initialized in a spherical orbit close to the edge of the primary star, the generation of substantial eccentricity in the plunge-in is indeed observed.

Our discussion in the previous sections indicates that the setup of CE simulations is a very delicate issue. Unlike the inspiral phase of CE interaction, the prospects for 3D hydrodynamic simulations of large parts of the pre-CE evolution are discouraging, leaving us with rather arbitrary choices of initial system parameters. This unsatisfactory situation calls for careful testing of the impact these parameters have on the results. The studies carried out thus far indicate some, but surprisingly little impact of the initial separation and even the rotation of the primary star on the final orbital separation (Iaconi et al. 2017b; Prust and Chang 2019; Sandquist et al. 1998). This, however, may depend on secondary parameters, such as the mass and evolutionary stage of the giant star and the mass of the companion. More extended parameter studies are required to settle the impact of the choice of initial parameters on the final orbital separation, but also on the mass and morphology of ejected envelope material.

6 Multidimensional hydrodynamic simulations

For reasons given in Sects. 3, 4 and 5, only certain stages of CEE are accessible to 3D hydrodynamic modeling. Although all phases are methodologically challenging, the dynamical inspiral, Phase (ii) of our classification in Sect. 1.3, is out of reach for classical approaches to stellar evolution modeling. Yet, it is perhaps the most critical phase for the fate of the system. Progress in binary stellar evolution fundamentally depends on a detailed understanding of this phase. We argue that only 3D hydrodynamic simulations provide the required realism and predictive power to solve this problem.

In this section, we review simulations pertaining to parts of the pre-CE evolution of the progenitor system, the dynamical CE interaction in the plunge-in phase, and a few tens to hundreds of orbits afterwards. These have been carried out over the past decades by several groups. In contrast to the previous sections, where we discussed general aspects of CE simulations and expressed our own view on the approaches taken, we here summarize the findings reported by the respective authors of the studies. The interpretations and conclusions drawn are often complementary, but occasionally also contradictory. This is an unavoidable consequence of the historical development of the field, which we intend to convey from a neutral perspective. We therefore try to hold back our own views.

6.1 Simulations of the pre-dynamical inspiral phase and the onset of CE interaction

Until recently, work on the pre-CE evolution was mostly carried out based on analytical models, stellar evolution calculations or binary population synthesis tools. We have briefly discussed some important aspects of the pre-CE interaction in Sect. 3.6 and refer the reader to Sect. 6 of Ivanova et al. (2013) for a more comprehensive review. A broader scope of modeling binary interactions, both with 1D stellar evolution approaches and with multidimensional hydrodynamic methods, is covered in the review of De Marco and Izzard (2017). Here, we restrict our discussion to the few available multidimensional, hydrodynamic models that pertain to the the onset of CEE.

There is no doubt that the physical parameters of the binary system together with the nature and evolutionary stage of the primary star and the companion determine its fate in and after the CE phase. But still we lack a comprehensive understanding of which systems achieve successful envelope ejections leaving behind a compact binary and which of them end up in a merger of the cores. It is expected that this is determined by the physical initial conditions and the many resulting processes that lead to the onset of CEE discussed in Sect. 3.6. As mentioned there, there is little hope to capture this complex phase comprehensively in 3D hydrodynamic simulations, but a few attempts exist.

Pejcha et al. (2016a, 2016b) carried out 3D, SPH-based radiation-hydrodynamic simulations aimed at understanding the pre-merger phase of the transient V1309 Sco (Tylenda et al. 2011). This is now established to have been the merger of a slightly enlarged, \({\sim } 1.5 \, M_\odot \) main sequence or sub-giant primary star and its much less massive main sequence companion. As discussed in Sect. 1.2, this configuration does not qualify as a show-case example of a CE system, but is rather at the blurry interface between CEE and classical stellar mergers. Nonetheless, the similarity of this system and the less extreme spatial scale challenges render it a suitable example to test some models with numerical simulations and comparisons to observations. The simulations of Pejcha et al. (2016b) and Pejcha et al. (2016a) modelled a very specific process: the mass loss of the interacting binary system from the outer Lagrange point \(L_2\) and its observational consequences.

SPH was coupled to a simplified treatment of radiation that splits the process into flux-limited diffusion of radiation energy, radiative cooling in the direction perpendicular to the orbital plane, and—only in Pejcha et al. (2016b)—irradiation of the gas from the central binary. A suitable equation of state was used to account for the ionization structure of the gas. The setup of Pejcha et al. (2016b) consisted of a central binary with a mass ratio between 0.06 and 0.8, modeled only including the mutual gravitational force of the stars, but with no back-reaction of the gas flow on the binary orbit. The SPH particles representing the gas component were injected directly at the \(L_2\) Lagrange point of the binary system allowing one to follow the structure of the outflow, which was not self-consistently modeled in the hydrodynamic simulation but assumed in the setup. The spiral arms generated by the outflow overlapped and merged at a certain distance from the binary, which is of interest for observing the corresponding system. Shock waves thermalized and about 10% to 20% of the radial kinetic energy of the outflow was converted to thermal energy. Depending on the system parameters, some of this energy was radiated away, diffused or generated adiabatic expansion of the gas and dominated the resulting luminosity. Conditions for dust formation were found to prevail in the ejected material. The temperatures and luminosities detected in the simulations of Pejcha et al. (2016b) matched observations of LRN in order of magnitude, but because the model did not follow the dynamical evolution of the binary itself, lightcurves could not be reproduced.

Pejcha et al. (2016a) extended the study to other mass ratios of the binary system and found outflows of unbound material from \(L_2\) if the thermal content of the ejecta was sufficiently high, i.e., the ratio between the sound speed and the orbital velocity at the injection point was large. On the other hand, cold outflows outside the mass ratio range determined in Pejcha et al. (2016b) remained marginally bound. A rich phenomenology was observed in the simulations. Again, the expected optical emission from the implied processes was found to explain prolonged activity of systems due to \(L_2\) mass loss before the peak of the emission was reached in the actual merger event. Informed by the radiation-SPH simulations of Pejcha et al. (2016a, 2016b), Metzger and Pejcha (2017) proposed that the interaction of material ejected in the dynamical stellar merger or CE event with the previous outflow generates a shock that contributes to powering the lightcurves of LRNe. This was suggested to explain typically observed double peaks.

Pejcha et al. (2016a, 2016b) assumed an outflow over an outer Lagrange point and studied its implications in their simulations, but they did not model the dynamics of the binary system itself. Although they focused on the pre-CE evolution, they did not attempt to model how the system enters CEE, nor the impact of the simulated phase on the following inspiral.

This was addressed for the first time by MacLeod et al. (2018b),Footnote 17 who studied the evolution from the onset of mass transfer towards the formation of a CE in a system comprising an evolved primary star and a lower-mass companion. Their choice of parameters ensured that mass transfer reduces the binary separation initiating unstable mass transfer. To simulate the hydrodynamic evolution in 3D, MacLeod et al. (2018b) employed the Eulerian MHD code athena++ (Stone et al. 2020), but without accounting for the evolution of magnetic fields. The spherical polar mesh was uniformly spaced in angular directions, with the spacing growing logarithmically with radius. Two nested levels of static grid refinement were prescribed around the binary orbital plane. The giant star’s envelope was constructed as a polytrope. Both the core of the primary star and the companion were modeled as point masses. Following the details of mass transfer required meticulous preparation of the initial model for the 3D hydrodynamic simulation. The envelope of the primary was relaxed damping out spurious velocities to ensure numerical HSE. The gravitational force of the companion was slowly turned on to allow the structure to adapt to its presence. At Roche-radius separation, mass transfer commenced in an unstable mode with an increasing rate so that the orbit of the binary core system eventually experienced runaway decay. A fit to the loss rates of mass and angular momentum was provided that allows for an analytic description of the orbital evolution. The morphology of the gas outflow was observed to change during the evolution: initially a thin stream of high-entropy gas was launched from the \(L_2\) and \(L_3\) Lagrange points, which later developed into a broad fan of gas ejected on ballistic trajectories. The origin of the transition between the two modes was identified as desynchronization of the orbital motion with the rotation of the donor star’s envelope. MacLeod et al. (2018a) interpreted their results in terms of observational features with particular emphasis on the formation of bipolar structures observed in remnants of stellar coalescences. While it is not the only path to binary coalescence and systems with mass ratios close to unity may evolve differently, their simulation captured an important case for the formation of a CE.

The case of “grazing envelope evolution” impeding or even preventing the onset of CEE (see Sect. 3.6) was simulated by Shiber et al. (2017) and Shiber and Soker (2018) who prepared a model of a \(3.4 \, M_\odot \) AGB star of radius \({\sim } 215 \, R_\odot \) in the mesa code and mapped it into the flash code (Fryxell et al. 2000) on a uniform Cartesian grid and assumed an ideal gas equation of state. The inner third of the radius was replaced with a constant density sphere. Gravity was modeled as constant, temporal evolution of the gravitational field and the effect of the companion star were ignored. A low-mass main sequence companion star was initialized on a Keplerian orbit at various radii. This radius was kept constant by Shiber et al. (2017) while Shiber and Soker (2018) allowed for inspiral to a two thirds of the initial radios of the primary star at a prescribed rate inspired by CE simulations. At the location of the companion, a bipolar jet was put in perpendicular to the orbital plane with a mass injection rate motivated by a BHL formalism and a prescribed opening angle and velocity. Shiber et al. (2017) observed a complicated flow morphology and an efficient removal of material due to jet action. Shiber and Soker (2018) concluded that the grazing envelope evolution may substantially delay or even prevent an inspiralling of the companion.

Simulations trying to model the processes leading to the formation of a CE system have to be distinguished from the conditions in which multidimensional hydrodynamic simulations are initialized, which are often chosen for practical and numerical reasons instead of a stringent physical motivation (see Sect. 5.4). Is this a fundamental problem for the credibility of current CE simulations? A look into the currently available simulations and even semi-analytical descriptions suggests that the ability of the system to eject the envelope ultimately deciding between the formation of a compact binary remnant or a merger of the cores is less sensitive than one might expect to the initial conditions of the simulation, such as the degree of co-rotation and the initial distance of the companion from the primary star when setting up global simulations of CEE. Some impact of these parameters, however, is recorded. For example, the exact value of the final orbital separation (Iaconi et al. 2017b) and the rate of orbital decay, do depend on the degree of co-rotation and the initial orbital angular momentum. The extent of these dependencies and whether there are large differences for different systems is not yet established.

Following Iaconi et al. (2018), Reichardt et al. (2019) carried out full CE interaction simulations starting at the time of Roche lobe overflow.Footnote 18 They tested the sensitivity of the outcome of the simulations to the conditions at the start of the interaction. The mass transfer (though Lagrange point \(L_1\)) and mass loss (though \(L_2\) and \(L_3\)) rates were found to be lower for higher resolution and for simulations that were carried out in the corotating frame, while the time before inspiral was longer. As a result, the mass lost before the inspiral was relatively insensitive to numerical conditions. The outcome of the simulations compared to similar ones that did not model the pre-CE inspiral led to the conclusion that the clearest difference is the shape of the expanded and ejected CE, which was found to be more symmetric in simulations that model the pre-inspiral thanks to the interaction with the disk of material formed during the early mass loss. However, it is likely that these conclusions only pertain to the chosen parameter set and cannot be generalized. This leaves us with the question of Sect. 5.4: how should we setup the simulation? Clearly, more work has to be devoted to the onset of CEE and its impact on the processes in the inspiral phase.

6.2 Simulations of the companion–envelope interaction

One of the fundamental questions of CEE is how the companion star interacts with the envelope gas as it passes through it. This question was already addressed in the earliest models of CE phases in binary stellar evolution, that were carried out in 1D in the framework of classical stellar evolution calculations, see Sect. 2.2. The inspiral of the companion was attributed to the action of a hydrodynamical or tidal drag force and analytic approximations (see Sect. 2.2.1) were employed to implement this interaction into CE simulations (Sect. 2.2.2).

The simplistic approximate 1D view on the interaction in CEE, however, diminishes the predictive power of the simulations. Effects that are not or only approximately captured in the basic formalism include density gradients in the envelope, asymmetries, nonlinearities, and the simple fact that not only the companion moves through the envelope gas but both stellar cores orbit each other inside it. To test some of these effects and to improve the accuracy of 1D models, multidimensional hydrodynamic simulations were used to study the interaction of objects with the stream of envelope gas—because of their similarity to technical setups they are sometimes called wind tunnel simulations. In terms of the physics modeling, they are quite similar to the “global” CE simulations in the framework of he basic gravo-hydrodynamic model, that are discussed in Sect. 6.3. There are, however, two important differences: the advantage of “local” wind tunnel simulations is that they potentially can resolve the stellar core and the flow in its immediate vicinity—a region that often remains under-resolved in global simulations because they have to accommodate the entire structure of the giant primary star. Their drawback, however, is that they do not account for the global geometry, the full gravitational potential of the primary, the eccentricity of the orbit, large-scale distortions of the flow of envelope gas, instabilities, and microphysical effects such as the recombination of ions (MacLeod and Ramirez-Ruiz 2015a). Nonetheless, wind tunnel simulations may capture main effects and with their superior spatial resolution they constitute an important complimentary approach to global CEE simulations.

The astrophysical problem of a compact body moving through gas while accreting material and being subject to drag forces is rather ubiquitous. Not all simulations of this type were performed in the context of CE studies. Despite the differences in the setups, however, their results often carry over to the problem at hand. A review of such studies can be found in Edgar (2004). In their Section 3.1, MacLeod and Ramirez-Ruiz (2015a) summarize some of the findings.

Early wind tunnel simulations were carried out by Shima et al. (1985) with a finite-volume discretization of fluid dynamics based on the Riemann solver of Osher (Osher and Chakravarthy 1983) under the assumption of axisymmetry. They tested the analytic prescriptions discussed in Sect. 2.2.1 and studied the details of the flow configurations relaxing the collisionless assumption. Overall, in the case of high-Mach number flows, the gas was found to converge behind the object. A bow shock forms slightly upstream of the body and it encloses the region where gas converges and flows towards the gravitating object, where it is accreted. This confirms the basic picture of BHL accretion. Consequently, Shima et al. (1985) cast their results in the corresponding form of the drag force,

$$\begin{aligned} F_\mathrm{drag} = C_\mathrm{d} \frac{1}{2} \pi R_\mathrm{a}^2 \rho _\infty v_\infty ^2, \end{aligned}$$
(41)

i.e. a variant of Eq. (6), and determined the drag coefficients \(C_\mathrm{d}\) from their simulations with varying Mach numbers of the flows and specific heat ratios of the gas.

3D hydrodynamic simulations including a density gradient in the gas were carried out by Soker et al. (1986) and Livio et al. (1986) with a hybrid particle-grid based scheme, and by Fryxell and Taam (1988) and Ruffert (1997, 1999) with the piecewise-parabolic finite-volume method (Colella and Woodward 1984). These studies were motivated by other astrophysical scenarios and therefore considered shallower density gradients than those expected in CEE. Additional simulations focused on flow instabilities that may occur in the Mach cone behind the moving object (e.g. Foglizzo et al. 2005; Ruffert 1994, 1995, 1996). Armitage and Livio (2000) performed 2D simulations with the finite-volume code zeus (Stone and Norman 1992) to model the accretion during CEE in the context of the formation of black holes.

The treatment of drag forces discussed in Sect. 2.2.1 is based on linear perturbation theory and applies to low-mass perturbers. In CEE, the companion mass is sufficiently large so that we expect the density wakes to be in the nonlinear regime. Following up on their semi-analytical approach (Kim and Kim 2007), Kim (2010) performed 3D hydrodynamic simulations with the zeus code (Stone and Norman 1992) for a massive perturber moving through gas on circular orbits. They found that for supersonic motion a bow shock develops upstream of the perturber through which the flow becomes subsonic. In its immediate vicinity, the perturber was surrounded by a near-hydrostatic spherical envelope, which reduced the drag force below the estimates from linear perturbation analysis, and an extended low-density region trailed the object.

The 3D wind tunnel simulations by MacLeod and Ramirez-Ruiz (2015a) were specifically aimed at CE interaction. They used the flash code (Fryxell et al. 2000) to model a gravitating object (which one can think of as the companion in a CE interaction) represented by a point particle with a softened gravitational potential. The point mass was surrounded by an absorbing boundary so that gravitational softening did not affect the flow. Block-wise AMR was employed and between six and nine levels of refinement were used based on the second derivative of pressure, but still centered at the gravitating object. MacLeod and Ramirez-Ruiz (2015a) pointed out that typical Bondi–Hoyle accretion radii in CE dynamics are much larger than the companions and extend over a substantial density gradient in the envelope. This breaks the symmetry of the flow and leads to an angular momentum barrier impeding accretion onto the companion (with consequences for a potential growth of neutron star masses in CE interaction), while the drag force is only mildly affected. MacLeod and Ramirez-Ruiz (2015a) pointed out that the drag forces observed in their simulations are not dominated by hydrodynamic friction but are of dynamical origin, i.e., they are caused by envelope gas piling up due to gravitational interaction with the companion. They fitted their results to the formalism of Bondi and Hoyle (1944), see Eq. (6). Contrary to the 2D simulations of Armitage and Livio (2000), the 3D simulations of MacLeod and Ramirez-Ruiz (2015a) showed no formation of a persistent disk around the companion. The study of MacLeod et al. (2017a) included the gravitational potentials of both the primary (assuming a planar geometry in the wind tunnel setup) and the companion and extended the parameter range in a systematic way. Different Mach numbers of the flow, density gradients, and mass ratios between primary and companion were tested. Again, the accretion rate was found to be reduced by the angular momentum barrier due to the density gradient. A potential problem of wind tunnel simulations is that the geometry is altered with respect to the situation in a common envelope. As a consequence, the effect of a radially increasing velocity of the material in the rest frame of the companion is not accounted for, which, however reduces the momentum gradient introduced by the density stratification. Therefore, it is possible that the accretion rate does not fall very much below the BHL value, see also Kashi et al. (2022) for a discussion in a different context.

Cruz-Osorio and Rezzolla (2020) presented the first general-relativistic simulations of an accretion flow onto a non-rotating black hole as may be encountered in CE interaction. They performed their simulations accounting for two spatial dimensions in the cafe code (Lora-Clavijo et al. 2015). While in the absence of density gradients, BHL accretion was recovered, for strong density gradients the rates of mass and momentum accretion onto the black hole are increased compared to a Newtonian treatment. Based on this result, a mass accretion rate well above the Eddington limit has been proposed to explain the gravitational wave transient GW190521 (Cruz-Osorio et al. 2021).

The universality of the drag forces determined in wind tunnel simulations remains an open question. Are they sufficient to calibrate semi-analytic 1D simulations so that they gain predictive power? A detailed discussion on the question of which quantities and phases in CEE can be captured this way was presented by Everson et al. (2020). Chamandy et al. (2019) compared the drag calculated using the analytical formalism of MacLeod et al. (2017a) with the drag measured in their 3D global CE simulations of a \({\sim } 2 \, M_\odot \) RGB primary star and a \({\sim } 1 \,M_\odot \) companion. They found that the two quantities match well only up to mid-inspiral. Afterwards, the analytical fit over-predicts the force experienced by the companion in the simulation by up to an order of magnitude. Other 3D simulations compared the measured gravitational drag with different variants of the analytical drag formalism (Sect. 2.2.1) to find reasonable agreement (Reichardt et al. 2019; Staff et al. 2016b). This said, there has never been a comprehensive parameter study nor a systematic comparison between drag estimates and therefore, for the time being, it is impossible to conclude on the extent to which the drag in 3D global simulation matches predictions from analytic formalisms.

In addition to simulations aiming at determining the drag force acting on the companion, studies have been performed that explore the effects of accretion and jet formation. In a series of publications, López-Cámara et al. (2019), López-Cámara et al. (2020), and López-Cámara et al. (2022) report on modeling jets launched from a compact object in a common envelope environment with the Mezcal code (De Colle et al. 2012). The compact object is represented by a point particle and a self-regulated jet is injected through an inner boundary. It is powered by a fraction of the mass accretion rate onto the compact object as measured at that boundary. Different parameters (efficiency of jet launching, inclination angle of the jet) are explored. In some cases, a neutron-star could drive a jet that breaks through the material piled up around it (López-Cámara et al. 2019, 2020). A white dwarf companion star, however needs a very high efficiency to successfully launch a jet and for main sequence stars accretion is found to be too weak so that the jet does not break out of a RG star envelope but is choked (López-Cámara et al. 2022).

6.3 Global CE simulations

Global CE simulations have a history dating back to the 1980s. Much of the early work was published in a series of papers on what was called back then “double-core evolution” by different groups of authors with various numerical methods (Bodenheimer and Taam 1984; Sandquist et al. 1998; Taam and Bodenheimer 1989, 1991; Terman et al. 1994; Taam et al. 1994; Terman et al. 1995; Terman and Taam 1996; Yorke et al. 1995).

The different approaches to numerical fluid dynamics that have been employed reflect the development of similar simulation techniques in other branches of computational astrophysics. CE simulations have benefited substantially from the rapid evolution of computational resources over the past decades, which enabled significant refinement in the physical and numerical modeling. Each of the approaches has its strengths and drawbacks and we gave an account of this in Sect. 4.4.

6.3.1 Pioneering Eulerian grid-based approaches

At a first glance, Eulerian approaches discretizing the equations of fluid dynamics on a static spatial grid may seem little appealing for simulating CEE. Missing obvious symmetries, the grid geometry cannot easily be adapted to the CE dynamics. Moreover, as detailed in Sect. 4.1, such schemes are not Galilean invariant and therefore the representation of physical phenomena, such as hydrodynamic instabilities, may depend on whether the simulations are conducted on a static or rotating frame of reference. Notorious advection errors tend to destabilize orbiting stellar objects and angular momentum conservation is problematic. Nonetheless, some Eulerian grid-based methods have been employed to studying CEE early on, motivated as natural extensions of 1D CE simulations in the drag force formalism. The primary goal was to alleviate a fundamental problem of the 1D models, where gravitational drag luminosity is injected into a spherical layer instead of a local energy deposition as expected to operate around the companion in reality.

To give proper credit to early attempts to simulate CEE in multidimensional hydrodynamic approaches, we start out our treatise with pioneering grid-based simulations. Some of their value lies in the discussion of fundamental processes, that remains valid until today. Many of the employed methods, however, no longer meet modern standards. We therefore refrain from discussing them in detail; they are of historical interest rather than a guide for future developments.

The first 2D simulation of CEE was conducted by Bodenheimer and Taam (1984), who used a “fluid-in-cell” approach to discretize the equations of fluid dynamics and assumed axisymmetry. Their setup system consisted of a \(16 \, M_\odot \) supergiant star, of which only a part of the envelope was modeled, and a \(1 \, M_\odot \) companion representing a neutron star. Interestingly, this early multidimensional model already addressed a situation that—as a progenitor system of a gravitational-wave emitting merger event—is of utmost interest today, but still challenges numerical simulations. The transfer of angular momentum and orbital energy from the companion to the envelope gas was not self-consistently followed, but instead an analytic expression for frictional heating in the Bondi–Hoyle–Lyttleton formalism was applied following Taam et al. (1978); see also Sect. 2.2.1. The gravitational interaction of the cores with the envelope gas was not included in this model. This simulation approach can be seen as a multidimensional generalization of earlier attempts to follow the inspiral of a companion into a giant star in classical 1D stellar evolution codes, such as discussed in Sect. 2.2.2. Bodenheimer and Taam (1984) found that about \(1 \, M_\odot \) of material is ejected in the evolution, preferentially in the direction of the orbital plane. Based on the multidimensional structure of the outflow, they argued that modeling CE events based on energy conservation arguments alone is insufficient. Applying the same numerical method, Taam and Bodenheimer (1989) explored CEE in a system with a \(5\, M_\odot \) RG primary star, whose core is replaced by a point mass to reduce the associated time-scale problem, and a \(1\, M_\odot \) companion. They report a significant mass ejection.

The study of Taam et al. (1994) was performed with the hydrodynamical code of Rózyczka and Spruit (1989) and changed the model of the interaction between the companion and the envelope gas. The orbital decay of the core binary was explicitly prescribed according to angular momentum conservation: The angular momentum of the envelope gas was approximated in a 2D setup that modeled the dynamics in the orbital plane. Its temporal change was equated to the change in angular momentum of the core binary thus providing the evolution of the orbital separation. The in-fall of the companion was not followed completely. Instead, the focus was on simulating the gravitational torques in late stages of CEE of a \(3\, M_\odot \) RG star, whose core was replaced by a point mass, and a companion, whose mass was slowly increased to \(1\, M_\odot \) in a relaxation step. In agreement with the results of the SPH simulation conducted by Terman et al. (1994) (see Sect. 6.3.3), these torques were found to establish co-rotation of the envelope material close to the companion. Taam et al. (1994) suggested this effect to be responsible for the termination of the inspiral phase.

Yorke et al. (1995) used an axisymmetric setup of a \(0.7 \, M_\odot \) main sequence star immersed into the envelope of a \(3 \, M_\odot \) AGB primary to follow later stages of CEE in this system. In contrast to previous simulations, both cores were allowed to move and a nested-grid technique afforded a higher spatial resolution in the inner regions of the CE: eight levels of cylindrical polar grids were used, each smaller by a factor of two in the radial extend than the next higher level grid. The treatment of angular momentum loss of the cores followed that of Taam and Bodenheimer (1991), with some modifications. Yorke et al. (1995) found that in their simulation the entire envelope was likely to be ejected without the cores merging. Orbital decay terminated at a separation of \(15 \, R_\odot \) due to a spin-up to near co-rotation of envelope gas in the vicinity of the cores. Owing to the nested grid approach, the expansion of the ejected material could be followed to relatively large distances and Yorke et al. (1995) commented on the shaping the emerging planetary nebula.

A leap forward in the quality of Eulerian grid-based CE simulations was taken with the 3D hydrodynamic simulations of Sandquist et al. (1998)—reported in the last paper of the series on “double-core evolution”. By abandoning analytic models for the drag force or the orbital decay, the modeling fidelity of physical processes drew level with the SPH simulations conducted slightly earlier by Terman et al. (1994, 1995), Terman and Taam (1996) and Rasio and Livio (1996), (see Sect. 6.3.3). Therefore, the simulations of Sandquist et al. (1998) were the first to model CE self-consistently in a 3D Eulerian grid-based approach. With their nested-grid approach similar to Yorke et al. (1995), but extended to three spatial dimensions in Cartesian geometry, Sandquist et al. (1998) claimed to reach higher spatial resolution than the SPH simulations. The nested-grid hydrodynamics code was based on that of Burkert and Bodenheimer (1993) and employed a second-order finite-difference method to solve the equations of fluid dynamics. To determine the gravitational potential of the gas, the Poisson equation was solved on the coarsest grid with a particle-mesh algorithm. Two collisionless particles were used to model the core of the primary star and the companion. Their mutual gravitational interactions and their interactions with the gas were softened according to Ruffert (1993), with an adaptive reduction of the softening length as the core particles approached each other. The envelope was modeled with an ideal-gas equation of state in combination with radiation pressure. The setups followed the interactions of AGB primary stars of 3 and \(5 \, M_\odot \) with main sequence companions of 0.4 and \(0.6 \, M_\odot \).

Sandquist et al. (1998) found that about 20% to 30% of the envelope gas was ejected at the end of the simulations, but most of the mass, although largely removed from the volume of the original giants, remained marginally bound at larger distances. Because of limited spatial resolution, the core orbit did not completely settle to a final separation, and extrapolating to the further evolution, Sandquist et al. (1998) predicted full envelope removal for their setups with the \(3 \, M_\odot \) primary, while for the more massive AGB star they concluded that a merger of the cores may be possible. The most important result of Sandquist et al. (1998) is perhaps the first detailed description of the dynamical change in the envelope structure due to flows that are clearly not axisymmetric. Their resolution of the coupling between the core particles and the envelope gas allowed to identify for the first time spiral density waves that were generated in front of both stellar cores. Sandquist et al. (1998) concluded that these spiral shock waves were the primary mechanism for transporting the angular momentum released in the core inspiral outwards through the envelope [but see also Rasio and Livio (1996)].

With the same numerical approach, Sandquist et al. (2000) performed a systematic exploration of CEE with RG primaries of different total and core masses with companions of various masses. They found that such low-mass binary systems can survive CEE provided that the total mass of the RG primary is below \(2 \, M_\odot \) and its degenerate helium core exceeds about \(0.25 \, M_\odot \). The remnants of these interactions are associated with observed helium double degenerate systems, pre-cataclysmic variables and subdwarf B stars. With the same code, De Marco et al. (2003a, 2003b) simulated the CE phase between an AGB primary star and companions of 0.1 and \(0.2 \, M_\odot \) as a potential origin of Wolf-Rayet central stars of planetary nebulae.

6.3.2 Modern Eulerian grid-based approaches

Up to this point in the history of Eulerian grid-based CE simulations, the treatment of fluid mechanics followed fluid-in-cell or finite-difference methods that are not commonly in use in modern astrophysical simulations any longer. The advantages of finite-volume techniques and high-resolution shock capturing schemes (see Sect. 4.1.1) were introduced into the field of CE simulations only relatively late compared with other astrophysical applications. This is surprising given the fact that conservation properties and resolution of shock waves are essential ingredients for capturing the dynamics of such events. Simulations performed after Sandquist et al. (2000) can be considered modern efforts: Eulerian approaches stepped up using techniques such as finite-volume methods, Godunov schemes and AMR. As such, they started to flank SPH techniques in addressing the complications of the CE interaction.

The work of Ricker and Taam (2006, already hinted at in Taam and Ricker 2008, whodiscussed some of the technical advantages) introduced the first modern Eulerian grid-based framework for numerical fluid dynamics to CE simulations. The flash code (Fryxell et al. 2000) features the piecewise-parabolic reconstruction method of Colella and Woodward (1984). The use of AMR techniques significantly improves flexibility in spatial resolution over fixed nested grids. This allows one to refine at shock fronts and in the vicinity of the stellar cores. As discussed in Sect. 4.1.1, it is this technique, that ultimately renders Eulerian grid-based approaches to simulating CEE competitive to alternative SPH and moving mesh techniques that we discuss in Sects. 6.3.3 and 6.3.4. However, even with AMR it is impossible to resolve the \(0.36 \, M_\odot \) core of the \(1.05 \, M_\odot \) RG primary star modeled by Ricker and Taam (2008)—in particular in the view of the small time steps required by the CFL condition (see Sect. 5.1). They therefore represented the core of the primary as well as the \(0.6 \, M_\odot \) companion by clouds of \(2\times 10^{5}\) particles each occupying a volume given by a length scale that exceeds the finest grid spacing by a factor of three. The particles are moved rigidly with their centers of mass. Their gravitational coupling is modeled with a cloud-in-cell interpolation and Ricker and Taam (2008) argued that particle clouds avoid force anisotropy problems that would arise from using single particles in this approach.

With their 8-level AMR setup, Ricker and Taam (2008) reached an effective resolution of \(2048^3\) cells over the domain size. Transient motions in the setup of the primary star were damped for one dynamical timescale before the companion was added and the primary was set spinning with an angular velocity of 95% of co-rotation with the orbit (that, if not previously stabilized, would have induced expansion). The simulation of Ricker and Taam (2008) covered only a very short initial phase of CE interaction—less than one orbit of the binary system is followed—but it confirmed the earlier finding of Sandquist et al. (1998) that the orbital decay was dominated by non-axisymmetric gravitational drag, which is one to two orders of magnitude larger than hydrodynamic drag. Moreover, Ricker and Taam (2008) found a much faster orbital decay than predicted from the BHL formalism. This was explained by the fact that within the BHL framework, the predicted gravitational drag is similar to the hydrodynamic counterpart because it is only affected by the local formation of a wake. In CEs, however, this drag is increased by the gravitational forces over a larger volume of the entire envelope. Although Ricker and Taam (2008) emphasized the shortcomings of their model in capturing accretion onto the companion caused by the lack of an inner boundary around it, they argued that the accretion rate onto the companion should be significantly smaller than expected from BHL accretion arguments.

Ricker and Taam (2012) presented an update of their previous work, again employing the flash code, following the same system for somewhat longer times of the evolution, now covering five orbits. They explicitly mentioned the treatment of self-gravity in this simulation: the Poisson equation was solved with a multigrid method (see Sect. 4.3.2). The number of particles used to represent the stellar cores was increased to \(2\times 10^{5}\) for each cloud and 9 levels of AMR were used. Ricker and Taam (2012) reported an ejection of 25% of the envelope’s mass over the simulated time, higher than reported by Sandquist et al. (2000), and possibly caused by a larger mass ratio between primary star and companion in their system. They further noted a rapid decrease of the eccentricity of the orbit and identified imprints of spiral shocks on the morphology of the envelope gas that was expelled preferentially close to the orbital plane. Again, they confirmed that gravitational drag dominates over hydrodynamic drag and emphasized that the BHL prescription overestimates the accretion rate onto the companion.

Recently, the same group, still using flash, has been attempting the simulation of CEE in more massive systems. There is so far only one brief publication (Ricker et al. 2019b) presenting a simulation of CE interaction with an \(82\, M_\odot \) red supergiant primary star of radius of \(2891 \, R_\odot \) at low metallicity, deriving from an \(88 \, M_\odot \) main sequence star. The companion was a \(35 \, M_\odot \) point particle, supposed to represent a black hole. This simulation included for the first time both the effects of partial ionization, via a suitable equation of state (see Sect. 4.2) and the effects of radiation, via a single-group, flux-limited diffusion approximation. Interestingly, Ricker et al. (2019b) concluded that envelope unbinding is not benefiting from recombination energy. Clearly, these simulations are critical to answer the question of whether double black hole binaries that merge under the emission of detectable gravitational waves can be formed via an isolated binary channel (Belczynski et al. 2016), but more work is needed to confirm the still very preliminary results of Ricker et al. (2019b).

The next grid-based code to be exercised on the CE problem was enzo (Bryan et al. 1995). This code was originally developed for cosmological simulations and Passy et al. (2012) adapted it to the stellar problem. Core and companion were modelled as point masses with the usual softening of the gravitational potentials (see Sect. 4.3.3). Self-gravity was implemented with a fast Fourier transform technique (see Sect. 4.3.2), while the gravity of the two point masses was treated analytically by adding the (softened) potential to that calculated for the gas. Starting out from a 1D stellar model, Passy et al. (2012) mapped a \(0.88 \,R_\odot \), \(100 \,R_\odot \) RGB star with a core of \(0.392 \, M_\odot \) onto a grid without any additional levels of refinement. Two resolutions with \([128]^3\) and \([256]^3\) cells were used. They carried out five CE simulations for each resolution with companion masses of 0.1, 0.15, 0.3, 0.6 and \(0.9 \,M_\odot \) and two additional low-resolution simulations to test the effects of the initial orbital separation and eccentricity. The companions were initialized on the stellar surface.Footnote 19 One finding of these simulations was the—perhaps expected—realization, that in none of them the entire CE became unbound.Footnote 20 The range of final separations was \({\sim }\, 6\) to \(30 \, R_\odot \), with wider final separations for more massive companions. The most important achievement of this study, however, was a direct comparison between Eulerian grid-based and SPH (see Sect. 6.3.3) approaches to CE simulations, which used the snsph code of Fryer et al. (2006). This paper also raised some questions which remain unanswered to this day. The most pressing of them is whether the final separation of the stellar cores measured in the simulations is the actual post-CE separation. The values determined from the simulations appeared to be on the high side of observations and it was therefore concluded that in post-dynamic inspiral phase the companion would migrate inwards.

The enzo code was the basis for a number of follow-up papers, which, as an upgrade, used its AMR capability and the adaptive particle-mesh solver of Passy and Bryan (2014). Iaconi et al. (2017b, 2018) modelled the same primary as Passy et al. (2012), but this time fully investigated the effect of initial orbital separation. They concluded that starting the simulation at a wider separation (approximately that of the start of Roche lobe overflow) does result in a somewhat wider orbital separation due to the giant expanding before the fast inspiral rather than spinning up. They too carried out a comparison with an SPH simulation (see Sect. 6.3.3), this time with the phantom code (Price et al. 2018). In a subsequent paper, Iaconi et al. (2018) compared results from setups identical to those of Passy et al. (2012) with simulations in which the primary was a more massive (\({\sim } 2 \,M_\odot \)) AGB star. The reasoning was that if the envelope was more massive it would expand more reluctantly and allow the companion to sink deeper. This was expected to cause an increased transfer of orbital energy to the envelope. While companions did spiral in deeper, no substantial increase in unbound mass was observed: in both the original setup and in the simulations involving an AGB primary star, the unbound mass fractions ranged between a few and about 15 percent.

Staff et al. (2016b) carried out enzo-based CE simulations involving a \({\sim }\, 3 \, M_\odot \) AGB star and companions between 0.6 and \(3.0 \, M_\odot \) with a range of eccentricities. Their aim was to understand systems such as the protoplanetary nebula OH 231.8+4.2. These had been suggested to result from a CE interaction in an eccentric binary. On the one hand, these simulations were used primarily as platforms for a series of analytical discussions on the ability of the companion to launch a jet before the actual CE interaction, that would result in the observed nebular energetics. On the other hand, these simulations were among the few that started out with high eccentricities in the initial system, AGB primary stars, and stellar masses above the common \({\sim }\, 1 \, M_\odot \). With the relatively low resolution achieved in these simulations, however, it remained difficult to put the results appropriately into context. Most of the envelope mass remained bound (again, between a few and about 15 percent of the material was unbound) and the separation still ranged on the wide side compared to observations. Moreover, the study concluded that if mass transfer takes place at periastron passage, the orbital elements are altered and it is likely that these orbital changes lead to a CE within a short period of time. This means that it is unlikely that objects like OH231.8+4.2 could be formed by repeated jet episodes that take place during periastron passage.

In a companion paper, (Staff et al. 2016a) used the same \(3 \, M_\odot \) AGB primary star as well as an RGB star of similar mass to determine the outcome of planetary intrusions into the envelopes of giants. Somewhat unsurprisingly the conclusion was that planets would inspiral and merge with the core within a decade (RGB star) to a century (AGB star). Considerable angular momentum would be added the the envelopes of the giants which would expand somewhat and spin up to values commensurate with the fastest rotating giant stars observed by de Medeiros et al. (1996).

Fig. 13
figure 13

Image reproduced with permission from Chamandy et al. (2020), copyright by the authors

CEE simulations with an AGB (top panels) and an RGB (bottom panels) primary star. Shown are slices after ten orbits of the core binary system through the orbital plane (left) and perpendicular to it in density (left panels) and total energy (right panels, where blue is bound gas while red is unbound).

Also using the version of enzo adapted by Passy et al. (2012), Shiber et al. (2019) carried out a simulation using the same star used by Passy et al. (2012). This time, however, the effect of jets was explored, that are potentially launched by the companion throughout the inspiral. In particular, the focus was on whether such jets enhance envelope unbinding. The jets were not self-consistently simulated, but were instead launched according to analytically derived quantities such as mass loss rate, launch speed and opening angle. The outcome of the simulation was not dramatically different from the equivalent simulation without jets: the final separation was somewhat wider and additional envelope gas was unbound (the unbound mass increased from \(\sim \,\)10% without jets to \(\sim \,\)30% with jets). This indicated that while jets may aid envelope ejection, it seems unlikely that they can fully explain it.

Schreier et al. (2019) explore the effect of jets in CEE of a triple system: a tight binary system is placed into the envelope of a \(4 \, M_\odot \) AGB star with \(100 \, R_\odot \). The inner \(5 \, R_\odot \) are replaced with a sphere of constant density, pressure, and temperature. The binary system is not resolved; one of its stars is assumed to accrete material and to launch two jets in opposite directions with an inclination relative to the orbital plane of the binary and the core of the AGB star. In the simulation, the jets are injected with an inclination angle of \(45^\circ \) at the location of the binary system. The simulation is carried out with the Pluto code (Mignone et al. 2012) on a cubical domain with \(400 \, R_\odot \) side length covered with 48 cells and three to four levels of AMR. Self-gravity is not accounted for in the setup: gravitational effects of the tight binary system and of the deformed envelope are ignored. Schreier et al. (2019) observe vortices and associated density fluctuations perturbing the envelope structure and discuss implications for dust formation and the shaping of “messy” PNe. The follow-up studies of Schreier et al. (2021) and Schreier et al. (2023) were carried out with the Flash code (Fryxell et al. 2000) in similar setups but with a more massive primary star of a zero-age main sequence mass of \(15 \, M_\odot \) evolved to a red supergiant stage (\(M = 12.5 \, M_\odot \), \(R = 881 \, R_\odot \)). To avoid prohibitively small time steps in the simulation, the inner 20% of the stellar radius are replaced by an inert core. The AMR capabilities of the Flash code are used. Schreier et al. (2021) assume a neutron star companion that passes through the envelope of the giant on a highly eccentric orbit—an event Gilkis et al. (2019) call a “common-envelope jets supernova impostor”. The neutron star is modeled as a point particle and the jets are launched artificially “by hand”. Again, neither gravity of the neutron star nor self-gravity of the envelope are included in the model such that no gravitational drag acts on the companion. Only one orbit of it is simulated. A complicated clumpy outflow morphology is detected and the luminosity of the event is estimated to place it into the regime of “gap transients” between classical novae and supernovae. Schreier et al. (2023) explore the deposition of angular momentum into the envelope due to jets that are launched perpendicular to the orbit and due to tilted jets (motivated by the triple scenario where the companion neutron star or black hole is part of a tight binary system).

Another set of grid-based CE simulations was carried out with the AMR code AstroBEAR (Carroll-Nellenback et al. 2013). A few studies have been published so far, concentrating on the analysis of two primary stellar structures and a range of companions. The two structures are an RGB and an AGB star deriving from a \(2 \, M_\odot \) main sequence star, with radii of \(49 \,R_\odot \) and \(122\,R_\odot \), respectively (Chamandy et al. 2018, 2020). All simulations initialized the companion approximately at the stellar surfaces.

Chamandy et al. (2018) benchmarked AstroBEAR against a similar simulation carried out with the moving mesh code arepo (Ohlmann et al. 2016a, see Sect. 6.3.4). They also investigated the amount of accretion that would likely take place onto the companion—a very important topic, particularly in the massive-star regime when massive companions may generate large amounts of feedback energy. They concluded that the amount of accretion cannot be estimated just using control surfaces around the companion because a high-pressure pseudo-atmosphere that settles around the point mass companion and reduces the accretion. Chamandy et al. (2018) suggested that the introduction of mass “disappearance” likely results in a more realistic outcome and that high accretion rates (\({\sim } \, 1 \,M_\odot \, \mathrm{yr}^{-1}\)) could exist during the short-lived inspiral phase. In the simulation, this was implemented with a subgrid-scale accretion model. Following Krumholz et al. (2004), the companion was represented by a sink particle in one of the runs. The simulations were also used to draw a comparison between the gravitational drag force measured in the simulation and what would be derived using the analytical approximations of MacLeod et al. (2017a). Chamandy et al. (2018) concluded that the simulated force was similar to the analytical prescription only early on and until mid inspiral, but diverges later with the simulated force being much smaller than the analytical approximation.

Chamandy et al. (2020) were first to model CEE of a low-mass AGB star with a \({\sim } \, 1 \, M_\odot \) companion. The conclusions that they could draw from a comparison of their RGB and AGB simulations was that the two were remarkably similar (see Fig. 13). However, both simulations were started with the companion at the surface, not accounting for the redistribution of gas that takes place when the simulation is started at the time of Roche lobe overflow. Only a fraction of the envelope mass was unbound during the simulated time, but Chamandy et al. (2020) estimated a full envelope ejection over 10 years if the rate of mass unbinding measured in the simulations stayed constant.

Zou et al. (2022) modified the setup of Chamandy et al. (2018) that, with a \(2\, M_\odot \) RG primary star and a \(1\, M_\odot \) or \(0.5 \, M_\odot \) companion, was similar in the parameters and the treatment of the RG core to that of Ohlmann et al. (2016a) but used the AstroBEAR code. They included a jet launched via a subgrid model from the companion. This model injects mass at a chosen constant rate with a certain velocity perpendicular to the orbital plane into a prescribed opening angle. Comparing this model to simulations without jets, the influence of a potential jet on orbital evolution and the morphology and unbinding of the envelope is explored and the parameters of the jet model are tested. The jets were found to be choked in the envelope and transferred additional energy onto it so that the unbound mass was increased by 10% over the ten simulated orbits compared to simulations without jets. Based on this result, Zou et al. (2022) expect that jets launched from main sequence or white dwarf companions are unlikely to dominate envelope unbinding.

Except for the study of Ricker et al. (2019b), none of “modern” Eulerian grid-based simulations of CEE accounted for ionization effects in the envelope material. None of them achieved a successful envelope ejection over the simulated time; the unbound mass fraction typically stayed below \(\sim \)20%.

6.3.3 SPH approaches

In logical continuation of previous 1D models, early Eulerian grid-based approaches to simulating CEE (see Sect. 6.3.1) modeled the interaction of the companion with the envelope by explicitly imposing a drag force on it. SPH simulations, in contrast, from the start relied on a self-consistent treatment of this interaction by implementing self-gravity. Although with their limited resolution simulations carried out in the 1980s and 1990s failed to converge in reproducing the effect, with increasing computer power this approach became gradually more realistic. In this sense, the development of SPH methods for CE simulations was not subject to breaks and breakthroughs in the modeling technique itself—although an efficient parallelization of the SPH framework to distributed memory machines is not trivial and was achieved only in the early-to-mid 2000s (e.g. Fryer et al. 2006; Springel et al. 2001; Springel 2005). It paved the way to increasing the resolution of the simulations, but still today not all SPH-based CE simulations are carried out with MPI parallelization.

The application of SPH for simulating the onset of CEE was pioneered by de Kool (1987). He modelled the interaction of a \(11 \, M_\odot \) giant with a \(4 \, M_\odot \) companion star. Only 600 particles were used to represent the envelope of the primary star assuming a polytropic equation of state while its core and the companion were modeled by single particles. The setup was obtained from relaxing the stellar envelope to hydrostatic equilibrium and—for the initial binary setup—by slowly reducing the separation between the interacting stars. This setup procedure is largely followed in SPH-based CE simulations to this day. Livio and Soker (1988) simulated CEE in a hybrid “particles in cell” (PIC) discretization of the equations of fluid dynamics, which combines a pseudo-particle approach with an Eulerian grid and thus differs from the SPH formalism.

The increase of computational power and improvements in numerical methods—most notably the introduction of a hierarchical tree algorithm for calculating self-gravity—allowed to conduct more detailed 3D CE simulations with SPH. For the first time, and in contrast to contemporary grid-based Eulerian simulations (see Sect. 6.3.1), such simulations were able to follow the inspiral of the companion into a giant primary with the gravitational interaction between the cores and the envelope gas captured by the model instead of using an analytic prescription for a drag force.

Terman et al. (1994) discretized the co-rotating envelope of a \(4.67 \,M_\odot \) RG primary mapped from a polytropic model using 10 000 SPH-particles. After random initial placement of the particles, frictional damping established HSE. The core of the primary star as well as the \(0.94 \, M_\odot \) companion were represented by single massive collisionless particles. A fictitious drag force was applied only initially to bring the binary system into the CE stage—the actual CEE was followed self-consistently with the drag force resulting from the modeled interaction. With this setup, Terman et al. (1994) demonstrated that gravitational tidal torques cause rapid orbital decay of the core binary after the onset of CEE. The evolution of the system was followed for \({0.6}\,{\mathrm{yr}}\) when the orbital separation settles to about \(6 \, R_\odot \) because of a spin-up of the gas in the vicinity of the cores approaching co-rotation. This simulation exploited the capability of SPH-based approaches to follow the inspiral phase over many orbits. It was eventually terminated because the gravitational softening of the core particles became larger than their separation rendering the model nonphysical. Only about 13% of RG envelope mass was ejected to this point. Based on their simulations, Terman et al. (1994) discussed the importance of the 3D response of the envelope to the motion of the binary composed of the giant’s core and the companion, pointing out deficiencies of models that assumed an inspiral of a companion star into a fixed core–envelope primary structure.

Terman et al. (1995) extended their numerical approach to simulating the inspiral of a \(1.4 \, M_\odot \) neutron star into massive primaries of 16 and \(24 \, M_\odot \) in various evolutionary stages. These simulations exploited the efficiency of the SPH approach to simulate CEE, although the achieved resolution was insufficient to accurately separate the core–envelope structure of the primary stars, which, with the given parameters, remains a challenge even for current simulations. For some of the considered systems, a mass ejection efficiency of \(\sim \)30%–40% was reported. Terman et al. (1995) pointed out that the survival of the core binary, as opposed to a merger of the neutron star with the primary’s core potentially forming a Thorne–Żytkov object (Thorne and Zytkow 1975), depends on the structure and evolutionary stage of the non-compact star.

Terman and Taam (1996) relaxed their assumption of a polytropic equation of state to include both gas and radiation pressure in simulations of systems with a \(5 \, M_\odot \) RG and companions with 0.5 and \(1.0 \, M_\odot \). Again, 10 000 SPH-particles were used for modeling the RG envelope, which, in this suite of simulations, was set up as spherical and non-rotating. The size of the cores was reduced with respect to the simulations of Terman et al. (1994), allowing the simulations to follow the inspiral for longer, which resulted in the ejection of up to 70% of the envelope gas.

Rasio and Livio (1996) used up to 50 000 particles to follow the onset of the unstable mass transfer and initial inspiral of a \(0.7 \, M_\odot \) main sequence star into a RG of \(4 \, M_\odot \) until a quasi-static CE had formed. They pioneered the construction of a rotationally synchronized binary system in HSE by means of a relaxation and damping procedure—in contrast to Terman and Taam (1996) and without the need of applying an initial fictitious drag force as in Terman et al. (1994). The core of the primary star and the secondary were modeled as point particles and their gravitational potentials were softened over a length comparable to the SPH smoothing length of the innermost particles, typically a hundredth of the radius of the RG primary (which is similar to what Terman and Taam 1996, used). Under this assumption, the core of the primary star is much larger than in reality. In their simulation, Rasio and Livio (1996) identified a co-rotating region of gas around the central binary and found indication for the onset of convection in the envelope in agreement with the predictions of Meyer and Meyer-Hofmeister (1979). Only about 10% of the envelope material was unbound—most likely because of the establishment of co-rotation in late stages of the evolution as opposed to the findings of Terman and Taam (1996) whose models eject a substantial fraction of the envelope. Rasio and Livio (1996) attributed this discrepancy to differences in the spatial resolution, but as neither the numbers of particles nor the sizes of the core models differ significantly, this interpretation appears questionable.

In their paper comparing CE simulations carried out with a grid-based Eulerian code (see Sect. 6.3.2) and SPH, Passy et al. (2012) employed the snsph code of Fryer et al. (2006). It adopts a distributed-memory parallelization (Fryer et al. 2006) and therefore allowed to conduct simulations with enhanced resolution. snsph uses a special tree-based method (a parallel hashed oct-tree, Warren and Salmon 1993) to calculate gravitational accelerations. As in their grid-based counterpart simulations, Passy et al. (2012) followed the interaction of a non-rotating \(0.88 \, M_\odot \) RG primary star of \(83 \, R_\odot \) with companions of masses between 0.9 and \(0.1 \, M_\odot \) that were initially placed at the primary’s surface in a circular orbit and were modeled as collisionless particles. These simulations were set up as close as possible to the counterpart grid-based enzo simulations (see Sect. 6.3.2). The envelope, modeled with an ideal-gas equation of state, was represented by an unprecedented number of 500 000 SPH-particles, that were initially placed with a weighted Voronoi tessellation. In contrast to other setups, the core of the giant primary star was treated as a massive SPH particle of \(0.392 \, M_\odot \) and not as a collisionless particle, such that its pressure stabilized the envelope against gravitational collapse. It was placed at the center, embedded in a region with SPH-particles, such that the profile of density connected smoothly at the core-envelope boundary, which was located at twice the smoothing length of the core particle, i.e. \(0.2 \, R_\odot \). Therefore, the interaction of the core with the envelope gas was better resolved than in any of the previous SPH simulations of CEE. The simulations of Passy et al. (2012) followed the evolution until the orbital separation and the mass of the unbound envelope gas saturated. The amount of envelope gas ejected during the simulation varied with the mass ratio and was expelled mostly close to the orbital plane. It remained below 10% in all cases and the final orbital separations between the core particles were systematically larger than those found in observations of post-CE systems. Passy et al. (2012) discussed additional physical effects that may increase the envelope ejection efficiency. They emphasized the capability of the SPH method to model the accumulation of gas around the companion star—a direct implication of the Lagrangian nature of the scheme in which the spatial resolution automatically adapts to the mass distribution.

The next group to simulate CEE with SPH codes were Nandez et al. (2014), who modelled the interaction in system V1309 Sco (a \(1.5 \, M_\odot \) subgiant and a \({\sim }\, 0.15 \, M_\odot \) main sequence star; Tylenda et al. 2011), using the SPH code starsmasher (Lombardi et al. 2011). In this simulation, the two stars were spatially resolved because of their relatively similar sizes (with particle numbers ranging from 20 000 to 200 000 for the primary star and from 2000 to 19 000 for the companion), and the interaction lead to a merger.

V1309 Sco is a particular system and perhaps not a clear CE case (see Sect. 1.2). A more traditional CE interaction was later simulated by the same group (Nandez et al. 2015) with the goal of modeling the double white dwarf system WD 1001+364. For this purpose, the core of the RG primary was selected to be \(0.32 \, M_\odot \) (slightly larger than the value of the original 1D stellar profile in order to match the envelope structure) and represented by a point mass interacting only gravitationally. The \(0.36 \, M_\odot \) companion was also modeled as a point particle. Various masses between 0.668 and \(1.481 \,M_\odot \) were assumed for the RG envelope and resolved with 100 000 particles; one run was carried out with twice this resolution. Nandez et al. (2015) were the first to model the effect of recombination processes in a 3D CE simulation. For that purpose, they adapted the mesa equation of state (Paxton et al. 2011), that accounts for changes in the ionization structure by implementing the opal tables, see Sect. 4.2. They found that while simulations of the basic gravo-hydrodynamic model removed only about 50% of the envelope mass, complete envelope ejection could be achieved when assuming the released recombination energy to thermalize locally.

The same approach was used by Nandez and Ivanova (2016) for a range of primary RG stars with masses of 1.2 to \(1.8 \, M_\odot \) and companions with masses of 0.32 to \(0.40 \,M_\odot \) meant to be white dwarfs and modelled as point particles that interact only gravitationally, as did the cores of the RG primaries. The resolution of 100 000 SPH particles was similar to the production runs in Nandez et al. (2014). Almost complete mass ejection was obtained thanks to their use of the tabulated equation of state that includes recombination energy. Their simulations were then used by Ivanova and Nandez (2016) to infer a number of parametrizations to be used, e.g., in population synthesis studies.

Iaconi et al. (2017b) carried out a simulation of CE interaction using the same setup as Passy et al. (2012), but with a wider initial separation between the primary star and the \(0.6 \, M_\odot \) companion. They used the shared-memory (OpenMP) parallelized SPH code phantom of Price et al. (2018). This time, both the core of the primary and the companion were modeled as collisionless massive single particles. For gravitational softening, the prescription of Ruffert (1993) was applied instead of the previously used formulation of Monaghan (1992). The envelope was represented by one million particles. Both the obtained post-CE orbital separation and the amount of unbound gas (\(\sim \)16% of the initial envelope material) were found to be slightly larger than those of Passy et al. (2012).

Reichardt et al. (2019) followed up on these studies and simulated CEE with the phantom code again in a system similar to that of Passy et al. (2012). Their resolution varied between \(8\times 10^{4}\) and \(1.1\times 10^{6}\) SPH particles representing the envelope of the RG primary star, which for one of their simulations was set up to co-rotate with the binary system. In contrast to previous simulations, the initial binary separation was chosen such that the RG primary star just filled its Roche lobe and mass transfer started immediately. This way, Reichardt et al. (2019) extended the simulation to the time before the inspiral, which was possible thanks to the excellent angular momentum conservation of SPH-based simulations (see Sect. 4.4.3). While the duration of the pre-inspiral evolution was found to be resolution-dependent, this simulation paves the way for the study of the impact of the initial conditions on the CEE. Moreover, mass lost over the \(L_2\) and \(L_3\) Lagrange points of the system before the inspiral was found to remain bound and to potentially form a circumbinary disk. This disk was destroyed in the subsequent CE ejection, but the authors speculated about its survival for other system parameters. The measured drag force in the CE inspiral phase was consistent with analytical models, but only a small fraction of the envelope material (about 10% to 30%) was ejected—confirming previous simulations that indicated less unbound mass for increasing numerical resolution.

Reichardt et al. (2020) equipped the phantom SPH code with an equation of state that can account for changes of the ionization structure of the envelope material. With this modification and assuming local thermalization of the released recombination energy, they carried out two simulations with RG primary stars of \(0.88 \, M_\odot \) and \(1.8 \, M_\odot \) and companions of \(0.6 \, M_\odot \) and \(0.36 \, M_\odot \), respectively. The latter configuration was the same as one of Nandez and Ivanova (2016), who claim complete envelope ejection for this case. In agreement with Nandez and Ivanova (2016), Reichardt et al. (2020) found that including recombination effects leads to a dramatic increase in envelope ejection. The system with the less massive primary star achieved complete envelope ejection, promoted by the release of both helium and hydrogen recombination energy. The model with the more massive primary, unbound more mass, seemingly at the hand of helium recombination energy (see Fig. 14), but the system did not achieve complete envelope ejection, contrary to Nandez and Ivanova (2016). The cause for this discrepancy is the definition of unbound gas (see also Sect. 3.4.1): When including recombination energy in the definition, effectively the entire envelope becomes unbound. If instead only the thermal energy is accounted for, the conclusion is that no more than 37% of the envelope are unbound. Moreover, Reichardt et al. (2020) discussed that while the hydrogen recombination energy may be more readily lost into space, helium recombination energy is much less prone to be radiated away, because it takes place deeper in the envelope, and it is therefore more likely to partake in the envelope ejection. Finally, they pointed out that the formation of dust in the expanded envelope is extremely likely. This could change the game-plan for the interaction. Reichardt et al. (2020) compared their simulations accounting for recombination energy release and assuming its local thermalization to counterparts carried out with an ideal-gas equation of state (that do not account for these effects). They found that the final orbital separation was almost unaffected by the equation of state and by the success of envelope ejection.

Fig. 14
figure 14

Image reproduced with permission from Reichardt et al. (2020), copyright by the authors

Correlation between unbinding of gas and recombination zones in the simulations of Reichardt et al. (2020) with a \(0.88 \, M_\odot \) (left) and a \(1.8 \,M_\odot \) RGB (right). The locations and times at which SPH particles became permanently unbound are plotted in black. The coloured zones represent the partially ionized regions of H and He gas. The black line indicates the distance between the stellar cores.

An efficient SPH code with parallelization on distributed memory architectures is gadget2 of Springel (2005). It was originally developed for cosmological simulations and has been applied to simulating CE interaction. Glanz and Perets (2018) pointed out the potential importance of dust formation for CEE based on a simulation with gadget2. They set up a solar-like star and evolved it to the RG stage (\(R_\star = 83 \, R_\odot \), core mass \(M_\mathrm{core} = 0.39 \, M_\odot \)) with the mesa code. The CEE with a main sequence companion was then simulated with gadget2, but Glanz and Perets (2018) give little details about the setup and the numerical treatment. The structure resulting from the CE simulation was compared to the structure of an AGB star and it was concluded that large parts of the envelope meet the conditions for dust condensation.

A similar approach was taken by Glanz and Perets (2021a) to model CEE in binaries with eccentricities of \(0 \le e \le 0.95\). Primary stars of \(1\, M_\odot \), \(4\, M_\odot \), and \(8\, M_\odot \) were evolved to the RGB stage with mesa (core masses of \(0.39\, M_\odot \), \(0.48\, M_\odot \) and \(1.03\, M_\odot \), respectively), the intermediate-mass model was in addition followed to the AGB stage. The stellar envelopes were mapped to distributions of 250 000 SPH-particles assuming an ideal-gas equation of state, while the cores were represented by point particles. For the mapping, the amuse framework of Portegies Zwart et al. (2009) was used and the obtained configuration was relaxed in a damping procedure (Glanz and Perets 2021b). Companions of \(0.6 \, M_\odot \) were added with varying eccentricities to the two lower mass primary star models, while for the high mass model a companion of \(2 \, M_\odot \) was chosen. These were modeled as point particles interacting only via gravity. In their simulations, Glanz and Perets (2021a) found that that the initial eccentricities only partially circularize. Because of the closer initial approach of the cores, more mass was unbound in highly eccentric systems compared to circular setups. However, no matter what setup was used the unbound mass was between \(\sim \)5% to \(\sim \)25%, typical values for all simulations that use an ideal-gas equation of state.

Glanz and Perets (2021b) later used similar tools to simulate CEE in a triple system in the “circumstellar” case, where a compact binary system (corresponding to the inner binary in a hierarchical triple) orbits in the envelope of a giant. In addition to the construction of the primary star models with mesa and the mapping and relaxation in the gadget2 computational domain, however, they modeled the dynamics of the binary companion system inside the potential of the primary giant star with the N-body code huayno (Pelupessy et al. 2012), likewise integrated in the amuse framework of Portegies Zwart et al. (2009). As models for primary stars, a \(2 \, M_\odot \) and an \(8\, M_\odot \) star were evolved to the RG stage (core masses of \(0.36 \, M_\odot \) and \(1.03 \, M_\odot \), respectively). For mapping these models into the SPH code gadget2, resolution tests were carried out with 100 000, 250 000, and 500 000 SPH-particles representing the envelope of the giant primary star. For the production runs, Glanz and Perets (2021b) settled to a resolution of 250 000 particles. The masses of the objects in the close binary companion system were set to \(0.6 \, M_\odot \) and \(0.4 \, M_\odot \) for the lower mass primary star and to \(1\, M_\odot \) for both objects when interacting with the more massive primary star. For the fate of this compact binary system, two cases were observed: a merger inside the envelope of the primary star and a disruption which—together with the core of the primary star—leads to chaotic triple dynamics. In the latter case, typically one of the former close-binary components was found to eventually merge with the core of the primary star, while the second component is ejected or continues “classical” binary CEE. The effect of a compact binary companion system in the case of triple-CE interaction was a slower inspiral and an increased mass ejection—attributed to the extraction of energy and momentum from the compact binary companion. Whereas comparison simulations with classical binary CE setups resulted in ejecting about 10% of the envelope mass (a typical value for simulations assuming an ideal-gas equation of state and not considering ionization effects), the triple systems unbound 11% to 28% of the envelope mass. Glanz and Perets (2021b) commented about the imprints of the altered triple dynamics on the morphology of the ejected material.

Recently, Lau et al. (2022a) carried out an SPH simulation using phantom of a \(12 \,M_\odot \) star and companions of \(3.0 \, M_\odot \) and \(1.26 \,M_\odot \), located at an orbital separation such that the primary just filled its Roche lobe (for their lower-resolved simulations with 50 000 and 500 000 SPH particles) or overfilled the Roche lobe by 25% (for their higher-resolution simulations, two million particles, which would have been unfeasibly long if started farther apart). These simulations were among the first modern attempts to model CE interaction with a massive primary star. Comparisons were carried out using three equations of state: an ideal gas, an ideal gas plus radiation, and a “full” equation of state that included the effects of recombination. The final separation of the binary was of the order of 30–\(44 \,R_\odot \) (for the \(3.0 \,M_\odot \) companion; the other companion sinks below the sum of the softening lengths of the core and companion, where the interaction is not reliable). Compared to simulations with a simple ideal-gas equation of state, including radiation pressure resulted in separations larger by about 10% and accounting for recombination energy enlarged the final separations by another \(\sim \)20%. The highest-resolution simulations with the \(3.0 \,M_\odot \) companion unbound 18%, 28% and 60% of the envelope for the ideal gas, ideal gas plus radiation, and full equations of state, respectively (using a criterion that accounts for mechanical and thermal energy, see Sects. 3.3 and 3.4.1). The measurement of the unbound mass was taken at a particular point after the inspiral, not at the end of the simulation. The additional unbound gas in the case of the a full equation of state derived from the thermalization of the helium recombination energy, which, even if radiation transport were included, was released in the deep layers and is unlikely to escape. For the full equation of state, three quarters of the envelope were unbound by the end of the simulation and mass unbinding still continued at 0.2 \(M_\odot \) yr\(^{-1}\), demonstrating that the envelope was likely to become completely unbound.

Finally, Lau et al. (2022b) studied the effects of hydrogen, helium and molecular hydrogen recombination energy on the same structure as that investigated by Lau et al. (2022a). They concluded that helium recombination energy alone, already unbinds 30% more gas than an ideal-gas equation of state and that the delivery of that energy is so deep in the envelope that it is highly likely that the entire payload can be thermalized and eventually converted to work. Somewhat more surprisingly, this is also so for hydrogen recombination energy. Only a fraction of the hydrogen recombination energy is needed to unbind the envelope and the delivery depth is such that, once again, we would conclude that it would be mostly thermalized locally and not escape. For a 12 \(M_\odot \) common envelope it is therefore to be concluded that recombination energy may well help unbind effectively the entire envelope.

6.3.4 Moving-mesh simulations of the common-envelope interaction

In Sect. 4.1.3 we have described the moving-mesh approach to hydrodynamical simulations. Based on its implementation in the arepo code of Springel (2010a), Ohlmann et al. (2016a) simulated the dynamical inspiral of a \(1 \, M_\odot \) companion into a RGB primary star of \(2 \, M_\odot \) with a \(0.4 \, M_\odot \) core. This rather standard setup was chosen because the scale problems discussed in Sect. 3 are less pronounced with a RG primary than, e.g., with an AGB star. The simulation is illustrated in Fig. 15. It demonstrated the advantages of using a moving mesh approach. The method allowed to follow the evolution for many orbits extending over the initial plunge-in phase into a regime where the orbital separation of the cores changed only very slightly. This was not only enabled by the efficiency of the method but also by its excellent conservation of angular momentum and energy lending credibility to the results even in late stages of the evolution. As discussed in see Sect. 4.4.3, this advantage derived from the almost Lagrangian nature of the scheme. At the same time, the Godunov approach to compute fluxes in the underlying finite-volume discretization facilitated high spatial resolution and captured hydrodynamical instabilities better than SPH methods. This allowed the authors to detect large-scale flow instabilities between adjacent layers of the spiral shock after about 20 orbits that were not noticed in earlier simulations. This effect ultimately lead to turbulent convection in the envelope. The simulation of Ohlmann et al. (2016a), however, failed to unbind the envelope. Only about 8% of the material was ejected. This failure of the gravo-hydrodynamic model triggered the inclusion of additional effects into moving-mesh CE simulations.

Fig. 15
figure 15

Image reproduced with permission from Ohlmann et al. (2016a), copyright by AAS

Time series of density cuts through the orbital plane during the inspiral simulated with the moving-mesh code arepo. The positions of the core of the RG primary star and the companion are marked by a “\(+\)” and a “\(\times \)”, respectively. The inset in the last panel shows the central region with a diameter of about \(20 \, R_\odot \). Again, density is color-coded and ranges from \(10^{-6}\) to \(10^{-3}\, \mathrm{g}\,\mathrm{cm}^{-3}\).

The first MHD simulation of CEE was carried out by Ohlmann et al. (2016a). It showed that tiny initial magnetic fields are strongly amplified in the evolution. While previous studies speculated about dynamo processes in the differentially rotating envelope (Regős and Tout 1995), magnetic field generation in an accretion disk formed from a tidally disrupted companion (Nordhaus et al.