Skip to content
Merged
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
68 changes: 0 additions & 68 deletions process/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
from process.fortran import (
blanket_library,
build_variables,
buildings_variables,
constants,
divertor_variables,
error_handling,
fwbs_variables,
heat_transport_variables,
pfcoil_variables,
physics_variables,
primary_pumping_variables,
)
Expand Down Expand Up @@ -83,9 +81,6 @@ def component_volumes(self):
# Apply coverage factors to volumes and surface areas
self.apply_coverage_factors()

# Calculate cryostat geometry
self.external_cryo_geometry()

def component_half_height(self, icomponent: int):
"""Calculate the blanket, shield or vacuum vessel half-height
Based on blanket_half_height, shield_half_height, vv_half_height
Expand Down Expand Up @@ -373,69 +368,6 @@ def apply_coverage_factors(self):
# changes in the same location.
fwbs_variables.vol_vv = fwbs_variables.fvoldw * fwbs_variables.vol_vv

@staticmethod
def external_cryo_geometry() -> None:
"""Calculate cryostat geometry.

This method calculates the geometry of the cryostat, including the inboard radius,
the vertical clearance between the uppermost PF coil and the cryostat lid, the half-height
of the cryostat, the vertical clearance between the TF coil and the cryostat, the cryostat volume,
the vacuum vessel mass, and the sum of internal vacuum vessel and cryostat masses.

"""

# Cryostat radius [m]
# Take radius of furthest PF coil and add clearance
fwbs_variables.r_cryostat_inboard = (
np.max(pfcoil_variables.r_pf_coil_outer) + fwbs_variables.dr_pf_cryostat
)

# Clearance between uppermost PF coil and cryostat lid [m].
# Scaling from ITER by M. Kovari
blanket_library.dz_pf_cryostat = (
build_variables.f_z_cryostat
* (2.0 * fwbs_variables.r_cryostat_inboard)
/ 28.440
)

# Half-height of cryostat [m]
# Take height of furthest PF coil and add clearance
fwbs_variables.z_cryostat_half_inside = (
np.max(pfcoil_variables.z_pf_coil_upper) + blanket_library.dz_pf_cryostat
)

# Vertical clearance between TF coil and cryostat (m)
buildings_variables.dz_tf_cryostat = fwbs_variables.z_cryostat_half_inside - (
build_variables.hmax + build_variables.dr_tf_inboard
)

# Internal cryostat space volume [m^3]
fwbs_variables.vol_cryostat_internal = (
np.pi
* (fwbs_variables.r_cryostat_inboard) ** 2
* 2
* fwbs_variables.z_cryostat_half_inside
)

# Cryostat structure volume [m^3]
# Calculate by taking the volume of the outer cryostat and subtracting the volume of the inner cryostat
fwbs_variables.vol_cryostat = (
(
np.pi
* (fwbs_variables.r_cryostat_inboard + build_variables.dr_cryostat) ** 2
)
* 2
* (build_variables.dr_cryostat + fwbs_variables.z_cryostat_half_inside)
) - (fwbs_variables.vol_cryostat_internal)

# Vacuum vessel mass (kg)
fwbs_variables.m_vv = fwbs_variables.vol_vv * fwbs_variables.denstl

# Sum of internal vacuum vessel and cryostat masses (kg)
fwbs_variables.dewmkg = (
fwbs_variables.vol_vv + fwbs_variables.vol_cryostat
) * fwbs_variables.denstl

def primary_coolant_properties(self, output: bool):
"""Calculates the fluid properties of the Primary Coolant in the FW and BZ.
Uses middle value of input and output temperatures of coolant.
Expand Down
59 changes: 0 additions & 59 deletions process/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from process import process_output as po
from process.blanket_library import dshellarea, eshellarea
from process.fortran import (
blanket_library,
build_variables,
buildings_variables,
constants,
Expand Down Expand Up @@ -723,11 +722,6 @@ def calculate_vertical_build(self, output: bool) -> None:
"\n*Cryostat roof allowance includes uppermost PF coil and outer thermal shield.\n*Cryostat floor allowance includes lowermost PF coil, outer thermal shield and gravity support.",
)

# Other build quantities

# Output the cryostat geometry
_ = self.cryostat_output(output)

# Output the cdivertor geometry
divht = self.divgeom(output)
# Issue #481 Remove build_variables.vgaptf
Expand Down Expand Up @@ -773,59 +767,6 @@ def calculate_vertical_build(self, output: bool) -> None:
- (build_variables.hmax + build_variables.dr_tf_inboard)
) / 2.0e0

def cryostat_output(self, output: bool) -> None:
"""
Outputs the cryostat geometry details to the output file.

Returns:
None
"""
if output:
po.oheadr(self.outfile, "Cryostat build")

po.ovarrf(
self.outfile,
"Cryostat thickness (m)",
"(dr_cryostat)",
build_variables.dr_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat internal radius (m)",
"(r_cryostat_inboard)",
fwbs_variables.r_cryostat_inboard,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat intenral half height (m)",
"(z_cryostat_half_inside)",
fwbs_variables.z_cryostat_half_inside,
"OP ",
)
po.ovarrf(
self.outfile,
"Vertical clearance from highest PF coil to cryostat (m)",
"(dz_pf_cryostat)",
blanket_library.dz_pf_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat structure volume (m^3)",
"(vol_cryostat)",
fwbs_variables.vol_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat internal volume (m^3)",
"(vol_cryostat_internal)",
fwbs_variables.vol_cryostat_internal,
"OP ",
)

def divgeom(self, output: bool):
"""
Divertor geometry calculation
Expand Down
2 changes: 2 additions & 0 deletions process/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def _call_models_once(self, xc: np.ndarray) -> None:

self.models.divertor.run(output=False)

self.models.cryostat.run()

# Structure Model
self.models.structure.run(output=False)

Expand Down
141 changes: 141 additions & 0 deletions process/cryostat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import numpy as np

from process import process_output as po
from process.fortran import (
blanket_library,
build_variables,
buildings_variables,
constants,
fwbs_variables,
pfcoil_variables,
)


class Cryostat:
def __init__(self) -> None:
self.outfile = constants.nout

def run(self) -> None:
"""Run the cryostat calculations.

This method runs the cryostat calculations, including the calculation of the cryostat geometry.

"""

# Calculate cryostat geometry
self.external_cryo_geometry()

@staticmethod
def external_cryo_geometry() -> None:
"""Calculate cryostat geometry.

This method calculates the geometry of the cryostat, including the inboard radius,
the vertical clearance between the uppermost PF coil and the cryostat lid, the half-height
of the cryostat, the vertical clearance between the TF coil and the cryostat, the cryostat volume,
the vacuum vessel mass, and the sum of internal vacuum vessel and cryostat masses.

"""

# Cryostat radius [m]
# Take radius of furthest PF coil and add clearance
fwbs_variables.r_cryostat_inboard = (
np.max(pfcoil_variables.r_pf_coil_outer) + fwbs_variables.dr_pf_cryostat
)

# Clearance between uppermost PF coil and cryostat lid [m].
# Scaling from ITER by M. Kovari
blanket_library.dz_pf_cryostat = (
build_variables.f_z_cryostat
* (2.0 * fwbs_variables.r_cryostat_inboard)
/ 28.440
)

# Half-height of cryostat [m]
# Take height of furthest PF coil and add clearance
fwbs_variables.z_cryostat_half_inside = (
np.max(pfcoil_variables.z_pf_coil_upper) + blanket_library.dz_pf_cryostat
)

# Vertical clearance between TF coil and cryostat (m)
buildings_variables.dz_tf_cryostat = fwbs_variables.z_cryostat_half_inside - (
build_variables.hmax + build_variables.dr_tf_inboard
)

# Internal cryostat space volume [m^3]
fwbs_variables.vol_cryostat_internal = (
np.pi
* (fwbs_variables.r_cryostat_inboard) ** 2
* 2
* fwbs_variables.z_cryostat_half_inside
)

# Cryostat structure volume [m^3]
# Calculate by taking the volume of the outer cryostat and subtracting the volume of the inner cryostat
fwbs_variables.vol_cryostat = (
(
np.pi
* (fwbs_variables.r_cryostat_inboard + build_variables.dr_cryostat) ** 2
)
* 2
* (build_variables.dr_cryostat + fwbs_variables.z_cryostat_half_inside)
) - (fwbs_variables.vol_cryostat_internal)

# Vacuum vessel mass (kg)
fwbs_variables.m_vv = fwbs_variables.vol_vv * fwbs_variables.denstl

# Sum of internal vacuum vessel and cryostat masses (kg)
fwbs_variables.dewmkg = (
fwbs_variables.vol_vv + fwbs_variables.vol_cryostat
) * fwbs_variables.denstl

def cryostat_output(self) -> None:
"""
Outputs the cryostat geometry details to the output file.

Returns:
None
"""
po.oheadr(self.outfile, "Cryostat build")

po.ovarrf(
self.outfile,
"Cryostat thickness (m)",
"(dr_cryostat)",
build_variables.dr_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat internal radius (m)",
"(r_cryostat_inboard)",
fwbs_variables.r_cryostat_inboard,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat intenral half height (m)",
"(z_cryostat_half_inside)",
fwbs_variables.z_cryostat_half_inside,
"OP ",
)
po.ovarrf(
self.outfile,
"Vertical clearance from highest PF coil to cryostat (m)",
"(dz_pf_cryostat)",
blanket_library.dz_pf_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat structure volume (m^3)",
"(vol_cryostat)",
fwbs_variables.vol_cryostat,
"OP ",
)
po.ovarrf(
self.outfile,
"Cryostat internal volume (m^3)",
"(vol_cryostat_internal)",
fwbs_variables.vol_cryostat_internal,
"OP ",
)
2 changes: 2 additions & 0 deletions process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from process.caller import write_output_files
from process.costs import Costs
from process.costs_2015 import Costs2015
from process.cryostat import Cryostat
from process.cs_fatigue import CsFatigue
from process.current_drive import CurrentDrive
from process.dcll import DCLL
Expand Down Expand Up @@ -654,6 +655,7 @@ def __init__(self):
self.cs_fatigue = CsFatigue()
self.pfcoil = PFCoil(cs_fatigue=self.cs_fatigue)
self.power = Power()
self.cryostat = Cryostat()
self.build = Build()
self.sctfcoil = Sctfcoil()
self.tfcoil = TFcoil(build=self.build, sctfcoil=self.sctfcoil)
Expand Down
3 changes: 3 additions & 0 deletions process/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def write(models, _outfile):
# Vertical build
models.build.calculate_vertical_build(output=True)

# Cryostat build
models.cryostat.cryostat_output()

# Toroidal field coil model
models.tfcoil.output()

Expand Down
Loading
Loading