Commits

Michael Kuhlen committed 7829cde

Fixed units error in initialize_UVbackground_rates.C. Needed to convert from eV to erg.

  • Participants
  • Parent commits 8c7d595

Comments (0)

Files changed (3)

File src/clib/freefall.C

     return FAIL;
   }
 
-  // my_chemistry.UVbackground = 1;
-  // my_chemistry.UVbackground_file = (char*) "UVB_rates_HM2012.hdf5";
-  // if (initialize_UVbackground_data(my_chemistry, my_units, a_value) == FAIL) {
-  //   fprintf(stderr, "Error in initialize_UVbackground_data.\n");
-  //   return FAIL;
-  // }
+  my_chemistry.UVbackground = 1;
+  my_chemistry.UVbackground_file = (char*) "UVB_rates_HM2012.hdf5";
+  if (initialize_UVbackground_data(my_chemistry, my_units, a_value) == FAIL) {
+    fprintf(stderr, "Error in initialize_UVbackground_data.\n");
+    return FAIL;
+  }
 
-  // update_UVbackground_rates(my_chemistry, my_units, a_value);
+  update_UVbackground_rates(my_chemistry, my_units, a_value);
 
   gr_float *density, *energy, *x_velocity, *y_velocity, *z_velocity;
   gr_float *HI_density, *HII_density, *HM_density,

File src/clib/initialize_UVbackground_data.C

       my_chemistry.UVbackground_table.k31[i] *= my_units.time_units;
     }
 
-    my_chemistry.UVbackground_table.piHI[i] /= CoolingUnits;
-    my_chemistry.UVbackground_table.piHeII[i] /= CoolingUnits;
-    my_chemistry.UVbackground_table.piHeI[i] /= CoolingUnits;
+    my_chemistry.UVbackground_table.piHI[i] /= CoolingUnits / 1.60217653e-12;
+    my_chemistry.UVbackground_table.piHeII[i] /= CoolingUnits / 1.60217653e-12;
+    my_chemistry.UVbackground_table.piHeI[i] /= CoolingUnits / 1.60217653e-12;
   }
 
 

File src/clib/update_UVbackground_rates.C

 
 
   // printf("%e %e %e\n",my_chemistry.k24,my_chemistry.k25,my_chemistry.k26);
+  // printf("%e %e %e\n",my_chemistry.piHI,my_chemistry.piHeII,my_chemistry.piHeI);
 
 
   // Now apply the Ramp factor