Skip to content

Commit 3b8b8fd

Browse files
authored
Add upstream pressure to the control variables (#257)
1 parent 9557c9f commit 3b8b8fd

6 files changed

Lines changed: 30 additions & 13 deletions

File tree

dashboard/config/variables.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ staging_injector:
22

33
input_variables:
44

5+
input0:
6+
name: "Cap Up (torr)"
7+
type: scalar
8+
default: 16.5
9+
value_range: [10, 25]
10+
511
input1:
612
name: "Cap downstream (torr)"
713
type: scalar
@@ -50,20 +56,27 @@ staging_injector:
5056
beta: 0.0
5157

5258
input4:
53-
name: "Background density [1e18/cm^3]"
59+
name: "Upstream density [1e18/cm^3]"
5460
unit: "cm^-3"
55-
depends_on: "Cap downstream (torr)"
61+
depends_on: "Cap Up (torr)"
5662
alpha: 0.0644
5763
beta: 0.0
5864

5965
input5:
66+
name: "Downstream density [1e18/cm^3]"
67+
unit: "cm^-3"
68+
depends_on: "Cap downstream (torr)"
69+
alpha: 0.0644
70+
beta: 0.0
71+
72+
input6:
6073
name: "Trapped charge [pC]"
6174
unit: "pC"
6275
depends_on: "EBeamPrf charge [pC]"
6376
alpha: 1.0
6477
beta: 0.0
6578

66-
input6:
79+
input7:
6780
name: "Beam RMS div x [mrad]"
6881
unit: "mrad"
6982
depends_on: "EBeamPrf fwhm div x [mrad]"

simulation_data/staging_injector/submission_script_multi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -l
22

3-
#SBATCH -t 02:15:00
3+
#SBATCH -t 04:00:00
44
#SBATCH -N 60
55
#SBATCH -A m558_g
66
#SBATCH -q regular

simulation_data/staging_injector/templates/analyze_simulation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def analyze_simulation():
4444
ramp_length = float( re.findall(r'my_constants\.ramp_length = (.+)', text)[0] )
4545
dopant_length = float( re.findall(r'my_constants\.dopant_length = (.+)', text)[0] )
4646
dopant_fraction = float( re.findall(r'my_constants\.dopant_fraction = (.+)', text)[0] )
47-
n_atom = float( re.findall(r'my_constants\.n_atom = (.+)', text)[0] )
47+
n_upstream_atom = float( re.findall(r'my_constants\.n_upstream_atom = (.+)', text)[0] )
48+
n_downstream_atom = float( re.findall(r'my_constants\.n_downstream_atom = (.+)', text)[0] )
4849
hydrogen_density_function = re.findall(r'hydrogen1\.density_function\(x,y,z\) = (.+)', text)[0]
4950
nitrogen_density_function = re.findall(r'nitrogen1\.density_function\(x,y,z\) = (.+)', text)[0]
5051

simulation_data/staging_injector/templates/inputs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ my_constants.ppc_z1 = 3
6363
##### plasma parameters #########
6464
#################################
6565

66-
my_constants.n_atom = {{background_density}}e24 # number of electrons per m^3
66+
my_constants.n_upstream_atom = {{upstream_density}}e24 # number of electrons per m^3
67+
my_constants.n_downstream_atom = {{downstream_density}}e24 # number of electrons per m^3
6768
my_constants.ramp_length = 0.4e-2
6869
my_constants.stage_length = 3.3e-2
6970
my_constants.dopant_length = 0.4e-2
@@ -83,7 +84,7 @@ electrons1.xmin = 0
8384
electrons1.xmax = 0.9*x_max
8485
electrons1.zmin = 0
8586
electrons1.zmax = stage_length
86-
electrons1.density_function(x,y,z) = "(1 + 4*dopant_fraction*(z<dopant_length))*n_atom*( (z<ramp_length)*sqrt(z/ramp_length) + (z>=ramp_length)*(z<stage_length-ramp_length)*1 + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_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)"
8788
electrons1.profile = parse_density_function
8889
electrons1.momentum_distribution_type = constant
8990
electrons1.do_continuous_injection=1
@@ -96,7 +97,7 @@ hydrogen1.xmin = 0
9697
hydrogen1.xmax = 0.9*x_max
9798
hydrogen1.zmin = 0
9899
hydrogen1.zmax = stage_length
99-
hydrogen1.density_function(x,y,z) = "(1 - dopant_fraction*(z<dopant_length))*n_atom*( (z<ramp_length)*sqrt(z/ramp_length) + (z>=ramp_length)*(z<stage_length-ramp_length)*1 + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_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)"
100101
hydrogen1.profile = parse_density_function
101102
hydrogen1.momentum_distribution_type = constant
102103
hydrogen1.do_continuous_injection=1
@@ -109,7 +110,7 @@ nitrogen1.xmin = 0
109110
nitrogen1.xmax = 0.9*x_max
110111
nitrogen1.zmin = 0
111112
nitrogen1.zmax = dopant_length
112-
nitrogen1.density_function(x,y,z) = "(z<dopant_length)*dopant_fraction*n_atom*( (z<ramp_length)*sqrt(z/ramp_length) + (z>=ramp_length)*(z<stage_length-ramp_length)*1 + (z>=stage_length-ramp_length)*(z<stage_length)*sqrt((stage_length-z)/ramp_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)"
113114
nitrogen1.profile = parse_density_function
114115
nitrogen1.momentum_distribution_type = constant
115116
nitrogen1.do_field_ionization = 1

simulation_data/staging_injector/templates/prepare_simulation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def record_simulation_parameters():
1818
"Laser energy [J]": {{laser_energy}},
1919
"Target-to-focus distance [cm]": {{target_to_focus_distance}},
2020
"Dopant concentration [%]": {{dopant_concentration}},
21-
"Background density [1e18/cm^3]": {{background_density}},
21+
"Upstream density [1e18/cm^3]": {{upstream_density}},
22+
"Downstream density [1e18/cm^3]": {{downstream_density}},
2223
}
2324
# Dump input parameters, to be read in analysis file
2425
with open('input_params.json', 'w') as file:

simulation_data/staging_injector/templates/run_grid_scan.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ def analysis_func_main(work_dir, output_params):
1313
var_1 = VaryingParameter("laser_energy", 12.5, 13.5)
1414
var_2 = VaryingParameter("target_to_focus_distance", 0, 1)
1515
var_3 = VaryingParameter("dopant_concentration", 0, 3)
16-
var_4 = VaryingParameter("background_density", 0.33, 1.1)
16+
var_4 = VaryingParameter("upstream_density", 0.9, 1.54)
17+
var_5 = VaryingParameter("downstream_density", 0.33, 1.1)
1718
obj = Objective("f", minimize=False)
1819

19-
n_steps = [3, 5, 4, 6]
20+
n_steps = [3, 5, 4, 6, 6]
2021
sim_workers = 240
2122

2223
# Compute total number of steps
@@ -26,7 +27,7 @@ def analysis_func_main(work_dir, output_params):
2627

2728
# Create generator
2829
gen = GridSamplingGenerator(
29-
varying_parameters=[var_1,var_2,var_3,var_4],
30+
varying_parameters=[var_1,var_2,var_3,var_4,var_5],
3031
objectives=[obj],
3132
n_steps=n_steps,
3233
)

0 commit comments

Comments
 (0)