Skip to content
13 changes: 7 additions & 6 deletions process/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
blanket_library,
build_variables,
divertor_variables,
first_wall_variables,
fwbs_variables,
heat_transport_variables,
physics_variables,
Expand Down Expand Up @@ -1611,13 +1612,13 @@ def thermo_hydraulic_model(self, output: bool):
# IB/OB FW (MW)
blanket_library.p_fw_inboard_nuclear_heat_mw = (
fwbs_variables.p_fw_nuclear_heat_total_mw
* build_variables.a_fw_inboard
/ build_variables.a_fw_total
* first_wall_variables.a_fw_inboard
/ first_wall_variables.a_fw_total
)
blanket_library.p_fw_outboard_nuclear_heat_mw = (
fwbs_variables.p_fw_nuclear_heat_total_mw
* build_variables.a_fw_outboard
/ build_variables.a_fw_total
* first_wall_variables.a_fw_outboard
/ first_wall_variables.a_fw_total
)

# IB/OB Blanket (MW)
Expand Down Expand Up @@ -1747,7 +1748,7 @@ def thermo_hydraulic_model(self, output: bool):
output,
fwbs_variables.radius_fw_channel,
build_variables.dr_fw_inboard,
build_variables.a_fw_inboard,
first_wall_variables.a_fw_inboard,
fwbs_variables.psurffwi,
blanket_library.p_fw_inboard_nuclear_heat_mw,
"Inboard first wall",
Expand All @@ -1761,7 +1762,7 @@ def thermo_hydraulic_model(self, output: bool):
output,
fwbs_variables.radius_fw_channel,
build_variables.dr_fw_outboard,
build_variables.a_fw_outboard,
first_wall_variables.a_fw_outboard,
fwbs_variables.psurffwo,
blanket_library.p_fw_outboard_nuclear_heat_mw,
"Outboard first wall",
Expand Down
120 changes: 0 additions & 120 deletions process/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from process import constants
from process import process_output as po
from process.blanket_library import dshellarea, eshellarea
from process.data_structure import (
build_variables,
buildings_variables,
Expand All @@ -17,7 +16,6 @@
superconducting_tf_coil_variables,
tfcoil_variables,
)
from process.exceptions import ProcessValueError

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -2010,124 +2008,6 @@ def calculate_radial_build(self, output: bool) -> None:
dx_tf_wp_insertion_gap=tfcoil_variables.dx_tf_wp_insertion_gap,
)

# Half-height of first wall (internal surface)
hbot = (
build_variables.z_plasma_xpoint_lower
+ build_variables.dz_xpoint_divertor
+ divertor_variables.dz_divertor
- build_variables.dz_blkt_upper
- 0.5e0 * (build_variables.dr_fw_inboard + build_variables.dr_fw_outboard)
)
if (
divertor_variables.n_divertors == 2
): # (i.e. physics_variables.i_single_null=0)
htop = hbot
else:
htop = (
build_variables.z_plasma_xpoint_upper + build_variables.dz_fw_plasma_gap
)

hfw = 0.5e0 * (htop + hbot)

if (physics_variables.itart == 1) or (
fwbs_variables.i_fw_blkt_vv_shape == 1
): # D-shaped
# Major radius to outer edge of inboard section
r1 = (
physics_variables.rmajor
- physics_variables.rminor
- build_variables.dr_fw_plasma_gap_inboard
)

# Horizontal distance between inside edges,
# i.e. outer radius of inboard part to inner radius of outboard part

r2 = (
physics_variables.rmajor
+ physics_variables.rminor
+ build_variables.dr_fw_plasma_gap_outboard
) - r1
# Calculate surface area, assuming 100% coverage

(
build_variables.a_fw_inboard_full_coverage,
build_variables.a_fw_outboard_full_coverage,
build_variables.a_fw_total_full_coverage,
) = dshellarea(r1, r2, hfw)

else: # Cross-section is assumed to be defined by two ellipses
# Major radius to centre of inboard and outboard ellipses
# (coincident in radius with top of plasma)

r1 = (
physics_variables.rmajor
- physics_variables.rminor * physics_variables.triang
)

# Distance between r1 and outer edge of inboard section

r2 = r1 - (
physics_variables.rmajor
- physics_variables.rminor
- build_variables.dr_fw_plasma_gap_inboard
)

# Distance between r1 and inner edge of outboard section

r3 = (
physics_variables.rmajor
+ physics_variables.rminor
+ build_variables.dr_fw_plasma_gap_outboard
) - r1

# Calculate surface area, assuming 100% coverage

(
build_variables.a_fw_inboard_full_coverage,
build_variables.a_fw_outboard_full_coverage,
build_variables.a_fw_total_full_coverage,
) = eshellarea(r1, r2, r3, hfw)

# Apply area coverage factor

if divertor_variables.n_divertors == 2:
# Double null configuration
build_variables.a_fw_outboard = (
build_variables.a_fw_outboard_full_coverage
* (
1.0e0
- 2.0e0 * fwbs_variables.f_ster_div_single
- fwbs_variables.f_a_fw_outboard_hcd
)
)
build_variables.a_fw_inboard = build_variables.a_fw_inboard_full_coverage * (
1.0e0 - 2.0e0 * fwbs_variables.f_ster_div_single
)
else:
# Single null configuration
build_variables.a_fw_outboard = (
build_variables.a_fw_outboard_full_coverage
* (
1.0e0
- fwbs_variables.f_ster_div_single
- fwbs_variables.f_a_fw_outboard_hcd
)
)
build_variables.a_fw_inboard = build_variables.a_fw_inboard_full_coverage * (
1.0e0 - fwbs_variables.f_ster_div_single
)

build_variables.a_fw_total = (
build_variables.a_fw_inboard + build_variables.a_fw_outboard
)

if build_variables.a_fw_outboard <= 0.0e0:
raise ProcessValueError(
"fhole+f_ster_div_single+f_a_fw_outboard_hcd is too high for a credible outboard wall area",
f_ster_div_single=fwbs_variables.f_ster_div_single,
f_a_fw_outboard_hcd=fwbs_variables.f_a_fw_outboard_hcd,
)

#

if output:
Expand Down
3 changes: 2 additions & 1 deletion process/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
cost_variables,
current_drive_variables,
divertor_variables,
first_wall_variables,
fwbs_variables,
heat_transport_variables,
ife_variables,
Expand Down Expand Up @@ -1220,7 +1221,7 @@ def acc2211(self):
* cmlsa[cost_variables.lsa - 1]
* (
(cost_variables.UCFWA + cost_variables.UCFWS)
* build_variables.a_fw_total
* first_wall_variables.a_fw_total
+ cost_variables.UCFWPS
)
)
Expand Down
3 changes: 2 additions & 1 deletion process/costs_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
cost_2015_variables,
cost_variables,
current_drive_variables,
first_wall_variables,
fwbs_variables,
global_variables,
heat_transport_variables,
Expand Down Expand Up @@ -278,7 +279,7 @@ def calc_fwbs_costs(self):
cost_2015_variables.s_cref[24] = 25.0e6
# First wall W coating mass (kg)
cost_2015_variables.s_k[24] = (
build_variables.a_fw_total
first_wall_variables.a_fw_total
* fwbs_variables.fw_armour_thickness
* constants.DEN_TUNGSTEN
)
Expand Down
35 changes: 0 additions & 35 deletions process/data_structure/build_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,6 @@
"""Separation force in CS coil pre-compression structure"""


a_fw_total_full_coverage: float = None
"""First wall total surface area with no holes or ports [m^2]"""


a_fw_inboard_full_coverage: float = None
"""Inboard first wall surface area with no holes or ports [m^2]"""


a_fw_outboard_full_coverage: float = None
"""Outboard first wall surface area with no holes or ports [m^2]"""

a_fw_total: float = None
"""First wall total surface area [m^2]"""


a_fw_inboard: float = None
"""Inboard first wall surface area [m^2]"""


a_fw_outboard: float = None
"""Outboard first wall surface area [m^2]"""


dr_fw_inboard: float = None
"""inboard first wall thickness, initial estimate as calculated (m)"""

Expand Down Expand Up @@ -438,12 +415,6 @@ def init_build_variables():
dr_vv_shells, \
fcspc, \
fseppc, \
a_fw_total_full_coverage, \
a_fw_inboard_full_coverage, \
a_fw_outboard_full_coverage, \
a_fw_total, \
a_fw_inboard, \
a_fw_outboard, \
dr_fw_inboard, \
dr_fw_outboard, \
dr_shld_vv_gap_inboard, \
Expand Down Expand Up @@ -535,12 +506,6 @@ def init_build_variables():
dr_vv_shells = 0.12
fcspc = 0.6
fseppc = 3.5e8
a_fw_total_full_coverage = 0.0
a_fw_inboard_full_coverage = 0.0
a_fw_outboard_full_coverage = 0.0
a_fw_total = 0.0
a_fw_inboard = 0.0
a_fw_outboard = 0.0
dr_fw_inboard = 0.0
dr_fw_outboard = 0.0
dr_shld_vv_gap_inboard = 0.155
Expand Down
38 changes: 38 additions & 0 deletions process/data_structure/first_wall_variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
a_fw_total_full_coverage: float = None
"""First wall total surface area with no holes or ports [m^2]"""


a_fw_inboard_full_coverage: float = None
"""Inboard first wall surface area with no holes or ports [m^2]"""


a_fw_outboard_full_coverage: float = None
"""Outboard first wall surface area with no holes or ports [m^2]"""


a_fw_total: float = None
"""First wall total surface area [m^2]"""

a_fw_inboard: float = None
"""Inboard first wall surface area [m^2]"""

a_fw_outboard: float = None
"""Outboard first wall surface area [m^2]"""


def init_first_wall_variables() -> None:
"""Initializes first wall variables to None"""
global \
a_fw_total_full_coverage, \
a_fw_inboard_full_coverage, \
a_fw_outboard_full_coverage, \
a_fw_total, \
a_fw_inboard, \
a_fw_outboard

a_fw_total_full_coverage = 0.0
a_fw_inboard_full_coverage = 0.0
a_fw_outboard_full_coverage = 0.0
a_fw_total = 0.0
a_fw_inboard = 0.0
a_fw_outboard = 0.0
7 changes: 6 additions & 1 deletion process/data_structure/fwbs_variables.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the other variables be moved here:

  • a_fw_inboard_full_coverage
  • a_fw_outboard_full_coverage
  • a_fw_total_full_coverage
  • a_fw_inboard
  • a_fw_outboard
  • a_fw_total

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall they go into fwbs_variables.py or shall we make a new fw_variables.py. I prefer the latter

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I agree that we can split the FW variables away from the blanket

Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,9 @@
radius_blkt_channel_180_bend: float = None
"""Radius of blanket cooling channel 180° bend [m]"""

dz_fw_half: float = None
"""Half-height of first wall structure [m]"""


def init_fwbs_variables():
"""Initialise FWBS variables"""
Expand Down Expand Up @@ -1108,7 +1111,8 @@ def init_fwbs_variables():
radius_fw_channel_90_bend, \
radius_fw_channel_180_bend, \
radius_blkt_channel_90_bend, \
radius_blkt_channel_180_bend
radius_blkt_channel_180_bend, \
dz_fw_half

life_blkt_fpy = 0.0
life_blkt = 0.0
Expand Down Expand Up @@ -1308,3 +1312,4 @@ def init_fwbs_variables():
radius_fw_channel_180_bend = 0.0
radius_blkt_channel_90_bend = 0.0
radius_blkt_channel_180_bend = 0.0
dz_fw_half = 0.0
15 changes: 8 additions & 7 deletions process/dcll.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
current_drive_variables,
dcll_variables,
divertor_variables,
first_wall_variables,
fwbs_variables,
heat_transport_variables,
physics_variables,
Expand Down Expand Up @@ -193,13 +194,13 @@ def dcll_neutronics_and_power(self, output: bool):
# All of the fast particle losses go to the outer wall.
fwbs_variables.psurffwo = (
fwbs_variables.p_fw_rad_total_mw
* build_variables.a_fw_outboard
/ build_variables.a_fw_total
* first_wall_variables.a_fw_outboard
/ first_wall_variables.a_fw_total
+ current_drive_variables.p_beam_orbit_loss_mw
+ physics_variables.p_fw_alpha_mw
)
fwbs_variables.psurffwi = fwbs_variables.p_fw_rad_total_mw * (
1 - build_variables.a_fw_outboard / build_variables.a_fw_total
1 - first_wall_variables.a_fw_outboard / first_wall_variables.a_fw_total
)

if output:
Expand Down Expand Up @@ -685,8 +686,8 @@ def dcll_masses(self, output: bool):
# FW
# First wall volume (m^3)
fwbs_variables.vol_fw_total = (
build_variables.a_fw_inboard * build_variables.dr_fw_inboard
+ build_variables.a_fw_outboard * build_variables.dr_fw_outboard
first_wall_variables.a_fw_inboard * build_variables.dr_fw_inboard
+ first_wall_variables.a_fw_outboard * build_variables.dr_fw_outboard
)
# First wall mass, excluding armour (kg)
dcll_variables.fwmass_stl = (
Expand Down Expand Up @@ -738,7 +739,7 @@ def dcll_masses(self, output: bool):
* (fwbs_variables.vol_blkt_inboard / fwbs_variables.vol_blkt_total)
+ fwbs_variables.m_fw_total
* (
build_variables.a_fw_inboard
first_wall_variables.a_fw_inboard
* build_variables.dr_fw_inboard
/ fwbs_variables.vol_fw_total
)
Expand All @@ -758,7 +759,7 @@ def dcll_masses(self, output: bool):
* (fwbs_variables.vol_blkt_outboard / fwbs_variables.vol_blkt_total)
+ fwbs_variables.m_fw_total
* (
build_variables.a_fw_outboard
first_wall_variables.a_fw_outboard
* build_variables.dr_fw_outboard
/ fwbs_variables.vol_fw_total
)
Expand Down
Loading