Skip to content

Commit 059be27

Browse files
committed
added new tests, updated contents
1 parent e59a056 commit 059be27

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ dependencies = [
1919
"pyroll-freiberg-flow-stress ~= 3.0",
2020
"pyroll-lendl-equivalent-method ~= 3.0",
2121
"pyroll-linear-thermal-expansion ~= 3.0",
22+
"pyroll-elastic-mill-spring ~= 3.0",
23+
"pyroll-gripping-analysis ~= 3.0",
24+
"pyroll-interface-friction ~= 3.0",
2225
"plotly"
2326
]
2427
readme = "README.md"

pyroll/basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
import pyroll.wusatowski_spreading as wusatowski_spreading
1919
import pyroll.lendl_equivalent_method as lendl_equivalent_method
2020
import pyroll.zouhar_contact as zouhar_contact
21+
import pyroll.gripping_analysis as gripping_analysis
22+
import pyroll.interface_friction as interface_friction
23+
import pyroll.elastic_mill_spring as elastic_mill_spring
2124
import pyroll.report as report
2225
import pyroll.export as export
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import logging
2+
import webbrowser
3+
from pathlib import Path
4+
5+
from pyroll.basic import Profile, PassSequence, RollPass, Roll, CircularOvalGroove, Transport, RoundGroove
6+
from pyroll.report import report
7+
8+
9+
def test_solve(tmp_path: Path, caplog):
10+
caplog.set_level(logging.DEBUG, logger="pyroll")
11+
12+
in_profile = Profile.round(
13+
diameter=30e-3,
14+
temperature=1200 + 273.15,
15+
strain=0,
16+
material=["C45", "steel"],
17+
flow_stress=100e6,
18+
density=7.5e3,
19+
specific_heat_capacity=690,
20+
)
21+
22+
sequence = PassSequence([
23+
RollPass(
24+
label="Oval I",
25+
roll=Roll(
26+
groove=CircularOvalGroove(
27+
depth=8e-3,
28+
r1=6e-3,
29+
r2=40e-3
30+
),
31+
nominal_radius=160e-3,
32+
rotational_frequency=1,
33+
),
34+
gap=2e-3,
35+
),
36+
Transport(
37+
label="I => II",
38+
duration=1
39+
),
40+
RollPass(
41+
label="Round II",
42+
roll=Roll(
43+
groove=RoundGroove(
44+
r1=1e-3,
45+
r2=12.5e-3,
46+
depth=11.5e-3
47+
),
48+
nominal_radius=160e-3,
49+
rotational_frequency=1,
50+
),
51+
gap=2e-3,
52+
),
53+
])
54+
55+
try:
56+
sequence.solve(in_profile)
57+
finally:
58+
print("\nLog:")
59+
print(caplog.text)
60+
61+
report_file = tmp_path / "report.html"
62+
63+
rendered = report(sequence)
64+
print()
65+
66+
report_file.write_text(rendered, encoding="utf-8")
67+
68+
webbrowser.open(report_file.as_uri())

0 commit comments

Comments
 (0)