Exemplo n.º 1
0
def iliev_test_5(N=10000,
                 L=15. | units.kpc,
                 source_luminosity=5.e48 | units.s**-1,
                 rhoinit=0.001 | (units.amu / units.cm**3),
                 Tinit=100. | units.K,
                 hydro_parameters=dict(),
                 rad_parameters=dict()):

    gamma = 5. / 3.
    mu = 1. | units.amu

    x, y, z = body_centered_grid_unit_cube(N).make_xyz()
    N = len(x)
    print N
    gas = Particles(N)

    # set particles homogeneously in space
    #  gas.x=L*numpy.random.uniform(-1.,1.,N)
    #  gas.y=L*numpy.random.uniform(-1.,1.,N)
    #  gas.z=L*numpy.random.uniform(-1.,1.,N)

    gas.x = L * x
    gas.y = L * y
    gas.z = L * z

    gas.x += L * numpy.random.uniform(-1., 1., N) / 1000
    gas.y += L * numpy.random.uniform(-1., 1., N) / 1000
    gas.z += L * numpy.random.uniform(-1., 1., N) / 1000

    # set other properties
    gas.h_smooth = 0. | units.parsec
    gas.vx = 0. | (units.km / units.s)
    gas.vy = 0. | (units.km / units.s)
    gas.vz = 0. | (units.km / units.s)
    gas.u = 1 / (gamma - 1) * constants.kB * Tinit / mu
    gas.rho = rhoinit
    gas.mass = rhoinit * (2 * L)**3 / N
    gas.xion = 0.1
    gas.metallicity = 0.02

    # set source in the center of the box
    sources = Particles(1)
    sources.x = 0. * L
    sources.y = 0. * L
    sources.z = 0. * L
    sources.luminosity = source_luminosity

    return gas, sources