Skip to content

Commit

Permalink
Changed tcycle to t_cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
j-a-foster committed Dec 2, 2024
1 parent eac36be commit 66259a4
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion examples/data/csv_output_large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.1999E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6699E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8441E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8441E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_1_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2035E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6631E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8463E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8463E+03 OP
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_2_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2035E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6631E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8463E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8463E+03 OP
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_3_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2035E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6631E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8463E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8463E+03 OP
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_4_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2035E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6631E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8463E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8463E+03 OP
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
18 changes: 9 additions & 9 deletions examples/data/scan_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -1411,7 +1411,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -2406,7 +2406,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -3401,7 +3401,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -4396,7 +4396,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -5391,7 +5391,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -6386,7 +6386,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -7381,7 +7381,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down Expand Up @@ -8376,7 +8376,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2000E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.8078E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 0.0000E+00
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 8.0716E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 8.0716E+03 OP
kallenbach_switch_______________________________________________________ (kallenbach_switch)___________ 0
# Radial Build #
Machine_bore_(m)________________________________________________________ (bore)________________________ 2.2626E+00 ITV
Expand Down
20 changes: 10 additions & 10 deletions process/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def avail(self, output: bool):
# Plant Availability (iavail=0,1)

# Calculate the number of fusion cycles for a given blanket lifetime
pulse_fpy = tv.tcycle / YEAR_SECONDS
pulse_fpy = tv.t_cycle / YEAR_SECONDS
cv.bktcycles = (fwbsv.bktlife / pulse_fpy) + 1

# if iavail = 0 use input value for cfactr
Expand Down Expand Up @@ -166,7 +166,7 @@ def avail(self, output: bool):

# Capacity factor
# Using the amount of time burning for a given pulse cycle
cv.cpfact = cv.cfactr * (tv.t_burn / tv.tcycle)
cv.cpfact = cv.cfactr * (tv.t_burn / tv.t_cycle)

# Modify lifetimes to take account of the availability
if ifev.ife != 1:
Expand Down Expand Up @@ -373,7 +373,7 @@ def avail_2(self, output: bool):
cv.cplife = min(cv.cplife / cv.cfactr, cv.tlife)

# Capacity factor
cv.cpfact = cv.cfactr * (tv.t_burn / tv.tcycle)
cv.cpfact = cv.cfactr * (tv.t_burn / tv.t_cycle)

# Output
if output:
Expand Down Expand Up @@ -661,11 +661,11 @@ def calc_u_unplanned_divertor(self, output: bool) -> float:

# Calculate cycle limit in terms of days
# Number of cycles between planned blanket replacements, N
n = cv.divlife * YEAR_SECONDS / tv.tcycle
n = cv.divlife * YEAR_SECONDS / tv.t_cycle

# The probability of failure in one pulse cycle (before the reference cycle life)
pf = (cv.div_prob_fail / DAY_SECONDS) * tv.tcycle
a0 = 1.0e0 - pf * cv.div_umain_time * YEAR_SECONDS / tv.tcycle
pf = (cv.div_prob_fail / DAY_SECONDS) * tv.t_cycle
a0 = 1.0e0 - pf * cv.div_umain_time * YEAR_SECONDS / tv.t_cycle

# Integrating the instantaneous availability gives the mean
# availability over the planned cycle life N
Expand Down Expand Up @@ -757,12 +757,12 @@ def calc_u_unplanned_fwbs(self, output: bool) -> float:
# Calculate cycle limit in terms of days

# Number of cycles between planned blanket replacements, N
n = fwbsv.bktlife * YEAR_SECONDS / tv.tcycle
n = fwbsv.bktlife * YEAR_SECONDS / tv.t_cycle

# The probability of failure in one pulse cycle
# (before the reference cycle life)
pf = (cv.fwbs_prob_fail / DAY_SECONDS) * tv.tcycle
a0 = 1.0e0 - pf * cv.fwbs_umain_time * YEAR_SECONDS / tv.tcycle
pf = (cv.fwbs_prob_fail / DAY_SECONDS) * tv.t_cycle
a0 = 1.0e0 - pf * cv.fwbs_umain_time * YEAR_SECONDS / tv.t_cycle

if cv.fwbs_nu <= cv.fwbs_nref:
logger.error(
Expand Down Expand Up @@ -1072,7 +1072,7 @@ def avail_st(self, output: bool):
)

# Capacity factor
cv.cpfact = cv.cfactr * (tv.t_burn / tv.tcycle)
cv.cpfact = cv.cfactr * (tv.t_burn / tv.t_cycle)

if output:
if tfv.i_tf_sup == 1:
Expand Down
2 changes: 1 addition & 1 deletion process/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,7 @@ def coelc(self):
* (24.0e0 * constants.n_day_year)
* cost_variables.cfactr
* times_variables.t_burn
/ times_variables.tcycle
/ times_variables.t_cycle
)

# Costs due to reactor plant
Expand Down
6 changes: 3 additions & 3 deletions process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ def physics(self):
)

# Total cycle time
times_variables.tcycle = (
times_variables.t_cycle = (
times_variables.t_precharge
+ times_variables.t_current_ramp_up
+ times_variables.t_fusion_ramp
Expand Down Expand Up @@ -3143,8 +3143,8 @@ def outtim(self):
po.ovarre(
self.outfile,
"Total plant cycle time (s)",
"(tcycle)",
times_variables.tcycle,
"(t_cycle)",
times_variables.t_cycle,
"OP ",
)

Expand Down
6 changes: 3 additions & 3 deletions source/fortran/constraint_equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1851,10 +1851,10 @@ subroutine constraint_eqn_042(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
!! and hence also optional here.
!! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
!! ftcycl : input real : f-value for cycle time
!! tcycle : input real : full cycle time (s)
!! t_cycle : input real : full cycle time (s)
!! tcycmn : input real : minimum cycle time (s)
use constraint_variables, only: ftcycl, tcycmn
use times_variables, only: tcycle
use times_variables, only: t_cycle
implicit none
real(dp), intent(out) :: tmp_cc
real(dp), intent(out) :: tmp_con
Expand All @@ -1864,7 +1864,7 @@ subroutine constraint_eqn_042(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)

! if the minimum cycle time == 0 report an error
if (tcycmn < 1.0D0) call report_error(6)
tmp_cc = 1.0D0 - ftcycl * tcycle/tcycmn
tmp_cc = 1.0D0 - ftcycl * t_cycle/tcycmn
tmp_con = tcycmn * (1.0D0 - tmp_cc)
tmp_err = tcycmn * tmp_cc
tmp_symbol = '>'
Expand Down
4 changes: 2 additions & 2 deletions source/fortran/stellarator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ subroutine stinit
use numerics, only: boundl, boundu
use stellarator_variables, only: istell
use tfcoil_variables, only: n_tf
use times_variables, only: t_burn, tcycle, tdown, t_between_pulse, t_fusion_ramp, t_current_ramp_up, &
use times_variables, only: t_burn, t_cycle, tdown, t_between_pulse, t_fusion_ramp, t_current_ramp_up, &
t_pulse_repetition, t_ramp_down, t_precharge
use global_variables, only: icase
use constants, only: pi, rmu0, nout
Expand Down Expand Up @@ -115,7 +115,7 @@ subroutine stinit
t_ramp_down = 0.0D0
t_pulse_repetition = t_current_ramp_up + t_fusion_ramp + t_burn + t_ramp_down
tdown = t_precharge + t_current_ramp_up + t_ramp_down + t_between_pulse
tcycle = t_precharge + t_current_ramp_up + t_fusion_ramp + t_burn + t_ramp_down + t_between_pulse
t_cycle = t_precharge + t_current_ramp_up + t_fusion_ramp + t_burn + t_ramp_down + t_between_pulse

end subroutine stinit
end module stellarator_module
4 changes: 2 additions & 2 deletions source/fortran/times_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module times_variables
real(dp) :: t_burn_0
!! burn time (s) - used for internal consistency

real(dp) :: tcycle
real(dp) :: t_cycle
!! full cycle time (s)

real(dp) :: tdown
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine init_times_variables
pulsetimings = 1.0D0
t_burn = 1000.0D0
t_burn_0 = 0.0D0
tcycle = 0.0D0
t_cycle = 0.0D0
tdown = 0.0D0
t_between_pulse = 1800.0D0
t_fusion_ramp = 10.0D0
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_1_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@
Burn_time_(s)___________________________________________________________ (t_burn)_______________________ 7.2035E+03 OP
Reset_time_to_zero_current_for_CS_(s)___________________________________ (t_ramp_down)_______________________ 1.6631E+02
Time_between_pulses_(s)_________________________________________________ (t_between_pulse)______________________ 1.8000E+03
Total_plant_cycle_time_(s)______________________________________________ (tcycle)______________________ 9.8463E+03 OP
Total_plant_cycle_time_(s)______________________________________________ (t_cycle)______________________ 9.8463E+03 OP
# Radial Build #
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
TF_coil_radial_placement_switch_________________________________________ (tf_in_cs)____________________ 0
Expand Down
Loading

0 comments on commit 66259a4

Please sign in to comment.