Skip to content
Snippets Groups Projects
Commit 5ce16cce authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added BH formation time to the BH particles. Added many BH properties to the i/o.

parent 03c8026b
No related branches found
No related tags found
1 merge request!804Implementation of black hole accretion and feedback
...@@ -55,6 +55,7 @@ __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart( ...@@ -55,6 +55,7 @@ __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart(
bp->time_bin = 0; bp->time_bin = 0;
bp->subgrid_mass = bp->mass; bp->subgrid_mass = bp->mass;
bp->energy_reservoir = 0.; bp->energy_reservoir = 0.;
bp->formation_time = -1.;
} }
/** /**
......
...@@ -61,7 +61,7 @@ INLINE static void black_holes_write_particles(const struct bpart *bparts, ...@@ -61,7 +61,7 @@ INLINE static void black_holes_write_particles(const struct bpart *bparts,
int *num_fields) { int *num_fields) {
/* Say how much we want to write */ /* Say how much we want to write */
*num_fields = 5; *num_fields = 10;
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH,
...@@ -74,6 +74,16 @@ INLINE static void black_holes_write_particles(const struct bpart *bparts, ...@@ -74,6 +74,16 @@ INLINE static void black_holes_write_particles(const struct bpart *bparts,
bparts, id); bparts, id);
list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH, list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
bparts, h); bparts, h);
list[5] = io_make_output_field("SubgridMasses", FLOAT, 1, UNIT_CONV_MASS,
bparts, subgrid_mass);
list[6] = io_make_output_field("FormationTime", FLOAT, 1, UNIT_CONV_TIME,
bparts, formation_time);
list[7] = io_make_output_field("GasDensity", FLOAT, 1, UNIT_CONV_DENSITY,
bparts, rho_gas);
list[8] = io_make_output_field("GasSoundSpeed", FLOAT, 1, UNIT_CONV_SPEED,
bparts, sound_speed_gas);
list[9] = io_make_output_field("EnergyReservoir", FLOAT, 1, UNIT_CONV_ENERGY,
bparts, energy_reservoir);
#ifdef DEBUG_INTERACTIONS_BLACK_HOLES #ifdef DEBUG_INTERACTIONS_BLACK_HOLES
......
...@@ -63,6 +63,16 @@ struct bpart { ...@@ -63,6 +63,16 @@ struct bpart {
/*! Subgrid mass of the black hole */ /*! Subgrid mass of the black hole */
float subgrid_mass; float subgrid_mass;
/*! Union for the formation time and formation scale factor */
union {
/*! Formation time */
float formation_time;
/*! Formation scale factor */
float formation_scale_factor;
};
/*! Energy reservoir for feedback */ /*! Energy reservoir for feedback */
float energy_reservoir; float energy_reservoir;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment