# 'cross_section' : cross_sec_direc+'charge_exchange.dat' # } } ) ########################## # numerics components ########################## grid = picmi.Cartesian2DGrid( number_of_cells = [nx, ny], lower_bound = [xmin, ymin], upper_bound = [xmax, ymax], bc_xmin = 'dirichlet', bc_xmax = 'dirichlet', bc_ymin = 'periodic', bc_ymax = 'periodic', warpx_potential_hi_x = "%.1f*sin(2*pi*%.5e*t)" % (VOLTAGE, FREQ), lower_boundary_conditions_particles=['absorbing', 'periodic'], upper_boundary_conditions_particles=['absorbing', 'periodic'], moving_window_velocity = None, warpx_max_grid_size = nx//4 ) solver = picmi.ElectrostaticSolver( grid=grid, method='Multigrid', required_precision=1e-6 ) ########################## # diagnostics ##########################
xmax = +20.e-6 ymax = +20.e-6 uniform_plasma = picmi.UniformDistribution( density=1.e25, upper_bound=[0., None, None], directed_velocity=[0.1 * constants.c, 0., 0.]) electrons = picmi.Species(particle_type='electron', name='electrons', initial_distribution=uniform_plasma) grid = picmi.Cartesian2DGrid( number_of_cells=[nx, ny], lower_bound=[xmin, ymin], upper_bound=[xmax, ymax], lower_boundary_conditions=['periodic', 'periodic'], upper_boundary_conditions=['periodic', 'periodic'], moving_window_velocity=[0., 0., 0.], warpx_max_grid_size=32) solver = picmi.ElectromagneticSolver(grid=grid, cfl=1.) sim = picmi.Simulation(solver=solver, max_steps=40, verbose=1, warpx_plot_int=1, warpx_current_deposition_algo='direct') sim.add_species(electrons, layout=picmi.GriddedLayout(n_macroparticle_per_cell=[2, 2], grid=grid))
collision2 = picmi.CoulombCollisions(name='collisions2', species=[electrons, electrons], CoulombLog=15.9) collision3 = picmi.CoulombCollisions(name='collisions3', species=[ions, ions], CoulombLog=15.9) ################################# ###### GRID AND SOLVER ########## ################################# grid = picmi.Cartesian2DGrid( number_of_cells=[nx, ny], warpx_max_grid_size=max_grid_size, warpx_blocking_factor=max_grid_size, lower_bound=[xmin, ymin], upper_bound=[xmax, ymax], lower_boundary_conditions=['periodic', 'periodic'], upper_boundary_conditions=['periodic', 'periodic'], ) solver = picmi.ElectromagneticSolver(grid=grid, cfl=cfl) ################################# ######### DIAGNOSTICS ########### ################################# field_diag = picmi.FieldDiagnostic(name='diag1', grid=grid, period=10, data_list=[], write_dir='.',
xmin = 0 xmax = 0.03 ymin = 0 ymax = 0.03 ########################## # numerics components ########################## grid = picmi.Cartesian2DGrid( number_of_cells = [nx, ny], lower_bound = [xmin, ymin], upper_bound = [xmax, ymax], lower_boundary_conditions = ['dirichlet', 'periodic'], upper_boundary_conditions = ['dirichlet', 'periodic'], lower_boundary_conditions_particles = ['absorbing', 'periodic'], upper_boundary_conditions_particles = ['absorbing', 'periodic'], moving_window_velocity = None, warpx_max_grid_size = 32 ) solver = picmi.ElectrostaticSolver( grid=grid, method='Multigrid', required_precision=1e-6, warpx_self_fields_verbosity=0 ) ########################## # physics components ##########################
xmax_refined = 5e-06 zmin_refined = -35e-06 zmax_refined = -25e-06 # Domain decomposition max_grid_size = 64 blocking_factor = 32 # Create grid grid = picmi.Cartesian2DGrid( number_of_cells=[nx, nz], lower_bound=[xmin, zmin], upper_bound=[xmax, zmax], lower_boundary_conditions=['open', 'open'], upper_boundary_conditions=['open', 'open'], lower_boundary_conditions_particles=['absorbing', 'absorbing'], upper_boundary_conditions_particles=['absorbing', 'absorbing'], moving_window_velocity=[0., c], warpx_max_grid_size=max_grid_size, warpx_blocking_factor=blocking_factor, refined_regions=[[ 1, [xmin_refined, zmin_refined], [xmax_refined, zmax_refined] ]]) # Particles: plasma electrons plasma_density = 2e23 plasma_xmin = -20e-06 plasma_ymin = None plasma_zmin = 10e-06 plasma_xmax = 20e-06 plasma_ymax = None plasma_zmax = None
xmin = -125e-6 zmin = -149e-6 xmax = 125e-6 zmax = 1e-6 ########################## # numerics components ########################## grid = picmi.Cartesian2DGrid( number_of_cells = [nx, nz], lower_bound = [xmin, zmin], upper_bound = [xmax, zmax], lower_boundary_conditions = ['dirichlet', 'dirichlet'], upper_boundary_conditions = ['dirichlet', 'dirichlet'], lower_boundary_conditions_particles = ['open', 'absorbing'], upper_boundary_conditions_particles = ['open', 'absorbing'], warpx_max_grid_size = 32 ) solver = picmi.ElectrostaticSolver( grid=grid, method='Multigrid', required_precision=1e-6, warpx_self_fields_verbosity=0 ) #embedded_boundary = picmi.EmbeddedBoundary( # implicit_function="-max(max(x-12.5e-6,-12.5e-6-x),max(z+6.15e-5,-8.65e-5-z))" #) ##########################
field_boundary = ['open', 'open'] # Spectral order nox = 8 noz = 8 # Guard cells nxg = 8 nzg = 8 # Initialize grid grid = picmi.Cartesian2DGrid(number_of_cells=[nx, nz], lower_bound=[xmin, zmin], upper_bound=[xmax, zmax], lower_boundary_conditions=field_boundary, upper_boundary_conditions=field_boundary, guard_cells=[nxg, nzg], moving_window_velocity=[0., 0., 0], warpx_max_grid_size_x=max_grid_size_x, warpx_max_grid_size_y=max_grid_size_z) # Initialize field solver solver = picmi.ElectromagneticSolver(grid=grid, cfl=0.95, method='PSATD', stencil_order=[nox, noz], divE_cleaning=1, divB_cleaning=1, pml_divE_cleaning=1, pml_divB_cleaning=1, warpx_psatd_update_with_rho=True)