Skip to content

Commit

Permalink
can initialize super gaussians (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
joglekara authored Aug 30, 2024
1 parent f313aac commit 91a0924
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
15 changes: 8 additions & 7 deletions adept/vfp1d/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,17 @@ def _initialize_distribution_(
dv = vmax / nv
vax = np.linspace(dv / 2.0, vmax - dv / 2.0, nv)

# alpha = np.sqrt(3.0 * gamma_3_over_m(m) / gamma_5_over_m(m))
# cst = m / (4 * np.pi * alpha**3.0 * gamma(3.0 / m))

# single_dist = np.exp(-3 * (vax**2.0) / (2 * vth**2.0)) / (2 * np.pi * vth**2.0) ** 1.5
# norm = 1.0 / np.sum(4 * np.pi * single_dist * vax**2.0 * dv, axis=0)

f = np.zeros([nx, nv])
for ix, (tn, tt) in enumerate(zip(n_prof, T_prof)):
# eq 4-51b in Shkarofsky
single_dist = (2 * np.pi * tt * (vth**2.0 / 2)) ** -1.5 * np.exp(-(vax**2.0) / (2 * tt * (vth**2.0 / 2)))

# from Ridgers2008
vth_x = np.sqrt(tt) * vth
alpha = np.sqrt(3.0 * gamma_3_over_m(m) / 2.0 / gamma_5_over_m(m))
cst = m / (4 * np.pi * alpha**3.0 * gamma_3_over_m(m))
single_dist = cst / vth_x**3.0 * np.exp(-((vax / alpha / vth_x) ** m))

f[ix, :] = tn * single_dist

# if noise_type.casefold() == "uniform":
Expand Down Expand Up @@ -164,7 +165,7 @@ def _initialize_total_distribution_(cfg, cfg_grid):

for k in ["n", "T"]:
if species_params[k]["basis"] == "uniform":
profs[k] = np.ones_like(prof_total[k])
profs[k] = species_params[k]["baseline"] * np.ones_like(prof_total[k])

elif species_params[k]["basis"] == "tanh":
center = (_Q(species_params[k]["center"]) / cfg["units"]["derived"]["x0"]).to("").value
Expand Down
40 changes: 30 additions & 10 deletions configs/vfp-1d/epp-short.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
units:
laser_wavelength: 351nm
reference electron temperature: 300eV
reference electron temperature: 3000eV
reference ion temperature: 300eV
reference electron density: 1.5e21/cm^3
Z: 30
reference electron density: 2.275e21/cm^3
Z: 6
Ion: Au+
logLambda: nrl

Expand All @@ -16,20 +16,40 @@ density:
noise_val: 0.0
v0: 0.0
T0: 1.0
m: 2.0
m: 3.4
n:
basis: uniform
baseline: 1.0
baseline: 0.9
bump_or_trough: bump
center: 0m
rise: 1m
bump_height: 0.0
width: 1m
T:
basis: sine
baseline: 1.0
baseline: 1.
amplitude: 1.0e-3
wavelength: 250um
species-hote:
noise_seed: 420
noise_type: gaussian
noise_val: 0.0
v0: 0.0
T0: 1.0
m: 2.0
n:
basis: uniform
baseline: 0.1
bump_or_trough: bump
center: 0m
rise: 1m
bump_height: 0.0
width: 1m
T:
basis: sine
baseline: 40.0
amplitude: 0.
wavelength: 250um

grid:
dt: 1fs
Expand All @@ -46,19 +66,19 @@ save:
fields:
t:
tmin: 0.0ps
tmax: 0.5ps
tmax: 2.0ps
nt: 11
electron:
t:
tmin: 0.0ps
tmax: 0.5ps
tmax: 2.0ps
nt: 6

solver: vfp-1d

mlflow:
experiment: vfp1d
run: epperlein-short
run: epperlein-short-hote-ee

drivers:
ex: {}
Expand All @@ -67,7 +87,7 @@ drivers:
terms:
fokker_planck:
flm:
ee: false
ee: true
f00:
type: Dougherty
e_solver: oshun
4 changes: 2 additions & 2 deletions tests/test_vfp1d/epp-short.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
units:
laser_wavelength: 351nm
reference electron temperature: 300eV
reference electron temperature: 2000eV
reference ion temperature: 300eV
reference electron density: 1.5e21/cm^3
Z: 30
Z: 6
Ion: Au+
logLambda: nrl

Expand Down

0 comments on commit 91a0924

Please sign in to comment.