Skip to content

Commit

Permalink
Fix units and unit-conversion factors (#2891)
Browse files Browse the repository at this point in the history
* Removed redundant units

* Removed all 'years' variable and YR_TO_S variables. Found two possible errors.

* Made units more understandable

* Undid all the raw_uc conversions in tools.py as they are not compatible with numba.jit's optimization. Using the constants YR_TO_S and S_TO_YR.

* Removed as many S_TO_YR and YR_TO_S as possible.

* Fixed the problem of missing elementary charge (e) constant in base.constants

* Undid all S_TO_YR/YR_TO_S changes

* Minor fixes to the YR_TO_S

* Added back in C_LIGHT

* Made sure all of the units used in neutronics matches the units used in plasma_physics
  • Loading branch information
OceanNuclear committed Jun 17, 2024
1 parent 667dd48 commit 8a03f54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bluemira/codes/openmc/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def run(
"""Run stage for Teardown task"""
result = OpenMCResult.from_run(
universe,
n_DT_reactions(source_params.plasma_physics_units.reactor_power),
n_DT_reactions(source_params.reactor_power),
statepoint_file,
)
if delete_files:
Expand Down
2 changes: 1 addition & 1 deletion bluemira/fuel_cycle/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def legal_limit(
mb = None

if mb is None:
mb = raw_uc(r_T_burn(p_fus), "kg/s", "g/s")
mb = r_T_burn(p_fus)

m_plasma = (
(mb * ((1 / fb - 1) + (1 - eta_fuel_pump) * (1 - eta_f) / (eta_f * fb)) + m_gas)
Expand Down

0 comments on commit 8a03f54

Please sign in to comment.