Skip to content

Commit

Permalink
Bulge mass due to accreted stars is now followed
Browse files Browse the repository at this point in the history
- Previously, the code was following only the mass that was formed via
starbursts due to disk instabilities and mergers. That mass is by
definition in the bulge. However, another growth channel for the bulge
is the accretion of stars that were formed in the disk of the primary
and/or secondary galaxy that because of the merger is transferred to the
bulge. This is now being followed. 

- For that it was necessary to add in the components.h a property to
track that growth channel, and galaxy_mergers was edited to explicitely
track that growth.
  • Loading branch information
cdplagos committed Jul 24, 2018
1 parent 0636cb9 commit 0230c1e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/components.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class Galaxy : public Identifiable<int> {
Baryon disk_gas {};
Baryon galaxymergers_burst_stars {};
Baryon diskinstabilities_burst_stars {};
Baryon galaxymergers_assembly_stars {};
BlackHole smbh {};

//save average star formation rates and metallicities of the newly formed stars.
Expand Down
13 changes: 13 additions & 0 deletions src/galaxy_mergers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ void GalaxyMergers::create_merger(GalaxyPtr &central, GalaxyPtr &satellite, Halo
//satellite stellar mass is always transferred to the bulge.
transfer_history_satellite_to_bulge(central, satellite, snapshot);

//transfer mass that was created in starbursts/disk instabilities.
central->galaxymergers_burst_stars += satellite->galaxymergers_burst_stars;
central->diskinstabilities_burst_stars += satellite->diskinstabilities_burst_stars;

/**
* Depending on the mass ratio, the baryonic components of the satellite and the disk of the major galaxy are going to be transferred differently.
*/
Expand All @@ -396,6 +400,11 @@ void GalaxyMergers::create_merger(GalaxyPtr &central, GalaxyPtr &satellite, Halo

central->bulge_stars.mass += central->disk_stars.mass + satellite->stellar_mass();
central->bulge_stars.mass_metals += central->disk_stars.mass_metals + satellite->stellar_mass_metals();

// Keep track of stars being transfered to the bulge via assembly.
central->galaxymergers_assembly_stars.mass += central->disk_stars.mass + satellite->stellar_mass();
central->galaxymergers_assembly_stars.mass_metals += central->disk_stars.mass_metals + satellite->stellar_mass_metals();

central->bulge_gas.mass += central->disk_gas.mass + satellite->gas_mass();
central->bulge_gas.mass_metals += central->disk_gas.mass_metals + satellite->gas_mass_metals();

Expand All @@ -418,6 +427,10 @@ void GalaxyMergers::create_merger(GalaxyPtr &central, GalaxyPtr &satellite, Halo
central->bulge_stars.mass += satellite->stellar_mass();
central->bulge_stars.mass_metals += satellite->stellar_mass_metals();

// Keep track of stars being transfered to the bulge via assembly.
central->galaxymergers_assembly_stars.mass += satellite->stellar_mass();
central->galaxymergers_assembly_stars.mass_metals += satellite->stellar_mass_metals();

// Calculate new angular momentum by adding up the two galaxies.
double tot_am = satellite->disk_gas.angular_momentum() + satellite->bulge_gas.angular_momentum();
double new_disk_sAM = 0;
Expand Down
12 changes: 12 additions & 0 deletions src/galaxy_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
vector<float> mstars_bulge;
vector<float> mstars_burst_mergers;
vector<float> mstars_burst_diskinstabilities;
vector<float> mstars_bulge_assembly;
vector<float> mgas_disk;
vector<float> mgas_bulge;
vector<float> mstars_metals_disk;
vector<float> mstars_metals_bulge;
vector<float> mstars_metals_burst_mergers;
vector<float> mstars_metals_burst_diskinstabilities;
vector<float> mstars_metals_bulge_assembly;
vector<float> mgas_metals_disk;
vector<float> mgas_metals_bulge;
vector<float> mmol_disk;
Expand Down Expand Up @@ -326,6 +328,7 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
mstars_bulge.push_back(galaxy->bulge_stars.mass);
mstars_burst_mergers.push_back(galaxy->galaxymergers_burst_stars.mass);
mstars_burst_diskinstabilities.push_back(galaxy->diskinstabilities_burst_stars.mass);
mstars_bulge_assembly.push_back(galaxy->galaxymergers_assembly_stars.mass);
mean_stellar_age.push_back(galaxy->mean_stellar_age / galaxy->total_stellar_mass_ever_formed);

// Gas components
Expand All @@ -337,6 +340,7 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
mstars_metals_bulge.push_back(galaxy->bulge_stars.mass_metals);
mstars_metals_burst_mergers.push_back(galaxy->galaxymergers_burst_stars.mass_metals);
mstars_metals_burst_diskinstabilities.push_back(galaxy->diskinstabilities_burst_stars.mass);
mstars_metals_bulge_assembly.push_back(galaxy->galaxymergers_assembly_stars.mass_metals);

// Metals of the gas components.
mgas_metals_disk.push_back(galaxy->disk_gas.mass_metals);
Expand Down Expand Up @@ -482,12 +486,14 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
REPORT(mstars_bulge);
REPORT(mstars_burst_mergers);
REPORT(mstars_burst_diskinstabilities);
REPORT(mstars_bulge_assembly);
REPORT(mgas_disk);
REPORT(mgas_bulge);
REPORT(mstars_metals_disk);
REPORT(mstars_metals_bulge);
REPORT(mstars_metals_burst_mergers);
REPORT(mstars_metals_burst_diskinstabilities);
REPORT(mstars_metals_bulge_assembly);
REPORT(mean_stellar_age);
REPORT(mgas_metals_disk);
REPORT(mgas_metals_bulge);
Expand Down Expand Up @@ -567,6 +573,9 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
comment = "stellar mass formed via starbursts driven by disk instabilities [Msun/h]";
file.write_dataset("galaxies/mstars_burst_diskinstabilities", mstars_burst_diskinstabilities, comment);

comment = "stellar mass in the bulge brought via galaxy mergers (but that formed in disks) [Msun/h]";
file.write_dataset("galaxies/mstars_bulge_assembly", mstars_bulge_assembly, comment);

comment = "total gas mass in the disk [Msun/h]";
file.write_dataset("galaxies/mgas_disk", mgas_disk, comment);

Expand All @@ -585,6 +594,9 @@ void HDF5GalaxyWriter::write_galaxies(hdf5::Writer &file, int snapshot, const st
comment = "mass of metals locked in stars that formed via starbursts driven by disk instabilities [Msun/h]";
file.write_dataset("galaxies/mstars_metals_burst_diskinstabilities", mstars_metals_burst_diskinstabilities, comment);

comment = "mass of metals locked in stars in the bulge that was brought via galaxy mergers (but that formed in disks) [Msun/h]";
file.write_dataset("galaxies/mstars_metals_bulge_assembly", mstars_metals_bulge_assembly, comment);

comment = "stellar mass-weighted stellar age [Gyr]";
file.write_dataset("galaxies/mean_stellar_age", mean_stellar_age, comment);

Expand Down

0 comments on commit 0230c1e

Please sign in to comment.