Commits

Cameron Hummels committed 87051a2

Modified CloudyIonBalance so that densities and numberdensity calculations for Cloudy work for hydrogen and helium species as well as metal species. Produces results similar to native enzo hydrogen and helium fields (when multispecies = 2 is set in enzo).

  • Participants
  • Parent commits 597013c

Comments (0)

Files changed (1)

File CloudyIonBalance.py

         atom = species[0]
 
     fractionField = "%s_Cloudy_eq_Ion_Fraction" % species
-    field = solarAbundance[atom] * data[fractionField] * data['Metallicity'] * \
-        data['Density']
+    if atom == 'H' or atom == 'He':
+        field = solarAbundance[atom] * data[fractionField] * data['Density']
+    else:    
+        field = solarAbundance[atom] * data[fractionField] * data['Metallicity'] * \
+            data['Density']
     field[field <= 0.0] = 1.e-50
     return field