Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions process/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def pfcoil(self):
tv.tim[0] = 0.0e0
tv.tim[1] = tv.tramp
tv.tim[2] = tv.tim[1] + tv.tohs
tv.tim[3] = tv.tim[2] + tv.theat
tv.tim[3] = tv.tim[2] + tv.t_fusion_ramp
tv.tim[4] = tv.tim[3] + tv.tburn
tv.tim[5] = tv.tim[4] + tv.tqnch

Expand Down Expand Up @@ -514,7 +514,7 @@ def pfcoil(self):
pf.ccls[nng] - (pf.ccl0[nng] * pfv.fcohbof / pfv.fcohbop)
)

# End of flat-top: t = tv.tramp+tv.tohs+tv.theat+tv.tburn
# End of flat-top: t = tv.tramp+tv.tohs+tv.t_fusion_ramp+tv.tburn
pfv.curpfb[ncl] = 1.0e-6 * (
pf.ccls[nng] - (pf.ccl0[nng] * (1.0e0 / pfv.fcohbop))
)
Expand Down Expand Up @@ -2697,7 +2697,7 @@ def waveform(self):
):
pfv.ric[ic] = pfv.curpff[ic]

# End of flat-top, t = tramp + tohs + theat + tburn
# End of flat-top, t = tramp + tohs + t_fusion_ramp + tburn
if (abs(pfv.curpfb[ic]) >= abs(pfv.curpfs[ic])) and (
abs(pfv.curpfb[ic]) >= abs(pfv.curpff[ic])
):
Expand Down
19 changes: 12 additions & 7 deletions process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def physics(self):
# The pulse length is the duration of non-zero plasma current
times_variables.tpulse = (
times_variables.tohs
+ times_variables.theat
+ times_variables.t_fusion_ramp
+ times_variables.tburn
+ times_variables.tqnch
)
Expand All @@ -173,7 +173,7 @@ def physics(self):
times_variables.tcycle = (
times_variables.tramp
+ times_variables.tohs
+ times_variables.theat
+ times_variables.t_fusion_ramp
+ times_variables.tburn
+ times_variables.tqnch
+ times_variables.tdwell
Expand Down Expand Up @@ -608,7 +608,7 @@ def physics(self):
physics_variables.rmajor,
physics_variables.rplas,
physics_variables.plascur,
times_variables.theat,
times_variables.t_fusion_ramp,
times_variables.tburn,
physics_variables.rli,
)
Expand Down Expand Up @@ -1284,7 +1284,7 @@ def vscalc(
rmajor,
rplas,
plascur,
theat,
t_fusion_ramp,
tburn,
rli,
):
Expand All @@ -1299,7 +1299,7 @@ def vscalc(
rli : input real : plasma normalised inductivity
rmajor : input real : plasma major radius (m)
rplas : input real : plasma resistance (ohm)
theat : input real : heating time (s)
t_fusion_ramp : input real : heating time (s)
tburn : input real : burn time (s)
phiint : output real : internal plasma volt-seconds (Wb)
rlp : output real : plasma inductance (H)
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def vscalc(
# if the pulsed reactor option is used, but the value
# will be correct on subsequent calls.

vsbrn = vburn * (theat + tburn)
vsbrn = vburn * (t_fusion_ramp + tburn)
vsstt = vsstt + vsbrn

return phiint, rlp, vsbrn, vsind, vsres, vsstt
Expand Down Expand Up @@ -2594,7 +2594,12 @@ def outtim(self):
"(tohs)",
times_variables.tohs,
)
po.ovarrf(self.outfile, "Heating time (s)", "(theat)", times_variables.theat)
po.ovarrf(
self.outfile,
"Heating time (s)",
"(t_fusion_ramp)",
times_variables.t_fusion_ramp,
)
po.ovarre(
self.outfile, "Burn time (s)", "(tburn)", times_variables.tburn, "OP "
)
Expand Down
10 changes: 5 additions & 5 deletions process/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ def power3(self, output: bool):
t_ip_up = times_variables.tohs

# Plasma heating phase (s)
t_heat = times_variables.theat
t_heat = times_variables.t_fusion_ramp

# Flat-top phase (s)
t_flat_top = times_variables.tburn
Expand Down Expand Up @@ -2152,7 +2152,7 @@ def power3(self, output: bool):

po.write(self.outfile, "Pulse timings [s]:")
po.oblnkl(self.outfile)
po.write(self.outfile, "tramp tohs theat tburn tqnch tdwell")
po.write(self.outfile, "tramp tohs t_fusion_ramp tburn tqnch tdwell")
po.write(self.outfile, "----- ---- ----- ----- ----- ------")
po.write(
self.outfile,
Expand All @@ -2163,7 +2163,7 @@ def power3(self, output: bool):

po.write(self.outfile, "Continous power usage [MWe]:")
po.oblnkl(self.outfile)
po.write(self.outfile, "System tramp tohs theat tburn tqnch tdwell")
po.write(self.outfile, "System tramp tohs t_fusion_ramp tburn tqnch tdwell")
po.write(self.outfile, "------ ----- ---- ----- ----- ----- ------")
po.write(
self.outfile,
Expand Down Expand Up @@ -2212,7 +2212,7 @@ def power3(self, output: bool):

po.write(self.outfile, "Intermittent power usage [MWe]:")
po.oblnkl(self.outfile)
po.write(self.outfile, "System tramp tohs theat tburn tqnch tdwell")
po.write(self.outfile, "System tramp tohs t_fusion_ramp tburn tqnch tdwell")
po.write(self.outfile, "------ ----- ---- ----- ----- ----- ------")
po.write(
self.outfile,
Expand All @@ -2238,7 +2238,7 @@ def power3(self, output: bool):

po.write(self.outfile, "Power production [MWe]:")
po.oblnkl(self.outfile)
po.write(self.outfile, " tramp tohs theat tburn tqnch tdwell avg")
po.write(self.outfile, " tramp tohs t_fusion_ramp tburn tqnch tdwell avg")
po.write(self.outfile, " ----- ---- ----- ----- ----- ------ ---")
po.write(
self.outfile,
Expand Down
4 changes: 2 additions & 2 deletions process/pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ def burn(self, output: bool):

# Burn time (s)

tb = vsmax / vburn - times_variables.theat
tb = vsmax / vburn - times_variables.t_fusion_ramp
if tb < 0.0e0:
error_handling.fdiags[0] = tb
error_handling.fdiags[1] = vsmax
error_handling.fdiags[2] = vburn
error_handling.fdiags[3] = times_variables.theat
error_handling.fdiags[3] = times_variables.t_fusion_ramp
error_handling.report_error(93)

times_variables.tburn = max(0.0e0, tb)
Expand Down
2 changes: 1 addition & 1 deletion process/utilities/errorlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
{
"no": 93,
"level": 2,
"message": "BURN: Negative burn time available; reduce theat or raise PF coil V-s capability"
"message": "BURN: Negative burn time available; reduce t_fusion_ramp or raise PF coil V-s capability"
},
{
"no": 94,
Expand Down
6 changes: 3 additions & 3 deletions source/fortran/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ subroutine parse_input_file(in_file,out_file,show_changes)
sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, &
str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv

use times_variables, only: tohs, pulsetimings, tqnch, theat, tramp, tburn, &
use times_variables, only: tohs, pulsetimings, tqnch, t_fusion_ramp, tramp, tburn, &
tdwell, tohsin
use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, &
initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, &
Expand Down Expand Up @@ -1124,8 +1124,8 @@ subroutine parse_input_file(in_file,out_file,show_changes)
case ('tdwell')
call parse_real_variable('tdwell', tdwell, 0.0D0, 1.0D8, &
'Time between burns (s)')
case ('theat')
call parse_real_variable('theat', theat, 0.0D0, 1.0D4, &
case ('t_fusion_ramp')
call parse_real_variable('t_fusion_ramp', t_fusion_ramp, 0.0D0, 1.0D4, &
'Heating time after current ramp (s)')
case ('tohs')
call parse_real_variable('tohs', tohs, 0.0D0, 1.0D4, &
Expand Down
6 changes: 3 additions & 3 deletions source/fortran/stellarator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subroutine stinit
use numerics, only: boundl, boundu
use stellarator_variables, only: istell
use tfcoil_variables, only: n_tf
use times_variables, only: tburn, tcycle, tdown, tdwell, theat, tohs, &
use times_variables, only: tburn, tcycle, tdown, tdwell, t_fusion_ramp, tohs, &
tpulse, tqnch, tramp
use global_variables, only: icase
use constants, only: pi, rmu0, nout
Expand Down Expand Up @@ -115,9 +115,9 @@ subroutine stinit
tohs = 0.0D0
tburn = 3.15576D7 ! one year
tqnch = 0.0D0
tpulse = tohs + theat + tburn + tqnch
tpulse = tohs + t_fusion_ramp + tburn + tqnch
tdown = tramp + tohs + tqnch + tdwell
tcycle = tramp + tohs + theat + tburn + tqnch + tdwell
tcycle = tramp + tohs + t_fusion_ramp + tburn + tqnch + tdwell

end subroutine stinit
end module stellarator_module
16 changes: 8 additions & 8 deletions source/fortran/times_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module times_variables
real(dp) :: tdwell
!! time between pulses in a pulsed reactor (s) (`iteration variable 17`)

real(dp) :: theat
real(dp) :: t_fusion_ramp
!! heating time, after current ramp up (s)

real(dp), dimension(6) :: tim
Expand All @@ -59,7 +59,7 @@ module times_variables
!! - <>0, tohs = tohsin; tramp, tqnch are input

real(dp) :: tpulse
!! pulse length = tohs + theat + tburn + tqnch
!! pulse length = tohs + t_fusion_ramp + tburn + tqnch

real(dp) :: tqnch
!! shut down time for PF coils (s); if pulsed, = tohs
Expand All @@ -79,19 +79,19 @@ subroutine init_times_variables
tcycle = 0.0D0
tdown = 0.0D0
tdwell = 1800.0D0
theat = 10.0D0
t_fusion_ramp = 10.0D0
tim = 0.0D0
timelabel = (/ 'Start', &
'BOP ', &
'EOR ', &
'BOF ', &
'EOF ', &
'EOP ' /)
intervallabel = (/ 'tramp', &
'tohs ', &
'theat', &
'tburn', &
'tqnch' /)
intervallabel = (/ 'tramp ', &
'tohs ', &
't_fusion_ramp', &
'tburn ', &
'tqnch ' /)
tohs = 30.0D0
tohsin = 0.0D0
tpulse = 0.0D0
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/ref_dicts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,7 @@
"intervallabel": [
"tramp",
"tohs",
"theat",
"t_fusion_ramp",
"tburn",
"tqnch"
],
Expand Down Expand Up @@ -7562,7 +7562,7 @@
"tgain": 85.0,
"th_joint_contact": 0.03,
"thcomp": null,
"theat": 10.0,
"t_fusion_ramp": 10.0,
"theta": null,
"theta_coil": 0.0,
"thick_bp_ib": 0.0,
Expand Down Expand Up @@ -10807,7 +10807,7 @@
"tgain": "IFE target gain (if `ifedrv = 0`) (`iteration variable 83`)",
"th_joint_contact": "TF sliding joints contact pad width [m]",
"thcomp": "",
"theat": "heating time, after current ramp up (s)",
"t_fusion_ramp": "heating time, after current ramp up (s)",
"theta": "",
"theta_coil": "Half toroidal angular extent of a single TF coil inboard leg",
"thick_bp_ib": "",
Expand Down Expand Up @@ -10862,7 +10862,7 @@
"tpeak": "peak first wall temperature (K)",
"tpeakfwi": "Inboard/outboard first wall peak temperature (K)",
"tpeakfwo": "Inboard/outboard first wall peak temperature (K)",
"tpulse": "pulse length = tohs + theat + tburn + tqnch",
"tpulse": "pulse length = tohs + t_fusion_ramp + tburn + tqnch",
"tqnch": "shut down time for PF coils (s); if pulsed, = tohs",
"tramp": "initial PF coil charge time (s); if pulsed, = tohs",
"transp_clrnc": "transportation clearance between components (m)",
Expand Down Expand Up @@ -14554,7 +14554,7 @@
"lb": 0.0,
"ub": 1.0
},
"theat": {
"t_fusion_ramp": {
"lb": 0.0,
"ub": 10000.0
},
Expand Down Expand Up @@ -19743,7 +19743,7 @@
"tcycle",
"tdown",
"tdwell",
"theat",
"t_fusion_ramp",
"tim",
"timelabel",
"intervallabel",
Expand Down Expand Up @@ -20788,7 +20788,7 @@
"tfwmatmax": "real_variable",
"tgain": "real_variable",
"th_joint_contact": "real_variable",
"theat": "real_variable",
"t_fusion_ramp": "real_variable",
"thicndut": "real_variable",
"thkcas": "real_variable",
"thshield": "real_variable",
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_pfcoil_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
are also many variables that could be asserted, so a few key variables central
to the testing of the subroutine have been chosen.
"""

import numpy as np
from numpy.testing import assert_array_almost_equal
import pytest
Expand Down Expand Up @@ -139,7 +140,7 @@ def test_pfcoil(monkeypatch, pfcoil):
monkeypatch.setattr(tv, "tburn", 7.1263e-1)
monkeypatch.setattr(tv, "tohs", 1.82538e2)
monkeypatch.setattr(tv, "tqnch", 1.82538e2)
monkeypatch.setattr(tv, "theat", 1.0e1)
monkeypatch.setattr(tv, "t_fusion_ramp", 1.0e1)
monkeypatch.setattr(constants, "dcopper", 8.9e3)
monkeypatch.setattr(pf, "first_call", True)

Expand Down
9 changes: 5 additions & 4 deletions tests/unit/test_physics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for physics.f90."""

from typing import Any, NamedTuple
from process.fortran import (
physics_variables,
Expand Down Expand Up @@ -1290,7 +1291,7 @@ class VscalcParam(NamedTuple):

tburn: Any = None

theat: Any = None
t_fusion_ramp: Any = None

expected_phiint: Any = None

Expand Down Expand Up @@ -1319,7 +1320,7 @@ class VscalcParam(NamedTuple):
rmajor=8,
rplas=3.7767895536275952e-09,
tburn=1000,
theat=10,
t_fusion_ramp=10,
expected_phiint=111.57651734747576,
expected_rlp=1.4075705307248088e-05,
expected_vsbrn=42.109179697761263,
Expand All @@ -1338,7 +1339,7 @@ class VscalcParam(NamedTuple):
rmajor=8,
rplas=3.7767895536275952e-09,
tburn=0,
theat=10,
t_fusion_ramp=10,
expected_phiint=111.57651734747576,
expected_rlp=1.4075705307248088e-05,
expected_vsbrn=0.41692257126496302,
Expand Down Expand Up @@ -1369,7 +1370,7 @@ def test_vscalc(vscalcparam, physics):
rmajor=vscalcparam.rmajor,
rplas=vscalcparam.rplas,
tburn=vscalcparam.tburn,
theat=vscalcparam.theat,
t_fusion_ramp=vscalcparam.t_fusion_ramp,
)

assert phiint == pytest.approx(vscalcparam.expected_phiint)
Expand Down
Loading