Skip to content

Commit

Permalink
Convert fw_thermal_conductivity to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-nunn committed Nov 8, 2024
1 parent b483eca commit aa89b13
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 51 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ FILE(GLOB PROCESS_PYTHON_SRC_PATHS ${PROCESS_PYTHON_SRC_DIR}/*.py)
LIST(APPEND PROCESS_SRCS
numerics.f90
scan.f90
fw.f90
hcpb.f90
pfcoil.f90
reinke_module.f90
Expand Down
17 changes: 15 additions & 2 deletions process/fw.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
constants,
fwbs_variables,
error_handling as eh,
fw_module,
process_output as po,
error_handling,
)
Expand Down Expand Up @@ -128,7 +127,7 @@ def fw_temp(
eh.report_error(224)

# Thermal conductivity of first wall material (W/m.K)
tkfw = fw_module.fw_thermal_conductivity(temp_k)
tkfw = self.fw_thermal_conductivity(temp_k)

# Heat transfer coefficient (W/m2K)
hcoeff = self.heat_transfer(
Expand Down Expand Up @@ -305,6 +304,20 @@ def fw_temp(

return tpeakfw, cfmean, rhofmean, massrate

def fw_thermal_conductivity(self, t):
"""Calculates the thermal conductivity of the first wall
t : input real : property temperature (K)
Calculates the thermal conductivity of Eurofer (W/m/K).
"""
# Eurofer correlation, from "Fusion Demo Interim Structural Design Criteria -
# Appendix A Material Design Limit Data", F. Tavassoli, TW4-TTMS-005-D01, 2004
# t in Kelvin
return (
(5.4308 + 0.13565 * t - 0.00023862 * t * t + 1.3393e-7 * t * t * t)
* fwbs_variables.fw_th_conductivity
/ 28.34
)

def heat_transfer(self, masflx, rhof, radius, cf, viscf, kf):
"""Calculate heat transfer coefficient using Gnielinski correlation
author: M Kovari, CCFE, Culham Science Centre
Expand Down
48 changes: 0 additions & 48 deletions source/fortran/fw.f90

This file was deleted.

6 changes: 6 additions & 0 deletions tests/unit/test_fw.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,9 @@ def test_heat_transfer(fw):
viscf=4.0416219836935569e-05,
kf=0.3211653052986152,
) == pytest.approx(1929.2210192752084)


def test_fw_thermal_conductivity(monkeypatch, fw):
monkeypatch.setattr(fwbs_variables, "fw_th_conductivity", 28.9)

assert fw.fw_thermal_conductivity(1900.0) == pytest.approx(326.70406785462256)

0 comments on commit aa89b13

Please sign in to comment.