GeezerVison is showing github.com — adding a constant to convert between power units · walshjon/pyne@10ffe0d
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: pyne/cpp_data.pxd +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,7 @@ cdef extern from "data.h" namespace "pyne": |
16 | 16 | double cm2_per_barn |
17 | 17 | double sec_per_day |
18 | 18 | double MeV_per_K |
| 19 | + double MeV_per_MW_s |
19 | 20 |
|
20 | 21 | # hash map and initialization function |
21 | 22 | map[std_string, std_string] data_checksums |
|
Collapse file
Copy file name to clipboardExpand all lines: pyne/data.pyx +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -55,6 +55,8 @@ sec_per_day = cpp_data.sec_per_day |
55 | 55 | MeV_per_K = cpp_data.MeV_per_K |
56 | 56 | """Megaelectronvolts per Kelvin.""" |
57 | 57 |
|
| 58 | +MeV_per_MW_s = cpp_data.MeV_per_MW_s |
| 59 | +"""Megaelectronvolts per megawatt-second.""" |
58 | 60 |
|
59 | 61 | # |
60 | 62 | # hash map and initialization |
|
Collapse file
Copy file name to clipboardExpand all lines: src/data.cpp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ const double pyne::barns_per_cm2 = 1e24; |
13 | 13 | const double pyne::cm2_per_barn = 1e-24; |
14 | 14 | const double pyne::sec_per_day = 24.0 * 3600.0; |
15 | 15 | const double pyne::MeV_per_K = 8.617343e-11; |
| 16 | +const double pyne::MeV_per_MW_s = 1.60217657e-19; |
16 | 17 |
|
17 | 18 | /********************************/ |
18 | 19 | /*** data_checksums Functions ***/ |
|
Collapse file
Copy file name to clipboardExpand all lines: src/data.h +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -38,6 +38,7 @@ namespace pyne |
38 | 38 | extern const double cm2_per_barn; ///< cm^2 per barn |
39 | 39 | extern const double sec_per_day; ///< seconds per day |
40 | 40 | extern const double MeV_per_K; ///< MeV per Kelvin |
| 41 | + extern const double MeV_per_MW_s; ///< MeV/s per MW |
41 | 42 | /// \} |
42 | 43 |
|
43 | 44 | extern std::string NUC_DATA_PATH; ///< Path to the nuc_data.h5 file. |
|
Collapse file
Copy file name to clipboardExpand all lines: src/material.cpp +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1097,10 +1097,8 @@ pyne::comp_map pyne::Material::decay_heat() { |
1097 | 1097 | using pyne::q_val; |
1098 | 1098 | pyne::comp_map dh; |
1099 | 1099 | double masspermole = mass * pyne::N_A; |
1100 | | - // converts MeV/s to MW |
1101 | | - double qconv = 1.602e-19; |
1102 | 1100 | for (pyne::comp_iter i = comp.begin(); i != comp.end(); ++i) { |
1103 | | - dh[i->first] = qconv * masspermole * (i->second) * \ |
| 1101 | + dh[i->first] = pyne::MeV_per_MW_s * masspermole * (i->second) * \ |
1104 | 1102 | decay_const(i->first) * q_val(i->first) / \ |
1105 | 1103 | atomic_mass(i->first); |
1106 | 1104 | } |
|