Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test restart #69

Open
wants to merge 174 commits into
base: Pulsar_BC_CorEInRstar_plus3DR_BdipoleinRstar
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
56487d8
adding pulsar as a compiler option
RevathiJambunathan Jan 14, 2020
d3f38b2
Adding pulsar input and reading pulsar parameters using Don's PR
RevathiJambunathan Jan 15, 2020
efefcc2
adding input file for pulsar
RevathiJambunathan Jan 15, 2020
5b82539
whitespace style fix
RevathiJambunathan Jan 15, 2020
c28bf7c
moved vis from pulsar file to tools
RevathiJambunathan Jan 15, 2020
556430f
scaling notebook to detemine inputs for pulsar
RevathiJambunathan Jan 15, 2020
8f7a505
removing unwanted file
RevathiJambunathan Jan 15, 2020
082ea43
added external E and B fields and the appropriate input parameters
RevathiJambunathan Jan 17, 2020
f7f38f9
EOL whitespace
RevathiJambunathan Jan 17, 2020
ab5f2bb
seeting up bounds for pulsar surface
RevathiJambunathan Jan 17, 2020
e7c13d6
pushing changes for comparison
RevathiJambunathan Jan 18, 2020
0057ca3
particles injected below surface, dipole magnetic field inside and ou…
RevathiJambunathan Jan 21, 2020
a2d091f
add particles based on analytical surface charge density
RevathiJambunathan Jan 22, 2020
1072fbe
using local Er and Er_cor to compute particle introduction
RevathiJambunathan Jan 23, 2020
c911e9f
fixing particle injection with local Er that includes Er_external
RevathiJambunathan Jan 23, 2020
3fe5f39
changes to pulsar
RevathiJambunathan Jan 23, 2020
3a13a42
michel and li efields inside and outside star. Particle injection rho_GJ
RevathiJambunathan Jan 23, 2020
fb94124
making changes suggested in the review
RevathiJambunathan Jan 22, 2020
9f3907a
removing EOL whitespace
RevathiJambunathan Jan 22, 2020
71263c6
cleaning
RevathiJambunathan Jan 23, 2020
4c03986
adding input parameters to toggle rho gj scaling, ninjection, maxden
RevathiJambunathan Jan 24, 2020
48d1a68
removing unwanted insidePulsarBound function
RevathiJambunathan Jan 24, 2020
4e0e106
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
7c033b3
Turn on inputs parameter to damp internal E-field for the pulsar setup.
dwillcox Jan 21, 2020
274ad57
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
dcd1d8d
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
2a52a9f
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
93e87c7
Add comments to distinguish different kinds of momentum injections. A…
dwillcox Jan 24, 2020
f92237e
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
bb6a12d
Add scale factor for damping internal E-field to the inputs file.
dwillcox Jan 24, 2020
bf9cc10
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
64af47b
Remove PulsarEBField from PulsarParameters.cpp after a rebase mistake.
dwillcox Jan 24, 2020
0e10b5f
Default the momentum initialization to 0.
dwillcox Jan 24, 2020
e1e0fff
Swap tabs for spaces.
dwillcox Jan 24, 2020
ff96a08
Ran the style commands suggested by Travis CI to remove trailing whit…
dwillcox Jan 24, 2020
16d6993
Rename pulsar analysis scripts to make the WarpX style checker happy.
dwillcox Jan 24, 2020
aace0ea
fixing an error in rho_GJ calculation
RevathiJambunathan Jan 24, 2020
ffdfea3
Upsating GetPosition() based on recent changes in master branch
RevathiJambunathan Mar 10, 2020
0cb9603
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
bfd0e3f
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
21a52de
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
ea14d50
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
bdf8ee3
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
cd59aab
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
b724bcb
Undo line removal.
dwillcox Mar 13, 2020
a2edc1f
Undo removal of newline.
dwillcox Mar 13, 2020
aeae465
fix compilation error
RevathiJambunathan Jun 25, 2020
2badefb
some more compilation error
RevathiJambunathan Jun 25, 2020
8c0931b
Calling External E and B for pulsar from GetExternal functions
RevathiJambunathan Jun 25, 2020
fabcd99
a few fixes in the getexternalEB and addplasma to ensure test works
RevathiJambunathan Jul 9, 2020
54ea2eb
include staggering
RevathiJambunathan Jul 9, 2020
004d898
damp b field and include staggering. fix compilation errors
RevathiJambunathan Jul 9, 2020
33bc560
fixed Ecell
RevathiJambunathan Jul 23, 2020
f978cf6
removing particles if inside R_Star
RevathiJambunathan Jul 23, 2020
0896e14
recent input file
RevathiJambunathan Jul 23, 2020
2ec3342
eol fix
RevathiJambunathan Jul 23, 2020
4d596f7
Pulsar add external eb (#39)
RevathiJambunathan Jan 27, 2021
5e42e3d
update input file to reflect diag.intervals to align with WarpX
RevathiJambunathan Jan 27, 2021
2763c27
fix typo in quering pulsar input parameter
RevathiJambunathan Jan 27, 2021
e8a70d9
arguments passed to insidePulsarBound must be rmin and rmax
RevathiJambunathan Jan 30, 2021
76be7ab
fix bug by removing semicolon
RevathiJambunathan Feb 4, 2021
a3e151c
spherical to cartesian missing phi term. benign for analytical fields
RevathiJambunathan Feb 26, 2021
eae1650
corotatingE must have Rstar
RevathiJambunathan Mar 2, 2021
9f7fe2d
add cor E and dipole B and changes for single particle test
RevathiJambunathan Apr 1, 2021
3a94115
add particle every timestep
Apr 17, 2021
92b0df5
add option to perform single particle test
RevathiJambunathan Apr 22, 2021
e3f87ea
fix bug in line that compares radius with max radius for enforcing E …
RevathiJambunathan Apr 22, 2021
bc47612
call redistribute right after particle injection
RevathiJambunathan Apr 22, 2021
d55994c
remove unusued coord type for Ext fields
RevathiJambunathan May 13, 2021
e02b486
Add conversion from cartesian to spherical coord
RevathiJambunathan May 13, 2021
d8312f2
Add Fr Ftheta Fphi EdotB and PoyntingVector diags
RevathiJambunathan May 13, 2021
0485e8e
DampBdipole between inner and outer rings
RevathiJambunathan May 14, 2021
7a920ca
different in theory and sim inside star
RevathiJambunathan May 24, 2021
cfe958a
print to file
RevathiJambunathan May 27, 2021
c5706da
add managed vector and store diags
RevathiJambunathan Jun 1, 2021
8145b6d
add new input for continuous injection
RevathiJambunathan Jun 1, 2021
5b9eb61
Merge branch 'Pulsar_DebugTheorySim' of https://github.com/RevathiJam…
RevathiJambunathan Jun 1, 2021
2e31e2d
delete aos host function not required
RevathiJambunathan Jun 1, 2021
c222726
local additions to track theory and sim results for single charge and…
RevathiJambunathan Aug 3, 2021
61cc940
ensure new diags work with dynamic load balancing, diff src and dst d…
RevathiJambunathan Aug 12, 2021
12a07fb
merge dev into Pulsar_DebugTheorySim
RevathiJambunathan Sep 9, 2021
e39d19a
adding pulsar as a compiler option
RevathiJambunathan Jan 14, 2020
8a5414e
Adding pulsar input and reading pulsar parameters using Don's PR
RevathiJambunathan Jan 15, 2020
4b9d6e0
adding input file for pulsar
RevathiJambunathan Jan 15, 2020
e306f4b
whitespace style fix
RevathiJambunathan Jan 15, 2020
464e760
moved vis from pulsar file to tools
RevathiJambunathan Jan 15, 2020
acdba63
scaling notebook to detemine inputs for pulsar
RevathiJambunathan Jan 15, 2020
60e1659
removing unwanted file
RevathiJambunathan Jan 15, 2020
5bcedb5
added external E and B fields and the appropriate input parameters
RevathiJambunathan Jan 17, 2020
72bcb89
EOL whitespace
RevathiJambunathan Jan 17, 2020
efc1693
seeting up bounds for pulsar surface
RevathiJambunathan Jan 17, 2020
9555591
pushing changes for comparison
RevathiJambunathan Jan 18, 2020
51a0a1f
particles injected below surface, dipole magnetic field inside and ou…
RevathiJambunathan Jan 21, 2020
9869b5d
add particles based on analytical surface charge density
RevathiJambunathan Jan 22, 2020
fec150e
using local Er and Er_cor to compute particle introduction
RevathiJambunathan Jan 23, 2020
32a3a7a
fixing particle injection with local Er that includes Er_external
RevathiJambunathan Jan 23, 2020
45bcf83
changes to pulsar
RevathiJambunathan Jan 23, 2020
245ec53
michel and li efields inside and outside star. Particle injection rho_GJ
RevathiJambunathan Jan 23, 2020
d86b180
making changes suggested in the review
RevathiJambunathan Jan 22, 2020
0dd5e67
removing EOL whitespace
RevathiJambunathan Jan 22, 2020
5a6a89f
cleaning
RevathiJambunathan Jan 23, 2020
36fe622
adding input parameters to toggle rho gj scaling, ninjection, maxden
RevathiJambunathan Jan 24, 2020
bfea2ee
removing unwanted insidePulsarBound function
RevathiJambunathan Jan 24, 2020
03b2e49
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
9cbf087
Turn on inputs parameter to damp internal E-field for the pulsar setup.
dwillcox Jan 21, 2020
a1f6184
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
f760008
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
02b0643
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
86f81a8
Add comments to distinguish different kinds of momentum injections. A…
dwillcox Jan 24, 2020
da38c66
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
be3baff
Add scale factor for damping internal E-field to the inputs file.
dwillcox Jan 24, 2020
66b031b
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
246bc59
Remove PulsarEBField from PulsarParameters.cpp after a rebase mistake.
dwillcox Jan 24, 2020
6e3d0f3
Default the momentum initialization to 0.
dwillcox Jan 24, 2020
9995a51
Swap tabs for spaces.
dwillcox Jan 24, 2020
8b2cf88
Ran the style commands suggested by Travis CI to remove trailing whit…
dwillcox Jan 24, 2020
7c5f76d
Rename pulsar analysis scripts to make the WarpX style checker happy.
dwillcox Jan 24, 2020
d5ff815
fixing an error in rho_GJ calculation
RevathiJambunathan Jan 24, 2020
c91cca9
Upsating GetPosition() based on recent changes in master branch
RevathiJambunathan Mar 10, 2020
23b36f4
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
a93b0cf
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
9a62eda
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
adcf94e
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
e857b61
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
51b0dba
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
63d8851
Undo line removal.
dwillcox Mar 13, 2020
221f18e
Undo removal of newline.
dwillcox Mar 13, 2020
3e22d46
fix compilation error
RevathiJambunathan Jun 25, 2020
dba9f12
some more compilation error
RevathiJambunathan Jun 25, 2020
7e35a97
Calling External E and B for pulsar from GetExternal functions
RevathiJambunathan Jun 25, 2020
64a6e27
a few fixes in the getexternalEB and addplasma to ensure test works
RevathiJambunathan Jul 9, 2020
7062fb9
include staggering
RevathiJambunathan Jul 9, 2020
0a54dd9
damp b field and include staggering. fix compilation errors
RevathiJambunathan Jul 9, 2020
ec0234e
fixed Ecell
RevathiJambunathan Jul 23, 2020
c575f2a
removing particles if inside R_Star
RevathiJambunathan Jul 23, 2020
83b4554
recent input file
RevathiJambunathan Jul 23, 2020
01fc2a5
eol fix
RevathiJambunathan Jul 23, 2020
139488f
Pulsar add external eb (#39)
RevathiJambunathan Jan 27, 2021
f80f75a
update input file to reflect diag.intervals to align with WarpX
RevathiJambunathan Jan 27, 2021
ee355b5
fix typo in quering pulsar input parameter
RevathiJambunathan Jan 27, 2021
0b72f2b
arguments passed to insidePulsarBound must be rmin and rmax
RevathiJambunathan Jan 30, 2021
bbb6bcc
fix bug by removing semicolon
RevathiJambunathan Feb 4, 2021
cf42d8e
spherical to cartesian missing phi term. benign for analytical fields
RevathiJambunathan Feb 26, 2021
3d6b7f8
corotatingE must have Rstar
RevathiJambunathan Mar 2, 2021
710edfb
Fix conflicts and compilation errors after rebase
RevathiJambunathan Sep 10, 2021
89186ff
Adding pulsar input and reading pulsar parameters using Don's PR
RevathiJambunathan Jan 15, 2020
105bc04
added external E and B fields and the appropriate input parameters
RevathiJambunathan Jan 17, 2020
43d8659
seeting up bounds for pulsar surface
RevathiJambunathan Jan 17, 2020
9742606
particles injected below surface, dipole magnetic field inside and ou…
RevathiJambunathan Jan 21, 2020
6817d8f
using local Er and Er_cor to compute particle introduction
RevathiJambunathan Jan 23, 2020
9792194
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
104de0d
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
0a8b503
Calling External E and B for pulsar from GetExternal functions
RevathiJambunathan Jun 25, 2020
e0bb6f3
a few fixes in the getexternalEB and addplasma to ensure test works
RevathiJambunathan Jul 9, 2020
d51ec05
eol fix
RevathiJambunathan Jul 23, 2020
f16ba38
Pulsar add external eb (#39)
RevathiJambunathan Jan 27, 2021
57b0692
add cor E and dipole B and changes for single particle test
RevathiJambunathan Apr 1, 2021
e246298
add particle every timestep
Apr 17, 2021
672035f
add option to perform single particle test
RevathiJambunathan Apr 22, 2021
4ee8dcf
fix bug in line that compares radius with max radius for enforcing E …
RevathiJambunathan Apr 22, 2021
367f7fc
call redistribute right after particle injection
RevathiJambunathan Apr 22, 2021
a01dcaa
remove unusued coord type for Ext fields
RevathiJambunathan May 13, 2021
5586ed1
Add conversion from cartesian to spherical coord
RevathiJambunathan May 13, 2021
d61b10c
Add Fr Ftheta Fphi EdotB and PoyntingVector diags
RevathiJambunathan May 13, 2021
b059f1b
DampBdipole between inner and outer rings
RevathiJambunathan May 14, 2021
07dda4e
fix compilation error
RevathiJambunathan Sep 10, 2021
31b0cb2
fix compilation error after rebase with Pulsar_Development
RevathiJambunathan Sep 10, 2021
eb56f9a
fix compilation error
RevathiJambunathan Sep 10, 2021
ea15c7a
Apply suggestions from code review
RevathiJambunathan Sep 11, 2021
a254052
fix duplication. particles injected before PIC loop, and removed at t…
RevathiJambunathan Sep 11, 2021
122f3d8
fix conflicts after merging pulsar_BC_cor
RevathiJambunathan Sep 11, 2021
72f01d0
merge conflicts
RevathiJambunathan Sep 11, 2021
7eada22
trailing conflict
RevathiJambunathan Sep 11, 2021
378c297
degree to radian
RevathiJambunathan Sep 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,392 changes: 1,392 additions & 0 deletions Examples/Physics_applications/pulsar/Pulsar_scale_RstarPhysical.ipynb

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions Examples/Physics_applications/pulsar/analysis_pulsar_vis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import yt
import os
import glob
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("-f", "--plotfile", type=str, help="Path to single input plotfile to visualize.")
parser.add_argument("-d", "--dir", type=str, help="Path to input plotfile directory to visualize.")

args = parser.parse_args()

def visualize(plt, annotate_particles=True):
ds = yt.load(plt)
sl = yt.SlicePlot(ds, 0, 'Ez', aspect=1) # Create a sliceplot object
if annotate_particles:
sl.annotate_particles(width=(2.e3, 'm'),ptype="plasma_p",col='b',p_size=5.0)
sl.annotate_particles(width=(2.e3, 'm'),ptype="plasma_e",col='r',p_size=5.0)
sl.annotate_streamlines("Ey", "Ez", plot_args={"color": "black"})
sl.annotate_grids() # Show grids
sl.annotate_sphere([90000.0, 90000.0, 90000.0], radius=12000.0,
circle_args={'color':'white', 'linewidth':2})
out_name = os.path.join(os.path.dirname(plt), "pulsar_{}.png".format(os.path.basename(plt)))
sl.save(out_name)

if __name__ == "__main__":
yt.funcs.mylog.setLevel(50)
if args.dir:
failed = []
plotfiles = glob.glob(os.path.join(args.dir, "plt" + "[0-9]"*5))
for pf in plotfiles:
try:
visualize(pf)
except:
# plotfile 0 may not have particles, so turn off annotations if we first failed
try:
visualize(pf, annotate_particles=False)
except:
failed.append(pf)
pass

if len(failed) > 0:
print("Visualization failed for the following plotfiles:")
for fp in failed:
print(fp)
else:
print("No plots failed, creating a gif ...")
input_files = os.path.join(args.dir, "*.png")
output_gif = os.path.join(args.dir, "pulsar.gif")
os.system("convert -delay 20 -loop 0 {} {}".format(input_files, output_gif))

elif args.plotfile:
visualize(args.plotfile)
else:
print("Supply either -f or -d options for visualization. Use the -h option to see help.")
745 changes: 745 additions & 0 deletions Examples/Physics_applications/pulsar/analysis_pulsar_viz.ipynb

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions Examples/Physics_applications/pulsar/inputs.corotating.3d.PM
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Description:
#
# This inputs file sets up a NS with these properties:
# - E = -(omega*R)[cross]B inside the NS
# - external E and B outside the star
#
# See the "Pulsar Setup" section at the end for the options
#
# This initializes the electrons and positrons with a corotating momentum function.
# Based on the pulsar_type = "active" or "dead", particles are injected continuously or
# until rho_GJ is reached

#################################
####### GENERAL PARAMETERS ######
#################################
max_step = 5
amr.n_cell = 128 128 128
amr.max_grid_size = 128
amr.blocking_factor = 128
amr.max_level = 0
geometry.coord_sys = 0 # 0: Cartesian
geometry.is_periodic = 0 0 0 # Is periodic?
geometry.prob_lo = 0.0 0.0 0.0
geometry.prob_hi = 180000 180000 180000

#################################
############ NUMERICS ###########
#################################
#algo.maxwell_fdtd_solver = yee
warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.use_filter = 1
warpx.cfl = .95
warpx.do_pml = 1
my_constants.pi = 3.141592653589793
my_constants.dens = 5.544e6
my_constants.xc = 90000
my_constants.yc = 90000
my_constants.zc = 90000
my_constants.r_star = 12000
my_constants.omega = 6245.676
my_constants.c = 299792458.
my_constants.B_star = 8.0323e-6 # magnetic field of NS (T)
my_constants.dR = 1400
my_constants.to = 2.e-4
algo.particle_shape = 3


#################################
############ PLASMA #############
#################################
particles.nspecies = 2
particles.species_names = plasma_e plasma_p

plasma_e.charge = -q_e
plasma_e.mass = m_e
plasma_e.injection_style = "NUniformPerCell"
plasma_e.profile = parse_density_function
plasma_e.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
plasma_e.num_particles_per_cell_each_dim = 4 4 4
plasma_e.momentum_distribution_type = parse_momentum_function

## Inject stationary pairs
plasma_e.momentum_function_ux(x,y,z) = "0.0"
plasma_e.momentum_function_uy(x,y,z) = "0.0"
## uz is always 0 for the injection methods above
plasma_e.momentum_function_uz(x,y,z) = "0.0"
plasma_e.do_continuous_injection = 0
plasma_e.density_min = 1E0

plasma_p.charge = q_e
plasma_p.mass = m_e
plasma_p.injection_style = "NUniformPerCell"
plasma_p.profile = parse_density_function
plasma_p.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
plasma_p.num_particles_per_cell_each_dim = 4 4 4
plasma_p.momentum_distribution_type = parse_momentum_function

## Inject stationary pairs
plasma_p.momentum_function_ux(x,y,z) = "0.0"
plasma_p.momentum_function_uy(x,y,z) = "0.0"
## uz is always 0 for the injection methods above
plasma_p.momentum_function_uz(x,y,z) = "0.0"
plasma_p.do_continuous_injection = 0
plasma_p.density_min = 1E0

diagnostics.diags_names = plt chk
plt.diag_type = Full
plt.intervals = 1
plt.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE Er Etheta Ephi Br Btheta Bphi EdotB Sx Sy Sz

chk.format = checkpoint
chk.diag_type = Full
chk.intervals = 1000

#################################
######### PULSAR SETUP ##########
#################################
pulsar.pulsarType = "dead" # [dead/active]: sets particle injection type
pulsar.omega_star = 6245.676 # angular velocity of NS (rad/s)
pulsar.ramp_omega_time = 0.0 # time over which to ramp up NS angular velocity (s)
# if ramp_omega_time < 0, omega = omega_star for any t
# consistency requires ramp_omega_time = my_constants.to
pulsar.center_star = 90000 90000 90000
pulsar.R_star = 12032 # radius of NS (m)
pulsar.B_star = 8.0323e-6 # magnetic field of NS (T)
pulsar.dR = 1400 # thickness on the surface of the pulsar
# consistency requires dR = my_constants.dR
pulsar.verbose = 0 # [0/1]: turn on verbosity for debugging print statements
pulsar.EB_external = 0 # [0/1]: to apply external E and B
pulsar.E_external_monopole = 0 # [0/1]
pulsar.EB_corotating_maxradius = 12032 # The radius where E-field changes from corotating
# inside the star to quadrapole outside.
# Default is R_star. (r<=cor_radius) i.e. the includes
# the r specified in the input
pulsar.max_ndens = 5.54e6 # max ndens == ndens used in initializing density
pulsar.Ninj_fraction = 0.2 # fraction of sigma injected
pulsar.ModifyParticleWeight = 1 # (0/1) the fractional injection is achieved
# by modifying particle weight if 1
# by modifying num_ppc if 0
pulsar.particle_inj_rmin = 10632 # default is Rstar-dR (consistent with density function above)
pulsar.particle_inj_rmax = 12032 # default is Rstar (consistent with density function)
pulsar.max_particle_absorption_radius = 12032 # Maximum radius within which particles are
# deleted every timestep.
# Default is Rstar
pulsar.rhoGJ_scale = 1e0 # scaling down of rho_GJ
pulsar.damp_EB_internal = 0 # Damp internal electric field
pulsar.damp_EB_radius = 12032 # The radius within which EB should be damped.
# default is r_star (damping will include this radius)
pulsar.damping_scale = 1000.0 # Damping scale factor for internal electric field
pulsar.turnoffdeposition = 0 # (0/1) 0 for depositing (default)
# 1 for no deposition
pulsar.max_nodepos_radius = 0. # radius within which particle deposition for j/rho
# is turned off. (r<=max_radius)
pulsar.turnoff_plasmaEB_gather = 0 # (0/1) 0 is default. always gather
# 1 for no gather of self-consistent fields
pulsar.max_nogather_radius = 0. # radius within which self-consistent field gather
pulsar.init_dipoleBfield = 1 # default is 1
pulsar.init_corotatingEfield = 1 # default
pulsar.corotatingE_maxradius = 12032 # default is Rstar
pulsar.enforceDipoleB_maxradius = 12032 # default is Rstar
pulsar.enforceCorotatingE = 1 # default 1
pulsar.enforceDipoleB = 1 # default 1
pulsar.singleParticleTest = 0 # default 0, if 1, then a particle pair will be introduced.
# Single particle position/momentum will need to be specified
pulsar.DampBDipoleInRing = 1
pulsar.Bdamping_scale = 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Description:
#
# This inputs file sets up a NS with these properties:
# - E = -(omega*R)[cross]B inside the NS
# - external E and B outside the star
#
# See the "Pulsar Setup" section at the end for the options
#
# This initializes the electrons and positrons with a corotating momentum function.
# Based on the pulsar_type = "active" or "dead", particles are injected continuously or
# until rho_GJ is reached

#################################
####### GENERAL PARAMETERS ######
#################################
max_step = 20000
amr.n_cell = 256 256 256
amr.max_grid_size = 128
amr.blocking_factor = 128
amr.max_level = 0
geometry.coord_sys = 0 # 0: Cartesian
geometry.is_periodic = 0 0 0 # Is periodic?
geometry.prob_lo = 0.0 0.0 0.0
geometry.prob_hi = 180000 180000 180000

#################################
############ NUMERICS ###########
#################################
#algo.maxwell_fdtd_solver = yee
warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.use_filter = 1
warpx.cfl = .95
warpx.do_pml = 1
my_constants.pi = 3.141592653589793
my_constants.dens = 5.544e6
my_constants.xc = 90000
my_constants.yc = 90000
my_constants.zc = 90000
my_constants.r_star = 12000
my_constants.omega = 6245.676
my_constants.c = 299792458.
my_constants.B_star = 8.0323e-6 # magnetic field of NS (T)
my_constants.dR = 1400
my_constants.to = 2.e-4
interpolation.nox = 3
interpolation.noy = 3
interpolation.noz = 3


#################################
############ PLASMA #############
#################################
particles.nspecies = 2
particles.species_names = plasma_e plasma_p

plasma_e.charge = -q_e
plasma_e.mass = m_e
plasma_e.injection_style = "singleparticle"
plasma_e.single_particle_pos = 90000. 103000. 90000.
plasma_e.single_particle_vel = 0. 0. 0.
plasma_e.single_particle_weight = 1.
#plasma_e.profile = parse_density_function
#plasma_e.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
#plasma_e.num_particles_per_cell_each_dim = 4 4 4
#plasma_e.momentum_distribution_type = parse_momentum_function
#
### Inject stationary pairs
#plasma_e.momentum_function_ux(x,y,z) = "0.0"
#plasma_e.momentum_function_uy(x,y,z) = "0.0"
### uz is always 0 for the injection methods above
#plasma_e.momentum_function_uz(x,y,z) = "0.0"
#plasma_e.do_continuous_injection = 0
#plasma_e.density_min = 1E0

plasma_p.charge = q_e
plasma_p.mass = m_e
plasma_p.injection_style = "singleparticle"
plasma_p.single_particle_pos = 90000. 103000. 90000.
plasma_p.single_particle_vel = 0. 0. 0.
plasma_p.single_particle_weight = 1.
#plasma_p.profile = parse_density_function
#plasma_p.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
#plasma_p.num_particles_per_cell_each_dim = 4 4 4
#plasma_p.momentum_distribution_type = parse_momentum_function
#
### Inject stationary pairs
#plasma_p.momentum_function_ux(x,y,z) = "0.0"
#plasma_p.momentum_function_uy(x,y,z) = "0.0"
### uz is always 0 for the injection methods above
#plasma_p.momentum_function_uz(x,y,z) = "0.0"
#plasma_p.do_continuous_injection = 0
#plasma_p.density_min = 1E0

diagnostics.diags_names = plt chk
plt.diag_type = Full
plt.intervals = 50
plt.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE rho_plasma_e rho_plasma_p

chk.format = checkpoint
chk.diag_type = Full
chk.intervals = 1000

#################################
######### PULSAR SETUP ##########
#################################
pulsar.pulsarType = "dead" # [dead/active]: sets particle injection type
pulsar.omega_star = 6245.676 # angular velocity of NS (rad/s)
pulsar.ramp_omega_time = 0.0 # time over which to ramp up NS angular velocity (s)
# if ramp_omega_time < 0, omega = omega_star for any t
# consistency requires ramp_omega_time = my_constants.to
pulsar.center_star = 90000 90000 90000
pulsar.R_star = 12032 # radius of NS (m)
pulsar.B_star = 8.0323e-6 # magnetic field of NS (T)
pulsar.dR = 1400 # thickness on the surface of the pulsar
# consistency requires dR = my_constants.dR
pulsar.verbose = 0 # [0/1]: turn on verbosity for debugging print statements
pulsar.EB_external = 0 # [0/1]: to apply external E and B
pulsar.E_external_monopole = 0 # [0/1]
pulsar.EB_corotating_maxradius = 12032 # The radius where E-field changes from corotating
# inside the star to quadrapole outside.
# Default is R_star. (r<=cor_radius) i.e. the includes
# the r specified in the input
pulsar.max_ndens = 5.54e6 # max ndens == ndens used in initializing density
pulsar.Ninj_fraction = 0.2 # fraction of sigma injected
pulsar.ModifyParticleWeight = 1 # (0/1) the fractional injection is achieved
# by modifying particle weight if 1
# by modifying num_ppc if 0
pulsar.particle_inj_rmin = 10632 # default is Rstar-dR (consistent with density function above)
pulsar.particle_inj_rmax = 12032 # default is Rstar (consistent with density function)
pulsar.max_particle_absorption_radius = 12032 # Maximum radius within which particles are
# deleted every timestep.
# Default is Rstar
pulsar.rhoGJ_scale = 1e0 # scaling down of rho_GJ
pulsar.damp_EB_internal = 0 # Damp internal electric field
pulsar.damp_EB_radius = 12032 # The radius within which EB should be damped.
# default is r_star (damping will include this radius)
pulsar.damping_scale = 1000.0 # Damping scale factor for internal electric field
pulsar.turnoffdeposition = 0 # (0/1) 0 for depositing (default)
# 1 for no deposition
pulsar.max_nodepos_radius = 0. # radius within which particle deposition for j/rho
# is turned off. (r<=max_radius)
pulsar.turnoff_plasmaEB_gather = 0 # (0/1) 0 is default. always gather
# 1 for no gather of self-consistent fields
pulsar.max_nogather_radius = 0. # radius within which self-consistent field gather
pulsar.init_dipoleBfield = 1 # default is 1
pulsar.init_corotatingEfield = 1 # default
pulsar.corotatingE_maxradius = 12032 # default is Rstar
pulsar.enforceDipoleB_maxradius = 12032 # default is Rstar
pulsar.enforceCorotatingE = 1 # default 1
pulsar.enforceDipoleB = 1 # default 1
Loading