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
5 changes: 3 additions & 2 deletions process/core/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from process.core.solver import constraints
from process.core.solver.iteration_variables import set_scaled_iteration_variable
from process.core.solver.objectives import objective_function
from process.data_structure.blanket_variables import BlktModelTypes
from process.models.tfcoil.base import TFConductorModel
from process.models.tfcoil.superconducting import SuperconductingTFTurnType

Expand Down Expand Up @@ -342,11 +343,11 @@ def _call_models_once(self, xc: np.ndarray):
4 | KIT HCLL model
5 | DCLL model
"""
if self.data.fwbs.i_blanket_type == 1:
if self.data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB:
# CCFE HCPB model
self.models.ccfe_hcpb.run()

elif self.data.fwbs.i_blanket_type == 5:
elif self.data.fwbs.i_blanket_type == BlktModelTypes.DCLL:
# DCLL model
self.models.dcll.run()

Expand Down
3 changes: 2 additions & 1 deletion process/core/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from process.core.log import logging_model_handler
from process.core.solver import iteration_variables
from process.core.solver.constraints import ConstraintManager
from process.data_structure.blanket_variables import BlktModelTypes
from process.data_structure.build_variables import init_build_variables
from process.data_structure.buildings_variables import init_buildings_variables
from process.data_structure.ccfe_hcpb_module import init_ccfe_hcpb_module
Expand Down Expand Up @@ -1170,7 +1171,7 @@ def check_process(inputs, data): # noqa: ARG001
# CCFE HCPB Model

if data_structure.stellarator_variables.istell == 0 and (
data.fwbs.i_blanket_type == 1
data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB
):
fsum = data.fwbs.breeder_multiplier + data.fwbs.vfcblkt + data.fwbs.vfpblkt
if fsum >= 1.0:
Expand Down
5 changes: 3 additions & 2 deletions process/core/output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from process import data_structure
from process.core.log import logging_model_handler
from process.data_structure.blanket_variables import BlktModelTypes
from process.models.tfcoil.base import TFConductorModel
from process.models.tfcoil.superconducting import (
SuperconductingTFTurnType,
Expand Down Expand Up @@ -122,11 +123,11 @@ def write(models, data, _outfile):
# First wall geometry
models.fw.output()

if data.fwbs.i_blanket_type == 1:
if data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB:
# CCFE HCPB model
models.ccfe_hcpb.output()

elif data.fwbs.i_blanket_type == 5:
elif data.fwbs.i_blanket_type == BlktModelTypes.DCLL:
# DCLL model
models.dcll.output()

Expand Down
8 changes: 8 additions & 0 deletions process/data_structure/blanket_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
"""

from dataclasses import dataclass
from enum import IntEnum


class BlktModelTypes(IntEnum):
"""Enum for blanket model types. `i_blanket_type`"""

CCFE_HCPB = 1
DCLL = 5


@dataclass
Expand Down
4 changes: 3 additions & 1 deletion process/models/blankets/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
physics_variables,
primary_pumping_variables,
)
from process.data_structure.blanket_variables import BlktModelTypes
from process.models.build import FwBlktVVShape
from process.models.engineering.ivc_functions import (
calculate_pipe_bend_radius,
Expand Down Expand Up @@ -892,7 +893,8 @@ def set_blanket_module_geometry(self):
Error
If the poloidal segment length is less than three times the minimum liquid breeder pipe width.
"""
if self.data.fwbs.i_blanket_type == 5:
i_blanket_type = BlktModelTypes(self.data.fwbs.i_blanket_type)
if i_blanket_type == BlktModelTypes.DCLL:
# Unless DCLL then we will use BZ
self.data.blanket.len_blkt_inboard_coolant_channel_radial = (
build_variables.blbuith
Expand Down
8 changes: 5 additions & 3 deletions process/models/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
tfcoil_variables,
times_variables,
)
from process.data_structure.blanket_variables import BlktModelTypes


class PumpingPowerModelTypes(IntEnum):
Expand Down Expand Up @@ -1894,9 +1895,10 @@ def plant_thermal_efficiency(self, eta_turbine):
i_thermal_electric_conversion = ElectricConversionModelTypes(
self.data.fwbs.i_thermal_electric_conversion
)
i_blanket_type = BlktModelTypes(self.data.fwbs.i_blanket_type)
if i_thermal_electric_conversion == ElectricConversionModelTypes.CCFE_HCPB_VALUE:
# CCFE HCPB Model
if self.data.fwbs.i_blanket_type == 1:
if i_blanket_type == BlktModelTypes.CCFE_HCPB:
# HCPB, efficiency taken from M. Kovari 2016
# "PROCESS": A systems code for fusion power plants - Part 2: Engineering
# https://www.sciencedirect.com/science/article/pii/S0920379616300072
Expand All @@ -1911,7 +1913,7 @@ def plant_thermal_efficiency(self, eta_turbine):
== ElectricConversionModelTypes.CCFE_HCPB_VALUE_WITH_DIVERTOR
):
# CCFE HCPB Model
if self.data.fwbs.i_blanket_type == 1:
if self.data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB:
# HCPB, efficiency taken from M. Kovari 2016
# "PROCESS": A systems code for fusion power plants - Part 2: Engineering
# https://www.sciencedirect.com/science/article/pii/S0920379616300072
Expand All @@ -1931,7 +1933,7 @@ def plant_thermal_efficiency(self, eta_turbine):
== ElectricConversionModelTypes.STEAM_RANKINE_CYCLE
):
# CCFE HCPB Model
if self.data.fwbs.i_blanket_type == 1:
if self.data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB:
# If coolant is helium, the steam cycle is assumed to be superheated
# and a different correlation is used. The turbine inlet temperature
# is assumed to be 20 degrees below the primary coolant outlet
Expand Down
Loading