Skip to content

Commit 9e08713

Browse files
committed
updated and removed bug
1 parent 39025bc commit 9e08713

File tree

7 files changed

+34
-15
lines changed

7 files changed

+34
-15
lines changed

docs/docs.pdf

460 Bytes
Binary file not shown.

docs/docs.tex

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
The correction coefficients $\kappa$ were measured by the autor from various rolling trials.
6262
For round - oval passes the value is $\kappa = 19.6e-12$ and for oval - round passes $\kappa = 35.9e-12$.
6363
Further, for round - oval roll passes the value $0.75$ is a empirical coefficient as stated by the original author.
64+
Also, the original authors stated, that the weight function $J_w$ should be in a range between 0.8 and 1.
65+
If the function leaves this range, the acting wear can be considered catastrophic and the model becomes invalid.
66+
This has been treated in the implementation as well.
6467

6568

6669
\section{Usage instructions}\label{sec:usage-instructions}

hatch.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ path = "pyroll/byon_lee_wear_model/__init__.py"
1010
path = ".venv"
1111
dependencies = [
1212
"pytest ~= 7.0",
13-
"pyroll-report ~= 3.0.0"
13+
"pyroll-report ~= 3.0.0",
14+
"pyroll-wusatowski-spreading ~= 3.0.0"
1415
]
1516

1617
[envs.docs]

pyroll/byon_lee_wear_model/report.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ def unit_plot(unit: Unit):
2222
unit.roll.groove_wear_cross_section.geoms):
2323
wear_contour = ax.plot(*wear_cl.xy, color='red', ls='--', label="wear contour")
2424
roll_surface = ax.plot(*cl.xy, color="k", label="roll surface")
25-
wear_cross_section = ax.fill(*wear_poly.boundary.xy, color="red", alpha=0.5,
26-
label="wear cross section")
25+
wear_cross_section = ax.fill(*wear_poly.boundary.xy, color="red", alpha=0.5, label="wear cross section")
2726

2827
axl.axis("off")
29-
axl.legend(handles=roll_surface + wear_cross_section + wear_contour, ncols=3, loc="lower center")
28+
axl.legend(handles=roll_surface + wear_contour + wear_cross_section, ncols=3, loc="lower center")
3029
fig.set_layout_engine('constrained')
3130

3231
return fig

pyroll/byon_lee_wear_model/roll_pass.py

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import math
2+
13
import numpy as np
24

35
from pyroll.core.hooks import Hook
46
from pyroll.core import SymmetricRollPass, root_hooks
5-
from shapely.affinity import translate, rotate
7+
from shapely.affinity import rotate
68
from shapely.geometry import LineString, MultiPoint, Point, Polygon
79
from shapely.geometry.multilinestring import MultiLineString
810
from shapely.geometry.multipolygon import MultiPolygon
11+
from shapely.lib import clip_by_rect
912

1013
SymmetricRollPass.Roll.shore_hardness = Hook[float]()
1114
"""Shore hardness of the roll material."""
@@ -34,6 +37,7 @@
3437
SymmetricRollPass.Roll.wear_area = Hook[float]()
3538
"""Worn area of the groove."""
3639

40+
3741
@SymmetricRollPass.Roll.oval_round_wear_coefficient
3842
def default_byon_lee_wear_coefficient(self: SymmetricRollPass.Roll):
3943
return 35.9e-12
@@ -51,17 +55,23 @@ def wear_radius(self: SymmetricRollPass.Roll):
5155

5256
def weight(correction_factor: float) -> float:
5357
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)
5559

5660
if "round" in in_profile.classifiers and "oval" in roll_pass.classifiers:
5761
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+
6067

6168
elif "oval" in in_profile.classifiers and "round" in roll_pass.classifiers:
6269
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)
6575
else:
6676
return 0
6777

@@ -72,6 +82,11 @@ def groove_wear_contour_lines(self: SymmetricRollPass.Roll) -> MultiLineString:
7282
Point(self.roll_pass.out_profile.contact_lines.geoms[0].coords[-1])])
7383
z_coordinates_wear_contour = np.arange(start=detachment_points.geoms[0].x, stop=detachment_points.geoms[1].x,
7484
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+
7590
y_coordinates_wear_contour = np.sqrt(self.wear_radius ** 2 - z_coordinates_wear_contour ** 2)
7691
minimum_wear_distance = min(y_coordinates_wear_contour)
7792
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:
88103

89104
@SymmetricRollPass.Roll.groove_wear_cross_section
90105
def groove_wear_cross_section(self: SymmetricRollPass.Roll):
91-
92106
poly = []
93107
for cl, wcl in zip(self.roll_pass.contour_lines.geoms, self.groove_wear_contour_lines.geoms):
94108
boundary = list(cl.coords) + list(reversed(wcl.coords))
95109
_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)
97112

98113
return MultiPolygon(poly)
99114

@@ -109,4 +124,4 @@ def wear_area(self: SymmetricRollPass.Roll):
109124

110125

111126
root_hooks.append(SymmetricRollPass.Roll.max_wear_depth)
112-
root_hooks.append(SymmetricRollPass.Roll.wear_area)
127+
root_hooks.append(SymmetricRollPass.Roll.wear_area)

tests/test_solve_falseround.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
def test_solve(tmp_path: Path, caplog):
99
caplog.set_level(logging.DEBUG, logger="pyroll")
1010

11+
import pyroll.wusatowski_spreading
1112
import pyroll.byon_lee_wear_model
1213
import pyroll.profile_bulging
1314

@@ -46,7 +47,7 @@ def test_solve(tmp_path: Path, caplog):
4647
velocity=11.7,
4748
gap=3.5e-3,
4849
coulomb_friction_coefficient=0.4,
49-
rolled_billets=20000,
50+
rolled_billets=3000,
5051

5152
),
5253
]

tests/test_solve_round_oval_round.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_solve_round_oval_round(tmp_path: Path, caplog):
3333
shore_hardness=65
3434
),
3535
gap=2e-3,
36-
rolled_billets=20000,
36+
rolled_billets=500,
3737

3838
),
3939

0 commit comments

Comments
 (0)