示例#1
0
ion_by_ion.add_species(de)
ion_by_ion.add_species(HI)
ion_by_ion.add_species(HII)
ion_by_ion.add_species(HeI)
ion_by_ion.add_species(HeII)
#ion_by_ion.add_species('O_1')
#ion_by_ion.add_species('O_2')
#ion_by_ion.add_species('O_3')
#ion_by_ion.add_species('O_4')
#ion_by_ion.add_species('O_5')
#ion_by_ion.add_species('O_6')

for atom in ["H", "He", "O"]: #"C", "N", "O", "Ne", "Si"]:
    s, c, r = setup_ionization(atom, photo_background="HM12")
    ion_by_ion.add_collection(s, c, r)

# This defines the temperature range for the rate tables
ion_by_ion.init_temperature((1e0, 1e12))

# This defines the redsfhit range for the rate tables
ion_by_ion.init_redshift((0.0, 9.0))

tiny = 1e-20

init_array = np.ones(NCELLS) * density
init_values = dict()

# set up initial temperatures values used to define ge
init_values['T'] = temperature
示例#2
0
umist = ChemicalNetwork()
umist.skip_weight += ("us_e_0", )

# This defines the temperature range for the rate tables
umist.init_temperature((1e0, 1e3))

# Get UMIST rates for a bunch of species for an example network

desired_species = [("H", 1), ("H2", 2), ("e-", 1)]
added_species = set([])

for name, weight in desired_species:
    s, c, r = setup_umist_species(name, weight)
    print("ADDED", s)
    added_species.update(s)
    umist.add_collection(s, c, r)
# Add ionic species by hand, since we need correct atomic weights

s, c, r = setup_umist_reactions(added_species)
umist.add_collection(s, c, r)

tiny = 1e-10

init_array = np.ones(NCELLS) * density
init_values = dict()
init_values['us_H_1'] = init_array * X
init_values['us_H2_1'] = init_array * X
init_values['us_e_0'] = init_array * 0.0

print(init_values)
#print sorted(umist.reactions.values())