d = dm.disk2d(sigma_type= sigma_type,
                  sigma0 = sigma0,gamma=gamma,Rc=Rc,xi=xi,R_cav = R_cav,
                  l=1.0, csndR0 = Rc,
                  sigma_floor = 1e-7,
                  sigma_back = sigma_out,
                  csnd0=0.12,Rout=70,adiabatic_gamma=1.00001)

    def perturbation_function(R,phi):
        return sigma0 * 4e-2 * np.exp(-(R-3.0)**2/0.1) * np.exp(-(phi-0.0)**2/1.0)
    d.add_perturbation(perturbation_function)
    
    # DISK MESH
    mesh = dm.disk_mesh2d(mesh_type="polar",Rin=Rin,Rout=Rout,
                          NR=600,Nphi=400,
                          fill_center=True,fill_box=True,BoxSize=120,
                          N_inner_boundary_rings=0, N_outer_boundary_rings=0,
                          self_gravity = True) 


    # Create SNAPSHOT
    s = dm.snapshot()
    s.create(d,mesh)


    # Write files
    snapshot_file = 'disk_pert_000.hdf5'
    s.write_snapshot(d,mesh,filename = snapshot_file)
    s.write_parameter_file(d,mesh)

    # Read snapshot from disk and check the surface density
示例#2
0
    # DISK MESH
    NR1 = NR
    NR2 = int((np.log10(Rout) - np.log10(Rbreak)) /
              (np.log10(Rbreak) - np.log10(Rin)) * NR / 1.5)
    print NR1, NR2
    Nphi1 = Nphi
    Nphi2 = int(Nphi / 1.5)

    mesh = dm.disk_mesh2d(mesh_type="polar",
                          Rin=Rin,
                          Rout=Rout,
                          Rbreak=Rbreak,
                          mesh_alignment="interleaved",
                          NR1=NR1,
                          Nphi1=Nphi1,
                          NR2=NR2,
                          Nphi2=Nphi2,
                          Nphi_outer_bound=Nphi2,
                          fill_center=False,
                          fill_box=True,
                          BoxSize=BOX,
                          N_inner_boundary_rings=2,
                          N_outer_boundary_rings=1)

    # Create SNAPSHOT
    s = dm.snapshot()
    s.create(d, mesh)
    #s.incline(37,0,mesh)

    # Write files
    s.write_snapshot(d,
                  Rout=70,
                  adiabatic_gamma=1.00001)

    def perturbation_function(R, phi):
        return sigma0 * 4e-2 * np.exp(-(R - 3.0)**2 / 0.1) * np.exp(
            -(phi - 0.0)**2 / 1.0)

    d.add_perturbation(perturbation_function)

    # DISK MESH
    mesh = dm.disk_mesh2d(mesh_type="polar",
                          Rin=Rin,
                          Rout=Rout,
                          NR=600,
                          Nphi=400,
                          fill_center=True,
                          fill_box=True,
                          BoxSize=120,
                          N_inner_boundary_rings=0,
                          N_outer_boundary_rings=0,
                          self_gravity=True)

    # Create SNAPSHOT
    s = dm.snapshot()
    s.create(d, mesh)

    # Write files
    snapshot_file = 'disk_pert_000.hdf5'
    s.write_snapshot(d, mesh, filename=snapshot_file)
    s.write_parameter_file(d, mesh)
                  csnd0=h0,adiabatic_gamma=1.00001,
                  alphacoeff = alpha,
                  quadrupole_correction = quadrupole_correction)

    # DISK MESH
    NR1 = NR
    NR2 = int((np.log10(Rout)-np.log10(Rbreak))/
               (np.log10(Rbreak)-np.log10(Rin)) * NR / 1.5)
    print NR1,NR2
    Nphi1 = Nphi
    Nphi2 = int(Nphi/1.5)

    mesh = dm.disk_mesh2d(mesh_type="polar",Rin= Rin,Rout=Rout, Rbreak = Rbreak,
                          mesh_alignment = "interleaved",
                          NR1=NR1,Nphi1=Nphi1,
                          NR2=NR2,Nphi2=Nphi2,
                          Nphi_outer_bound = Nphi2,
                          fill_center=False,fill_box=True,BoxSize=BOX,
                          N_inner_boundary_rings=2,
                          N_outer_boundary_rings=1) 


    
    # Create SNAPSHOT
    s = dm.snapshot()
    s.create(d,mesh)
    #s.incline(37,0,mesh)


    # Write files
    s.write_snapshot(d,mesh,filename='disk_qb%.2f_eb%.2f_alpha%.2f_h%.2f.hdf5' % (qb,eb,alpha,h0),
                     relax_density_in_input = True)
示例#5
0
                  csnd0=0.12,Rout=70,adiabatic_gamma=1.00001)
    '''
    
    d = dm.disk2d(sigma_function = sigma_function,
                  constant_accretion = mdot_out,
                  R0 = 1.0, csndR0 = 1.0,
                  sigma0 = sigma0,
                  sigma_floor = 1e-7,
                  sigma_back = sigma_out,
                  csnd0=h0,adiabatic_gamma=1.00001,
                  quadrupole_correction = quadrupole_correction)

    # DISK MESH
    mesh = dm.disk_mesh2d(mesh_type="polar",Rin=1.0,Rout=70.0,
                          NR=600,Nphi=400,
                          fill_center=False,fill_box=True,BoxSize=160,
                          N_inner_boundary_rings=0,
                          N_outer_boundary_rings=3) 


    # Create SNAPSHOT
    s = dm.snapshot()
    s.create(d,mesh)
    #s.incline(37,0,mesh)


    # Write files
    s.write_snapshot(d,mesh,filename='disk_qb%.2f_eb%.2f_alpha%.2f_h%.2f.hdf5' % (qb,eb,alpha,h0))
    s.write_parameter_file(d,mesh)

    print "Simulation parameters"