Skip to content

Commit 75f9480

Browse files
committed
Calculate area and volume of PFs from elements outline
1 parent 0977d57 commit 75f9480

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/physics/pf_active.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
Returns cross sectional area of PF coils
66
"""
77
function area(coil::IMAS.pf_active__coil)
8-
return coil.element[1].geometry.rectangle.width * coil.element[1].geometry.rectangle.height
8+
A = 0.0
9+
for element in coil.element
10+
oute = outline(element)
11+
A += area(oute.r, oute.z)
12+
end
13+
return A
914
end
1015

1116
"""
@@ -14,7 +19,14 @@ end
1419
Returns volume of PF coils
1520
"""
1621
function volume(coil::IMAS.pf_active__coil)
17-
return area(coil) * 2π * coil.element[1].geometry.rectangle.r
22+
V = 0.0
23+
for element in coil.element
24+
oute = outline(element)
25+
A = area(oute.r, oute.z)
26+
RC, ZC = centroid(oute.r, oute.z)
27+
V += A * 2π * RC
28+
end
29+
return V
1830
end
1931

2032
"""

0 commit comments

Comments
 (0)