1
+ import math
2
+
1
3
import numpy as np
2
4
3
5
from pyroll .core .hooks import Hook
4
6
from pyroll .core import SymmetricRollPass , root_hooks
5
- from shapely .affinity import translate , rotate
7
+ from shapely .affinity import rotate
6
8
from shapely .geometry import LineString , MultiPoint , Point , Polygon
7
9
from shapely .geometry .multilinestring import MultiLineString
8
10
from shapely .geometry .multipolygon import MultiPolygon
11
+ from shapely .lib import clip_by_rect
9
12
10
13
SymmetricRollPass .Roll .shore_hardness = Hook [float ]()
11
14
"""Shore hardness of the roll material."""
34
37
SymmetricRollPass .Roll .wear_area = Hook [float ]()
35
38
"""Worn area of the groove."""
36
39
40
+
37
41
@SymmetricRollPass .Roll .oval_round_wear_coefficient
38
42
def default_byon_lee_wear_coefficient (self : SymmetricRollPass .Roll ):
39
43
return 35.9e-12
@@ -51,17 +55,23 @@ def wear_radius(self: SymmetricRollPass.Roll):
51
55
52
56
def weight (correction_factor : float ) -> float :
53
57
return 1 - correction_factor * (
54
- (roll_pass .roll_force ** 2 * self .contact_length * roll_pass .rolled_billets ) / self .shore_hardness )
58
+ (roll_pass .roll_force ** 2 * self .contact_length * roll_pass .rolled_billets ) / self .shore_hardness )
55
59
56
60
if "round" in in_profile .classifiers and "oval" in roll_pass .classifiers :
57
61
weight = weight (self .round_oval_wear_coefficient )
58
- radius = self .groove .r2 * weight + in_profile .equivalent_radius * (1 - weight )
59
- return radius
62
+ if weight <= 0.75 : # Condition from Byon-Lee weight should be between 0.8 and 1
63
+ return 0
64
+ self .logger .debug (f"Weight function on Byon-Lee model for round - oval pass: { weight } ." )
65
+ return self .groove .r2 * weight + in_profile .equivalent_radius * (1 - weight )
66
+
60
67
61
68
elif "oval" in in_profile .classifiers and "round" in roll_pass .classifiers :
62
69
weight = weight (self .oval_round_wear_coefficient )
63
- radius = self .groove .r2 * weight + 0.75 * roll_pass .out_profile .bulge_radius * (1 - weight )
64
- return radius
70
+ self .logger .debug (f"Weight function on Byon-Lee model for oval - round pass: { weight } ." )
71
+ if weight <= 0.75 : # Condition from Byon-Lee weight should be between 0.8 and 1
72
+ return 0
73
+
74
+ return self .groove .r2 * weight + 0.75 * roll_pass .out_profile .bulge_radius * (1 - weight )
65
75
else :
66
76
return 0
67
77
@@ -72,6 +82,11 @@ def groove_wear_contour_lines(self: SymmetricRollPass.Roll) -> MultiLineString:
72
82
Point (self .roll_pass .out_profile .contact_lines .geoms [0 ].coords [- 1 ])])
73
83
z_coordinates_wear_contour = np .arange (start = detachment_points .geoms [0 ].x , stop = detachment_points .geoms [1 ].x ,
74
84
step = 1e-6 )
85
+
86
+ if self .wear_radius == 0 :
87
+ self .logger .warning ("Wear radius is 0 either pass-sequence unsuitable or model detected catastrophic wear." )
88
+ return self .roll_pass .contour_lines
89
+
75
90
y_coordinates_wear_contour = np .sqrt (self .wear_radius ** 2 - z_coordinates_wear_contour ** 2 )
76
91
minimum_wear_distance = min (y_coordinates_wear_contour )
77
92
y_coordinates_wear_contour_shifted = y_coordinates_wear_contour - minimum_wear_distance + detachment_points .geoms [
@@ -88,12 +103,12 @@ def groove_wear_contour_lines(self: SymmetricRollPass.Roll) -> MultiLineString:
88
103
89
104
@SymmetricRollPass .Roll .groove_wear_cross_section
90
105
def groove_wear_cross_section (self : SymmetricRollPass .Roll ):
91
-
92
106
poly = []
93
107
for cl , wcl in zip (self .roll_pass .contour_lines .geoms , self .groove_wear_contour_lines .geoms ):
94
108
boundary = list (cl .coords ) + list (reversed (wcl .coords ))
95
109
_poly = Polygon (boundary )
96
- poly .append (_poly )
110
+ _clipped_poly = clip_by_rect (_poly , - self .roll_pass .out_profile .width / 2 , - math .inf , self .roll_pass .out_profile .width / 2 , math .inf )
111
+ poly .append (_clipped_poly )
97
112
98
113
return MultiPolygon (poly )
99
114
@@ -109,4 +124,4 @@ def wear_area(self: SymmetricRollPass.Roll):
109
124
110
125
111
126
root_hooks .append (SymmetricRollPass .Roll .max_wear_depth )
112
- root_hooks .append (SymmetricRollPass .Roll .wear_area )
127
+ root_hooks .append (SymmetricRollPass .Roll .wear_area )
0 commit comments