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
4 changes: 2 additions & 2 deletions documentation/source/eng-models/central-solenoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ the central solenoid causes a change in the flux linked to the plasma region, in
it. `PROCESS` calculates the amount of flux required to produce the plasma current, and also the
amount actually available. The code measures the magnetic flux in units of Volt.seconds (= Webers).

Switch `iohcl` controls whether a central solenoid is present. A value of 1 denotes that this coil
is present, and should be assigned a non-zero thickness `dr_cs`. A value of `iohcl` = 0 denotes
Switch `i_cs_use` controls whether a central solenoid is present. A value of 1 denotes that this coil
is present, and should be assigned a non-zero thickness `dr_cs`. A value of `i_cs_use` = 0 denotes
that no central solenoid is present, in which case the thickness `dr_cs` should be zero. No PF
coils should be located at positions defined by `i_pf_location(j)` = 1 if no central solenoid is present.

Expand Down
1 change: 1 addition & 0 deletions process/core/data_structure/obsolete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@
"f_p_div_lower": "f_p_div_lower_separatrix",
"temp_plasma_pedestal_kev": "temp_plasma_pedestal_electron_kev",
"temp_plasma_separatrix_kev": "temp_plasma_separatrix_electron_kev",
"iohcl": "i_cs_use",
}

OBS_VARS_HELP = {
Expand Down
2 changes: 1 addition & 1 deletion process/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]:
"i_plasma_ignited": InputVariable("physics", int, choices=[0, 1]),
"i_blkt_module_segmentation": InputVariable("fwbs", int, choices=[0, 1]),
"inuclear": InputVariable("fwbs", int, choices=[0, 1]),
"iohcl": InputVariable("build", int, choices=[0, 1]),
"i_cs_use": InputVariable("build", int, choices=[0, 1]),
"i_plasma_pedestal": InputVariable("physics", int, choices=[0, 1]),
"i_pf_conductor": InputVariable("pf_coil", int, choices=[0, 1]),
"ipnet": InputVariable("costs", int, choices=[0, 1]),
Expand Down
4 changes: 2 additions & 2 deletions process/core/io/plot/summary/magnets/cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from process.core.io.plot.summary.common import box_style, setup_axis, text_layout
from process.core.io.plot.summary.constants import SOLENOID_COLOUR
from process.core.io.plot.summary.reporting.text import plot_info
from process.data_structure.pfcoil_variables import NFIXMX
from process.data_structure.pfcoil_variables import NFIXMX, CSUseModel
from process.models.superconductors import SuperconductorModel

if TYPE_CHECKING:
Expand Down Expand Up @@ -513,7 +513,7 @@ def plot_pf_cs_plasma_mutual_inductance(
axis.set_yticks(range(n_pf_cs_plasma_circuits))
labels = list(range(1, n_pf_cs_plasma_circuits + 1))

if iohcl == 1:
if CSUseModel(iohcl) == CSUseModel.FULL_PULSE:
labels[-2] = "CS"
labels[-1] = "Plasma"
axis.set_xticklabels(labels)
Expand Down
17 changes: 13 additions & 4 deletions process/core/io/plot/summary/magnets/pf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from process.core.io.plot.summary.constants import CSCOMPRESSION_COLOUR, SOLENOID_COLOUR
from process.core.io.plot.summary.radial_build import cumulative_radial_build2
from process.data_structure.pfcoil_variables import CSUseModel
from process.models.geometry.pfcoil import pfcoil_geometry

if TYPE_CHECKING:
Expand Down Expand Up @@ -59,11 +60,17 @@ def plot_pf_coils(
number_of_coils += 1

# Check for Central Solenoid
iohcl = mfile.get("iohcl", scan=scan) if "iohcl" in mfile.data else 1
iohcl = (
mfile.get("iohcl", scan=scan) if "iohcl" in mfile.data else CSUseModel.FULL_PULSE
)

# If Central Solenoid present, ignore last entry in for loop
# The last entry will be the OH coil in this case
noc = number_of_coils - 1 if iohcl == 1 else number_of_coils
noc = (
number_of_coils - 1
if CSUseModel(iohcl) == CSUseModel.FULL_PULSE
else number_of_coils
)

for coil in range(noc):
coils_r.append(mfile.get(f"r_pf_coil_middle[{coil + 1:01}]", scan=scan))
Expand Down Expand Up @@ -145,8 +152,10 @@ def plot_pf_dimensions(
z_pf_coil_middle = []
radial_thicknesses = []
vertical_thicknesses = []
iohcl = mfile.get("iohcl", scan=scan) if "iohcl" in mfile.data else 1
x = 1 if iohcl == 0 else 2
iohcl = (
mfile.get("iohcl", scan=scan) if "iohcl" in mfile.data else CSUseModel.FULL_PULSE
)
x = 1 if CSUseModel(iohcl) == CSUseModel.NO_CENTRAL_SOLENOID else 2
for coil in range(int(mfile.get("n_pf_cs_plasma_circuits", scan=scan) - x)):
r_pf_coil_middle.append(mfile.get(f"r_pf_coil_middle[{coil + 1}]", scan=scan))
z_pf_coil_middle.append(mfile.get(f"z_pf_coil_middle[{coil + 1}]", scan=scan))
Expand Down
2 changes: 1 addition & 1 deletion process/data_structure/build_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class BuildData:
hr1: float = 0.0
"""half-height of TF coil inboard leg straight section (m)"""

iohcl: int = 1
i_cs_use: int = 1
"""Switch for existence of central solenoid:
- =0 central solenoid not present
- =1 central solenoid exists
Expand Down
10 changes: 10 additions & 0 deletions process/data_structure/pfcoil_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class PFConductorModel(IntEnum):
RESISTIVE = 1


@unique
class CSUseModel(IntEnum):
"""Enumeration for Central Solenoid usage models."""

NO_CENTRAL_SOLENOID = 0
"""No central solenoid is present"""
FULL_PULSE = 1
"""Central solenoid is used to drive the plasma current for the full pulse"""


N_PF_GROUPS_MAX = 10
"""maximum number of groups of PF coils"""

Expand Down
6 changes: 3 additions & 3 deletions process/models/costs/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from process.core import process_output as po
from process.core.exceptions import ProcessValueError
from process.core.model import Model
from process.data_structure.pfcoil_variables import PFConductorModel
from process.data_structure.pfcoil_variables import CSUseModel, PFConductorModel
from process.models.tfcoil.base import TFConductorModel
from process.models.vacuum import VacuumPumpType

Expand Down Expand Up @@ -1627,7 +1627,7 @@ def acc2222(self):

# Non-Central Solenoid coils

if self.data.build.iohcl == 1:
if CSUseModel(self.data.build.i_cs_use) != CSUseModel.NO_CENTRAL_SOLENOID:
npf = self.data.pf_coil.n_cs_pf_coils - 1
else:
npf = self.data.pf_coil.n_cs_pf_coils
Expand Down Expand Up @@ -1715,7 +1715,7 @@ def acc2222(self):

# Central Solenoid

if self.data.build.iohcl == 1:
if CSUseModel(self.data.build.i_cs_use) == CSUseModel.FULL_PULSE:
# Superconductor ($/m)
if self.data.costs.supercond_cost_model == 0:
# Issue #328 Use CS conductor cross-sectional area (m2)
Expand Down
Loading
Loading