Skip to content

Commit 66dba3e

Browse files
authored
Update density function (#263)
1 parent 3b8b8fd commit 66dba3e

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

simulation_data/staging_injector/templates/analyze_simulation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def analyze_simulation():
4848
n_downstream_atom = float( re.findall(r'my_constants\.n_downstream_atom = (.+)', text)[0] )
4949
hydrogen_density_function = re.findall(r'hydrogen1\.density_function\(x,y,z\) = (.+)', text)[0]
5050
nitrogen_density_function = re.findall(r'nitrogen1\.density_function\(x,y,z\) = (.+)', text)[0]
51+
plateau_length = eval( re.findall(r'my_constants\.plateau_length = (.+)', text)[0] )
5152

53+
5254
# Compute red/blue shift: wavelength such that 13.5%/86.5% of the spectrum energy is below
5355
S, info = ts.get_laser_spectral_intensity(
5456
iteration=ts.iterations[-1], pol=pol)

simulation_data/staging_injector/templates/inputs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ my_constants.n_upstream_atom = {{upstream_density}}e24 # number of electrons per
6767
my_constants.n_downstream_atom = {{downstream_density}}e24 # number of electrons per m^3
6868
my_constants.ramp_length = 0.4e-2
6969
my_constants.stage_length = 3.3e-2
70+
my_constants.plateau_length = stage_length - 2*ramp_length
7071
my_constants.dopant_length = 0.4e-2
7172
my_constants.dopant_fraction = {{dopant_concentration}}e-2
7273

@@ -84,7 +85,7 @@ electrons1.xmin = 0
8485
electrons1.xmax = 0.9*x_max
8586
electrons1.zmin = 0
8687
electrons1.zmax = stage_length
87-
electrons1.density_function(x,y,z) = "(1 + 4*dopant_fraction*(z<dopant_length))*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + n_downstream_atom*(z-ramp_length)/stage_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
88+
electrons1.density_function(x,y,z) = "(1 + 4*dopant_fraction*(z<dopant_length))*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + (n_downstream_atom-n_upstream_atom)*(z-ramp_length)/plateau_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
8889
electrons1.profile = parse_density_function
8990
electrons1.momentum_distribution_type = constant
9091
electrons1.do_continuous_injection=1
@@ -97,7 +98,7 @@ hydrogen1.xmin = 0
9798
hydrogen1.xmax = 0.9*x_max
9899
hydrogen1.zmin = 0
99100
hydrogen1.zmax = stage_length
100-
hydrogen1.density_function(x,y,z) = "(1 - dopant_fraction*(z<dopant_length))*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + n_downstream_atom*(z-ramp_length)/stage_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
101+
hydrogen1.density_function(x,y,z) = "(1 - dopant_fraction*(z<dopant_length))*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + (n_downstream_atom-n_upstream_atom)*(z-ramp_length)/plateau_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
101102
hydrogen1.profile = parse_density_function
102103
hydrogen1.momentum_distribution_type = constant
103104
hydrogen1.do_continuous_injection=1
@@ -110,7 +111,7 @@ nitrogen1.xmin = 0
110111
nitrogen1.xmax = 0.9*x_max
111112
nitrogen1.zmin = 0
112113
nitrogen1.zmax = dopant_length
113-
nitrogen1.density_function(x,y,z) = "(z<dopant_length)*dopant_fraction*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + n_downstream_atom*(z-ramp_length)/stage_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
114+
nitrogen1.density_function(x,y,z) = "(z<dopant_length)*dopant_fraction*( (z<ramp_length)*sqrt(z/ramp_length)*n_upstream_atom + (z>=ramp_length)*(z<stage_length-ramp_length)*(n_upstream_atom + (n_downstream_atom-n_upstream_atom)*(z-ramp_length)/plateau_length) + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_length)*n_downstream_atom)"
114115
nitrogen1.profile = parse_density_function
115116
nitrogen1.momentum_distribution_type = constant
116117
nitrogen1.do_field_ionization = 1

0 commit comments

Comments
 (0)