From ae742c4d53b64a43bbe8965799283cdb822378cb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 2 Dec 2024 09:45:19 +0000 Subject: [PATCH] :arrows_counterclockwise: Rename presleg to p_tf_leg_resistive for clarity and consistency; --- process/io/plot_proc.py | 4 ++-- process/power.py | 4 ++-- process/sctfcoil.py | 8 ++++---- source/fortran/tfcoil_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 6 +++--- tests/unit/test_sctfcoil.py | 10 +++++----- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 7c0b926f..f1f1f7b6 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -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) @@ -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"), ] diff --git a/process/power.py b/process/power.py index eb17f763..9a25ccb0 100644 --- a/process/power.py +++ b/process/power.py @@ -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 ) @@ -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 = ( diff --git a/process/sctfcoil.py b/process/sctfcoil.py index 64a35b81..676ce33d 100644 --- a/process/sctfcoil.py +++ b/process/sctfcoil.py @@ -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 @@ -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 @@ -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, diff --git a/source/fortran/tfcoil_variables.f90 b/source/fortran/tfcoil_variables.f90 index ffbebf97..8505299e 100644 --- a/source/fortran/tfcoil_variables.f90 +++ b/source/fortran/tfcoil_variables.f90 @@ -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 @@ -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 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index b02ca575..61d5ee0f 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -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, @@ -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", @@ -19720,7 +19720,7 @@ "ncool", "ppump", "prescp", - "presleg", + "p_tf_leg_resistive", "ptempalw", "rcool", "tcoolin", diff --git a/tests/unit/test_sctfcoil.py b/tests/unit/test_sctfcoil.py index ae331b5a..7138a04b 100644 --- a/tests/unit/test_sctfcoil.py +++ b/tests/unit/test_sctfcoil.py @@ -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 @@ -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, @@ -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, @@ -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) @@ -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)