|
| 1 | +################################# |
| 2 | +########## CONSTANTS ############ |
| 3 | +################################# |
| 4 | + |
| 5 | +### characteristic plasma values |
| 6 | +my_constants.n0 = 1.e23 # plasma density [1/m^3] |
| 7 | +my_constants.T0 = 1. # plasma temperature [eV] |
| 8 | +my_constants.R0 = 1.5e-2 # plasma radius [m] |
| 9 | +my_constants.I0 = 200.e3 # pinch current [Amps] |
| 10 | + |
| 11 | +my_constants.AD = 2.01410 # atomic number deuterium |
| 12 | +my_constants.mD = AD*m_u - m_e # deuterium mass [kg] |
| 13 | + |
| 14 | +### derived characteristic pinch values |
| 15 | +my_constants.B0 = mu0*I0/(2*pi*R0) # B at r=R0 [Tesla] |
| 16 | +my_constants.PB0 = B0^2/(2.0*mu0) # B pressure at r=R0 |
| 17 | +my_constants.rho0 = AD*m_u*n0 # mass density [kg/m^3] |
| 18 | +my_constants.u0 = sqrt(PB0/rho0) # implosion speed [m/s] |
| 19 | +my_constants.t0 = R0/u0 # implosion time [m/s] |
| 20 | + |
| 21 | +### simulation parameters |
| 22 | +my_constants.tsim = 220.e-9 # sim time = 1.35*t0 [s] |
| 23 | +my_constants.rise_time = t0/20.0 # current rise time [s] |
| 24 | +my_constants.dt = 1.0e-3*1.0e-9 # time step [s] |
| 25 | +my_constants.Nppc = 1028 # particles per cell |
| 26 | + |
| 27 | +################################# |
| 28 | +####### GENERAL PARAMETERS ###### |
| 29 | +################################# |
| 30 | +stop_time = tsim |
| 31 | +max_step = 20 |
| 32 | +amr.n_cell = 216 |
| 33 | +amr.max_level = 0 |
| 34 | +warpx.numprocs = 2 |
| 35 | +geometry.dims = 1 |
| 36 | +geometry.prob_lo = 0.0 |
| 37 | +geometry.prob_hi = 1.54e-2 |
| 38 | + |
| 39 | +################################# |
| 40 | +####### Boundary condition ###### |
| 41 | +################################# |
| 42 | +boundary.field_lo = pmc |
| 43 | +boundary.field_hi = pec_insulator |
| 44 | +boundary.particle_lo = reflecting |
| 45 | +boundary.particle_hi = absorbing |
| 46 | + |
| 47 | +insulator.area_z_hi(x,y) = 1.0 |
| 48 | +insulator.Bx_z_hi(x,y,t) = min(t/rise_time,1)*B0 |
| 49 | + |
| 50 | +################################# |
| 51 | +############ NUMERICS ########### |
| 52 | +################################# |
| 53 | +warpx.serialize_initial_conditions = 1 |
| 54 | +warpx.verbose = 1 |
| 55 | +warpx.const_dt = dt |
| 56 | +warpx.use_filter = 0 |
| 57 | + |
| 58 | +algo.maxwell_solver = Yee |
| 59 | +algo.evolve_scheme = "theta_implicit_em" |
| 60 | + |
| 61 | +implicit_evolve.theta = 0.5 |
| 62 | +implicit_evolve.max_particle_iterations = 21 |
| 63 | +implicit_evolve.particle_tolerance = 1.0e-10 |
| 64 | + |
| 65 | +implicit_evolve.nonlinear_solver = "newton" |
| 66 | +newton.verbose = true |
| 67 | +newton.max_iterations = 100 |
| 68 | +newton.relative_tolerance = 1.0e-8 |
| 69 | +newton.absolute_tolerance = 0.0 |
| 70 | +newton.require_convergence = false |
| 71 | +newton.diagnostic_file = "diags/reduced_files/newton_solver.txt" |
| 72 | +newton.diagnostic_interval = 10 |
| 73 | + |
| 74 | +gmres.verbose_int = 2 |
| 75 | +gmres.max_iterations = 1000 |
| 76 | +gmres.relative_tolerance = 1.0e-4 |
| 77 | +gmres.absolute_tolerance = 0.0 |
| 78 | + |
| 79 | +implicit_evolve.use_mass_matrices = true |
| 80 | +jacobian.pc_type = "pc_curl_curl_mlmg" |
| 81 | +pc_curl_curl_mlmg.verbose = true |
| 82 | +pc_curl_curl_mlmg.max_iter = 10 |
| 83 | +pc_curl_curl_mlmg.relative_tolerance = 1e-4 |
| 84 | + |
| 85 | +algo.particle_pusher = "boris" |
| 86 | + |
| 87 | +algo.particle_shape = 2 |
| 88 | +algo.current_deposition = "villasenor" |
| 89 | + |
| 90 | +################################# |
| 91 | +############ PLASMA ############# |
| 92 | +################################# |
| 93 | +particles.species_names = electrons deuterium |
| 94 | + |
| 95 | +electrons.charge = -q_e |
| 96 | +electrons.mass = m_e |
| 97 | +electrons.injection_style = "NUniformPerCell" |
| 98 | +electrons.num_particles_per_cell_each_dim = Nppc |
| 99 | +electrons.profile = constant |
| 100 | +electrons.density = n0 |
| 101 | +electrons.zmax = R0 |
| 102 | +electrons.momentum_distribution_type = "gaussian" |
| 103 | +electrons.ux_th = sqrt(T0*q_e/m_e)/clight |
| 104 | +electrons.uy_th = sqrt(T0*q_e/m_e)/clight |
| 105 | +electrons.uz_th = sqrt(T0*q_e/m_e)/clight |
| 106 | + |
| 107 | +deuterium.charge = q_e |
| 108 | +deuterium.mass = mD |
| 109 | +deuterium.injection_style = "NUniformPerCell" |
| 110 | +deuterium.num_particles_per_cell_each_dim = Nppc |
| 111 | +deuterium.profile = constant |
| 112 | +deuterium.density = n0 |
| 113 | +deuterium.zmax = R0 |
| 114 | +deuterium.momentum_distribution_type = "gaussian" |
| 115 | +deuterium.ux_th = sqrt(T0*q_e/mD)/clight |
| 116 | +deuterium.uy_th = sqrt(T0*q_e/mD)/clight |
| 117 | +deuterium.uz_th = sqrt(T0*q_e/mD)/clight |
| 118 | + |
| 119 | +### Diagnostics |
| 120 | +diagnostics.diags_names = diag1 |
| 121 | +diag1.intervals = 20 |
| 122 | +diag1.diag_type = Full |
| 123 | +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE |
| 124 | +diag1.electrons.variables = z w ux uy uz |
| 125 | +diag1.deuterium.variables = z w ux uy uz |
| 126 | + |
| 127 | +### reduced diagnostics |
| 128 | +warpx.reduced_diags_names = particle_energy field_energy poynting_flux |
| 129 | + |
| 130 | +particle_energy.type = ParticleEnergy |
| 131 | +particle_energy.intervals = 10 |
| 132 | +particle_energy.precision = 18 |
| 133 | +particle_energy.path = diags/reduced_files/ |
| 134 | + |
| 135 | +field_energy.type = FieldEnergy |
| 136 | +field_energy.intervals = 10 |
| 137 | +field_energy.precision = 18 |
| 138 | +field_energy.path = diags/reduced_files/ |
| 139 | + |
| 140 | +poynting_flux.type = FieldPoyntingFlux |
| 141 | +poynting_flux.intervals = 10 |
| 142 | +poynting_flux.precision = 18 |
| 143 | +poynting_flux.path = diags/reduced_files/ |
| 144 | + |
| 145 | +################################# |
| 146 | +############ COLLISION ########## |
| 147 | +################################# |
| 148 | +collisions.collision_names = collision1 collision2 collision3 |
| 149 | + |
| 150 | +collision1.species = electrons electrons |
| 151 | +collision2.species = deuterium deuterium |
| 152 | +collision3.species = electrons deuterium |
| 153 | +collision1.CoulombLog = 10.0 |
| 154 | +collision2.CoulombLog = 10.0 |
| 155 | +collision3.CoulombLog = 10.0 |
0 commit comments