Skip to content

Gear star formation split

Loic Hausammann requested to merge gear_sf_split into master

Here is my implementation of partial star formation. In GEAR, we wish to have a high resolution for the stars, therefore during the star formation, we transform a small part of a gas particle into a star particle.

Here are the key points for the merge request:

  • at the beginning of the simulation, I am computing the average mass of the gas particles and use it as the mass of my future particles.
  • We use two different functions for the star formation. Either we create a new spart or if the gas particle does not have enough mass we convert it to a spart.
  • For creating a new spart, we need a new gpart (A simple copy / paste of the spart functions is enough).
  • The code was crashing due to a small mistake in space.c. The function space_allocate_extra was using the wrong number of gparts.
  • The same function was not updating the gpart pointers in the black holes when a new gpart is created.

I have been able to do the IsolatedGalaxy and SmallCosmologicalVolume simulations until the end with the new way of SF and will test it more later with my comparison between SWIFT and GEAR.

Merge request reports