Skip to content
Open
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
1 change: 0 additions & 1 deletion process/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,6 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]:
"quench_model": InputVariable("tfcoil", str, choices=["exponential", "linear"]),
"i_fw_coolant_type": InputVariable("fwbs", int, choices=[1, 2]),
"i_vacuum_pumping": InputVariable("vacuum", str, choices=["old", "simple"]),
"dcond": InputVariable("tfcoil", float, array=True),
"c_pf_coil_turn_peak_input": InputVariable("pf_coil", float, array=True),
"i_pf_location": InputVariable("pf_coil", int, array=True),
"n_pf_coils_in_group": InputVariable("pf_coil", int, array=True),
Expand Down
15 changes: 0 additions & 15 deletions process/data_structure/tfcoil_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,6 @@ class TFData:
den_tf_coil_case: float = 8000.0
"""density of coil case (kg/m3)"""

dcond: list[float] = field(
default_factory=lambda: np.array([
6080.0,
6080.0,
6070.0,
6080.0,
6080.0,
8500.0,
6070.0,
8500.0,
8500.0,
])
)
"""density of superconductor type given by i_tf_sc_mat/i_cs_superconductor/i_pf_superconductor (kg/m3)"""

den_tf_wp_turn_insulation: float = 1800.0
"""density of conduit + ground-wall insulation (kg/m3)"""

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

Expand Down Expand Up @@ -1648,9 +1649,9 @@ def acc2222(self):
)
* 1.0e6
/ self.data.pf_coil.j_pf_coil_wp_peak[i]
* self.data.tfcoil.dcond[
self.data.pf_coil.i_pf_superconductor - 1
]
* SuperconductorModel(
self.data.pf_coil.i_pf_superconductor
).material.density
)
else:
costpfsc = 0.0e0
Expand Down Expand Up @@ -1728,9 +1729,9 @@ def acc2222(self):
/ self.data.pf_coil.n_pf_coil_turns[
self.data.pf_coil.n_cs_pf_coils - 1
]
* self.data.tfcoil.dcond[
self.data.pf_coil.i_cs_superconductor - 1
]
* SuperconductorModel(
self.data.pf_coil.i_cs_superconductor
).material.density
)
else:
costpfsc = 0.0e0
Expand Down
10 changes: 6 additions & 4 deletions process/models/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,9 @@ def pfcoil(self):
if self.data.pf_coil.i_pf_conductor == PFConductorModel.SUPERCONDUCTING:
self.data.pf_coil.m_pf_coil_conductor[i] = (
volpf
* self.data.tfcoil.dcond[
self.data.pf_coil.i_pf_superconductor - 1
]
* SuperconductorModel(
self.data.pf_coil.i_pf_superconductor
).material.density
* (1.0e0 - self.data.pf_coil.f_a_pf_coil_void[i])
)
else:
Expand Down Expand Up @@ -3683,7 +3683,9 @@ def ohcalc(self):
* 2.0e0
* np.pi
* self.data.pf_coil.r_pf_coil_middle[self.data.pf_coil.n_cs_pf_coils - 1]
* self.data.tfcoil.dcond[self.data.pf_coil.i_cs_superconductor - 1]
* SuperconductorModel(
self.data.pf_coil.i_cs_superconductor
).material.density
)
else:
self.data.pf_coil.m_pf_coil_conductor[
Expand Down
3 changes: 2 additions & 1 deletion process/models/stellarator/coils/mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from process.core import constants
from process.core.data_structure.base import DataStructure
from process.models.superconductors import SuperconductorModel


def calculate_coils_mass(
Expand Down Expand Up @@ -85,7 +86,7 @@ def superconductor(data: DataStructure):
* (1.0e0 - data.tfcoil.f_a_tf_turn_cable_space_extra_void)
* (1.0e0 - data.tfcoil.f_a_tf_turn_cable_copper)
- data.tfcoil.len_tf_coil * data.tfcoil.a_tf_wp_coolant_channels
) * data.tfcoil.dcond[data.tfcoil.i_tf_sc_mat - 1]
) * SuperconductorModel(data.tfcoil.i_tf_sc_mat).material.density


def copper(data: DataStructure):
Expand Down
18 changes: 13 additions & 5 deletions process/models/superconductors.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ def abbreviation(self):
class SuperconductorMaterial(IntEnum):
"""Enumeration of superconductor materials."""

NB3SN = (1, SuperconductorType.LOW_TEMPERATURE, "Nb₃Sn")
NBTI = (2, SuperconductorType.LOW_TEMPERATURE, "NbTi")
BI2212 = (3, SuperconductorType.HIGH_TEMPERATURE, "Bi-2212")
REBCO = (4, SuperconductorType.HIGH_TEMPERATURE, "REBCO")
NB3SN = (1, SuperconductorType.LOW_TEMPERATURE, 8.7e3, "Nb₃Sn")
NBTI = (2, SuperconductorType.LOW_TEMPERATURE, 6.45e3, "NbTi")
BI2212 = (3, SuperconductorType.HIGH_TEMPERATURE, 6.3e3, "Bi-2212")
REBCO = (4, SuperconductorType.HIGH_TEMPERATURE, 6.35e3, "REBCO")

def __new__(cls, value: int, sc_type: SuperconductorType, material_name: str):
def __new__(
cls, value: int, sc_type: SuperconductorType, density: float, material_name: str
):
"""Create a new instance of SuperconductorMaterial."""
obj = int.__new__(cls, value)
obj._value_ = value
obj._sc_type_ = sc_type
obj._density_ = density
obj._material_name_ = material_name
return obj

Expand All @@ -67,6 +70,11 @@ def sc_type(self):
"""The superconductor type (LTS or HTS) for this material."""
return self._sc_type_.abbreviation

@DynamicClassAttribute
def density(self):
"""The density of the superconductor material. [kg/m³]"""
return self._density_

Comment thread
chris-ashe marked this conversation as resolved.
@DynamicClassAttribute
def material_name(self):
"""The name of the superconductor material."""
Expand Down
2 changes: 1 addition & 1 deletion process/models/tfcoil/superconducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,7 @@ def superconducting_tf_coil_areas_and_masses(self):
* (1.0e0 - self.data.tfcoil.f_a_tf_turn_cable_space_extra_void)
* (1.0e0 - self.data.tfcoil.f_a_tf_turn_cable_copper)
- self.data.tfcoil.len_tf_coil * self.data.tfcoil.a_tf_wp_coolant_channels
) * self.data.tfcoil.dcond[self.data.tfcoil.i_tf_sc_mat - 1]
) * SuperconductorModel(self.data.tfcoil.i_tf_sc_mat).material.density

# Copper mass [kg]
self.data.tfcoil.m_tf_coil_copper = (
Expand Down
33 changes: 4 additions & 29 deletions tests/unit/models/test_costs_1990.py
Original file line number Diff line number Diff line change
Expand Up @@ -1908,8 +1908,6 @@ class Acc2222Param(NamedTuple):

fncmass: Any = None

dcond: Any = None

c22: Any = None

expected_c2222: Any = None
Expand Down Expand Up @@ -2103,16 +2101,9 @@ class Acc2222Param(NamedTuple):
).transpose(),
a_cs_cable_space=3.8004675824985918,
fncmass=310716.52923547616,
dcond=np.array(
np.array(
(6080, 6080, 6070, 6080, 6080, 8500, 6070, 8500, 8500),
order="F",
),
order="F",
).transpose(),
c22=0,
expected_c2222=626.57984594974835,
expected_c22221=434.46640986938519,
expected_c2222=656.1818171277597,
expected_c22221=464.0683810473965,
expected_c22222=69.02908267696219,
expected_c22223=113.89491205126185,
expected_c22224=9.1894413521392071,
Expand Down Expand Up @@ -2294,16 +2285,9 @@ class Acc2222Param(NamedTuple):
).transpose(),
a_cs_cable_space=3.8004675824985918,
fncmass=310716.52923547616,
dcond=np.array(
np.array(
(6080, 6080, 6070, 6080, 6080, 8500, 6070, 8500, 8500),
order="F",
),
order="F",
).transpose(),
c22=3474.7391916096453,
expected_c2222=634.503192513881,
expected_c22221=448.04573758127646,
expected_c2222=664.5491422744361,
expected_c22221=478.0916873418316,
expected_c22222=71.202561277966055,
expected_c22223=106.06545230249935,
expected_c22224=9.1894413521392071,
Expand Down Expand Up @@ -2485,13 +2469,6 @@ class Acc2222Param(NamedTuple):
).transpose(),
a_cs_cable_space=3.8004675824985918,
fncmass=310716.52923547616,
dcond=np.array(
np.array(
(6080, 6080, 6070, 6080, 6080, 8500, 6070, 8500, 8500),
order="F",
),
order="F",
).transpose(),
c22=3474.7391916096453,
expected_c2222=2271626.1414324627,
expected_c22221=2271439.6839775303,
Expand Down Expand Up @@ -2595,8 +2572,6 @@ def test_acc2222(acc2222param, monkeypatch, costs):

monkeypatch.setattr(costs.data.structure, "fncmass", acc2222param.fncmass)

monkeypatch.setattr(costs.data.tfcoil, "dcond", acc2222param.dcond)

monkeypatch.setattr(costs.data.costs, "c22", acc2222param.c22)

costs.acc2222()
Expand Down
6 changes: 0 additions & 6 deletions tests/unit/models/test_pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,6 @@ class PFCoilParam(NamedTuple):
itart: Any = None
beta_poloidal_vol_avg: Any = None
tftmp: Any = None
dcond: Any = None
fhts: Any = None
tcritsc: Any = None
str_pf_con_res: Any = None
Expand Down Expand Up @@ -2546,7 +2545,6 @@ class PFCoilParam(NamedTuple):
itart=0,
beta_poloidal_vol_avg=6.313e-1,
tftmp=4.750,
dcond=np.full(9, 9.0e3),
fhts=0.5,
tcritsc=1.6e1,
str_pf_con_res=-5.0e-3,
Expand Down Expand Up @@ -2652,7 +2650,6 @@ def test_pfcoil(monkeypatch, pfcoil, pfcoilparam):

for field in [
"tftmp",
"dcond",
"fhts",
"tcritsc",
"str_pf_con_res",
Expand Down Expand Up @@ -2715,7 +2712,6 @@ class OhCalcParam(NamedTuple):
z_pf_coil_lower: Any = None
n_pf_coil_turns: Any = None
m_pf_coil_structure: Any = None
dcond: Any = None
tftmp: Any = None
tcritsc: Any = None
str_cs_con_res: Any = None
Expand Down Expand Up @@ -2766,7 +2762,6 @@ class OhCalcParam(NamedTuple):
z_pf_coil_lower=np.full(22, 0.0),
n_pf_coil_turns=np.full(22, 0.0),
m_pf_coil_structure=np.full(22, 0.0),
dcond=np.full(9, 9.0e3),
tftmp=4.750,
tcritsc=1.6e1,
str_cs_con_res=-5.000e-3,
Expand Down Expand Up @@ -2838,7 +2833,6 @@ def test_ohcalc(monkeypatch, reinitialise_error_module, cs_coil, ohcalcparam):
monkeypatch.setattr(cs_coil.data.pf_coil, field, getattr(ohcalcparam, field))

for field in [
"dcond",
"tftmp",
"tcritsc",
"str_cs_con_res",
Expand Down
46 changes: 4 additions & 42 deletions tests/unit/models/tfcoil/test_sctfcoil.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Any, NamedTuple

import numpy as np
import pytest

from process.models.superconductors import SuperconductorModel
Expand Down Expand Up @@ -1639,8 +1638,6 @@ class TfCoilAreaAndMassesParam(NamedTuple):

f_a_tf_turn_cable_space_extra_void: Any = None

dcond: Any = None

den_tf_wp_turn_insulation: Any = None

len_tf_coil: Any = None
Expand Down Expand Up @@ -1754,23 +1751,6 @@ class TfCoilAreaAndMassesParam(NamedTuple):
m_tf_coil_conductor=0.0,
m_tf_coil_wp_turn_insulation=0.0,
f_a_tf_turn_cable_space_extra_void=0.30000000000000004,
dcond=np.array(
np.array(
(
6080.0,
6080.0,
6070.0,
6080.0,
6080.0,
8500.0,
6070.0,
8500.0,
8500.0,
),
order="F",
),
order="F",
).transpose(),
den_tf_wp_turn_insulation=1800.0,
len_tf_coil=50.483843027201402,
den_tf_coil_case=8000.0,
Expand Down Expand Up @@ -1801,9 +1781,9 @@ class TfCoilAreaAndMassesParam(NamedTuple):
expected_m_tf_wp_steel_conduit=115651.90127937049,
expected_m_tf_coil_case=1034021.9996272125,
expected_m_tf_coil_wp_insulation=5909.3507916745702,
expected_m_tf_coil_superconductor=5802.5700395134345,
expected_m_tf_coil_superconductor=8303.019628909025,
expected_m_tf_coil_copper=58744.465423173802,
expected_whtcon=188184.68882144717,
expected_whtcon=190685.13841084277,
expected_m_tf_coil_wp_turn_insulation=7985.7520793894437,
expected_cplen=20.562180043124066,
),
Expand All @@ -1828,23 +1808,6 @@ class TfCoilAreaAndMassesParam(NamedTuple):
m_tf_coil_conductor=0.0,
m_tf_coil_wp_turn_insulation=0.0,
f_a_tf_turn_cable_space_extra_void=0.30000000000000004,
dcond=np.array(
np.array(
(
6080.0,
6080.0,
6070.0,
6080.0,
6080.0,
8500.0,
6070.0,
8500.0,
8500.0,
),
order="F",
),
order="F",
).transpose(),
den_tf_wp_turn_insulation=1800.0,
len_tf_coil=50.514015976170839,
den_tf_coil_case=8000.0,
Expand Down Expand Up @@ -1875,9 +1838,9 @@ class TfCoilAreaAndMassesParam(NamedTuple):
expected_m_tf_wp_steel_conduit=115721.02357090525,
expected_m_tf_coil_case=1034699.2182961091,
expected_m_tf_coil_wp_insulation=5912.8826650262808,
expected_m_tf_coil_superconductor=5806.038092640837,
expected_m_tf_coil_superconductor=8307.982139140671,
expected_m_tf_coil_copper=58779.575542593491,
expected_whtcon=188297.16217276,
expected_whtcon=190799.10621926418,
expected_m_tf_coil_wp_turn_insulation=7990.5249666247555,
expected_cplen=20.562180043124066,
),
Expand Down Expand Up @@ -1932,7 +1895,6 @@ def test_superconducting_tf_coil_area_and_masses(
"f_a_tf_turn_cable_space_extra_void",
tfcoilareaandmassesparam.f_a_tf_turn_cable_space_extra_void,
),
("dcond", tfcoilareaandmassesparam.dcond),
(
"den_tf_wp_turn_insulation",
tfcoilareaandmassesparam.den_tf_wp_turn_insulation,
Expand Down
Loading