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

Add MOCMC #80

Merged
merged 150 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 138 commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
322c6dd
First cut
brryan Feb 18, 2022
fb01f93
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Feb 18, 2022
2c78d46
Cleanup
brryan Feb 22, 2022
01d4d7e
Working on packing tilPi and sending it around
brryan Feb 23, 2022
e441155
Runs radiation_advection
brryan Feb 23, 2022
76ef14c
backing up
brryan Mar 1, 2022
cb02e23
Working on MOCMC, about to try fixing Mesh swarm BCs
brryan Mar 2, 2022
ca3fd6c
Refining
brryan Mar 3, 2022
b09e9ab
Working on MOCMC
brryan Mar 5, 2022
e0f830f
Prepared for pij calc
brryan Mar 6, 2022
d34c2c6
Fix species indexing on itil
brryan Mar 6, 2022
c41a243
Add transport to mocmc particles
brryan Mar 7, 2022
07c573e
Working
brryan Mar 7, 2022
668deb9
Merge remote-tracking branch 'origin' into brryan/add_mocmc
brryan Mar 8, 2022
4be8d5c
Merge branch 'brryan/add_mocmc' of github.com:lanl/phoebus into brrya…
brryan Mar 8, 2022
785ec26
adding code to assign samples a dOmega and compute eddington
jdolence Mar 8, 2022
015c33b
normalize the 2nd moment
jdolence Mar 8, 2022
38e529b
normalize the 2nd moment right
jdolence Mar 8, 2022
606b993
Make particle sampling work
brryan Mar 8, 2022
c6f0530
new singularity opac
brryan Mar 8, 2022
c4449bc
Working
brryan Mar 9, 2022
096b7ff
About to merge in jdolence recon changes
brryan Mar 9, 2022
fc31fcc
Merge branch 'brryan/add_mocmc' into jdolence/mocmc_edd
brryan Mar 9, 2022
41184ed
Merge pull request #87 from lanl/jdolence/mocmc_edd
brryan Mar 9, 2022
637159a
Compiles and runs
brryan Mar 9, 2022
b312786
opacity averaging
brryan Mar 9, 2022
f47f055
First cut of MOCMC residual
brryan Mar 9, 2022
f68a588
2D rootfind :(
brryan Mar 9, 2022
acc5884
Actually initialize samples with thermal values
brryan Mar 10, 2022
99b6098
Working on rootfind
brryan Mar 10, 2022
1a26d9f
working
brryan Mar 14, 2022
f0dec0d
Add script for getting 0D thermalization solutions
brryan Mar 15, 2022
861855f
Add pre-timestep boundary communication
brryan Mar 16, 2022
755d669
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan Mar 16, 2022
819cb0e
Working out how to deal with ispec issue
brryan Mar 22, 2022
ab04071
Bizarre error with c2p right now
brryan Mar 22, 2022
f751c56
compiles
brryan Mar 23, 2022
f4984ed
Cleaned up comments
brryan Mar 23, 2022
2270ef6
Formatting
brryan Mar 23, 2022
b6fa769
Weird git error
brryan Mar 23, 2022
1bf23e2
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Mar 23, 2022
ac8f2dc
Real version of parthenon
brryan Mar 23, 2022
241c1e8
Working to solve my bvals bug
brryan Mar 23, 2022
62ac2ff
submodule
brryan Mar 23, 2022
110b8bd
Add lfroberts suggestion for inherited type checking
brryan Mar 23, 2022
762194c
change loop pattern
brryan Mar 23, 2022
f955e8d
Formatting
brryan Mar 23, 2022
3838754
Removed EDDINGTON_KNOWN as a template parameter
brryan Mar 24, 2022
3a8009f
Update parthenon
brryan Mar 24, 2022
72e6bed
merge
brryan Apr 5, 2022
29b81fa
Remove print statements
brryan Apr 6, 2022
9e9466f
A bit of progress in mocmc interactions
brryan Apr 6, 2022
b7c1523
cleanup
brryan Apr 6, 2022
9daba9d
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Apr 7, 2022
ea0af2d
Scattering working
brryan Apr 7, 2022
4804fd7
Integrate over frequency correctly
brryan Apr 7, 2022
3b867be
old version
brryan Apr 11, 2022
ac55f8b
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan Apr 11, 2022
ecc015c
Interpolating intensities properly
brryan Apr 11, 2022
b04b465
Working on mocmc
brryan Apr 12, 2022
575ae22
Update singularity-opac
brryan Apr 12, 2022
5d00021
Working on getting units right
brryan Apr 13, 2022
66ba244
Latest singularity-opac
brryan Apr 13, 2022
ef56203
About to clean up
brryan Apr 13, 2022
3651795
Working on this
brryan Apr 13, 2022
106c213
Merge remote-tracking branch 'origin' into brryan/add_mocmc
brryan Apr 14, 2022
4ff360c
Merge branch 'brryan/add_mocmc' of github.com:lanl/phoebus into brrya…
brryan Apr 14, 2022
60d7358
Modifying units for adv test
brryan Apr 14, 2022
0d6c523
Workign
brryan Apr 14, 2022
c3166b9
moment method back to working
brryan Apr 14, 2022
58d6862
Working on this
brryan Apr 14, 2022
c1a6ff3
Got units working
brryan Apr 19, 2022
5e855f6
Add MOCMC particle counter
brryan Apr 19, 2022
e3f4e2d
Formatting
brryan Apr 19, 2022
d0be90c
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Apr 19, 2022
42ea305
Back to cfm12
brryan Apr 19, 2022
02428cb
Cleanup
brryan Apr 19, 2022
37aaa25
Working on cleaning things up
brryan Apr 19, 2022
e541876
Cleaning up
brryan Apr 21, 2022
894e52e
Working
brryan Apr 21, 2022
bd555cc
Response to code review
brryan Apr 25, 2022
a21e452
Formatting
brryan Apr 25, 2022
881c14b
Formatting
brryan Apr 25, 2022
6c44f82
Switch to GetFourVelocity
brryan Apr 25, 2022
de933b5
change intepr filename
brryan Apr 28, 2022
590ddb8
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Apr 29, 2022
4930e5b
Merge remote-tracking branch 'origin/jmm/lower-d-interp' into brryan/…
brryan Apr 29, 2022
fb2fa20
attempted fix
brryan Apr 29, 2022
3716bb6
Merge remote-tracking branch 'origin/jmm/lower-d-interp' into brryan/…
brryan Apr 29, 2022
44f3af5
Merge remote-tracking branch 'origin/jmm/lower-d-interp' into brryan/…
brryan Apr 29, 2022
d6a1ab6
Merge remote-tracking branch 'origin/jmm/lower-d-interp' into brryan/…
brryan Apr 29, 2022
c657e2a
Merge remote-tracking branch 'origin/jmm/lower-d-interp' into brryan/…
brryan Apr 29, 2022
1591200
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan Apr 29, 2022
5dd3fc4
Working on equilibration analysis
brryan Apr 29, 2022
4ea83bf
copyright
brryan Apr 29, 2022
3bc15f1
Working on consistent data reading
brryan May 2, 2022
6c3e224
Spin out phoebus package
brryan May 3, 2022
6860361
Working on this
brryan May 5, 2022
70060d1
Switch to mean opacities
brryan May 10, 2022
1654138
Formatting
brryan May 10, 2022
8a6cf34
Switching to scalefree rad physics
brryan May 12, 2022
0fddbd0
Trying to identify lack of energy conservation
brryan May 12, 2022
4c5f491
Still trying to debug
brryan May 13, 2022
c337944
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan May 16, 2022
fe88c48
MOCMC conserving atm
brryan May 16, 2022
ff4ddde
Found the line that breaks things
brryan May 16, 2022
15e29ad
Fix interpolation stencil issue
brryan May 16, 2022
728bd53
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan May 16, 2022
98eb947
fix phi domain bug
brryan May 17, 2022
bf9c331
Cleaned up print statements
brryan May 17, 2022
5cfffc7
Plot_eq working for rad again
brryan May 17, 2022
c0bccbd
wrong equilib temp
brryan May 18, 2022
d2b04dd
Looks like phoebus is equilibrating to the wrong temperature
brryan May 18, 2022
a9f88c0
MOCMC also works for eql test
brryan May 18, 2022
6c633b0
Add tests
brryan May 18, 2022
9ab55fa
Fix bugs and upgold
brryan May 18, 2022
19575b8
Formatting
brryan May 18, 2022
d1e2da6
Remove old debug code
brryan May 18, 2022
ea0a50e
update CI
brryan May 18, 2022
e989550
update CI
brryan May 18, 2022
6f56c4f
Fix bug with non-rad runs
brryan May 19, 2022
a6e0476
Some fixes from review comments
brryan May 19, 2022
cb3750c
Implement LFR approach to constant code_constants
brryan May 20, 2022
8dcd543
Fixed bug with nu units but MC still not working
brryan May 20, 2022
9afb2bb
still unclear why MC is broken
brryan May 20, 2022
8f575cf
backup
brryan May 26, 2022
6087e45
I think I fixed the bug
brryan May 26, 2022
022304f
About to move frequency unit conversion around
brryan May 26, 2022
c5e43d6
Switched frequency around, upgolded
brryan May 26, 2022
e86a312
Formatting
brryan May 26, 2022
7308a8b
Merge remote-tracking branch 'origin/main' into brryan/add_mocmc
brryan May 26, 2022
9aaed3d
bad merge
brryan May 27, 2022
a3f4523
Move to latest parthenon brryan/TEMP_PHOEBUS_SUPPORT
brryan May 31, 2022
b0e71d6
SetPrecise -> SetReal
brryan May 31, 2022
80fdb20
+/- issue I may have introduced recently
brryan May 31, 2022
d5f8cb5
Make max frac error calc more robust
brryan May 31, 2022
53461ef
Update parthenon
brryan May 31, 2022
0afee82
upgold linear modes because of old setreal precision issue
brryan May 31, 2022
7a95155
Remove printfs
brryan Jun 1, 2022
0b3629c
Don't output flux div for fluid if fluid isnt active
brryan Jun 3, 2022
476154b
Merge remote-tracking branch 'origin/brryan/fix_rad_gpu' into brryan/…
brryan Jun 3, 2022
191dd36
Fix host/gpu issue and update to latest parth preview
brryan Jun 3, 2022
1237458
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan Jun 3, 2022
05e7b35
Actually update parthenon submodule
brryan Jun 3, 2022
a379b1a
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan Jun 3, 2022
f350a88
update TEMP_PHOEBUS
brryan Jun 3, 2022
63699b5
Merge remote-tracking branch 'origin/brryan/add_mocmc' into brryan/ad…
brryan Jun 3, 2022
36dbdd6
Formatting
brryan Jun 3, 2022
24003c8
Remove printfs
brryan Jun 8, 2022
6b01f91
Merge branch 'brryan/add_mocmc' of github.com:lanl/phoebus into brrya…
brryan Jun 8, 2022
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
44 changes: 35 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,48 @@ jobs:
- name: Run test scripts
run: |
cd tst/regression
mkdir build_minkowski
cd build_minkowski
mkdir build_minkowski_release
cd build_minkowski_release
cmake -DCMAKE_BUILD_TYPE=Release -DPHOEBUS_ENABLE_UNIT_TESTS=ON -DMAX_NUMBER_CONSERVED_VARS=10 -DPHOEBUS_GEOMETRY=Minkowski -DPHOEBUS_CACHE_GEOMETRY=ON -DPARTHENON_DISABLE_HDF5_COMPRESSION=ON ../../../
cmake --build . --parallel 4
cd ..
mkdir build_fmks
cd build_fmks
mkdir build_fmks_release
cd build_fmks_release
brryan marked this conversation as resolved.
Show resolved Hide resolved
cmake -DCMAKE_BUILD_TYPE=Release -DPHOEBUS_ENABLE_UNIT_TESTS=ON -DMAX_NUMBER_CONSERVED_VARS=10 -DPHOEBUS_GEOMETRY=FMKS -DPHOEBUS_CACHE_GEOMETRY=ON -DPARTHENON_DISABLE_HDF5_COMPRESSION=ON ../../../
cmake --build . --parallel 4
cd ..
mkdir build_minkowski_debug
cd build_minkowski_debug
cmake -DCMAKE_BUILD_TYPE=Debug -DPHOEBUS_ENABLE_UNIT_TESTS=ON -DMAX_NUMBER_CONSERVED_VARS=10 -DPHOEBUS_GEOMETRY=Minkowski -DPHOEBUS_CACHE_GEOMETRY=ON -DPARTHENON_DISABLE_HDF5_COMPRESSION=ON ../../../
cmake --build . --parallel 4
cd ..
mkdir build_fmks_debug
cd build_fmks_debug
cmake -DCMAKE_BUILD_TYPE=Debug -DPHOEBUS_ENABLE_UNIT_TESTS=ON -DMAX_NUMBER_CONSERVED_VARS=10 -DPHOEBUS_GEOMETRY=FMKS -DPHOEBUS_CACHE_GEOMETRY=ON -DPARTHENON_DISABLE_HDF5_COMPRESSION=ON ../../../
cmake --build . --parallel 4
cd ..
# TODO(BRR) add --use_gpu flag here if running on GPU
./radiation_diffusion.py --executable build_minkowski/src/phoebus
./bondi.py --executable build_fmks/src/phoebus
./linear_modes.py --executable build_minkowski/src/phoebus
./thincooling.py --executable build_minkowski/src/phoebus
./thincooling_coolingfunction.py --executable build_minkowski/src/phoebus
# Release suite
./radiation_diffusion.py --executable build_minkowski_release/src/phoebus
./mocmc_diffusion.py --executable build_minkowski_release/src/phoebus
./radiation_equilibration.py --executable build_minkowski_release/src/phoebus
./mocmc_equilibration.py --executable build_minkowski_release/src/phoebus
./bondi.py --executable build_fmks_release/src/phoebus
./linear_modes.py --executable build_minkowski_release/src/phoebus
./thincooling.py --executable build_minkowski_release/src/phoebus
./thincooling_coolingfunction.py --executable build_minkowski_release/src/phoebus

# Debug suite
./radiation_diffusion.py --executable build_minkowski_debug/src/phoebus
./mocmc_diffusion.py --executable build_minkowski_debug/src/phoebus
./radiation_equilibration.py --executable build_minkowski_debug/src/phoebus
./mocmc_equilibration.py --executable build_minkowski_debug/src/phoebus
./bondi.py --executable build_fmks_debug/src/phoebus
./linear_modes.py --executable build_minkowski_debug/src/phoebus
./thincooling.py --executable build_minkowski_debug/src/phoebus
./thincooling_coolingfunction.py --executable build_minkowski_debug/src/phoebus

# Custom builds
./friedmann.py
- name: Build code for unit testing
run: |
Expand Down
2 changes: 1 addition & 1 deletion external/parthenon
42 changes: 24 additions & 18 deletions inputs/radiation_advection.pin
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<phoebus>
problem = radiation_advection
ix1_bc = outflow
ox1_bc = outflow
#ix1_bc = outflow
#ox1_bc = outflow

<parthenon/job>
problem_id = rad_adv # problem ID: basename of output filenames
Expand All @@ -22,7 +22,7 @@ problem_id = rad_adv # problem ID: basename of output filenames
variables = r.c.E, &
r.c.F, &
r.p.J, &
r.p.H
r.p.H

file_type = hdf5 # Tabular data dump
dt = 1.e-1 # time increment between outputs
Expand All @@ -42,8 +42,13 @@ nghost = 4
nx1 = 512 # Number of zones in X1-direction
x1min = 0 # minimum value of X1
x1max = 1 # maximum value of X1
ix1_bc = user # Inner-X1 boundary condition flag
ox1_bc = user # Outer-X1 boundary condition flag
#ix1_bc = user # Inner-X1 boundary condition flag
#ox1_bc = user # Outer-X1 boundary condition flag
# TODO(BRR) Currently an issue with asymptotic preserving transport in samples
# in pure scattering problems that makes this problem misbehave with outflow
# boundaries
brryan marked this conversation as resolved.
Show resolved Hide resolved
ix1_bc = periodic
ox1_bc = periodic

nx2 = 1 # Number of zones in X2-direction
x2min = -1 # minimum value of X2
Expand All @@ -59,7 +64,7 @@ ox3_bc = periodic # Outer-X3 boundary condition flfgag

num_threads = 1 # maximum number of OMP threads

bc_vars = primitive
bc_vars = primitive

<parthenon/meshblock>
nx1 = 512
Expand All @@ -74,7 +79,7 @@ max_level = 3
<eos>
type = IdealGas
Gamma = 1.6666666666666666667
Cv = 1.0
Cv = 1.0

<physics>
hydro = false
Expand All @@ -91,23 +96,24 @@ c2p_max_iter = 100
Ye = true

<radiation>
cfl = 0.5
cfl = 0.5
method = moment_m1
nu_min = 1.e15
nu_max = 1.e22
nu_bins = 200
nu_min = 1.e-2
nu_max = 1.e2
nu_bins = 10
absorption = true
do_nu_electron = true
do_nu_electron_anti = false
do_nu_heavy = false

scattering_fraction = 1.0
B_fake = 0.5
brryan marked this conversation as resolved.
Show resolved Hide resolved
use_B_fake = true
scattering_fraction = 1.0

<opacity>
type = gray
gray_kappa = 1.e3
<radiation/mocmc>
nsamp_per_zone = 32

<opacity>
type = gray
gray_kappa = 1.e3

<radiation_advection>
J = 1.0
Expand All @@ -116,5 +122,5 @@ Hy = 0.0
Hz = 0.0
vx = 0.3
width = 0.0333
kappas_init = 1.e3
tau = 1.e3
boost_profile = true
38 changes: 19 additions & 19 deletions inputs/radiation_equilibration.pin
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ bc_ox1 = outflow
problem_id = rad_eql # problem ID: basename of output filenames

<parthenon/output1>
variables = r.c.E, &
variables = p.density, &
r.p.J, &
r.p.H, &
r.c.E, &
r.c.F, &
c.energy
p.energy, &
c.energy

file_type = hdf5 # Tabular data dump
dt = 1.e-1 # time increment between outputs
Expand All @@ -38,11 +42,11 @@ nghost = 4
#refinement = adaptive
#numlevel = 3

nx1 = 32 # Number of zones in X1-direction
nx1 = 4 # Number of zones in X1-direction
x1min = 0 # minimum value of X1
x1max = 1 # maximum value of X1
ix1_bc = periodic # Inner-X1 boundary condition flag
ox1_bc = periodic # Outer-X1 boundary condition flag
ix1_bc = periodic # Inner-X1 boundary condition flag
ox1_bc = periodic # Outer-X1 boundary condition flag

nx2 = 1 # Number of zones in X2-direction
x2min = -1 # minimum value of X2
Expand All @@ -58,10 +62,10 @@ ox3_bc = periodic # Outer-X3 boundary condition flfgag

num_threads = 1 # maximum number of OMP threads

bc_vars = primitive
bc_vars = primitive

<parthenon/meshblock>
nx1 = 32
nx1 = 4
nx2 = 1
nx3 = 1

Expand All @@ -73,7 +77,7 @@ max_level = 3
<eos>
type = IdealGas
Gamma = 1.6666666666666666667
Cv = 1.0
Cv = 1.0

<physics>
hydro = true
Expand All @@ -90,23 +94,19 @@ c2p_max_iter = 100
Ye = true

<radiation>
cfl = 0.8
cfl = 0.8
method = moment_eddington
nu_min = 1.e15
nu_max = 1.e22
nu_bins = 200
nu_min = 1.e-2
nu_max = 1.e2
nu_bins = 10
absorption = true
do_nu_electron = true
do_nu_electron_anti = false
do_nu_heavy = false

scattering_fraction = 0.0
B_fake = 0.5
use_B_fake = false

<opacity>
type = gray
gray_kappa = 1.0
<opacity>
type = gray
gray_kappa = 0.2

<radiation_equilibration>
J = 0.2
11 changes: 6 additions & 5 deletions inputs/thincooling.pin
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variables = p.density, &
temperature

file_type = hdf5 # Tabular data dump
dt = 1.e-2 # time increment between outputs
dt = 1.e-3 # time increment between outputs

<parthenon/time>
nlim = -1 # cycle limit
Expand All @@ -27,8 +27,7 @@ nghost = 4

nx1 = 4 # Number of zones in X1-direction
x1min = 0 # minimum value of X1
#x1max = 1.e-7 # maximum value of X1 (for cooling_function)
x1max = 1.e-4 # maximum value of X1 (for monte_carlo)
x1max = 5.e-4 # maximum value of X1 (for monte_carlo)
ix1_bc = periodic # Inner-X1 boundary condition flag
ox1_bc = periodic # Outer-X1 boundary condition flag

Expand Down Expand Up @@ -81,8 +80,10 @@ Ye = true
method = monte_carlo
nu_min = 1.e15
nu_max = 0.9999e17
nu_bins = 200
tune_emission = 1.e-39
nu_bins = 100
tune_emission = 1.e-43
#tune_emission = 1.e-41
#tune_emission = 1.e-34
num_particles = 16
opacity_model = tophat
absorption = false
Expand Down
16 changes: 7 additions & 9 deletions scripts/python/neutrino_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,23 @@
import os
from subprocess import call, DEVNULL
import glob
from parthenon_tools import phdf
import time
from enum import Enum
from phoedf import phoedf

NeutrinoSpecies = Enum('NeutrinoSpecies', 'electron electronanti')

dfnams = np.sort(glob.glob(DUMP_NAMES))
dfile0 = phdf.phdf(dfnams[0])
dfile0 = phoedf(dfnams[0])

cl = 2.99792458e10
mp = 1.672621777e-24
h = 6.62606957e-27

T_unit = dfile0.Params['eos/time_unit']
L_unit = dfile0.Params['eos/length_unit']
M_unit = dfile0.Params['eos/mass_unit']
U_unit = M_unit / L_unit**3 * cl**2
numin = dfile0.Params['radiation/nu_min']
numax = dfile0.Params['radiation/nu_max']
T_unit = dfile0.TimeCodeToCGS
U_unit = dfile0.EnergyDensityCodeToCGS
numin = dfile0.Params['opacity/numin']
numax = dfile0.Params['opacity/numax']
do_nu_electron = dfile0.Params['radiation/do_nu_electron']
do_nu_electron_anti = dfile0.Params['radiation/do_nu_electron_anti']
do_nu_heavy = dfile0.Params['radiation/do_nu_heavy']
Expand Down Expand Up @@ -84,7 +82,7 @@ def get_u(t):
Ye_code = np.zeros(dfnams.size)
u_code = np.zeros(dfnams.size)
for n, dfnam in enumerate(dfnams):
dfile = phdf.phdf(dfnam)
dfile = phoedf(dfnam)
t_code[n] = dfile.Time*T_unit
Ye_code[n] = dfile.Get("p.ye").mean()
u_code[n] = dfile.Get("p.energy").mean()*U_unit
Expand Down
79 changes: 79 additions & 0 deletions scripts/python/phoebus_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# © 2022. Triad National Security, LLC. All rights reserved. This
# program was produced under U.S. Government contract
# 89233218CNA000001 for Los Alamos National Laboratory (LANL), which
# is operated by Triad National Security, LLC for the U.S. Department
# of Energy/National Nuclear Security Administration. All rights in
# the program are reserved by Triad National Security, LLC, and the
# U.S. Department of Energy/National Nuclear Security
# Administration. The Government is granted for itself and others
# acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
# license in this material to reproduce, prepare derivative works,
# distribute copies to the public, perform publicly and display
# publicly, and to permit others to do so.

from math import pi
cgs = {}
cgs['KM'] = 1e5
cgs['CL'] = 2.99792458e10
cgs['QE'] = 4.80320680e-10
cgs['ME'] = 9.1093826e-28
cgs['MP'] = 1.67262171e-24
cgs['MN'] = 1.67492728e-24
cgs['HPL'] = 6.6260693e-27
cgs['HBAR'] = 1.0545717e-27
cgs['KBOL'] = 1.3806505e-16
cgs['GNEWT'] = 6.6742e-8
cgs['SIG'] = 5.670400e-5
cgs['AR'] = 7.5657e-15
cgs['THOMSON'] = 0.665245873e-24
cgs['JY'] = 1.e-23
cgs['PC'] = 3.085678e18
cgs['AU'] = 1.49597870691e13
cgs['MSOLAR'] = 1.989e33
cgs['RSOLAR'] = 6.96e10
cgs['LSOLAR'] = 3.827e33
cgs['EV'] = 1.60217653e-12
cgs['MEV'] = 1.0e6*cgs['EV']
cgs['GEV'] = 1.0e9*cgs['EV']
cgs['K'] = 1.380648780669e-16
cgs['GK'] = 1.0e9*cgs['K']
cgs['GFERM'] = 1.435850814907447e-49
cgs['GA'] = -1.272323
cgs['S2THW'] = 0.222321
cgs['alphafs'] = 1./137.
cgs['NUSIGMA0'] = (4.0*(cgs['GFERM']**2)
*((cgs['ME']*cgs['CL']**2)**2)
/(pi*(cgs['HBAR']*cgs['CL'])**4))

scalefree = {}
scalefree['KM'] = 1.
scalefree['CL'] = 1.
scalefree['QE'] = 1.
scalefree['ME'] = 1.
scalefree['MP'] = 1.
scalefree['MN'] = 1.
scalefree['HPL'] = 1.
scalefree['HBAR'] = scalefree['HPL']/(2.*pi)
scalefree['KBOL'] = 1.
scalefree['GNEWT'] = 1.
scalefree['SIG'] = 1.
scalefree['AR'] = 1.
scalefree['THOMSON'] = 1.
scalefree['JY'] = 1.
scalefree['PC'] = 1.
scalefree['AU'] = 1.
scalefree['MSOLAR'] = 1.
scalefree['RSOLAR'] = 1.
scalefree['LSOLAR'] = 1.
scalefree['EV'] = 1.
scalefree['MEV'] = 1.0e6*scalefree['EV']
scalefree['GEV'] = 1.0e9*scalefree['EV']
scalefree['K'] = 1.
scalefree['GK'] = 1.0e9*scalefree['K']
scalefree['GFERM'] = 1.
scalefree['GA'] = -1.
scalefree['S2THW'] = 1.
scalefree['alphafs'] = 1./137.
scalefree['NUSIGMA0'] = (4.0*(scalefree['GFERM']**2)
*((scalefree['ME']*scalefree['CL']**2)**2)
/(pi*(scalefree['HBAR']*scalefree['CL'])**4))
brryan marked this conversation as resolved.
Show resolved Hide resolved
Loading