예제 #1
0
    ChemicalNetwork, \
    reaction_registry, \
    cooling_registry
import dengo.primordial_rates, dengo.primordial_cooling
import dengo.oxygen_rates, dengo.oxygen_cooling
from dengo.chemistry_constants import tiny, kboltz, mh
from dengo.known_species import *

NCELLS = 4
density = 1.0
temperature = np.logspace(4, 6.7, NCELLS)
temperature[:] = 1e7
X = 1e-3

oxygen = ChemicalNetwork()
oxygen.add_energy_term()

for ca in cooling_registry.values():
    if ca.name.startswith("O"):
        oxygen.add_cooling(ca)

for s in reaction_registry.values():
    if s.name.startswith("O"):
        oxygen.add_reaction(s)

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

tiny = 1e-10

init_array = np.ones(NCELLS) * density
    reaction_registry, \
    cooling_registry
import dengo.primordial_rates, dengo.primordial_cooling
import dengo.carbon_rates, dengo.carbon_cooling
from dengo.write_rate_reader import \
    create_rate_tables, \
    create_rate_reader, \
    create_initial_conditions
from dengo.chemistry_constants import tiny, kboltz, mh

# If only a subset of species are wanted put them here
# and change the commented lines below
want = ('CIII', 'CIV', 'CV', 'de', 'ge')

carbon = ChemicalNetwork()
carbon.add_energy_term()

# for ca in cooling_registry.values():
#     # The following line can be used to specify a subset of species
#     #if all(sp.name in want for sp in ca.species):
#     if ca.name.startswith("C"):
#        carbon.add_cooling(ca)

for s in reaction_registry.values():
    # The following line can be used to specify a subset of species
    #if all(sp.name in want for sp in s.species):
    if s.name.startswith("C"):
        carbon.add_reaction(s)

# This defines the temperature range for the rate tables
carbon.init_temperature((1e4, 1e8))
from dengo.chemical_network import \
    ChemicalNetwork, \
    reaction_registry, \
    cooling_registry
import dengo.primordial_rates, dengo.primordial_cooling
from dengo.chemistry_constants import tiny, kboltz, mh
from dengo.known_species import *

# If only a subset of species are wanted put them here
# and change the commented lines below
want = ("HI", "HII", "de", "ge")

primordial = ChemicalNetwork()
primordial.add_energy_term()

# Set to false if intermediate solution output is not wanted
primordial.write_intermediate_solutions = True

for ca in cooling_registry.values():
    #if not all(sp.name in want for sp in ca.species): continue
    primordial.add_cooling(ca)

for i, rname in enumerate(sorted(reaction_registry)):
    s = reaction_registry[rname]
    #if not all(sp.name in want for sp in s.species): continue
    primordial.add_reaction(s)

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

# Generate initial conditions (switch to False to disable this)
예제 #4
0
import dengo.oxygen_rates, dengo.oxygen_cooling
import dengo.neon_rates, dengo.neon_cooling
import dengo.magnesium_rates, dengo.magnesium_cooling
import dengo.silicon_rates, dengo.silicon_cooling
import dengo.sulfur_rates, dengo.sulfur_cooling
from dengo.chemistry_constants import tiny, kboltz, mh
import numpy as np

NCELLS = 1
density = 1.0
temperature = np.logspace(4, 6.7, NCELLS)
temperature[:] = 5e6
X = 1e-3

combined = ChemicalNetwork()
combined.add_energy_term()

for ca in cooling_registry.values():
    if ca.name.startswith("C") \
    or ca.name.startswith("N") \
    or ca.name.startswith("O") \
    or ca.name.startswith("Ne") \
    or ca.name.startswith("Mg") \
    or ca.name.startswith("Si") \
    or ca.name.startswith("S"):
        combined.add_cooling(ca)

combined.add_cooling("brem")
combined.add_cooling("reHII")
combined.add_cooling("reHeIII")
combined.add_cooling("ceHI")