Skip to content

Commit 589dce2

Browse files
committed
refactor names of terminal velocity method functions for droplets
1 parent 3667c54 commit 589dce2

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

PySDM/backends/impl_numba/methods/terminal_velocity_methods.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111

1212
class TerminalVelocityMethods(BackendMethods):
13-
# TODO #1603 give terminal velocity functions name of the parametrisation
13+
1414
@cached_property
15-
def _interpolation_body(self):
15+
def _gunn_and_kinzer_interpolation_body(self):
1616
@numba.njit(**self.default_jit_flags)
1717
def body(output, radius, factor, b, c):
1818
for i in numba.prange(len(radius)): # pylint: disable=not-an-iterable
@@ -25,15 +25,13 @@ def body(output, radius, factor, b, c):
2525

2626
return body
2727

28-
# TODO #1603 give terminal velocity functions name of the parametrisation
29-
def interpolation(self, *, output, radius, factor, b, c):
30-
return self._interpolation_body(
28+
def gunn_and_kinzer_interpolation(self, *, output, radius, factor, b, c):
29+
return self._gunn_and_kinzer_interpolation_body(
3130
output.data, radius.data, factor, b.data, c.data
3231
)
3332

34-
# TODO #1603 give terminal velocity functions name of the parametrisation
3533
@cached_property
36-
def _terminal_velocity_body(self):
34+
def _rogers_and_yau_terminal_velocity_body(self):
3735
v_term = self.formulae.terminal_velocity.v_term
3836

3937
@numba.njit(**self.default_jit_flags)
@@ -44,9 +42,8 @@ def body(*, values, radius):
4442

4543
return body
4644

47-
# TODO #1603 give terminal velocity functions name of the parametrisation
48-
def terminal_velocity(self, *, values, radius):
49-
self._terminal_velocity_body(values=values, radius=radius)
45+
def rogers_and_yau_terminal_velocity(self, *, values, radius):
46+
self._rogers_and_yau_terminal_velocity_body(values=values, radius=radius)
5047

5148
@cached_property
5249
def _power_series_body(self):

PySDM/backends/impl_thrust_rtc/methods/terminal_velocity_methods.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __linear_collection_efficiency_body(self):
6969
)
7070

7171
@cached_property
72-
def __interpolation_body(self):
72+
def __gunn_and_kinzer_interpolation_body(self):
7373
# TODO #599 r<0
7474
return trtc.For(
7575
("output", "radius", "factor", "a", "b"),
@@ -126,9 +126,9 @@ def linear_collection_efficiency(
126126
)
127127

128128
@nice_thrust(**NICE_THRUST_FLAGS)
129-
def interpolation(self, *, output, radius, factor, b, c):
129+
def gunn_and_kinzer_interpolation(self, *, output, radius, factor, b, c):
130130
factor_device = trtc.DVInt64(factor)
131-
self.__interpolation_body.launch_n(
131+
self.__gunn_and_kinzer_interpolation_body.launch_n(
132132
len(radius), (output.data, radius.data, factor_device, b.data, c.data)
133133
)
134134

@@ -157,7 +157,7 @@ def power_series(self, *, values, radius, num_terms, prefactors, powers):
157157
)
158158

159159
@cached_property
160-
def __terminal_velocity_body(self):
160+
def __rogers_and_yau_terminal_velocity_body(self):
161161
return trtc.For(
162162
param_names=("values", "radius"),
163163
name_iter="i",
@@ -171,5 +171,5 @@ def __terminal_velocity_body(self):
171171
)
172172

173173
@nice_thrust(**NICE_THRUST_FLAGS)
174-
def terminal_velocity(self, *, values, radius):
175-
self.__terminal_velocity_body.launch_n(n=values.size(), args=[values, radius])
174+
def rogers_and_yau_terminal_velocity(self, *, values, radius):
175+
self.__rogers_and_yau_terminal_velocity_body.launch_n(n=values.size(), args=[values, radius])

PySDM/dynamics/terminal_velocity/gunn_and_kinzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __call__(self, output, radius):
131131
f"Radii can be interpolated up to {self.maximum_radius} m"
132132
+ f" (max value of {r_max} m within input data)"
133133
)
134-
self.particulator.backend.interpolation(
134+
self.particulator.backend.gunn_and_kinzer_interpolation(
135135
output=output, radius=radius, factor=self.factor, b=self.a, c=self.b
136136
)
137137

PySDM/dynamics/terminal_velocity/rogers_and_yau.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, particulator):
88
self.particulator = particulator
99

1010
def __call__(self, output, radius):
11-
self.particulator.backend.terminal_velocity(
11+
self.particulator.backend.rogers_and_yau_terminal_velocity(
1212
values=output.data,
1313
radius=radius.data,
1414
)

0 commit comments

Comments
 (0)