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
2 changes: 1 addition & 1 deletion process/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def calculate_beam_port_size(
# Have kept the single letter variable names to match the original code and documentation diagram.
radius_beam_tangency = f_radius_beam_tangency_rmajor * rmajor

omega = constants.TWOPI / n_tf_coils
omega = 2.0 * np.pi / n_tf_coils

a = 0.5e0 * dx_tf_inboard_out_toroidal
try:
Expand Down
4 changes: 0 additions & 4 deletions process/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,9 @@
Assume the room is at 20 degrees Celsius
"""

PI = 3.1415926535897932

RMU0 = 1.256637062e-6
"""permeability of free space [H/m]"""

TWOPI = 6.2831853071795862

UMASS = 1.660538921e-27
"""unified atomic mass unit [kg]"""

Expand Down
9 changes: 6 additions & 3 deletions process/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,8 @@ def acc2222(self):
for i in range(pfcoil_variables.n_cs_pf_coils):
pfwndl = (
pfwndl
+ constants.TWOPI
+ 2.0
* np.pi
* pfcoil_variables.r_pf_coil_middle[i]
* pfcoil_variables.n_pf_coil_turns[i]
)
Expand Down Expand Up @@ -1787,7 +1788,8 @@ def acc2222(self):

cost_variables.c22221 = cost_variables.c22221 + (
1.0e-6
* constants.TWOPI
* 2.0
* np.pi
* pfcoil_variables.r_pf_coil_middle[i]
* pfcoil_variables.n_pf_coil_turns[i]
* cpfconpm
Expand Down Expand Up @@ -1865,7 +1867,8 @@ def acc2222(self):

cost_variables.c22221 = cost_variables.c22221 + (
1.0e-6
* constants.TWOPI
* 2.0
* np.pi
* pfcoil_variables.r_pf_coil_middle[pfcoil_variables.n_cs_pf_coils - 1]
* pfcoil_variables.n_pf_coil_turns[pfcoil_variables.n_cs_pf_coils - 1]
* cpfconpm
Expand Down
13 changes: 5 additions & 8 deletions process/divertor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import math

import numpy as np

from process import constants
from process import process_output as po
from process.data_structure import build_variables as bv
Expand Down Expand Up @@ -153,11 +155,11 @@ def divtart(

# Vertical plate area

a1 = 2.0e0 * constants.PI * r1 * dz_divertor
a1 = 2.0e0 * np.pi * r1 * dz_divertor

# Horizontal plate area

a2 = constants.PI * (r2 * r2 - r1 * r1)
a2 = np.pi * (r2 * r2 - r1 * r1)

# Diagonal plate area

Expand Down Expand Up @@ -323,12 +325,7 @@ def divwade(

# Wetted area
area_wetted = (
2
* constants.PI
* rmajor
* lambda_int
* f_div_flux_expansion
* math.sin(theta_div)
2 * np.pi * rmajor * lambda_int * f_div_flux_expansion * math.sin(theta_div)
)

# Divertor heat load
Expand Down
30 changes: 14 additions & 16 deletions process/pfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def pfcoil(self):

ddics = (
4.0e-7
* constants.PI
* constants.PI
* np.pi
* np.pi
* (
(bv.dr_bore * bv.dr_bore)
+ (bv.dr_cs * bv.dr_cs) / 6.0e0
Expand Down Expand Up @@ -862,7 +862,7 @@ def pfcoil(self):

rll = (
2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_pf_coil_middle[i]
* pfcoil_variables.n_pf_coil_turns[i]
)
Expand Down Expand Up @@ -960,7 +960,7 @@ def pfcoil(self):
pfcoil_variables.m_pf_coil_structure[i] = (
areaspf
* 2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_pf_coil_middle[i]
* fwbsv.den_steel
)
Expand Down Expand Up @@ -1939,7 +1939,7 @@ def induct(self, output):
rl = abs(
pfcoil_variables.z_pf_coil_upper[k]
- pfcoil_variables.z_pf_coil_lower[k]
) / math.sqrt(constants.PI)
) / math.sqrt(np.pi)
pfcoil_variables.ind_pf_cs_plasma_mutual[k, k] = (
constants.RMU0
* pfcoil_variables.n_pf_coil_turns[k] ** 2
Expand Down Expand Up @@ -3085,17 +3085,15 @@ def calculate_cs_turn_geometry_eu_demo(
dr_cs_turn = f_dr_dz_cs_turn * dz_cs_turn

# Calculate radius of cable space in CS turn
radius_cs_turn_cable_space = -(
(dr_cs_turn - dz_cs_turn) / constants.PI
) + math.sqrt(
(((dr_cs_turn - dz_cs_turn) / constants.PI) ** 2)
radius_cs_turn_cable_space = -((dr_cs_turn - dz_cs_turn) / np.pi) + math.sqrt(
(((dr_cs_turn - dz_cs_turn) / np.pi) ** 2)
+ (
(
(dr_cs_turn * dz_cs_turn)
- (4 - constants.PI) * (radius_cs_turn_corners**2)
- (4 - np.pi) * (radius_cs_turn_corners**2)
- (a_cs_turn * f_a_cs_turn_steel)
)
/ constants.PI
/ np.pi
)
)

Expand Down Expand Up @@ -3416,7 +3414,7 @@ def ohcalc(self):
pfcoil_variables.m_pf_coil_structure[pfcoil_variables.n_cs_pf_coils - 1] = (
areaspf
* 2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_pf_coil_middle[pfcoil_variables.n_cs_pf_coils - 1]
* fwbsv.den_steel
)
Expand All @@ -3437,7 +3435,7 @@ def ohcalc(self):
pfcoil_variables.awpoh
* (1.0e0 - pfcoil_variables.f_a_cs_void)
* 2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_pf_coil_middle[pfcoil_variables.n_cs_pf_coils - 1]
* tfv.dcond[pfcoil_variables.i_cs_superconductor - 1]
)
Expand All @@ -3446,7 +3444,7 @@ def ohcalc(self):
pfcoil_variables.awpoh
* (1.0e0 - pfcoil_variables.f_a_cs_void)
* 2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_pf_coil_middle[pfcoil_variables.n_cs_pf_coils - 1]
* constants.den_copper
)
Expand Down Expand Up @@ -3538,7 +3536,7 @@ def ohcalc(self):

pfcoil_variables.p_cs_resistive_flat_top = (
2.0e0
* constants.PI
* np.pi
* pfcoil_variables.r_cs_middle
* pfcoil_variables.rho_pf_coil
/ (
Expand Down Expand Up @@ -3763,7 +3761,7 @@ def calculate_cs_self_peak_midplane_axial_stress(
forc_z_cs_self_peak_midplane = axial_term_1 * (axial_term_2 - axial_term_3)

# axial area [m2]
area_ax = constants.PI * (r_cs_outer**2 - r_cs_inner**2)
area_ax = np.pi * (r_cs_outer**2 - r_cs_inner**2)

# Calculate unsmeared axial stress
# Average axial stress at the interface of each half of the coil
Expand Down
2 changes: 1 addition & 1 deletion process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,7 @@ def calculate_plasma_current(
# Main plasma current calculation using the fq value from the different settings
if i_plasma_current != 2:
plasma_current = (
(constants.TWOPI / constants.RMU0)
(2.0 * np.pi / constants.RMU0)
* rminor**2
/ (rmajor * q95)
* fq
Expand Down
6 changes: 4 additions & 2 deletions process/plasma_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ def plasma_volume(

rc = rmajor - rminor + xi
vin = (
constants.TWOPI
2.0
* np.pi
* xi
* (
rc**2 * np.sin(thetai)
Expand All @@ -465,7 +466,8 @@ def plasma_volume(

rc = rmajor + rminor - xo
vout = (
constants.TWOPI
2.0
* np.pi
* xo
* (
rc**2 * np.sin(thetao)
Expand Down
18 changes: 6 additions & 12 deletions process/tf_coil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2209,9 +2209,7 @@ def cntrpst(self):
) # Cooling cross-sectional area
dcool = 2.0e0 * tfcoil_variables.rcool # Diameter
lcool = 2.0e0 * (bv.z_tf_inside_half + bv.dr_tf_outboard) # Length
tfcoil_variables.ncool = acool / (
constants.PI * tfcoil_variables.rcool**2
) # Number
tfcoil_variables.ncool = acool / (np.pi * tfcoil_variables.rcool**2) # Number

# Average conductor cross-sectional area to cool (with cooling area)
acpav = (
Expand All @@ -2220,7 +2218,7 @@ def cntrpst(self):
/ (bv.z_tf_inside_half + bv.dr_tf_outboard)
+ acool
)
ro = (acpav / (constants.PI * tfcoil_variables.ncool)) ** 0.5
ro = (acpav / (np.pi * tfcoil_variables.ncool)) ** 0.5

# Inner legs total heating power (to be removed by coolant)
ptot = tfcoil_variables.p_cp_resistive + fwbs_variables.pnuc_cp_tf * 1.0e6
Expand Down Expand Up @@ -2307,12 +2305,7 @@ def cntrpst(self):
nuselt = 0.023e0 * reyn**0.8e0 * prndtl**0.4e0
h = nuselt * coolant_th_cond / dcool
dtfilmav = ptot / (
h
* 2.0e0
* constants.PI
* tfcoil_variables.rcool
* tfcoil_variables.ncool
* lcool
h * 2.0e0 * np.pi * tfcoil_variables.rcool * tfcoil_variables.ncool * lcool
)

# Average film temperature (in contact with te conductor)
Expand Down Expand Up @@ -3094,7 +3087,7 @@ def tf_coil_self_inductance(
ind_tf_coil = (
(z_tf_inside_half + dr_tf_outboard)
* constants.RMU0
/ constants.PI
/ np.pi
* np.log(r_tf_outboard_mid / r_tf_inboard_mid)
)

Expand Down Expand Up @@ -3124,7 +3117,8 @@ def generic_tf_coil_area_and_masses(self):
tfcoil_variables.tfcryoarea = (
2.0e0
* tfcoil_variables.len_tf_coil
* constants.TWOPI
* 2.0
* np.pi
* 0.5e0
* (build_variables.r_tf_inboard_mid + build_variables.r_tf_outboard_mid)
)
Expand Down