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 @@ -344,11 +345,11 @@ def _call_models_once(self, xc: np.ndarray, data: DataStructure):
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
5 changes: 4 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.impurity_radiation_module import (
init_impurity_radiation_module,
)
Expand Down Expand Up @@ -1116,7 +1117,9 @@ def check_process(inputs, data): # noqa: ARG001
# Ensure that blanket material fractions allow non-zero space for steel
# CCFE HCPB Model

if data.stellarator.istell == 0 and (data.fwbs.i_blanket_type == 1):
if data.stellarator.istell == 0 and (
data.fwbs.i_blanket_type == BlktModelTypes.CCFE_HCPB
):
fsum = data.fwbs.breeder_multiplier + data.fwbs.vfcblkt + data.fwbs.vfpblkt
if fsum >= 1.0:
raise ProcessValidationError(
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 @@ -13,6 +13,7 @@
from process.data_structure import (
physics_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 @@ -888,7 +889,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 = (
self.data.build.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 @@ -16,6 +16,7 @@
physics_variables,
tfcoil_variables,
)
from process.data_structure.blanket_variables import BlktModelTypes
from process.data_structure.pfcoil_variables import NGC2


Expand Down Expand Up @@ -1932,9 +1933,10 @@ def plant_thermal_efficiency(self, eta_turbine: float) -> float:
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
Expand All @@ -1950,7 +1952,7 @@ def plant_thermal_efficiency(self, eta_turbine: float) -> float:
== 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
Expand All @@ -1971,7 +1973,7 @@ def plant_thermal_efficiency(self, eta_turbine: float) -> float:
== 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