-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds filtering to the implicit solver, replacing PR #4600. It is a simple change. All that is needed is adding a call to filter the `Efield_fp` just before the particles are pushed. The current density is already filtered in `SyncCurrentAndRho`. The name of the routine `ApplyFilterJ` was changed to `ApplyFilterMF` since it now has a more general usage.
- Loading branch information
Showing
8 changed files
with
184 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb_filtered
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
################################# | ||
########## CONSTANTS ############ | ||
################################# | ||
|
||
my_constants.n0 = 1.e30 # m^-3 | ||
my_constants.Ti = 100. # eV | ||
my_constants.Te = 100. # eV | ||
my_constants.wpe = q_e*sqrt(n0/(m_e*epsilon0)) | ||
my_constants.de0 = clight/wpe | ||
my_constants.nppcz = 10 # number of particles/cell in z | ||
my_constants.dt = 0.1/wpe # s | ||
|
||
################################# | ||
####### GENERAL PARAMETERS ###### | ||
################################# | ||
max_step = 20 | ||
amr.n_cell = 40 40 | ||
amr.max_grid_size = 8 | ||
amr.blocking_factor = 8 | ||
amr.max_level = 0 | ||
geometry.dims = 2 | ||
geometry.prob_lo = 0.0 0.0 # physical domain | ||
geometry.prob_hi = 10.0*de0 10.0*de0 | ||
|
||
################################# | ||
####### Boundary condition ###### | ||
################################# | ||
boundary.field_lo = periodic periodic | ||
boundary.field_hi = periodic periodic | ||
|
||
################################# | ||
############ NUMERICS ########### | ||
################################# | ||
warpx.abort_on_warning_threshold = high | ||
warpx.serialize_initial_conditions = 1 | ||
warpx.verbose = 1 | ||
warpx.const_dt = dt | ||
#warpx.cfl = 0.5656 | ||
warpx.use_filter = 1 | ||
|
||
algo.maxwell_solver = Yee | ||
algo.evolve_scheme = "theta_implicit_em" | ||
#algo.evolve_scheme = "semi_implicit_em" | ||
|
||
implicit_evolve.theta = 0.5 | ||
implicit_evolve.max_particle_iterations = 21 | ||
implicit_evolve.particle_tolerance = 1.0e-12 | ||
|
||
#implicit_evolve.nonlinear_solver = "picard" | ||
#picard.verbose = true | ||
#picard.max_iterations = 25 | ||
#picard.relative_tolerance = 0.0 #1.0e-12 | ||
#picard.absolute_tolerance = 0.0 #1.0e-24 | ||
#picard.require_convergence = false | ||
|
||
implicit_evolve.nonlinear_solver = "newton" | ||
newton.verbose = true | ||
newton.max_iterations = 20 | ||
newton.relative_tolerance = 1.0e-12 | ||
newton.absolute_tolerance = 0.0 | ||
newton.require_convergence = false | ||
|
||
gmres.verbose_int = 2 | ||
gmres.max_iterations = 1000 | ||
gmres.relative_tolerance = 1.0e-8 | ||
gmres.absolute_tolerance = 0.0 | ||
|
||
algo.particle_pusher = "boris" | ||
#algo.particle_pusher = "higuera" | ||
|
||
algo.particle_shape = 2 | ||
#algo.current_deposition = "direct" | ||
#algo.current_deposition = "esirkepov" | ||
algo.current_deposition = "villasenor" | ||
|
||
################################# | ||
############ PLASMA ############# | ||
################################# | ||
particles.species_names = electrons protons | ||
|
||
electrons.charge = -q_e | ||
electrons.mass = m_e | ||
electrons.injection_style = "NUniformPerCell" | ||
electrons.num_particles_per_cell_each_dim = nppcz nppcz | ||
electrons.profile = constant | ||
electrons.density = 1.e30 # number per m^3 | ||
electrons.momentum_distribution_type = "gaussian" | ||
electrons.ux_th = sqrt(Te*q_e/m_e)/clight | ||
electrons.uy_th = sqrt(Te*q_e/m_e)/clight | ||
electrons.uz_th = sqrt(Te*q_e/m_e)/clight | ||
|
||
protons.charge = q_e | ||
protons.mass = m_p | ||
protons.injection_style = "NUniformPerCell" | ||
protons.num_particles_per_cell_each_dim = nppcz nppcz | ||
protons.profile = constant | ||
protons.density = 1.e30 # number per m^3 | ||
protons.momentum_distribution_type = "gaussian" | ||
protons.ux_th = sqrt(Ti*q_e/m_p)/clight | ||
protons.uy_th = sqrt(Ti*q_e/m_p)/clight | ||
protons.uz_th = sqrt(Ti*q_e/m_p)/clight | ||
|
||
# Diagnostics | ||
diagnostics.diags_names = diag1 | ||
diag1.intervals = 20 | ||
diag1.diag_type = Full | ||
diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE | ||
diag1.electrons.variables = x z w ux uy uz | ||
diag1.protons.variables = x z w ux uy uz | ||
|
||
warpx.reduced_diags_names = particle_energy field_energy | ||
particle_energy.type = ParticleEnergy | ||
particle_energy.intervals = 1 | ||
field_energy.type = FieldEnergy | ||
field_energy.intervals = 1 |
31 changes: 31 additions & 0 deletions
31
Regression/Checksum/benchmarks_json/test_2d_theta_implicit_jfnk_vandb_filtered.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"lev=0": { | ||
"Bx": 65625.24877705125, | ||
"By": 71913.65275407257, | ||
"Bz": 59768.79247890749, | ||
"Ex": 56341360261928.086, | ||
"Ey": 13926508614721.855, | ||
"Ez": 56508162715968.17, | ||
"divE": 5.5816922509658905e+22, | ||
"jx": 1.8114330881270456e+19, | ||
"jy": 2.0727708668063334e+19, | ||
"jz": 1.7843765469944717e+19, | ||
"rho": 494213515033.04443 | ||
}, | ||
"electrons": { | ||
"particle_momentum_x": 4.888781979240524e-19, | ||
"particle_momentum_y": 4.879904653089102e-19, | ||
"particle_momentum_z": 4.878388335258947e-19, | ||
"particle_position_x": 0.0042514822919144084, | ||
"particle_position_y": 0.0042515394083575886, | ||
"particle_weight": 2823958719279159.5 | ||
}, | ||
"protons": { | ||
"particle_momentum_x": 2.0873319751377048e-17, | ||
"particle_momentum_y": 2.0858882863041667e-17, | ||
"particle_momentum_z": 2.0877426824914187e-17, | ||
"particle_position_x": 0.004251275869325256, | ||
"particle_position_y": 0.0042512738905204584, | ||
"particle_weight": 2823958719279159.5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters