Skip to content

Commit

Permalink
🔄 Rename i_bb_liq to i_blkt_liquid_breeder_type for clarity and consi…
Browse files Browse the repository at this point in the history
…stency across the codebase
  • Loading branch information
chris-ashe committed Feb 19, 2025
1 parent b87ba46 commit 29cdb50
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 49 deletions.
12 changes: 6 additions & 6 deletions documentation/proc-pages/eng-models/fw-blanket.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Summary of key variables and switches:
| maximum temp (K) | `temp_fw_max` | --- | --- |
| FCI switch | --- | --- | `ifci` |
| Coolant | :-----------: | ------------------------ | -------------------------- |
| primary coolant switch | `i_fw_coolant_type` | `coolwh` | --- |
| secondary coolant switch | --- | --- | `i_bb_liq` |
| inlet temp (K) | `temp_fw_coolant_in` | `inlet_temp` | `inlet_temp_liq` |
| outlet temp (K) | `temp_fw_coolant_out` | `outlet_temp` | `outlet_temp_liq` |
| pressure (Pa) | `pres_fw_coolant` | `blpressure` | `blpressure_liq` |
| primary coolant switch | `i_fw_coolant_type` | `i_blkt_coolant_type` | --- |
| secondary coolant switch | --- | --- | `i_blkt_liquid_breeder_type` |
| inlet temp (K) | `temp_fw_coolant_in` | `temp_blkt_coolant_in` | `inlet_temp_liq` |
| outlet temp (K) | `temp_fw_coolant_out` | `temp_blkt_coolant_out` | `outlet_temp_liq` |
| pressure (Pa) | `pres_fw_coolant` | `pres_blkt_coolant` | `blpressure_liq` |

The default thermo-hydraulic model assumes that a solid breeder is in use, with both the first wall and the breeding blanket using helium as a coolant.
This can be changed using the switches detailed in the following subsection.
Expand Down Expand Up @@ -178,7 +178,7 @@ The user can select the number poloidal and toroidal modules for the IB and OB B

#### Liquid Breeder or Dual Coolant

There are two material options for the liquid breeder/coolant, chosen by the user to match their selected blanket design using the switch 'i_bb_liq' (default=0):
There are two material options for the liquid breeder/coolant, chosen by the user to match their selected blanket design using the switch 'i_blkt_liquid_breeder_type' (default=0):
0. Lead-Lithium
1. Lithium (needs testing)
Both options use the mid-temperature of the metal to find the following properties: density, specific heat, thermal conductivity, dynamic viscosity and electrical conductivity.
Expand Down
41 changes: 24 additions & 17 deletions process/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ def liquid_breeder_properties(self, output: bool = False):
) * 0.5

# If the liquid metal is PbLi...
if fwbs_variables.i_bb_liq == 0:
if fwbs_variables.i_blkt_liquid_breeder_type == 0:
# PbLi from [Mar2019]
# Constant pressure ~ 17 atmospheres ~ 1.7D6 Pa
# Li content is ~ 17%
Expand Down Expand Up @@ -1290,7 +1290,7 @@ def liquid_breeder_properties(self, output: bool = False):
t_ranges[4, 1] = 800.0

# If the liquid metal is Li...
elif fwbs_variables.i_bb_liq == 1:
elif fwbs_variables.i_blkt_liquid_breeder_type == 1:
# Temporary - should be updated with information from Li reviews conducted at CCFE once completed
# Li Properties from [Mal1995] at 300 Celcius
# den_liq = 505 kg/m3
Expand Down Expand Up @@ -1368,7 +1368,7 @@ def liquid_breeder_properties(self, output: bool = False):
)

# Error for temperature range of breeder property realtions
if fwbs_variables.i_bb_liq == 0 and (
if fwbs_variables.i_blkt_liquid_breeder_type == 0 and (
(t_ranges[:, 0] > mid_temp_liq).any()
or (t_ranges[:, 1] < mid_temp_liq).any()
):
Expand Down Expand Up @@ -1412,12 +1412,15 @@ def liquid_breeder_properties(self, output: bool = False):
if fwbs_variables.icooldual == 2:
po.ocmmnt(self.outfile, "Dual coolant: self-cooled liquid metal breeder.")

if fwbs_variables.i_bb_liq == 0:
if fwbs_variables.i_blkt_liquid_breeder_type == 0:
po.ocmmnt(
self.outfile, "Blanket breeder type (i_bb_liq=0), PbLi (~ 17% Li)"
self.outfile,
"Blanket breeder type (i_blkt_liquid_breeder_type=0), PbLi (~ 17% Li)",
)
if fwbs_variables.i_blkt_liquid_breeder_type == 1:
po.ocmmnt(
self.outfile, "Blanket breeder type (i_blkt_liquid_breeder_type=1), Li"
)
if fwbs_variables.i_bb_liq == 1:
po.ocmmnt(self.outfile, "Blanket breeder type (i_bb_liq=1), Li")

po.ovarrf(
self.outfile, "Density (kg m-3)", "(den_liq)", fwbs_variables.den_liq, "OP "
Expand Down Expand Up @@ -1532,11 +1535,11 @@ def thermo_hydraulic_model(self, output: bool):
Coolant FW BB primary BB secondary
primary coolant switch i_fw_coolant_type coolwh ---
secondary coolant switch --- --- i_bb_liq
inlet temp (K) temp_fw_coolant_in inlet_temp inlet_temp_liq
outlet temp (K) temp_fw_coolant_out outlet_temp outlet_temp_liq
pressure (Pa) pres_fw_coolant blpressure blpressure_liq
primary coolant switch i_fw_coolant_type i_blkt_coolant_type ---
secondary coolant switch --- --- i_blkt_liquid_breeder_type
inlet temp (K) temp_fw_coolant_in temp_blkt_coolant_in inlet_temp_liq
outlet temp (K) temp_fw_coolant_out temp_blkt_coolant_out outlet_temp_liq
pressure (Pa) pres_fw_coolant pres_blkt_coolant blpressure_liq
"""
######################################################
# Pre calculations needed for thermo-hydraulic model #
Expand Down Expand Up @@ -2079,8 +2082,8 @@ def thermo_hydraulic_model(self, output: bool):
po.ovarin(
self.outfile,
"Blanket liquid breeder type (0=PbLi, 1=Li)",
"(i_bb_liq)",
fwbs_variables.i_bb_liq,
"(i_blkt_liquid_breeder_type)",
fwbs_variables.i_blkt_liquid_breeder_type,
)
if fwbs_variables.icooldual == 2:
po.ocmmnt(
Expand Down Expand Up @@ -2341,7 +2344,8 @@ def liquid_breeder_pressure_drop_mhd(

if fwbs_variables.ifci == 0:
po.ocmmnt(
self.outfile, "Flow channels have thin conducting walls (ifci==0)"
self.outfile,
"Flow channels have thin conducting walls (i_blkt_liquid_breeder_channel_type==0)",
)
po.ovarre(
self.outfile,
Expand All @@ -2350,8 +2354,11 @@ def liquid_breeder_pressure_drop_mhd(
fwbs_variables.bz_channel_conduct_liq,
"OP ",
)
elif fwbs_variables.ifci == 2:
po.ocmmnt(self.outfile, "Flow Channel Inserts (FCIs) used (ifci==2)")
elif fwbs_variables.i_blkt_liquid_breeder_channel_type == 2:
po.ocmmnt(
self.outfile,
"Flow Channel Inserts (FCIs) used (i_blkt_liquid_breeder_channel_type==2)",
)
po.ovarre(
self.outfile,
"FCI conductance (A V-1 m-1)",
Expand Down
2 changes: 1 addition & 1 deletion process/dcll.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DCLL:
i_blanket_type = 5 * DCLL
Liquid Metal Breeder Material = PbLi
i_bb_liq = 0 * Liquid Metal Breeder Material = PbLi
i_blkt_liquid_breeder_type = 0 * Liquid Metal Breeder Material = PbLi
Specify dual-coolant i.e., get mass flow required from heat extracted from liqid metal breeder
icooldual = 2
Expand Down
2 changes: 1 addition & 1 deletion source/fortran/dcll.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module dcll_module
!! i_blanket_type = 5 * DCLL
!!
!! Liquid Metal Breeder Material = PbLi
!! i_bb_liq = 0 * Liquid Metal Breeder Material = PbLi
!! i_blkt_liquid_breeder_type = 0 * Liquid Metal Breeder Material = PbLi
!!
!! Specify dual-coolant i.e., get mass flow required from heat extracted from liqid metal breeder
!! icooldual = 2
Expand Down
10 changes: 5 additions & 5 deletions source/fortran/fwbs_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ module fwbs_variables
!! - =0 FW and BB have the same primary coolant, flow = FWin->FWout->BBin->BBout
!! - =1 FW and BB have the different primary coolant and are on different pump systems

integer :: i_bb_liq
integer :: i_blkt_liquid_breeder_type
!! Switch for Liquid Metal Breeder Material
!! - =0 PbLi
!! - =1 Li
Expand Down Expand Up @@ -806,10 +806,10 @@ subroutine init_fwbs_variables
pnuc_cp_sh = 0.0D0
pnuc_cp_tf = 0.0D0
neut_flux_cp = 0.0D0
ipump = 0
i_bb_liq = 0
icooldual = 0
ifci = 0
i_fw_blkt_shared_coolant = 0
i_blkt_liquid_breeder_type = 0
i_blkt_dual_coolant = 0
i_blkt_liquid_breeder_channel_type = 0
ims = 0
n_liq_recirc = 10
r_f_liq_ib=0.5
Expand Down
12 changes: 6 additions & 6 deletions source/fortran/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ subroutine parse_input_file(in_file,out_file,show_changes)
declblkt, fblhebmo, blkttype, radius_fw_channel, inuclear, declshld, hcdportsize, &
npdiv, f_fw_peak, primary_pumping, dr_pf_cryostat, secondary_cycle, secondary_cycle_liq, &
denstl, declfw, nphcdout, i_blkt_inboard, vfpblkt, temp_fw_coolant_in, wallpf, fblbe, &
fhole, fwbsshape, coolp, temp_fw_max, irefprop, len_fw_channel, &
li6enrich, etaiso, nblktmodto, fvoldw, i_shield_mat, i_bb_liq, &
icooldual, ifci, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, ipump, ims, &
coolwh, emult
fhole, i_fw_blkt_vv_shape, coolp, temp_fw_max, irefprop, len_fw_channel, &
f_blkt_li6_enrichment, etaiso, n_blkt_outboard_modules_toroidal, fvoldw, i_shield_mat, i_blkt_liquid_breeder_type, &
i_blkt_dual_coolant, i_blkt_liquid_breeder_channel_type, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, i_fw_blkt_shared_coolant, ims, &
i_blkt_coolant_type, emult
use heat_transport_variables, only: htpmw_fw, baseel, fmgdmw, htpmw_div, &
pwpm2, etath, vachtmw, iprimshld, fpumpdiv, pinjmax, htpmw_blkt, etatf, &
htpmw_min, fpumpblkt, ipowerflow, htpmw_shld, fpumpshld, trithtmw, &
Expand Down Expand Up @@ -2025,8 +2025,8 @@ subroutine parse_input_file(in_file,out_file,show_changes)
case ('i_shield_mat')
call parse_int_variable('i_shield_mat', i_shield_mat, 0, 1, &
'Switch for shield material)')
case ('i_bb_liq')
call parse_int_variable('i_bb_liq', i_bb_liq, 0, 1, &
case ('i_blkt_liquid_breeder_type')
call parse_int_variable('i_blkt_liquid_breeder_type', i_blkt_liquid_breeder_type, 0, 1, &
'Switch for breeding blaket liquid metal')
case ('icooldual')
call parse_int_variable('icooldual', icooldual, 0, 2, &
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/test_blanket_library_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_liquid_breeder_properties_part_1(monkeypatch, blanket_library_fixture):
monkeypatch.setattr(fwbs, "outlet_temp_liq", 1.0)

# PbLi - see [Fer2020] for relavent equations
monkeypatch.setattr(fwbs, "i_bb_liq", 0)
monkeypatch.setattr(fwbs, "i_blkt_liquid_breeder_type", 0)

blanket_library_fixture.liquid_breeder_properties()

Expand All @@ -115,7 +115,7 @@ def test_liquid_breeder_properties_part_1(monkeypatch, blanket_library_fixture):
assert pytest.approx(fwbs.hartmann_liq, rel=1e-3) == (7.189e3, 3.528e3)

# Li - see [Lyublinski et al., 2009] for relavent equations
monkeypatch.setattr(fwbs, "i_bb_liq", 1)
monkeypatch.setattr(fwbs, "i_blkt_liquid_breeder_type", 1)

blanket_library_fixture.liquid_breeder_properties()

Expand All @@ -142,7 +142,7 @@ def test_liquid_breeder_properties_part_2(monkeypatch, blanket_library_fixture):
monkeypatch.setattr(bv, "dr_blkt_inboard", 0.0)
monkeypatch.setattr(bv, "dr_blkt_outboard", 0.2)
monkeypatch.setattr(fwbs, "i_blkt_inboard", 0)
monkeypatch.setattr(fwbs, "i_bb_liq", 0)
monkeypatch.setattr(fwbs, "i_blkt_liquid_breeder_type", 0)
monkeypatch.setattr(fwbs, "inlet_temp_liq", 0.0)
monkeypatch.setattr(fwbs, "outlet_temp_liq", 0.0)

Expand All @@ -168,12 +168,12 @@ def test_liquid_breeder_properties_part_3(monkeypatch, blanket_library_fixture):
monkeypatch.setattr(fwbs, "outlet_temp_liq", 1.0)

# PbLi - see [Fer2020] for relavent equations
monkeypatch.setattr(fwbs, "i_bb_liq", 0)
monkeypatch.setattr(fwbs, "i_blkt_liquid_breeder_type", 0)

blanket_library_fixture.liquid_breeder_properties()
assert pytest.approx(fwbs.den_liq, rel=1e-3) == 1.052e4
# Li - see [Lyublinski et al., 2009] for relavent equations
monkeypatch.setattr(fwbs, "i_bb_liq", 1)
monkeypatch.setattr(fwbs, "i_blkt_liquid_breeder_type", 1)

blanket_library_fixture.liquid_breeder_properties()
assert pytest.approx(fwbs.den_liq, rel=1e-3) == 504.0
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/st_regression.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ inuclear = 0
* DCLL * * Set i_blanket_type = 5 *
*------*

*i_bb_liq =
*i_blkt_liquid_breeder_type =
* DESCRIPTION: Switch for Liquid Metal Breeder Material
* =0 PbLi
* =1 Li
Expand Down
18 changes: 12 additions & 6 deletions tests/unit/test_blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ class LiquidBreederPropertiesParam(NamedTuple):
thermal_conductivity_liq: Any = None
dynamic_viscosity_liq: Any = None
electrical_conductivity_liq: Any = None
i_bb_liq: Any = None
i_blkt_liquid_breeder_type: Any = None
hartmann_liq: Any = None
b_mag_blkt: Any = None
i_blkt_inboard: Any = None
Expand Down Expand Up @@ -1571,7 +1571,7 @@ class LiquidBreederPropertiesParam(NamedTuple):
thermal_conductivity_liq=30,
dynamic_viscosity_liq=0,
electrical_conductivity_liq=0,
i_bb_liq=0,
i_blkt_liquid_breeder_type=0,
hartmann_liq=np.array(np.array((0, 0), order="F"), order="F").transpose(),
b_mag_blkt=np.array(np.array((5, 5), order="F"), order="F").transpose(),
i_blkt_inboard=1,
Expand Down Expand Up @@ -1605,10 +1605,10 @@ class LiquidBreederPropertiesParam(NamedTuple):
den_liq=9500,
specific_heat_liq=190,
thermal_conductivity_liq=30,
expected_thermal_conductivity_liq=30, # doesn't change when i_bb_liq=1
expected_thermal_conductivity_liq=30, # doesn't change when i_blkt_liquid_breeder_type=1
dynamic_viscosity_liq=0,
electrical_conductivity_liq=0,
i_bb_liq=1,
i_blkt_liquid_breeder_type=1,
hartmann_liq=np.array(np.array((0, 0), order="F"), order="F").transpose(),
b_mag_blkt=np.array(np.array((5, 5), order="F"), order="F").transpose(),
i_blkt_inboard=1,
Expand Down Expand Up @@ -1683,7 +1683,9 @@ def test_liquid_breeder_properties(
liquidbreederpropertiesparam.electrical_conductivity_liq,
)
monkeypatch.setattr(
fwbs_variables, "i_bb_liq", liquidbreederpropertiesparam.i_bb_liq
fwbs_variables,
"i_blkt_liquid_breeder_type",
liquidbreederpropertiesparam.i_blkt_liquid_breeder_type,
)
monkeypatch.setattr(
fwbs_variables, "hartmann_liq", liquidbreederpropertiesparam.hartmann_liq
Expand Down Expand Up @@ -1930,7 +1932,11 @@ def test_liquid_breeder_pressure_drop_mhd(
:param monkeypatch: pytest fixture used to mock module/class variables
:type monkeypatch: _pytest.monkeypatch.monkeypatch
"""
monkeypatch.setattr(fwbs_variables, "ifci", liquidbreederpressuredropmhdparam.ifci)
monkeypatch.setattr(
fwbs_variables,
"i_blkt_liquid_breeder_channel_type",
liquidbreederpressuredropmhdparam.i_blkt_liquid_breeder_channel_type,
)
monkeypatch.setattr(
fwbs_variables, "a_bz_liq", liquidbreederpressuredropmhdparam.a_bz_liq
)
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/test_dcll.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,11 @@ def test_dcll_masses(dcllmassesparam, monkeypatch, dcll):

monkeypatch.setattr(fwbs_variables, "den_liq", dcllmassesparam.den_liq)

monkeypatch.setattr(fwbs_variables, "ifci", dcllmassesparam.ifci)
monkeypatch.setattr(
fwbs_variables,
"i_blkt_liquid_breeder_channel_type",
dcllmassesparam.i_blkt_liquid_breeder_channel_type,
)

monkeypatch.setattr(fwbs_variables, "den_ceramic", dcllmassesparam.den_ceramic)

Expand Down

0 comments on commit 29cdb50

Please sign in to comment.