Commits

yl2501 committed 072c9db

fix typo & "&&"

Comments (0)

Files changed (2)

src/enzo/ClusterSMBHSumGasMass.C

 
   float ColdGasMassMsun=ClusterSMBHColdGasMass*MassUnits/SolarMass;
   if (ClusterSMBHCalculateGasMass == 2){
-    if (ColdGasMassMsun - 0.0 > 0.1) {
+    if (ColdGasMassMsun  > 0.001) {
        ClusterSMBHFeedbackSwitch = TRUE;
        ClusterSMBHJetMdot = (ColdGasMassMsun/(ClusterSMBHAccretionTime*1e6))/2.0;  // AccretionTime from Myr to yr; reset Mdot, still in Msun/yr. Devide it by 2 because Mdot is for only one jet.
        float epsilon=0.001;
 
   if (MyProcessorNumber == ROOT_PROCESSOR) {
     FILE *fptr=fopen("MT.out","a");
-    fprintf(fptr,"Time, ClusterSMBHStartTime, Switch, and Total ClusterSMBGColdGasMass in Msun = %g %g %d %g \n", Time, ClusterSMBHStartTime, ClusterSMBHFeedbackSwitch, ColdGasMassMsun);
+    fprintf(fptr,"Time, ClusterSMBHStartTime, Switch, and Total ClusterSMBHColdGasMass in Msun = %g %g %d %g \n", Time, ClusterSMBHStartTime, ClusterSMBHFeedbackSwitch, ColdGasMassMsun);
     fclose(fptr);
   }
   return SUCCESS;

src/enzo/Grid_ClusterSMBHFeedback.C

 
 
   /* loop over cells of disk, remove mass. */
-if (DiskOnGrid == true & ClusterSMBHCalculateGasMass != 0){
+if (DiskOnGrid == true && ClusterSMBHCalculateGasMass != 0){
+  if (ClusterSMBHColdGasMass < 0.0001)
+     return SUCCESS;
   float AccretionRate = JetMdot*2.0; // in codeunit  *2 because Mdot is Mdot of one jet. There are two jets!
   int size = GridDimension[0]*GridDimension[1]*GridDimension[2];
   float ColdGasTemperature = 3.0e4;