15
15
major_radius = ureg .meter ,
16
16
B_pol_out_mid = ureg .tesla ,
17
17
inverse_aspect_ratio = ureg .dimensionless ,
18
+ magnetic_field_on_axis = ureg .T ,
19
+ q_star = ureg .dimensionless ,
18
20
lambda_q_factor = ureg .dimensionless ,
19
21
),
20
22
)
@@ -25,6 +27,8 @@ def calc_lambda_q(
25
27
major_radius : float ,
26
28
B_pol_out_mid : float ,
27
29
inverse_aspect_ratio : float ,
30
+ magnetic_field_on_axis : float ,
31
+ q_star : float ,
28
32
lambda_q_factor : float = 1.0 ,
29
33
) -> float :
30
34
"""Calculate SOL heat flux decay length (lambda_q) from a scaling.
@@ -36,64 +40,101 @@ def calc_lambda_q(
36
40
major_radius: [m] :term:`glossary link<major_radius>`
37
41
B_pol_out_mid: [T] :term:`glossary link<B_pol_out_mid>`
38
42
inverse_aspect_ratio: [~] :term:`glossary link<inverse_aspect_ratio>`
43
+ magnetic_field_on_axis: [T] :term:`glossary link<magnetic_field_on_axis>`
44
+ q_star: [~] :term:`glossary link<q_star>`
39
45
lambda_q_factor: [~] :term:`glossary link<lambda_q_factor>`
40
46
41
47
Returns:
42
48
:term:`lambda_q` [mm]
43
49
"""
44
50
if lambda_q_scaling == LambdaQScaling .Brunner :
45
- return lambda_q_factor * float (calc_lambda_q_with_brunner .unitless_func (average_total_pressure ))
51
+ lambda_q = calc_lambda_q_with_brunner .unitless_func (average_total_pressure = average_total_pressure , lambda_q_factor = lambda_q_factor )
52
+ elif lambda_q_scaling == LambdaQScaling .EichRegression9 :
53
+ lambda_q = calc_lambda_q_with_eich_regression_9 .unitless_func (
54
+ magnetic_field_on_axis = magnetic_field_on_axis ,
55
+ q_star = q_star ,
56
+ power_crossing_separatrix = power_crossing_separatrix ,
57
+ lambda_q_factor = lambda_q_factor ,
58
+ )
46
59
elif lambda_q_scaling == LambdaQScaling .EichRegression14 :
47
- return lambda_q_factor * float ( calc_lambda_q_with_eich_regression_14 .unitless_func (B_pol_out_mid ) )
60
+ lambda_q = calc_lambda_q_with_eich_regression_14 .unitless_func (B_pol_out_mid = B_pol_out_mid , lambda_q_factor = lambda_q_factor )
48
61
elif lambda_q_scaling == LambdaQScaling .EichRegression15 :
49
- return lambda_q_factor * float (
50
- calc_lambda_q_with_eich_regression_15 .unitless_func (
51
- power_crossing_separatrix , major_radius , B_pol_out_mid , inverse_aspect_ratio
52
- )
62
+ lambda_q = calc_lambda_q_with_eich_regression_15 .unitless_func (
63
+ power_crossing_separatrix = power_crossing_separatrix ,
64
+ major_radius = major_radius ,
65
+ B_pol_out_mid = B_pol_out_mid ,
66
+ inverse_aspect_ratio = inverse_aspect_ratio ,
67
+ lambda_q_factor = lambda_q_factor ,
53
68
)
54
69
else :
55
70
raise NotImplementedError (f"No implementation for lambda_q scaling { lambda_q_scaling } " )
56
71
72
+ return float (lambda_q )
73
+
57
74
75
+ @Algorithm .register_algorithm (return_keys = ["lambda_q" ])
58
76
@wraps_ufunc (
59
77
return_units = dict (lambda_q = ureg .millimeter ),
60
- input_units = dict (average_total_pressure = ureg .atm ),
78
+ input_units = dict (average_total_pressure = ureg .atm , lambda_q_factor = ureg . dimensionless ),
61
79
)
62
- def calc_lambda_q_with_brunner (average_total_pressure : float ) -> float :
80
+ def calc_lambda_q_with_brunner (average_total_pressure : float , lambda_q_factor : float = 1.0 ) -> float :
63
81
"""Return lambda_q according to the Brunner scaling.
64
82
65
83
Equation 4 in :cite:`brunner_2018_heat_flux`
66
84
"""
67
- return float (0.91 * average_total_pressure ** - 0.48 )
85
+ return float (lambda_q_factor * 0.91 * average_total_pressure ** - 0.48 )
68
86
69
87
70
- @wraps_ufunc (return_units = dict (lambda_q = ureg .millimeter ), input_units = dict (B_pol_out_mid = ureg .tesla ))
71
- def calc_lambda_q_with_eich_regression_14 (B_pol_out_mid : float ) -> float :
88
+ @Algorithm .register_algorithm (return_keys = ["lambda_q" ])
89
+ @wraps_ufunc (
90
+ return_units = dict (lambda_q = ureg .millimeter ),
91
+ input_units = dict (
92
+ magnetic_field_on_axis = ureg .T ,
93
+ q_star = ureg .dimensionless ,
94
+ power_crossing_separatrix = ureg .megawatt ,
95
+ lambda_q_factor = ureg .dimensionless ,
96
+ ),
97
+ )
98
+ def calc_lambda_q_with_eich_regression_9 (
99
+ magnetic_field_on_axis : float , q_star : float , power_crossing_separatrix : float , lambda_q_factor : float = 1.0
100
+ ) -> float :
101
+ """Return lambda_q according to Eich regression 9.
102
+
103
+ #9 in Table 2 in :cite:`eich_scaling_2013`
104
+ """
105
+ return float (lambda_q_factor * 0.7 * magnetic_field_on_axis ** - 0.77 * q_star ** 1.05 * power_crossing_separatrix ** 0.09 )
106
+
107
+
108
+ @Algorithm .register_algorithm (return_keys = ["lambda_q" ])
109
+ @wraps_ufunc (return_units = dict (lambda_q = ureg .millimeter ), input_units = dict (B_pol_out_mid = ureg .tesla , lambda_q_factor = ureg .dimensionless ))
110
+ def calc_lambda_q_with_eich_regression_14 (B_pol_out_mid : float , lambda_q_factor : float = 1.0 ) -> float :
72
111
"""Return lambda_q according to Eich regression 14.
73
112
74
113
#14 in Table 3 in :cite:`eich_scaling_2013`
75
114
"""
76
- return float (0.63 * B_pol_out_mid ** - 1.19 )
115
+ return float (lambda_q_factor * 0.63 * B_pol_out_mid ** - 1.19 )
77
116
78
117
118
+ @Algorithm .register_algorithm (return_keys = ["lambda_q" ])
79
119
@wraps_ufunc (
80
120
return_units = dict (lambda_q = ureg .millimeter ),
81
121
input_units = dict (
82
122
power_crossing_separatrix = ureg .megawatt ,
83
123
major_radius = ureg .meter ,
84
124
B_pol_out_mid = ureg .tesla ,
85
125
inverse_aspect_ratio = ureg .dimensionless ,
126
+ lambda_q_factor = ureg .dimensionless ,
86
127
),
87
128
)
88
129
def calc_lambda_q_with_eich_regression_15 (
89
- power_crossing_separatrix : float , major_radius : float , B_pol_out_mid : float , inverse_aspect_ratio : float
130
+ power_crossing_separatrix : float , major_radius : float , B_pol_out_mid : float , inverse_aspect_ratio : float , lambda_q_factor : float = 1.0
90
131
) -> float :
91
132
"""Return lambda_q according to Eich regression 15.
92
133
93
134
#15 in Table 3 in :cite:`eich_scaling_2013`
94
135
"""
95
136
lambda_q = 1.35 * major_radius ** 0.04 * B_pol_out_mid ** - 0.92 * inverse_aspect_ratio ** 0.42
96
137
if power_crossing_separatrix > 0 :
97
- return float (lambda_q * power_crossing_separatrix ** - 0.02 )
138
+ return float (lambda_q_factor * lambda_q * power_crossing_separatrix ** - 0.02 )
98
139
else :
99
- return float (lambda_q )
140
+ return float (lambda_q_factor * lambda_q )
0 commit comments