Skip to content

Commit

Permalink
🔄 Rename presleg to p_tf_leg_resistive for clarity and consistency;
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ashe committed Dec 2, 2024
1 parent e9ac665 commit ae742c4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@ def plot_magnetics_info(axis, mfile_data, scan):
else:
n_tf_coils = mfile_data.data["n_tf_coils"].get_scan(scan)
prescp = 1.0e-6 * mfile_data.data["prescp"].get_scan(scan)
presleg = 1.0e-6 * mfile_data.data["presleg"].get_scan(scan)
p_tf_leg_resistive = 1.0e-6 * mfile_data.data["p_tf_leg_resistive"].get_scan(scan)
pres_joints = 1.0e-6 * mfile_data.data["pres_joints"].get_scan(scan)
fcoolcp = 100.0 * mfile_data.data["fcoolcp"].get_scan(scan)

Expand All @@ -2557,7 +2557,7 @@ def plot_magnetics_info(axis, mfile_data, scan):
(fcoolcp, "CP cooling fraction", "%"),
("vcool", "Maximum coolant flow speed", "ms$^{-1}$"),
(prescp, "CP Resisitive heating", "MW"),
(presleg * n_tf_coils, "legs Resisitive heating (all legs)", "MW"),
(p_tf_leg_resistive * n_tf_coils, "legs Resisitive heating (all legs)", "MW"),
(pres_joints, "TF joints resisitive heating ", "MW"),
]

Expand Down
4 changes: 2 additions & 2 deletions process/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def power1(self):
# Heat removal power at cryogenic temperature tfcoil_variables.tcoolin (W)
heat_transport_variables.helpow_cryal = (
tfcoil_variables.prescp
+ tfcoil_variables.presleg
+ tfcoil_variables.p_tf_leg_resistive
+ tfcoil_variables.pres_joints
+ fwbs_variables.pnuc_cp_tf * 1.0e6
)
Expand Down Expand Up @@ -2505,7 +2505,7 @@ def tfpwr(self, output: bool):
1.0e-6 * tfcoil_variables.prescp
) # inboard legs (called centrepost, CP for tart design)
tfcoil_variables.tflegmw = (
1.0e-6 * tfcoil_variables.presleg
1.0e-6 * tfcoil_variables.p_tf_leg_resistive
) # outboard legs
tfcoil_variables.tfjtsmw = 1.0e-6 * tfcoil_variables.pres_joints # Joints
tfbusmw = (
Expand Down
8 changes: 4 additions & 4 deletions process/sctfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ def tf_res_heating(self):
)

# TF outer leg resistive power (TOTAL) [W]
tfcoil_variables.presleg = (
tfcoil_variables.p_tf_leg_resistive = (
tfcoil_variables.res_tf_leg
* tfcoil_variables.ritfc**2
/ tfcoil_variables.n_tf_coils
Expand Down Expand Up @@ -1935,7 +1935,7 @@ def tf_res_heating(self):
)

# tfcoil_variables.prescp containts the the total resistive power losses
tfcoil_variables.presleg = 0.0e0
tfcoil_variables.p_tf_leg_resistive = 0.0e0

# No joints if physics_variables.itart = 0
tfcoil_variables.pres_joints = 0.0e0
Expand Down Expand Up @@ -5376,8 +5376,8 @@ def outtf(self, peaktfflag):
po.ovarre(
self.outfile,
"Leg resitive power loss, (per leg) (W)",
"(presleg)",
tfcoil_variables.presleg,
"(p_tf_leg_resistive)",
tfcoil_variables.p_tf_leg_resistive,
)
po.ovarre(
self.outfile,
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 @@ -779,7 +779,7 @@ module tfcoil_variables
!! resistive power in the centrepost (itart=1) [W].
!! If `itart=0`, this variable is the ressitive power on the whole magnet

real(dp) :: presleg
real(dp) :: p_tf_leg_resistive
!! Summed resistive power in the TF coil legs [W]. Remain 0 if `itart=0`.

real(dp) :: ptempalw
Expand Down Expand Up @@ -1037,7 +1037,7 @@ subroutine init_tfcoil_variables
ncool = 0.0D0
ppump = 0.0D0
prescp = 0.0D0
presleg = 0.0D0
p_tf_leg_resistive = 0.0D0
ptempalw = 473.15D0 ! 200 C
rcool = 0.005D0
tcoolin = 313.15D0 ! 40 C
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 @@ -3619,7 +3619,7 @@
"precomp": 0.0,
"pres_joints": 0.0,
"prescp": 0.0,
"presleg": 0.0,
"p_tf_leg_resistive": 0.0,
"pressure0": 0.0,
"priheat": 0.0,
"primary_pumping": 2.0,
Expand Down Expand Up @@ -10374,7 +10374,7 @@
"precomp": "CS coil precompression structure thickness (m)",
"pres_joints": "Calculated TF joints resistive power losses [W]",
"prescp": "resistive power in the centrepost (itart=1) [W].\n If `itart=0`, this variable is the ressitive power on the whole magnet",
"presleg": "Summed resistive power in the TF coil legs [W]. Remain 0 if `itart=0`.",
"p_tf_leg_resistive": "Summed resistive power in the TF coil legs [W]. Remain 0 if `itart=0`.",
"pressure0": "Total plasma pressure near target (thermal+dynamic) [Pa]",
"priheat": "total thermal power removed from fusion core (MW)",
"primary_pumping": "Switch for pumping power for primary coolant (mechanical power only and peak first wall\n temperature is only calculated if `primary_pumping=2`):\n<ul>\n<li>=0 User sets pump power directly (htpmw_blkt, htpmw_fw, htpmw_div, htpmw_shld)</li>\n<li>=1 User sets pump power as a fraction of thermal power (fpumpblkt, fpumpfw, fpumpdiv, fpumpshld)</li>\n<li>=2 Mechanical pumping power is calculated</li>\n<li>=3 Mechanical pumping power is calculated using specified pressure drop</li>\n</ul>",
Expand Down Expand Up @@ -19720,7 +19720,7 @@
"ncool",
"ppump",
"prescp",
"presleg",
"p_tf_leg_resistive",
"ptempalw",
"rcool",
"tcoolin",
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_sctfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ class TfResHeatingParam(NamedTuple):
arealeg: Any = None
ritfc: Any = None
rho_tf_joints: Any = None
presleg: Any = None
p_tf_leg_resistive: Any = None
prescp: Any = None
pres_joints: Any = None
n_tf_joints_contact: Any = None
Expand Down Expand Up @@ -1116,7 +1116,7 @@ def test_res_tf_internal_geom(restfinternalgeomparam, monkeypatch, sctfcoil):
arealeg=0.070242733939617885,
ritfc=25500000,
rho_tf_joints=2.5000000000000002e-10,
presleg=0,
p_tf_leg_resistive=0,
prescp=0,
pres_joints=0,
n_tf_joints_contact=6,
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def test_res_tf_internal_geom(restfinternalgeomparam, monkeypatch, sctfcoil):
arealeg=0.068800107640501845,
ritfc=25500000,
rho_tf_joints=2.5000000000000002e-10,
presleg=332643748.67243439,
p_tf_leg_resistive=332643748.67243439,
prescp=470083798.99090022,
pres_joints=1944336.7995005273,
n_tf_joints_contact=6,
Expand Down Expand Up @@ -1249,7 +1249,7 @@ def test_tf_res_heating(tfresheatingparam, monkeypatch, sctfcoil):
tfcoil_variables, "rho_tf_joints", tfresheatingparam.rho_tf_joints
)

monkeypatch.setattr(tfcoil_variables, "presleg", tfresheatingparam.presleg)
monkeypatch.setattr(tfcoil_variables, "p_tf_leg_resistive", tfresheatingparam.p_tf_leg_resistive)

monkeypatch.setattr(tfcoil_variables, "prescp", tfresheatingparam.prescp)

Expand Down Expand Up @@ -1321,7 +1321,7 @@ def test_tf_res_heating(tfresheatingparam, monkeypatch, sctfcoil):
tfresheatingparam.expected_tflegres
)

assert tfcoil_variables.presleg == pytest.approx(tfresheatingparam.expected_presleg)
assert tfcoil_variables.p_tf_leg_resistive == pytest.approx(tfresheatingparam.expected_presleg)

assert tfcoil_variables.prescp == pytest.approx(tfresheatingparam.expected_prescp)

Expand Down

0 comments on commit ae742c4

Please sign in to comment.