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
3 changes: 2 additions & 1 deletion process/core/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
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 InboardBlanketConfiguration
from process.data_structure.impurity_radiation_variables import N_IMPURITIES
from process.data_structure.numerics import FiguresOfMerit, PROCESSRunMode
from process.data_structure.physics_variables import DivertorNumberModels
Expand Down Expand Up @@ -1042,7 +1043,7 @@ def check_process(inputs, data): # noqa: ARG001

# Set inboard blanket thickness to zero if no inboard blanket switch
# used (Issue #732)
if data.fwbs.i_blkt_inboard == 0:
if data.build.i_blkt_inboard == InboardBlanketConfiguration.NO_INBOARD_BLANKET:
data.build.dr_blkt_inboard = 0.0

# Ensure that blanket material fractions allow non-zero space for steel
Expand Down
14 changes: 14 additions & 0 deletions process/data_structure/build_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from dataclasses import dataclass
from enum import IntEnum


class InboardBlanketConfiguration(IntEnum):
"""Switch for inboard blanket, controlled through `BuildData.i_blkt_inboard`"""

NO_INBOARD_BLANKET = 0
INBOARD_BLANKET_PRESENT = 1


@dataclass(slots=True)
Expand Down Expand Up @@ -303,5 +311,11 @@ class BuildData:
the ripple calculation, else 0
"""

i_blkt_inboard: int = 1
"""Switch for inboard blanket, controlled through InboardBlanketConfiguration enum:
- =0 No inboard blanket (dr_blkt_inboard=0.0)
- =1 Inboard blanket present
"""


CREATE_DICTS_FROM_DATACLASS = BuildData
6 changes: 0 additions & 6 deletions process/data_structure/fwbs_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ class FWBSData:
- please use i_p_coolant_pumping = 0 or 1.
"""

i_blkt_inboard: int = 1
"""switch for inboard blanket:
- =0 No inboard blanket (dr_blkt_inboard=0.0)
- =1 Inboard blanket present
"""

inuclear: int = 0
Comment on lines 83 to 84
"""switch for nuclear heating in the coils:
- =0 Frances Fox model (default)
Expand Down
116 changes: 93 additions & 23 deletions process/models/blankets/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from process.core.exceptions import ProcessValueError
from process.core.model import Model
from process.data_structure.blanket_variables import BlktModelTypes
from process.data_structure.build_variables import InboardBlanketConfiguration
from process.models.build import FwBlktVVShape
from process.models.engineering.ivc_functions import (
calculate_pipe_bend_radius,
Expand Down Expand Up @@ -981,7 +982,10 @@ def set_blanket_module_geometry(self):
# If liquid breeder or dual coolant blanket then calculate
if self.data.fwbs.i_blkt_dual_coolant > 0:
# Use smallest space available to pipes for pipe sizes in pumping calculations (worst case)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Radial direction
self.data.fwbs.b_bz_liq = (
min(
Expand Down Expand Up @@ -1181,7 +1185,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
flow_density=self.data.fwbs.den_liq,
)

if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Calc total num of pipes (in all inboard modules) from
# coolant frac and channel dimensions
# Assumes up/down flow, two 90 deg bends per length
Expand Down Expand Up @@ -1270,7 +1277,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
flow_density=self.data.fwbs.den_liq,
)

if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Calc total num of pipes (in all inboard modules) from
# coolant frac and channel dimensions
# Assumes up/down flow, two 90 deg bends per length
Expand Down Expand Up @@ -1347,7 +1357,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
flow_density=self.data.fwbs.den_blkt_coolant,
)

if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Calc total num of pipes (in all inboard modules) from
# coolant frac and channel dimensions
# Assumes up/down flow, two 90 deg bends per length
Expand Down Expand Up @@ -1427,7 +1440,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
)

# Long polodal flows
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
npoltoti = self.data.fwbs.nopol * npblkti_liq
npoltoto = self.data.fwbs.nopol * npblkto_liq

Expand All @@ -1446,7 +1462,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
label="Outboard blanket",
)

if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
dpres_blkt_inboard_coolant = self.total_pressure_drop(
output,
icoolpump=1,
Expand Down Expand Up @@ -1478,7 +1497,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
nopolchan=npoltoto,
label="Outboard blanket breeder liquid",
)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_bli_liq = self.total_pressure_drop(
output,
icoolpump=2,
Expand Down Expand Up @@ -1509,7 +1531,10 @@ def thermo_hydraulic_model_pressure_drop_calculations(self, output: bool):
deltap_blo_liq,
]

if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
return [
dpres_fw_inboard_coolant,
dpres_fw_outboard_coolant,
Expand Down Expand Up @@ -1851,7 +1876,10 @@ def liquid_breeder_properties(self, output: bool = False):

# Magnetic feild strength in T for Hartmann calculation
# IB
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
self.data.fwbs.b_mag_blkt[0] = (
self.data.physics.b_plasma_toroidal_on_axis
* self.data.physics.rmajor
Expand All @@ -1862,7 +1890,10 @@ def liquid_breeder_properties(self, output: bool = False):
)
)
# We do not use this if there is no IB blanket, but will use edge as fill value
if self.data.fwbs.i_blkt_inboard == 0:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.NO_INBOARD_BLANKET
):
self.data.fwbs.b_mag_blkt[0] = (
self.data.physics.b_plasma_toroidal_on_axis
* self.data.physics.rmajor
Expand Down Expand Up @@ -2098,7 +2129,10 @@ def thermo_hydraulic_model(self, output: bool):
# IB/OB Blanket (MW)

# Neutron power deposited in inboard blanket (MW)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
self.data.blanket.p_blkt_nuclear_heat_inboard_mw = (
self.data.fwbs.p_blkt_nuclear_heat_total_mw
* self.data.fwbs.vol_blkt_inboard
Expand Down Expand Up @@ -2194,7 +2228,10 @@ def thermo_hydraulic_model(self, output: bool):
)

# Outlet FW/inlet BB temp (mass flow FW = mass flow BB)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
fwoutleti = (f_nuc_fwi * self.data.fwbs.temp_blkt_coolant_out) + (
1 - f_nuc_fwi
) * self.data.fwbs.temp_fw_coolant_in
Expand Down Expand Up @@ -2289,7 +2326,10 @@ def thermo_hydraulic_model(self, output: bool):
)

# If there is an IB blanket...
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Mass flow rates for inboard blanket coolants (kg/s)
self.data.blanket.mflow_blkt_inboard_coolant = (
1.0e6
Expand Down Expand Up @@ -2331,7 +2371,10 @@ def thermo_hydraulic_model(self, output: bool):
) / (24 * 3600)

# If there is an IB blanket...
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# Mass flow rate for inboard blanket coolant (kg/s)
self.data.blanket.mflow_blkt_inboard_coolant = (
1.0e6
Expand Down Expand Up @@ -2360,7 +2403,10 @@ def thermo_hydraulic_model(self, output: bool):

# If there is an IB blanket...
# Mass flow rate for inboard blanket coolant (kg/s)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
self.data.blanket.mflow_blkt_inboard_coolant = (
1.0e6
* (self.data.blanket.p_blkt_nuclear_heat_inboard_mw)
Expand All @@ -2384,23 +2430,35 @@ def thermo_hydraulic_model(self, output: bool):
deltap_fwo = deltap[1]
deltap_blo = deltap[2]
if self.data.fwbs.i_blkt_dual_coolant > 0:
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_bli = deltap[3]
deltap_blo_liq = deltap[4]
deltap_bli_liq = deltap[5]
else:
deltap_blo_liq = deltap[3]
elif self.data.fwbs.i_blkt_inboard == 1:
elif (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_bli = deltap[3]

# Pumping Power
# If FW and BB have the same coolant...
if self.data.fwbs.i_fw_blkt_shared_coolant == FWBlktCoolantLoopTypes.SHARED_LOOP:
# Total pressure drop in the first wall/blanket (Pa)
if i_p_coolant_pumping == PumpingPowerModelTypes.MECHANICAL:
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_fw_blkt = deltap_fwi + deltap_bli + deltap_fwo + deltap_blo
if self.data.fwbs.i_blkt_inboard == 0:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.NO_INBOARD_BLANKET
):
deltap_fw_blkt = deltap_fwi + deltap_fwo + deltap_blo
elif (
i_p_coolant_pumping
Expand Down Expand Up @@ -2439,9 +2497,15 @@ def thermo_hydraulic_model(self, output: bool):
deltap_fw = deltap_fwi + deltap_fwo

# Total pressure drop in the blanket (Pa)
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_blkt = deltap_bli + deltap_blo
if self.data.fwbs.i_blkt_inboard == 0:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.NO_INBOARD_BLANKET
):
deltap_blkt = deltap_blo
elif (
i_p_coolant_pumping
Expand Down Expand Up @@ -2501,9 +2565,15 @@ def thermo_hydraulic_model(self, output: bool):
if self.data.fwbs.i_blkt_dual_coolant > 0:
# Total pressure drop in the blanket (Pa)
if i_p_coolant_pumping == PumpingPowerModelTypes.MECHANICAL:
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
deltap_bl_liq = deltap_bli_liq + deltap_blo_liq
if self.data.fwbs.i_blkt_inboard == 0:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.NO_INBOARD_BLANKET
):
deltap_bl_liq = deltap_blo_liq
elif (
i_p_coolant_pumping
Expand Down
11 changes: 9 additions & 2 deletions process/models/blankets/dcll.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from process.core import (
process_output as po,
)
from process.data_structure.build_variables import InboardBlanketConfiguration
from process.models.blankets.blanket_library import InboardBlanket, OutboardBlanket
from process.models.engineering.ivc_functions import (
calculate_pipe_bend_radius,
Expand Down Expand Up @@ -549,7 +550,10 @@ def dcll_masses(self, output: bool):
self.data.dcll.f_vol_mfbss_pbli = 0.4436

# Calculate Volumes
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
# IB and OB blanket

# BZ
Expand Down Expand Up @@ -770,7 +774,10 @@ def dcll_masses(self, output: bool):
)

# Total mass of IB/OB segment
if self.data.fwbs.i_blkt_inboard == 1:
if (
self.data.build.i_blkt_inboard
== InboardBlanketConfiguration.INBOARD_BLANKET_PRESENT
):
self.data.dcll.mass_segm_ib = (
self.data.fwbs.m_blkt_total
* (self.data.fwbs.vol_blkt_inboard / self.data.fwbs.vol_blkt_total)
Expand Down
Loading
Loading