Skip to content

Commit ad32540

Browse files
committed
Add calculate_elliptical_vessel_volumes method to VacuumVessel class
1 parent db5aa41 commit ad32540

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

process/vacuum.py

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from process import constants
77
from process import process_output as po
8-
from process.blanket_library import dshellvol
8+
from process.blanket_library import dshellvol, eshellvol
99
from process.data_structure import blanket_library as blanket_library
1010
from process.data_structure import build_variables as buv
1111
from process.data_structure import fwbs_variables as fwbs_variables
@@ -773,7 +773,7 @@ def calculate_dshaped_vessel_volumes(
773773
dr_vv_outboard: float,
774774
dz_vv_upper: float,
775775
dz_vv_lower: float,
776-
) -> None:
776+
) -> tuple[float, float, float]:
777777
"""Calculate volumes of D-shaped vacuum vessel segments"""
778778

779779
r_1 = rsldi
@@ -793,3 +793,40 @@ def calculate_dshaped_vessel_volumes(
793793
)
794794

795795
return vol_vv_inboard, vol_vv_outboard, vol_vv
796+
797+
def calculate_elliptical_vessel_volumes(
798+
self,
799+
rmajor: float,
800+
rminor: float,
801+
triang: float,
802+
rsldi: float,
803+
rsldo: float,
804+
dz_vv_half: float,
805+
dr_vv_inboard: float,
806+
dr_vv_outboard: float,
807+
dz_vv_upper: float,
808+
dz_vv_lower: float,
809+
) -> tuple[float, float, float]:
810+
# Major radius to centre of inboard and outboard ellipses (m)
811+
# (coincident in radius with top of plasma)
812+
r_1 = rmajor - rminor * triang
813+
814+
# Calculate distance between r1 and outer edge of inboard ...
815+
# ... section (m)
816+
r_2 = r_1 - rsldi
817+
r_3 = rsldo - r_1
818+
819+
(
820+
vol_vv_inboard,
821+
vol_vv_outboard,
822+
vol_vv,
823+
) = eshellvol(
824+
r_1,
825+
r_2,
826+
r_3,
827+
dz_vv_half,
828+
dr_vv_inboard,
829+
dr_vv_outboard,
830+
(dz_vv_upper + dz_vv_lower) / 2,
831+
)
832+
return vol_vv_inboard, vol_vv_outboard, vol_vv

0 commit comments

Comments
 (0)