1. Cameron Hummels
  2. ion_balance

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
  • Branches default

Comments (0)

Files changed (1)

File CloudyIonBalance.py

View file
         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