From eac36be568866ef0cab75b56bf1898d9cd0883b4 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 2 Dec 2024 13:16:12 +0000 Subject: [PATCH] Tidying up missed renames --- ...ower-conversion-and-heat-dissipation-systems.md | 2 +- .../proc-pages/physics-models/pulsed-plant.md | 2 +- process/physics.py | 4 ++-- process/pulse.py | 6 +++--- source/fortran/constraint_equations.f90 | 12 ++++++------ source/fortran/constraint_variables.f90 | 4 ++-- source/fortran/times_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 12 ++++++------ tests/regression/input_files/st_regression.IN.DAT | 2 +- tests/unit/test_pulse.py | 14 +++++++++----- 10 files changed, 33 insertions(+), 29 deletions(-) diff --git a/documentation/proc-pages/eng-models/power-conversion-and-heat-dissipation-systems.md b/documentation/proc-pages/eng-models/power-conversion-and-heat-dissipation-systems.md index e4329a83..b60d307f 100644 --- a/documentation/proc-pages/eng-models/power-conversion-and-heat-dissipation-systems.md +++ b/documentation/proc-pages/eng-models/power-conversion-and-heat-dissipation-systems.md @@ -115,6 +115,6 @@ The recirculating power comprises the electrical power required to run all of th electrical systems surrounding the fusion power core, plus the on-site building services, offices, etc., as shown in Figure 1. Of these, the cryogenic plant power includes the power required to cool the TF coils from the neutron power absorbed by the coils, the PF coils (as defined by the ratio of -the total PF coil stored energy to the fusion power pulse time `tpulse`), and other 'cold' components. +the total PF coil stored energy to the fusion power pulse time `t_pulse_repetition`), and other 'cold' components. [^1]: C. Harrington, *"Development and Implementation of Improved Balance of Plant Models for PROCESS"*, CCFE C5.M15 Milestone Report, August 2014 (copy stored as CCFE internal note T&M/PKNIGHT/PROCESS/027) diff --git a/documentation/proc-pages/physics-models/pulsed-plant.md b/documentation/proc-pages/physics-models/pulsed-plant.md index 07a39f27..f3eea47b 100644 --- a/documentation/proc-pages/physics-models/pulsed-plant.md +++ b/documentation/proc-pages/physics-models/pulsed-plant.md @@ -41,7 +41,7 @@ can be set as an iteration variable (65). The ramp-up and shutdown time in the p equal to `t_current_ramp_up`. To ensure that the plasma current ramp rate during start-up is prevented from being too high, as governed by the requirement to maintain plasma stability by ensuring that the induced current has time to diffuse into the body of the plasma, constraint equation no. 41 should be -turned on with iteration variable no. 66 `ft_current_ramp_up` and input `tohsmn`, the minimum plasma current +turned on with iteration variable no. 66 `ft_current_ramp_up` and input `t_current_ramp_up_min`, the minimum plasma current ramp-up time. ## Burn time diff --git a/process/physics.py b/process/physics.py index d2044605..3caea8a3 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1587,10 +1587,10 @@ def physics(self): # t_ramp_down = max(t_ramp_down,t_current_ramp_up) times_variables.t_ramp_down = times_variables.t_current_ramp_up - # Reset second times_variables.t_burn value (times_variables.tburn0). + # Reset second times_variables.t_burn value (times_variables.t_burn_0). # This is used to ensure that the burn time is used consistently; # see convergence loop in fcnvmc1, evaluators.f90 - times_variables.tburn0 = times_variables.t_burn + times_variables.t_burn_0 = times_variables.t_burn # Pulse and down times : The reactor is assumed to be 'down' # at all times outside of the plasma current flat-top period. diff --git a/process/pulse.py b/process/pulse.py index c170a277..b24c09d8 100755 --- a/process/pulse.py +++ b/process/pulse.py @@ -97,7 +97,7 @@ def tohswg(self, output: bool) -> None: # Minimum plasma current ramp-up time (s) # - corrected (bus resistance is not a function of pfcoil_variables.turns) - constraint_variables.tohsmn = ( + constraint_variables.t_current_ramp_up_min = ( loh * (ioht2 - ioht1) / ( @@ -115,8 +115,8 @@ def tohswg(self, output: bool) -> None: po.ovarre( self.outfile, "Minimum plasma current ramp-up time (s)", - "(tohsmn)", - constraint_variables.tohsmn, + "(t_current_ramp_up_min)", + constraint_variables.t_current_ramp_up_min, ) def burn(self, output: bool): diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index bee123dd..472657ef 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1817,13 +1817,13 @@ subroutine constraint_eqn_041(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for plasma current ramp-up time lower limit !! #=# times - !! #=#=# ft_current_ramp_up, tohsmn + !! #=#=# ft_current_ramp_up, t_current_ramp_up_min !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! ft_current_ramp_up : input real : f-value for plasma current ramp-up time !! t_current_ramp_up : input real : plasma current ramp-up time for current initiation (s) - !! tohsmn : input real : minimum plasma current ramp-up time (s) - use constraint_variables, only: ft_current_ramp_up, tohsmn + !! t_current_ramp_up_min : input real : minimum plasma current ramp-up time (s) + use constraint_variables, only: ft_current_ramp_up, t_current_ramp_up_min use times_variables, only: t_current_ramp_up implicit none real(dp), intent(out) :: tmp_cc @@ -1832,9 +1832,9 @@ subroutine constraint_eqn_041(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - ft_current_ramp_up * t_current_ramp_up/tohsmn - tmp_con = tohsmn * (1.0D0 - tmp_cc) - tmp_err = tohsmn * tmp_cc + tmp_cc = 1.0D0 - ft_current_ramp_up * t_current_ramp_up/t_current_ramp_up_min + tmp_con = t_current_ramp_up_min * (1.0D0 - tmp_cc) + tmp_err = t_current_ramp_up_min * tmp_cc tmp_symbol = '>' tmp_units = 'sec' diff --git a/source/fortran/constraint_variables.f90 b/source/fortran/constraint_variables.f90 index bff2f330..ed344127 100644 --- a/source/fortran/constraint_variables.f90 +++ b/source/fortran/constraint_variables.f90 @@ -269,7 +269,7 @@ module constraint_variables real(dp) :: tcycmn !! minimum cycle time (s) (`constraint equation 42`) - real(dp) :: tohsmn + real(dp) :: t_current_ramp_up_min !! minimum plasma current ramp-up time (s) (`constraint equation 41`) real(dp) :: vvhealw @@ -387,7 +387,7 @@ subroutine init_constraint_variables tbrmin = 1.1D0 t_burn_min = 1.0D0 tcycmn = 0.0D0 - tohsmn = 1.0D0 + t_current_ramp_up_min = 1.0D0 vvhealw = 1.0D0 walalw = 1.0D0 taulimit = 5.0D0 diff --git a/source/fortran/times_variables.f90 b/source/fortran/times_variables.f90 index f6550ff6..18e2e4e4 100644 --- a/source/fortran/times_variables.f90 +++ b/source/fortran/times_variables.f90 @@ -23,7 +23,7 @@ module times_variables real(dp) :: t_burn !! flat-top duration (s) (calculated if `lpulse=1`) - real(dp) :: tburn0 + real(dp) :: t_burn_0 !! burn time (s) - used for internal consistency real(dp) :: tcycle @@ -75,7 +75,7 @@ subroutine init_times_variables pulsetimings = 1.0D0 t_burn = 1000.0D0 - tburn0 = 0.0D0 + t_burn_0 = 0.0D0 tcycle = 0.0D0 tdown = 0.0D0 t_between_pulse = 1800.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 2f3c0644..fefd1652 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -7492,7 +7492,7 @@ "tbrmin": 1.1, "t_burn_min": 1.0, "t_burn": 1000.0, - "tburn0": 0.0, + "t_burn_0": 0.0, "tcomrepl": 0.5, "tconl": 0.0, "tcoolin": 313.15, @@ -7621,7 +7621,7 @@ "tn": 300.0, "t_current_ramp_up": 30.0, "tohsin": 0.0, - "tohsmn": 1.0, + "t_current_ramp_up_min": 1.0, "tok_build_cost_per_vol": 1283.0, "tol": null, "toolow": ".false.", @@ -10750,7 +10750,7 @@ "tbrmin": "minimum tritium breeding ratio (`constraint equation 52`)", "t_burn_min": "minimum burn time (s) (KE - no longer itv., see issue #706)", "t_burn": "burn time (s) (calculated if `lpulse=1`)", - "tburn0": "burn time (s) - used for internal consistency", + "t_burn_0": "burn time (s) - used for internal consistency", "tcomrepl": "time taken to replace both blanket and divertor (y) (`iavail=1`)", "tconl": "main plasma connection length (m)", "tcoolin": "centrepost coolant inlet temperature (K)", @@ -10855,7 +10855,7 @@ "tn": "neutral gas temperature in chamber (K)", "t_current_ramp_up": "plasma current ramp-up time for current initiation (s) (calculated if `lpulse=0`)\n (`iteration variable 65`)", "tohsin": "Switch for plasma current ramp-up time (if lpulse=0):\n", - "tohsmn": "minimum plasma current ramp-up time (s) (`constraint equation 41`)", + "t_current_ramp_up_min": "minimum plasma current ramp-up time (s) (`constraint equation 41`)", "tok_build_cost_per_vol": "Unit cost for tokamak complex buildings, including building and site services ($/m3)", "tol": "", "toolow": "Used for reporting error in function pimpden", @@ -17467,7 +17467,7 @@ "tbrmin", "t_burn_min", "tcycmn", - "tohsmn", + "t_current_ramp_up_min", "vvhealw", "walalw", "taulimit", @@ -19738,7 +19738,7 @@ "times_variables": [ "pulsetimings", "t_burn", - "tburn0", + "t_burn_0", "tcycle", "tdown", "t_between_pulse", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index d3dd0f53..3a9f441b 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -3257,7 +3257,7 @@ t_between_pulse = 100.0 * JUSTIFICATION: Turned off, do not care about plasma current ramp up time * VARIABLES: t_current_ramp_up (s) calculated in-situ -*tohsmn = +*t_current_ramp_up_min = * DESCRIPTION: Minimum plasma current ramp-up time (s) * JUSTIFICATION: Turned off, not using icc = 41 diff --git a/tests/unit/test_pulse.py b/tests/unit/test_pulse.py index 15d7576c..fbe48165 100755 --- a/tests/unit/test_pulse.py +++ b/tests/unit/test_pulse.py @@ -32,7 +32,7 @@ def pulse(): class TohswgParam(NamedTuple): - tohsmn: Any = None + t_current_ramp_up_min: Any = None vpfskv: Any = None @@ -104,7 +104,7 @@ class BurnParam(NamedTuple): "tohswgparam", ( TohswgParam( - tohsmn=0, + t_current_ramp_up_min=0, vpfskv=0, ncirt=8, ipfres=0, @@ -661,7 +661,7 @@ class BurnParam(NamedTuple): expected_tohsmn=-526.67247746645455, ), TohswgParam( - tohsmn=-526.67247746645455, + t_current_ramp_up_min=-526.67247746645455, vpfskv=20, ncirt=8, ipfres=0, @@ -1232,7 +1232,9 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(constraint_variables, "tohsmn", tohswgparam.tohsmn) + monkeypatch.setattr( + constraint_variables, "t_current_ramp_up_min", tohswgparam.t_current_ramp_up_min + ) monkeypatch.setattr(pf_power_variables, "vpfskv", tohswgparam.vpfskv) @@ -1264,7 +1266,9 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): pulse.tohswg(output=False) - assert constraint_variables.tohsmn == pytest.approx(tohswgparam.expected_tohsmn) + assert constraint_variables.t_current_ramp_up_min == pytest.approx( + tohswgparam.expected_tohsmn + ) @pytest.mark.parametrize(