diff --git a/src/disk_instability.cpp b/src/disk_instability.cpp index a883f8c7..064ab2bc 100644 --- a/src/disk_instability.cpp +++ b/src/disk_instability.cpp @@ -188,9 +188,11 @@ void DiskInstability::create_starburst(SubhaloPtr &subhalo, GalaxyPtr &galaxy, d // Define accretion rate. galaxy->smbh.macc_sb = delta_mbh/tdyn; - // Grow SMBH. - galaxy->smbh.mass += delta_mbh; - galaxy->smbh.mass_metals += delta_mzbh; + // Check if SMBH exists in this galaxy, then grow it. + if(galaxy->smbh.mass != 0){ + galaxy->smbh.mass += delta_mbh; + galaxy->smbh.mass_metals += delta_mzbh; + } // Reduce gas available for star formation due to black hole growth. galaxy->bulge_gas.mass -= delta_mbh; diff --git a/src/galaxy_mergers.cpp b/src/galaxy_mergers.cpp index 8e85f614..0f3a6440 100644 --- a/src/galaxy_mergers.cpp +++ b/src/galaxy_mergers.cpp @@ -540,8 +540,11 @@ void GalaxyMergers::create_starbursts(HaloPtr &halo, double z, double delta_t){ physicalmodel->evolve_galaxy_starburst(*subhalo, *galaxy, z, delta_t, true); // Grow SMBH after starbursts, as during it we need a realistical measurement of Ledd the BH had before the starburst. - galaxy->smbh.mass += delta_mbh; - galaxy->smbh.mass_metals += delta_mzbh; + // Check if SMBH exists in this galaxy, then grow it. + if(galaxy->smbh.mass != 0){ + galaxy->smbh.mass += delta_mbh; + galaxy->smbh.mass_metals += delta_mzbh; + } // Check for small gas reservoirs left in the bulge, in case mass is small, transfer to disk. if(galaxy->bulge_gas.mass > 0 && galaxy->bulge_gas.mass < parameters.mass_min){