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

Update constants to use values from CODATA2022 #5661

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
iz0 = round((0.0 - zmin) / dz)

# Constants
eps_0 = 8.8541878128e-12 # Vacuum Permittivity in C/(V*m)
q_e = -1.60217662e-19 # Electron charge in C
eps_0 = 8.8541878188e-12 # Vacuum Permittivity in C/(V*m)
q_e = -1.602176634e-19 # Electron charge in C
pi = np.pi # Circular constant of the universe
r_0 = 0.1 # Initial radius of sphere
q_tot = -1e-15 # Total charge of sphere in C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FILE = inputs_base_3d

# test input parameters
algo.em_solver_medium = macroscopic
macroscopic.epsilon = 1.5*8.8541878128e-12
macroscopic.mu = 1.25663706212e-06
macroscopic.epsilon = 1.5*8.8541878188e-12
macroscopic.mu = 1.25663706127e-06
macroscopic.sigma = 0
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ my_constants.Lx = 1.06
my_constants.Lz = 1.06
my_constants.x_cent = 0.
my_constants.z_cent = 0.
my_constants.mu_0 = 1.25663706212e-06
my_constants.mu_0 = 1.25663706127e-06

warpx.B_ext_grid_init_style = parse_B_ext_grid_function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ my_constants.x_cent = 0.
my_constants.y_cent = 0.
my_constants.z_cent = 0.
my_constants.h_2 = (m * pi / Lx) ** 2 + (n * pi / Ly) ** 2 + (p * pi / Lz) ** 2
my_constants.mu_0 = 1.25663706212e-06
my_constants.mu_0 = 1.25663706127e-06

warpx.B_ext_grid_init_style = parse_B_ext_grid_function
warpx.Bx_external_grid_function(x,y,z) = "-2/h_2 * mu_0 * (m * pi / Lx) * (p * pi / Lz) *
Expand Down
1 change: 1 addition & 0 deletions Examples/Tests/nci_psatd_stability/analysis_galilean.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
energy_ref = 191002.6526271543
if current_correction and periodic_single_box:
energy_ref = 472779.70801323955
tol_charge = 1.2e-9
if current_correction and not periodic_single_box:
energy_ref = 511671.4108624746
tol_charge = 3e-4
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/photon_pusher/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Physical constants
c = 299792458.0
m_e = 9.1093837015e-31
m_e = 9.1093837139e-31
# ________________________________________

# Test cases
Expand Down
6 changes: 3 additions & 3 deletions Examples/Tests/qed/analysis_breit_wheeler_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
tol = 1.0e-8
tol_red = 2.0e-2

# Physical constants (from CODATA 2018, see: https://physics.nist.gov/cuu/Constants/index.html )
me = 9.1093837015e-31 # electron mass
# Physical constants (from CODATA 2022, see: https://physics.nist.gov/cuu/Constants/index.html )
me = 9.1093837139e-31 # electron mass
c = 299792458 # speed of light
hbar = 6.62607015e-34 / (2 * np.pi) # reduced Plank constant
fine_structure = 7.2973525693e-3 # fine structure constant
fine_structure = 7.2973525643e-3 # fine structure constant
qe = 1.602176634e-19 # elementary charge
E_s = (me**2 * c**3) / (qe * hbar) # Schwinger E field
B_s = E_s / c # Schwinger B field
Expand Down
6 changes: 3 additions & 3 deletions Examples/Tests/qed/analysis_quantum_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
tol = 1.0e-8
tol_red = 1.0e-2

# Physical constants (from CODATA 2018, see: https://physics.nist.gov/cuu/Constants/index.html )
me = 9.1093837015e-31 # electron mass
# Physical constants (from CODATA 2022, see: https://physics.nist.gov/cuu/Constants/index.html )
me = 9.1093837139e-31 # electron mass
c = 299792458 # speed of light
hbar = 6.62607015e-34 / (2 * np.pi) # reduced Plank constant
fine_structure = 7.2973525693e-3 # fine structure constant
fine_structure = 7.2973525643e-3 # fine structure constant
qe = 1.602176634e-19 # elementary charge
E_s = (me**2 * c**3) / (qe * hbar) # Schwinger E field
B_s = E_s / c # Schwinger B field
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/qed/analysis_schwinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
# define some parameters

c = 299792458.0
m_e = 9.1093837015e-31
m_e = 9.1093837139e-31
e = 1.602176634e-19
hbar = 1.054571817e-34
hbar = 1.0545718176461565e-34
E_S = m_e**2 * c**3 / e / hbar # Schwinger field

dV = (1.0e-6) ** 3 # total simulation volume
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/radiation_reaction/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

# Physical constants
c = 299792458.0
m_e = 9.1093837015e-31
m_e = 9.1093837139e-31
q_0 = 1.602176634e-19
classical_electron_radius = 2.81794e-15
classical_electron_radius = 2.8179403205e-15
reference_length = 1.0e-6
very_small_dot_product = 1.0e-4
very_small_weight = 1.0e-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ algo.particle_shape = 1
algo.maxwell_solver = none

particles.species_names = hydrogen
hydrogen.mass = 1.67262192369e-27
hydrogen.mass = 1.67262192595e-27
hydrogen.charge = 1.602176634e-19
hydrogen.injection_style = nrandompercell
hydrogen.initialize_self_fields = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ algo.particle_shape = 1
algo.maxwell_solver = none

particles.species_names = hydrogen
hydrogen.mass = 1.67262192369e-27
hydrogen.mass = 1.67262192595e-27
hydrogen.charge = 1.602176634e-19
hydrogen.injection_style = nrandompercell
hydrogen.initialize_self_fields = 0
Expand Down
10 changes: 5 additions & 5 deletions Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class constants:
# --- Put the constants in their own namespace
# --- Values from WarpXConst.H
c = 299792458.0
ep0 = 8.8541878128e-12
mu0 = 1.25663706212e-06
ep0 = 8.8541878188e-12
mu0 = 1.25663706127e-06
q_e = 1.602176634e-19
m_e = 9.1093837015e-31
m_p = 1.67262192369e-27
hbar = 1.054571817e-34
m_e = 9.1093837139e-31
m_p = 1.67262192595e-27
hbar = 1.0545718176461565e-34
kb = 1.380649e-23


Expand Down
10 changes: 5 additions & 5 deletions Regression/Checksum/benchmarks_json/test_1d_collision_z.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"jz": 0.0
},
"ions": {
"particle_momentum_x": 3.4242515316949867e-16,
"particle_momentum_y": 3.441515880563085e-16,
"particle_momentum_z": 5.537993210573513e-16,
"particle_position_x": 720.0714079424476,
"particle_momentum_x": 3.426740383191036e-16,
"particle_momentum_y": 3.4341191627531064e-16,
"particle_momentum_z": 5.534133727474967e-16,
"particle_position_x": 720.0606789412075,
"particle_weight": 1.0999999999999997e+24
}
}
}
22 changes: 11 additions & 11 deletions Regression/Checksum/benchmarks_json/test_1d_fel.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"lev=0": {
"Bx": 0.0,
"By": 473.98537926589177,
"By": 473.9851752069676,
"Bz": 0.0,
"Ex": 142097845843.78326,
"Ex": 142097784668.6643,
"Ey": 0.0,
"Ez": 0.0,
"jx": 1260205974.7220135,
"jx": 1260206216.9372153,
"jy": 0.0,
"jz": 0.0
},
"electrons": {
"particle_position_x": 0.0,
"particle_position_y": 0.0,
"particle_position_z": 13607.572916093213,
"particle_momentum_x": 3.2646797960476606e-19,
"particle_position_z": 13607.572916094066,
"particle_momentum_x": 3.2646796350343706e-19,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.541338620507345e-16,
"particle_weight": 1349823909946836.0
"particle_momentum_z": 1.541338621662012e-16,
"particle_weight": 1349823910557873.5
},
"positrons": {
"particle_position_x": 0.0,
"particle_position_y": 0.0,
"particle_position_z": 13607.572916093213,
"particle_momentum_x": 3.2646797960476606e-19,
"particle_position_z": 13607.572916094066,
"particle_momentum_x": 3.2646796350343706e-19,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.541338620507345e-16,
"particle_weight": 1349823909946836.0
"particle_momentum_z": 1.541338621662012e-16,
"particle_weight": 1349823910557873.5
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"lev=0": {
"Ez": 123800860242.32724,
"jz": 48549778373280.2,
"rho": 344278.3437340355
"Ez": 123800860081.74591,
"jz": 48549779347546.66,
"rho": 344278.34351820184
}
}
26 changes: 13 additions & 13 deletions Regression/Checksum/benchmarks_json/test_1d_langmuir_multi.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.186531831468082e-22,
"particle_position_x": 2.560000000000000e-03,
"particle_weight": 8.000000000000000e+19
},
"lev=0": {
"Bx": 0.0,
"By": 0.0,
"Bz": 0.0,
"Ex": 0.0,
"Ey": 0.0,
"Ez": 1.241536718934408e+11,
"Ez": 124153671742.0029,
"jx": 0.0,
"jy": 0.0,
"jz": 4.745867308790159e+13
"jz": 47458674066449.58
},
"positrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.186531831468082e-22,
"particle_position_x": 2.560000000000001e-03,
"particle_weight": 8.000000000000000e+19
"particle_momentum_z": 1.1865318612030134e-22,
"particle_position_x": 0.0025600000000000006,
"particle_weight": 8e+19
},
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.1865318612030134e-22,
"particle_position_x": 0.00256,
"particle_weight": 8e+19
}
}
}
30 changes: 15 additions & 15 deletions Regression/Checksum/benchmarks_json/test_1d_laser_acceleration.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 1.2957667581353911e-20,
"particle_momentum_z": 3.314669116074607e-21,
"particle_orig_z": 0.02238310546875004,
"particle_position_x": 0.02235662928400318,
"particle_regionofinterest": 38.0,
"particle_weight": 5.1796875e+18
},
"lev=0": {
"Bx": 178016.89264546678,
"Bx": 178016.8926456872,
"By": 0.0,
"Bz": 0.0,
"Ex": 0.0,
"Ey": 40878300517906.74,
"Ez": 12662514703.092445,
"Ey": 40878300517960.234,
"Ez": 12662514721.141022,
"jx": 0.0,
"jy": 30370448611224.453,
"jz": 5611270121187.104,
"rho": 3098219.079601462
"jy": 30370448606626.36,
"jz": 5611270133558.213,
"rho": 3098219.079601461
},
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 1.2957667586537889e-20,
"particle_momentum_z": 3.3146691226657727e-21,
"particle_orig_z": 0.02238310546875004,
"particle_position_x": 0.022356629283921774,
"particle_regionofinterest": 38.0,
"particle_weight": 5.1796875e+18
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"lev=0": {
"Bx": 7268241.144300916,
"Bx": 7268241.1443280205,
"By": 0.0,
"Bz": 0.0,
"Ex": 0.0,
"Ey": 2146970168314705.0,
"Ez": 370041408451418.1,
"Ey": 2146970168321463.0,
"Ez": 370041407961430.2,
"jx": 0.0,
"jy": 3.4818196503065956e+16,
"jz": 2.3196405062669472e+17,
"rho": 775945622.8993922
"jy": 3.4818196485606964e+16,
"jz": 2.31964050352414e+17,
"rho": 775945621.9761939
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 1.295766758135391e-20,
"particle_momentum_z": 3.314669116074607e-21,
"particle_position_x": 0.02235662928400318,
"particle_weight": 5.1796875e+18
},
"lev=0": {
"Bx": 178016.8926454668,
"Bx": 178016.8926456872,
"By": 0.0,
"Bz": 0.0,
"Ex": 0.0,
"Ey": 40878300517906.74,
"Ez": 12662514703.09245,
"Ey": 40878300517960.234,
"Ez": 12662514721.141022,
"jx": 0.0,
"jy": 30370448611224.45,
"jz": 5611270121187.104,
"rho": 3098219.079601462
"jy": 30370448606626.36,
"jz": 5611270133558.213,
"rho": 3098219.079601461
},
"electrons": {
"particle_momentum_x": 0.0,
"particle_momentum_y": 1.2957667586537889e-20,
"particle_momentum_z": 3.3146691226657727e-21,
"particle_position_x": 0.022356629283921774,
"particle_weight": 5.1796875e+18
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"lev=0": {
"Bx": 0.08460920626188952,
"By": 0.07485331147996604,
"Bx": 0.08460920619089983,
"By": 0.07485331151684288,
"Bz": 256.0,
"Ex": 1954.3267519602405,
"Ey": 2363.4281756166347,
"Ez": 4873.508158589938,
"jx_displacement": 914396602.5344071,
"jy_displacement": 762623912.4748704,
"jz_displacement": 2938492698.375407
"Ex": 1954.3267492531736,
"Ey": 2363.4281754474127,
"Ez": 4873.50815858735,
"jx_displacement": 914396602.5823275,
"jy_displacement": 762623911.2464752,
"jz_displacement": 2938492698.37597
},
"ions": {
"particle_momentum_x": 1.6151135948675135e-19,
"particle_momentum_y": 1.6152336151551518e-19,
"particle_momentum_z": 1.6134581268392543e-19,
"particle_momentum_x": 1.6151135948675014e-19,
"particle_momentum_y": 1.615233615155173e-19,
"particle_momentum_z": 1.613458126839253e-19,
"particle_position_x": 3678.484650899751,
"particle_weight": 4.220251350277737e+21
}
}

}
Loading
Loading