Skip to content

Commit

Permalink
🔄 Refactor tfbusmas to m_tf_bus for clarity and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ashe committed Nov 29, 2024
1 parent 9a0578c commit 8519a1e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion process/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ def acc2251(self):
# Account 225.1.5 : TF coil bussing

if tfcoil_variables.i_tf_sup != 1:
self.c22515 = 1.0e-6 * cost_variables.uctfbus * tfcoil_variables.tfbusmas
self.c22515 = 1.0e-6 * cost_variables.uctfbus * tfcoil_variables.m_tf_bus
else:
self.c22515 = (
1.0e-6
Expand Down
6 changes: 3 additions & 3 deletions process/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ def tfpwr(self, output: bool):
tfbusres = tfcoil_variables.rho_tf_bus * tfcoil_variables.len_tf_bus / abus

# Bus mass (kg)
tfcoil_variables.tfbusmas = (
tfcoil_variables.m_tf_bus = (
tfcoil_variables.len_tf_bus * abus * constants.dcopper
)

Expand Down Expand Up @@ -2557,8 +2557,8 @@ def tfpwr(self, output: bool):
po.ovarre(
self.outfile,
"Bus mass (kg)",
"(tfbusmas)",
tfcoil_variables.tfbusmas,
"(m_tf_bus)",
tfcoil_variables.m_tf_bus,
"OP ",
)
# po.ovarre(outfile,'Maximum impedance (ohm)','(ztot)',ztot)
Expand Down
4 changes: 2 additions & 2 deletions source/fortran/tfcoil_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ module tfcoil_variables
real(dp) :: len_tf_bus
!! TF coil bus length (m)

real(dp) :: tfbusmas
real(dp) :: m_tf_bus
!! TF coil bus mass (kg)

real(dp) :: tfckw
Expand Down Expand Up @@ -957,7 +957,7 @@ subroutine init_tfcoil_variables
tdmptf = 10.0D0
tfareain = 0.0D0
len_tf_bus = 300.0D0
tfbusmas = 0.0D0
m_tf_bus = 0.0D0
tfckw = 0.0D0
tfcmw = 0.0D0
tfcpmw = 0.0D0
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/ref_dicts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7536,7 +7536,7 @@
0.0
],
"len_tf_bus": 0.0,
"tfbusmas": 0.0,
"m_tf_bus": 0.0,
"tfc_current": 0.0,
"tfc_nuc_heating": 0.0,
"tfc_sidewall_is_fraction": ".false.",
Expand Down Expand Up @@ -10784,7 +10784,7 @@
"tfareain": "Area of inboard midplane TF legs (m2)",
"tfb": "Vertical radius of inside edge of TF coil (m)",
"len_tf_bus": "TF coil bus length (m)",
"tfbusmas": "TF coil bus mass (kg)",
"m_tf_bus": "TF coil bus mass (kg)",
"tfc_current": "Current in each TF coil",
"tfc_nuc_heating": "Unit nuclear heating in TF coil (W per W of fusion power)",
"tfc_sidewall_is_fraction": "logical switch to make casths a fraction of TF coil thickness (`casths_fraction`)",
Expand Down Expand Up @@ -19639,7 +19639,7 @@
"tdmptf",
"tfareain",
"len_tf_bus",
"tfbusmas",
"m_tf_bus",
"tfckw",
"tfcmw",
"tfcpmw",
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_costs_1990.py
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,7 @@ class Acc2251Param(NamedTuple):

i_tf_sup: Any = None

tfbusmas: Any = None
m_tf_bus: Any = None

tfckw: Any = None

Expand Down Expand Up @@ -3309,7 +3309,7 @@ class Acc2251Param(NamedTuple):
len_tf_bus=3397.0129827974288,
estotftgj=152.78343648685947,
i_tf_sup=1,
tfbusmas=0,
m_tf_bus=0,
tfckw=32474.753636211804,
n_tf=16,
cpttf=74026.751437500003,
Expand Down Expand Up @@ -3340,7 +3340,7 @@ class Acc2251Param(NamedTuple):
len_tf_bus=3397.0129827974288,
estotftgj=152.98264590137683,
i_tf_sup=1,
tfbusmas=0,
m_tf_bus=0,
tfckw=32505.257577809778,
n_tf=16,
cpttf=74026.751437500003,
Expand Down Expand Up @@ -3396,7 +3396,7 @@ def test_acc2251(acc2251param, monkeypatch, costs):

monkeypatch.setattr(tfcoil_variables, "i_tf_sup", acc2251param.i_tf_sup)

monkeypatch.setattr(tfcoil_variables, "tfbusmas", acc2251param.tfbusmas)
monkeypatch.setattr(tfcoil_variables, "m_tf_bus", acc2251param.m_tf_bus)

monkeypatch.setattr(tfcoil_variables, "tfckw", acc2251param.tfckw)

Expand Down

0 comments on commit 8519a1e

Please sign in to comment.