Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Feb 26, 2024
1 parent af0be11 commit 1d97c7c
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions Examples/Tests/circuits/inputs_resonator
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
################################
####### GENERAL PARAMETERS ######
#################################
max_step = 20000
amr.n_cell = 200 200 200
amr.max_grid_size = 200
amr.blocking_factor = 256

# do not modify these
geometry.dims = 3
warpx.verbose = 1
amr.max_level = 0

max_step = 20000
warpx.cfl = 0.9

my_constants.ncells = 200

# units [m]
my_constants.Ldomain = 0.02

amr.n_cell = ncells ncells ncells
amr.max_grid_size = ncells

# physical domain size in [m]
geometry.prob_lo = -1.e-2 -1.e-2 -1.e-2
geometry.prob_hi = 1.e-2 1.e-2 1.e-2
geometry.prob_lo = -Ldomain/2 -Ldomain/2 -Ldomain/2
geometry.prob_hi = Ldomain/2 Ldomain/2 Ldomain/2

my_constants.dx = 2.e-2/200
my_constants.dy = 2.e-2/200
my_constants.dz = 2.e-2/200
my_constants.dx = Ldomain/ncells
my_constants.dy = Ldomain/ncells
my_constants.dz = Ldomain/ncells

my_constants.ddx = dx/100
my_constants.ddy = dy/100
my_constants.ddz = dz/100
my_constants.smalldx = dx/100
my_constants.smalldy = dy/100
my_constants.smalldz = dz/100

amr.max_level = 0
boundary.field_lo = pml pml pml
boundary.field_hi = pml pml pml

#################################
############ NUMERICS ###########
#################################
warpx.verbose = 1
warpx.use_filter = 0
warpx.cfl = 0.9

algo.em_solver_medium = macroscopic # vacuum/macroscopic

Expand All @@ -49,17 +56,13 @@ macroscopic.sigma_function(x,y,z) = "sigma * (
############ FIELDS #############
#################################

my_constants.flag_ss = 2

my_constants.pi = 3.14159265359
my_constants.c = 299792458.

# length of cubic cavity
my_constants.L = 1.e-2

# thickness of metal
my_constants.t = 1.e-3

# excitation parameters
my_constants.wavelength = 1.e-2
my_constants.f = 2.99792458e10
my_constants.t0 = 2.e-10
Expand All @@ -69,19 +72,24 @@ my_constants.BW = 6.67e-11
# 5.8e7 = copper
my_constants.sigma = 5.8e3

my_constants.pi = 3.14159265359
my_constants.c = 299792458.
my_constants.epsilon_0 = 8.8541878128e-12
my_constants.mu_0 = 1.25663706212e-06

# initial E field
warpx.E_ext_grid_init_style = parse_E_ext_grid_function
warpx.Ex_external_grid_function(x,y,z) = "0."
warpx.Ey_external_grid_function(x,y,z) = "0."
warpx.Ez_external_grid_function(x,y,z) = "0."

# initial B field
warpx.B_ext_grid_init_style = parse_B_ext_grid_function
warpx.Bx_external_grid_function(x,y,z) = "0."
warpx.By_external_grid_function(x,y,z) = "0."
warpx.Bz_external_grid_function(x,y,z) = "0."

# external E excitation
warpx.E_excitation_on_grid_style = parse_E_excitation_grid_function

warpx.Ex_excitation_flag_function(x,y,z) = "0."
Expand All @@ -92,26 +100,30 @@ warpx.Ex_excitation_grid_function(x,y,z,t) = "0."
warpx.Ey_excitation_grid_function(x,y,z,t) = "0."
warpx.Ez_excitation_grid_function(x,y,z,t) = "0."

# external B excitation
warpx.B_excitation_on_grid_style = parse_B_excitation_grid_function

warpx.Bx_excitation_flag_function(x,y,z) = "flag_ss * (x>-ddx) * (x<ddx) * (y>0) * (y<dy) * (z>-L/2) * (z<L/2)"
# 2 = soft source excitation (increment field as opposed to overwrite with a hard source)
warpx.Bx_excitation_flag_function(x,y,z) = "2 * (x>-smalldx) * (x<smalldx) * (y>0) * (y<dy) * (z>-L/2) * (z<L/2)"
warpx.By_excitation_flag_function(x,y,z) = "0."
warpx.Bz_excitation_flag_function(x,y,z) = "0."

warpx.Bx_excitation_grid_function(x,y,z,t) = "exp(-(t-t0)*(t-t0)/(BW*BW))*cos(2*pi*f*(t-t0))"
warpx.By_excitation_grid_function(x,y,z,t) = "0."
warpx.Bz_excitation_grid_function(x,y,z,t) = "0."

# Diagnostics
# plotfile diagnostics
diagnostics.diags_names = plt
plt.intervals = 100
plt.fields_to_plot = Ex Ey Ez Bx By Bz
plt.diag_type = Full
plt.plot_raw_fields = 1

# output diagnostics
warpx.reduced_diags_names = Eobs1
Eobs1.type = RawEFieldReduction
Eobs1.reduction_type = integral
Eobs1.integration_type = volume
Eobs1.intervals = 1
Eobs1.reduced_function(x,y,z) = (x>L/4) * (x<L/4+dx/2+ddx) * (y>L/4) * (y<L/4+dy/2+ddy) * (z>L/4) * (z<L/4+dz/2+ddz)
Eobs1.reduced_function(x,y,z) = (x>L/4) * (x<L/4+dx/2+smalldx) * (y>L/4) * (y<L/4+dy/2+smalldy) * (z>L/4) * (z<L/4+dz/2+smalldz)

0 comments on commit 1d97c7c

Please sign in to comment.