From 73d10ef4358becc63772e8521785467297a2cfac Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 24 Feb 2025 10:07:32 +0000 Subject: [PATCH 1/2] Renamed tohsin to i_t_current_ramp_up --- documentation/proc-pages/physics-models/pulsed-plant.md | 4 ++-- process/physics.py | 4 +--- source/fortran/input.f90 | 6 +++--- source/fortran/times_variables.f90 | 6 +++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/documentation/proc-pages/physics-models/pulsed-plant.md b/documentation/proc-pages/physics-models/pulsed-plant.md index f3eea47bd7..2f472bc0c2 100644 --- a/documentation/proc-pages/physics-models/pulsed-plant.md +++ b/documentation/proc-pages/physics-models/pulsed-plant.md @@ -31,9 +31,9 @@ but this is not taken ito account. In the steady-state scenario (`lpulse` = 0), the plasma current ramp-up time `t_current_ramp_up` is determined as follows. -- If `tohsin` = 0, the rate of change of plasma current is 0.5 MA/s. The PF coil ramp time `t_precharge` +- If `i_t_current_ramp_up` = 0, the rate of change of plasma current is 0.5 MA/s. The PF coil ramp time `t_precharge` and shutdown time `t_ramp_down` are (arbitrarily) set equal to `t_current_ramp_up`. -- If `tohsin` $\neq$ 0, the plasma current ramp-up time `t_current_ramp_up` = `tohsin`, and the PF coil ramp +- If `i_t_current_ramp_up` $\neq$ 0, the plasma current ramp-up time `t_current_ramp_up`, and the PF coil ramp and shutdown times are input parameters. In the pulsed scenario, (`lpulse` = 1), the plasma current ramp-up time `t_current_ramp_up` is an input, and it diff --git a/process/physics.py b/process/physics.py index 2b77c07eba..f5a9717e2d 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1644,14 +1644,12 @@ def physics(self): # Set PF coil ramp times if pulse_variables.lpulse != 1: - if times_variables.tohsin == 0.0e0: + if times_variables.i_t_current_ramp_up == 0: times_variables.t_current_ramp_up = ( physics_variables.plasma_current / 5.0e5 ) times_variables.t_precharge = times_variables.t_current_ramp_up times_variables.t_ramp_down = times_variables.t_current_ramp_up - else: - times_variables.t_current_ramp_up = times_variables.tohsin else: if times_variables.pulsetimings == 0.0e0: diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index b4f4695920..a456b49b67 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -346,7 +346,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv use times_variables, only: t_current_ramp_up, pulsetimings, t_ramp_down, t_fusion_ramp, t_precharge, t_burn, & - t_between_pulse, tohsin + t_between_pulse, i_t_current_ramp_up use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, & initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, & pumpareafraction, ntype, vacuum_model, pumptp @@ -1127,8 +1127,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('t_current_ramp_up') call parse_real_variable('t_current_ramp_up', t_current_ramp_up, 0.0D0, 1.0D4, & 'Plasma current ramp-up time for current init (s)') - case ('tohsin') - call parse_real_variable('tohsin', tohsin, 0.0D0, 1.0D4, & + case ('i_t_current_ramp_up') + call parse_int_variable('i_t_current_ramp_up', i_t_current_ramp_up, 0, 1, & 'Switch for t_current_ramp_up calculation') case ('t_ramp_down') call parse_real_variable('t_ramp_down', t_ramp_down, 0.0D0, 1.0D4, & diff --git a/source/fortran/times_variables.f90 b/source/fortran/times_variables.f90 index 6b61972052..2a2d7155f6 100644 --- a/source/fortran/times_variables.f90 +++ b/source/fortran/times_variables.f90 @@ -51,11 +51,11 @@ module times_variables !! time for plasma current to ramp up to approx. full value (s) (calculated if `lpulse=0`) !! (`iteration variable 65`) - real(dp) :: tohsin + integer :: i_t_current_ramp_up !! Switch for plasma current ramp-up time (if lpulse=0): !! !! - = 0, t_current_ramp_up = t_precharge = t_ramp_down = Ip(MA)/0.5 - !! - <>0, t_current_ramp_up = tohsin; t_precharge, t_ramp_down are input + !! - = 1, t_current_ramp_up, t_precharge, t_ramp_down are input real(dp) :: t_pulse_repetition !! pulse length = t_current_ramp_up + t_fusion_ramp + t_burn + t_ramp_down @@ -93,7 +93,7 @@ subroutine init_times_variables 't_burn ', & 't_ramp_down ' /) t_current_ramp_up = 30.0D0 - tohsin = 0.0D0 + i_t_current_ramp_up = 0 t_pulse_repetition = 0.0D0 t_ramp_down = 15.0D0 t_precharge = 15.0D0 From 2aabb3e350ecc36553acd081b9e7ca8c0005729d Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 24 Feb 2025 11:15:27 +0000 Subject: [PATCH 2/2] Replaced obsolete variable --- process/physics.py | 2 +- source/fortran/times_variables.f90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/process/physics.py b/process/physics.py index bf45f5e6be..eadcc389b8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1688,7 +1688,7 @@ def physics(self): ) # Set PF coil ramp times - if pulse_variables.lpulse != 1: + if pulse_variables.i_pulsed_plant != 1: if times_variables.i_t_current_ramp_up == 0: times_variables.t_current_ramp_up = ( physics_variables.plasma_current / 5.0e5 diff --git a/source/fortran/times_variables.f90 b/source/fortran/times_variables.f90 index 9d0f13b2b5..96daf7385a 100644 --- a/source/fortran/times_variables.f90 +++ b/source/fortran/times_variables.f90 @@ -52,7 +52,7 @@ module times_variables !! (`iteration variable 65`) integer :: i_t_current_ramp_up - !! Switch for plasma current ramp-up time (if lpulse=0): + !! Switch for plasma current ramp-up time (if i_pulsed_plant=0): !! !! - = 0, t_current_ramp_up = t_precharge = t_ramp_down = Ip(MA)/0.5 !! - = 1, t_current_ramp_up, t_precharge, t_ramp_down are input