bstart-trb 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bstart_trb/__init__.py +6 -6
- bstart_trb/models.py +118 -116
- bstart_trb/wrapper.py +51 -50
- bstart_trb-0.2.2.dist-info/METADATA +289 -0
- bstart_trb-0.2.2.dist-info/RECORD +11 -0
- bstart_trb-0.2.1.dist-info/METADATA +0 -153
- bstart_trb-0.2.1.dist-info/RECORD +0 -11
- {bstart_trb-0.2.1.dist-info → bstart_trb-0.2.2.dist-info}/WHEEL +0 -0
- {bstart_trb-0.2.1.dist-info → bstart_trb-0.2.2.dist-info}/licenses/LICENSE +0 -0
bstart_trb/__init__.py
CHANGED
|
@@ -11,8 +11,8 @@ Features:
|
|
|
11
11
|
- Dataclass wrapped results
|
|
12
12
|
|
|
13
13
|
Example:
|
|
14
|
-
>>> from
|
|
15
|
-
>>> from
|
|
14
|
+
>>> from bstart_trb import slice_stress, RollerParams, RacewayParams
|
|
15
|
+
>>> from bstart_trb import CrownType, RacewayType
|
|
16
16
|
>>>
|
|
17
17
|
>>> # Define cylindrical roller parameters
|
|
18
18
|
>>> roller = RollerParams(
|
|
@@ -47,17 +47,17 @@ from .wrapper import (
|
|
|
47
47
|
)
|
|
48
48
|
|
|
49
49
|
__all__ = [
|
|
50
|
-
#
|
|
50
|
+
# Enum types
|
|
51
51
|
"CrownType",
|
|
52
52
|
"RacewayType",
|
|
53
|
-
#
|
|
53
|
+
# Data types
|
|
54
54
|
"RollerParams",
|
|
55
55
|
"RacewayParams",
|
|
56
56
|
"SliceResult",
|
|
57
|
-
#
|
|
57
|
+
# Calculation functions
|
|
58
58
|
"slice_stress",
|
|
59
59
|
"batch_slice_stress",
|
|
60
60
|
"is_fortran_available",
|
|
61
61
|
]
|
|
62
62
|
|
|
63
|
-
__version__ = "0.2.
|
|
63
|
+
__version__ = "0.2.2"
|
bstart_trb/models.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
Data Type Definitions
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Defines input parameter and output result data classes for
|
|
5
|
+
cylindrical/tapered roller bearing slice calculation.
|
|
6
|
+
All classes use the dataclass decorator with complete type hints.
|
|
6
7
|
"""
|
|
7
8
|
|
|
8
9
|
from dataclasses import dataclass
|
|
@@ -13,62 +14,63 @@ from numpy.typing import NDArray
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class CrownType(IntEnum):
|
|
16
|
-
"""
|
|
17
|
+
"""Crown modification type enumeration.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Specifies the crown modification type for the roller.
|
|
19
20
|
|
|
20
21
|
Attributes:
|
|
21
|
-
STRAIGHT:
|
|
22
|
-
ARC:
|
|
23
|
-
LOGARITHMIC:
|
|
22
|
+
STRAIGHT: No modification (straight profile)
|
|
23
|
+
ARC: Circular arc crown
|
|
24
|
+
LOGARITHMIC: Logarithmic crown (recommended for optimal stress distribution)
|
|
24
25
|
"""
|
|
25
26
|
STRAIGHT = 0
|
|
26
|
-
"""
|
|
27
|
+
"""No modification (straight profile), high edge stress"""
|
|
27
28
|
|
|
28
29
|
ARC = 1
|
|
29
|
-
"""
|
|
30
|
+
"""Circular arc crown, requires arc radius specification"""
|
|
30
31
|
|
|
31
32
|
LOGARITHMIC = 2
|
|
32
|
-
"""
|
|
33
|
+
"""Logarithmic crown (recommended), theoretically achieves uniform stress distribution"""
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
class RacewayType(IntEnum):
|
|
36
|
-
"""
|
|
37
|
+
"""Raceway type enumeration.
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
Specifies the type of raceway in contact.
|
|
39
40
|
|
|
40
41
|
Attributes:
|
|
41
|
-
PLANE:
|
|
42
|
-
INNER:
|
|
43
|
-
OUTER:
|
|
42
|
+
PLANE: Flat surface contact
|
|
43
|
+
INNER: Inner ring raceway (convex surface)
|
|
44
|
+
OUTER: Outer ring raceway (concave surface)
|
|
44
45
|
"""
|
|
45
46
|
PLANE = 0
|
|
46
|
-
"""
|
|
47
|
+
"""Flat surface contact"""
|
|
47
48
|
|
|
48
49
|
INNER = 1
|
|
49
|
-
"""
|
|
50
|
+
"""Inner ring raceway (convex surface)"""
|
|
50
51
|
|
|
51
52
|
OUTER = 2
|
|
52
|
-
"""
|
|
53
|
+
"""Outer ring raceway (concave surface), note: use negative diameter value"""
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
@dataclass
|
|
56
57
|
class RollerParams:
|
|
57
|
-
"""
|
|
58
|
+
"""Roller geometry parameters.
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
Defines geometric dimensions and crown modification parameters
|
|
61
|
+
for cylindrical/tapered rollers.
|
|
60
62
|
|
|
61
63
|
Attributes:
|
|
62
|
-
d1:
|
|
63
|
-
d2:
|
|
64
|
-
length:
|
|
65
|
-
alfa:
|
|
66
|
-
tilt:
|
|
67
|
-
crown_type:
|
|
68
|
-
curve_q:
|
|
64
|
+
d1: Roller small end diameter (mm)
|
|
65
|
+
d2: Roller large end diameter (mm), d1=d2 for cylindrical rollers
|
|
66
|
+
length: Roller effective length (mm)
|
|
67
|
+
alfa: Roller half cone angle (degrees), alfa=0 for cylindrical rollers
|
|
68
|
+
tilt: Roller tilt angle (degrees), 0 means no tilt
|
|
69
|
+
crown_type: Crown modification type, see CrownType enum
|
|
70
|
+
curve_q: Design load (N), used for logarithmic crown calculation
|
|
69
71
|
|
|
70
72
|
Example:
|
|
71
|
-
>>> #
|
|
73
|
+
>>> # Cylindrical roller
|
|
72
74
|
>>> roller = RollerParams(
|
|
73
75
|
... d1=10.0, d2=10.0, length=9.6,
|
|
74
76
|
... alfa=0.0, tilt=0.0,
|
|
@@ -76,7 +78,7 @@ class RollerParams:
|
|
|
76
78
|
... curve_q=14100.0
|
|
77
79
|
... )
|
|
78
80
|
|
|
79
|
-
>>> #
|
|
81
|
+
>>> # Tapered roller
|
|
80
82
|
>>> taper_roller = RollerParams(
|
|
81
83
|
... d1=8.0, d2=10.0, length=12.0,
|
|
82
84
|
... alfa=10.0, tilt=0.0,
|
|
@@ -85,79 +87,79 @@ class RollerParams:
|
|
|
85
87
|
... )
|
|
86
88
|
|
|
87
89
|
Note:
|
|
88
|
-
-
|
|
89
|
-
- tilt > 0
|
|
90
|
+
- Logarithmic crown achieves uniform stress distribution when load == curve_q
|
|
91
|
+
- tilt > 0 causes stress concentration at one end, other end may lose contact
|
|
90
92
|
"""
|
|
91
93
|
d1: float
|
|
92
|
-
"""
|
|
94
|
+
"""Roller small end diameter (mm)"""
|
|
93
95
|
|
|
94
96
|
d2: float
|
|
95
|
-
"""
|
|
97
|
+
"""Roller large end diameter (mm), d1=d2 for cylindrical rollers"""
|
|
96
98
|
|
|
97
99
|
length: float
|
|
98
|
-
"""
|
|
100
|
+
"""Roller effective length (mm)"""
|
|
99
101
|
|
|
100
102
|
alfa: float = 0.0
|
|
101
|
-
"""
|
|
103
|
+
"""Roller half cone angle (degrees), alfa=0 for cylindrical rollers"""
|
|
102
104
|
|
|
103
105
|
tilt: float = 0.0
|
|
104
|
-
"""
|
|
106
|
+
"""Roller tilt angle (degrees)"""
|
|
105
107
|
|
|
106
108
|
crown_type: CrownType = CrownType.LOGARITHMIC
|
|
107
|
-
"""
|
|
109
|
+
"""Crown modification type"""
|
|
108
110
|
|
|
109
111
|
curve_q: float = 0.0
|
|
110
|
-
"""
|
|
112
|
+
"""Design load (N), used for logarithmic crown calculation, 0 means use actual load"""
|
|
111
113
|
|
|
112
114
|
def __post_init__(self):
|
|
113
|
-
"""
|
|
115
|
+
"""Parameter validation"""
|
|
114
116
|
if self.d1 <= 0:
|
|
115
|
-
raise ValueError(f"
|
|
117
|
+
raise ValueError(f"Roller small end diameter must be positive, got: {self.d1}")
|
|
116
118
|
if self.d2 <= 0:
|
|
117
|
-
raise ValueError(f"
|
|
119
|
+
raise ValueError(f"Roller large end diameter must be positive, got: {self.d2}")
|
|
118
120
|
if self.length <= 0:
|
|
119
|
-
raise ValueError(f"
|
|
121
|
+
raise ValueError(f"Roller effective length must be positive, got: {self.length}")
|
|
120
122
|
if self.d1 > self.d2:
|
|
121
123
|
import warnings
|
|
122
|
-
warnings.warn(f"
|
|
124
|
+
warnings.warn(f"Roller small end diameter d1={self.d1} is greater than large end diameter d2={self.d2}, please verify")
|
|
123
125
|
|
|
124
|
-
#
|
|
126
|
+
# Convert enum type
|
|
125
127
|
if isinstance(self.crown_type, int):
|
|
126
128
|
self.crown_type = CrownType(self.crown_type)
|
|
127
129
|
|
|
128
130
|
@property
|
|
129
131
|
def is_cylindrical(self) -> bool:
|
|
130
|
-
"""
|
|
132
|
+
"""Whether this is a cylindrical roller"""
|
|
131
133
|
return abs(self.d1 - self.d2) < 1e-6 and abs(self.alfa) < 1e-6
|
|
132
134
|
|
|
133
135
|
@property
|
|
134
136
|
def diameter(self) -> float:
|
|
135
|
-
"""
|
|
137
|
+
"""Roller diameter (cylindrical) or mean diameter (tapered)"""
|
|
136
138
|
return (self.d1 + self.d2) / 2.0
|
|
137
139
|
|
|
138
140
|
|
|
139
141
|
@dataclass
|
|
140
142
|
class RacewayParams:
|
|
141
|
-
"""
|
|
143
|
+
"""Raceway parameters.
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
Defines raceway geometric characteristics.
|
|
144
146
|
|
|
145
147
|
Attributes:
|
|
146
|
-
diameter:
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
raceway_type:
|
|
150
|
-
fai:
|
|
148
|
+
diameter: Raceway diameter (mm)
|
|
149
|
+
- Inner ring raceway: positive value
|
|
150
|
+
- Outer ring raceway: negative value (Hertz contact theory sign convention)
|
|
151
|
+
raceway_type: Raceway type, see RacewayType enum
|
|
152
|
+
fai: Raceway half cone angle (degrees), 0 for cylindrical roller bearings
|
|
151
153
|
|
|
152
154
|
Example:
|
|
153
|
-
>>> #
|
|
155
|
+
>>> # Inner ring raceway
|
|
154
156
|
>>> inner = RacewayParams(
|
|
155
157
|
... diameter=110.0,
|
|
156
158
|
... raceway_type=RacewayType.INNER,
|
|
157
159
|
... fai=0.0
|
|
158
160
|
... )
|
|
159
161
|
|
|
160
|
-
>>> #
|
|
162
|
+
>>> # Outer ring raceway (note negative sign)
|
|
161
163
|
>>> outer = RacewayParams(
|
|
162
164
|
... diameter=-150.0,
|
|
163
165
|
... raceway_type=RacewayType.OUTER,
|
|
@@ -165,111 +167,111 @@ class RacewayParams:
|
|
|
165
167
|
... )
|
|
166
168
|
|
|
167
169
|
Note:
|
|
168
|
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
170
|
+
Outer ring raceway diameter uses negative value per Hertz contact theory convention:
|
|
171
|
+
- Positive radius of curvature → convex surface (roller, inner ring)
|
|
172
|
+
- Negative radius of curvature → concave surface (outer ring)
|
|
171
173
|
"""
|
|
172
174
|
diameter: float
|
|
173
|
-
"""
|
|
175
|
+
"""Raceway diameter (mm), use negative value for outer ring"""
|
|
174
176
|
|
|
175
177
|
raceway_type: RacewayType = RacewayType.INNER
|
|
176
|
-
"""
|
|
178
|
+
"""Raceway type"""
|
|
177
179
|
|
|
178
180
|
fai: float = 0.0
|
|
179
|
-
"""
|
|
181
|
+
"""Raceway half cone angle (degrees)"""
|
|
180
182
|
|
|
181
183
|
def __post_init__(self):
|
|
182
|
-
"""
|
|
183
|
-
#
|
|
184
|
+
"""Parameter validation"""
|
|
185
|
+
# Convert enum type
|
|
184
186
|
if isinstance(self.raceway_type, int):
|
|
185
187
|
self.raceway_type = RacewayType(self.raceway_type)
|
|
186
188
|
|
|
187
|
-
#
|
|
189
|
+
# Check sign convention
|
|
188
190
|
if self.raceway_type == RacewayType.OUTER and self.diameter > 0:
|
|
189
191
|
import warnings
|
|
190
192
|
warnings.warn(
|
|
191
|
-
f"
|
|
192
|
-
"
|
|
193
|
+
f"Outer ring raceway diameter is typically negative (current value: {self.diameter}), "
|
|
194
|
+
"please verify if this is correct"
|
|
193
195
|
)
|
|
194
196
|
|
|
195
197
|
|
|
196
198
|
@dataclass
|
|
197
199
|
class SliceResult:
|
|
198
|
-
"""
|
|
200
|
+
"""Slice calculation result.
|
|
199
201
|
|
|
200
|
-
|
|
202
|
+
Contains results of roller-raceway contact slice stress distribution calculation.
|
|
201
203
|
|
|
202
204
|
Attributes:
|
|
203
|
-
n_slice:
|
|
204
|
-
stress:
|
|
205
|
-
half_width:
|
|
206
|
-
slice_force:
|
|
207
|
-
deflection:
|
|
208
|
-
equilibrium_load:
|
|
209
|
-
equilibrium_moment:
|
|
210
|
-
converged:
|
|
211
|
-
error_code:
|
|
205
|
+
n_slice: Number of slices
|
|
206
|
+
stress: Contact center stress for each slice (MPa)
|
|
207
|
+
half_width: Contact half-width for each slice (mm)
|
|
208
|
+
slice_force: Contact force for each slice (N)
|
|
209
|
+
deflection: Roller deformation (mm)
|
|
210
|
+
equilibrium_load: Equilibrium load (N)
|
|
211
|
+
equilibrium_moment: Equilibrium moment (N·mm)
|
|
212
|
+
converged: Whether calculation converged
|
|
213
|
+
error_code: Error code (0=success)
|
|
212
214
|
|
|
213
215
|
Example:
|
|
214
216
|
>>> result = slice_stress(roller, raceway, load=1340.0, n_slice=30)
|
|
215
|
-
>>> print(f"
|
|
216
|
-
>>> print(f"
|
|
217
|
-
>>> print(f"
|
|
217
|
+
>>> print(f"Max stress: {result.max_stress:.0f} MPa")
|
|
218
|
+
>>> print(f"Stress distribution: {result.stress}")
|
|
219
|
+
>>> print(f"Slice forces: {result.slice_force}")
|
|
218
220
|
"""
|
|
219
221
|
n_slice: int
|
|
220
|
-
"""
|
|
222
|
+
"""Number of slices"""
|
|
221
223
|
|
|
222
224
|
stress: NDArray[np.float64]
|
|
223
|
-
"""
|
|
225
|
+
"""Contact center stress for each slice (MPa)"""
|
|
224
226
|
|
|
225
227
|
half_width: NDArray[np.float64]
|
|
226
|
-
"""
|
|
228
|
+
"""Contact half-width for each slice (mm)"""
|
|
227
229
|
|
|
228
230
|
slice_force: NDArray[np.float64]
|
|
229
|
-
"""
|
|
231
|
+
"""Contact force for each slice (N)"""
|
|
230
232
|
|
|
231
233
|
deflection: float
|
|
232
|
-
"""
|
|
234
|
+
"""Roller deformation (mm)"""
|
|
233
235
|
|
|
234
236
|
equilibrium_load: float
|
|
235
|
-
"""
|
|
237
|
+
"""Equilibrium load (N), should be close to input load"""
|
|
236
238
|
|
|
237
239
|
equilibrium_moment: float
|
|
238
|
-
"""
|
|
240
|
+
"""Equilibrium moment (N·mm)"""
|
|
239
241
|
|
|
240
242
|
converged: bool = True
|
|
241
|
-
"""
|
|
243
|
+
"""Whether calculation converged"""
|
|
242
244
|
|
|
243
245
|
error_code: int = 0
|
|
244
|
-
"""
|
|
246
|
+
"""Error code: 0=success, 1=equation solve failed, 2=invalid n_slice, 3=invalid load"""
|
|
245
247
|
|
|
246
248
|
@property
|
|
247
249
|
def max_stress(self) -> float:
|
|
248
|
-
"""
|
|
250
|
+
"""Maximum contact stress (MPa)"""
|
|
249
251
|
return float(np.max(self.stress)) if len(self.stress) > 0 else 0.0
|
|
250
252
|
|
|
251
253
|
@property
|
|
252
254
|
def min_stress(self) -> float:
|
|
253
|
-
"""
|
|
255
|
+
"""Minimum contact stress (MPa), excluding 0 (non-contact zones)"""
|
|
254
256
|
nonzero = self.stress[self.stress > 0]
|
|
255
257
|
return float(np.min(nonzero)) if len(nonzero) > 0 else 0.0
|
|
256
258
|
|
|
257
259
|
@property
|
|
258
260
|
def mean_stress(self) -> float:
|
|
259
|
-
"""
|
|
261
|
+
"""Mean contact stress (MPa), calculated for contact zone only"""
|
|
260
262
|
nonzero = self.stress[self.stress > 0]
|
|
261
263
|
return float(np.mean(nonzero)) if len(nonzero) > 0 else 0.0
|
|
262
264
|
|
|
263
265
|
@property
|
|
264
266
|
def contact_slices(self) -> int:
|
|
265
|
-
"""
|
|
267
|
+
"""Number of slices in contact (stress > 0)"""
|
|
266
268
|
return int(np.sum(self.stress > 0))
|
|
267
269
|
|
|
268
270
|
@property
|
|
269
271
|
def stress_uniformity(self) -> float:
|
|
270
|
-
"""
|
|
272
|
+
"""Stress uniformity (0~1), 1 means perfectly uniform.
|
|
271
273
|
|
|
272
|
-
|
|
274
|
+
Defined as: 1 - (max_stress - min_stress) / mean_stress
|
|
273
275
|
"""
|
|
274
276
|
if self.mean_stress == 0:
|
|
275
277
|
return 0.0
|
|
@@ -277,54 +279,54 @@ class SliceResult:
|
|
|
277
279
|
return max(0.0, 1.0 - variation)
|
|
278
280
|
|
|
279
281
|
def get_slice_positions(self, roller_length: float) -> NDArray[np.float64]:
|
|
280
|
-
"""
|
|
282
|
+
"""Get center position of each slice.
|
|
281
283
|
|
|
282
284
|
Args:
|
|
283
|
-
roller_length:
|
|
285
|
+
roller_length: Roller effective length (mm)
|
|
284
286
|
|
|
285
287
|
Returns:
|
|
286
|
-
|
|
288
|
+
Center position of each slice, from 0 to roller_length
|
|
287
289
|
"""
|
|
288
|
-
h = roller_length / self.n_slice / 2 #
|
|
290
|
+
h = roller_length / self.n_slice / 2 # Half slice width
|
|
289
291
|
positions = np.array([h * (2 * i + 1) for i in range(self.n_slice)])
|
|
290
292
|
return positions
|
|
291
293
|
|
|
292
294
|
def get_slice_width(self, roller_length: float) -> float:
|
|
293
|
-
"""
|
|
295
|
+
"""Get slice width.
|
|
294
296
|
|
|
295
297
|
Args:
|
|
296
|
-
roller_length:
|
|
298
|
+
roller_length: Roller effective length (mm)
|
|
297
299
|
|
|
298
300
|
Returns:
|
|
299
|
-
|
|
301
|
+
Width of a single slice (mm)
|
|
300
302
|
"""
|
|
301
303
|
return roller_length / self.n_slice
|
|
302
304
|
|
|
303
305
|
def get_slice_spacing(self, roller_length: float) -> float:
|
|
304
|
-
"""
|
|
306
|
+
"""Get spacing between adjacent slice centers.
|
|
305
307
|
|
|
306
|
-
|
|
308
|
+
Note: Slice spacing = slice width = roller_length / n_slice
|
|
307
309
|
|
|
308
310
|
Args:
|
|
309
|
-
roller_length:
|
|
311
|
+
roller_length: Roller effective length (mm)
|
|
310
312
|
|
|
311
313
|
Returns:
|
|
312
|
-
|
|
314
|
+
Spacing between adjacent slice centers (mm)
|
|
313
315
|
"""
|
|
314
316
|
return roller_length / self.n_slice
|
|
315
317
|
|
|
316
318
|
def print_slice_info(self, roller_length: float) -> None:
|
|
317
|
-
"""
|
|
319
|
+
"""Print slice division information.
|
|
318
320
|
|
|
319
321
|
Args:
|
|
320
|
-
roller_length:
|
|
322
|
+
roller_length: Roller effective length (mm)
|
|
321
323
|
"""
|
|
322
324
|
width = self.get_slice_width(roller_length)
|
|
323
325
|
positions = self.get_slice_positions(roller_length)
|
|
324
|
-
print(f"
|
|
325
|
-
print(f"
|
|
326
|
-
print(f"
|
|
327
|
-
print(f"
|
|
328
|
-
print(f"
|
|
329
|
-
print(f"
|
|
330
|
-
print(f"
|
|
326
|
+
print(f"Slice division info:")
|
|
327
|
+
print(f" Roller effective length: {roller_length} mm")
|
|
328
|
+
print(f" Number of slices: {self.n_slice}")
|
|
329
|
+
print(f" Slice width: {width:.6f} mm")
|
|
330
|
+
print(f" Slice width × n_slice = {width * self.n_slice:.6f} mm")
|
|
331
|
+
print(f" First slice center position: {positions[0]:.6f} mm")
|
|
332
|
+
print(f" Last slice center position: {positions[-1]:.6f} mm")
|
bstart_trb/wrapper.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Python
|
|
2
|
+
Python Wrapper Layer
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Provides high-level Python interface for cylindrical/tapered roller bearing
|
|
5
|
+
slice stress calculation. Wraps the underlying Fortran computational core (via f2py).
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from typing import Optional, Sequence, Callable, Tuple
|
|
@@ -17,7 +17,7 @@ from .models import (
|
|
|
17
17
|
SliceResult,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
# Try to import f2py compiled module
|
|
21
21
|
_FORTRAN_AVAILABLE = False
|
|
22
22
|
_taper_calculate: Optional[Callable[..., Tuple[
|
|
23
23
|
NDArray[np.float64], NDArray[np.float64], NDArray[np.float64], float, float, float, int
|
|
@@ -30,8 +30,8 @@ try:
|
|
|
30
30
|
except ImportError:
|
|
31
31
|
import warnings
|
|
32
32
|
warnings.warn(
|
|
33
|
-
"Fortran
|
|
34
|
-
"
|
|
33
|
+
"Fortran core not compiled. Please run 'python build.py' to compile. "
|
|
34
|
+
"Slice calculation functionality is currently unavailable."
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
|
|
@@ -41,73 +41,73 @@ def slice_stress(
|
|
|
41
41
|
load: float,
|
|
42
42
|
n_slice: int = 30,
|
|
43
43
|
) -> SliceResult:
|
|
44
|
-
"""
|
|
44
|
+
"""Calculate slice stress distribution for roller-raceway contact.
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
Uses the Influence Coefficient Method to calculate stress distribution
|
|
47
|
+
across slices, considering crown modification and roller tilt effects.
|
|
48
48
|
|
|
49
49
|
Args:
|
|
50
|
-
roller:
|
|
51
|
-
raceway:
|
|
52
|
-
load:
|
|
53
|
-
n_slice:
|
|
50
|
+
roller: Roller geometry parameters
|
|
51
|
+
raceway: Raceway parameters
|
|
52
|
+
load: Roller load (N)
|
|
53
|
+
n_slice: Number of slices (1-50), default 30
|
|
54
54
|
|
|
55
55
|
Returns:
|
|
56
|
-
SliceResult:
|
|
56
|
+
SliceResult: Contains stress, contact half-width, and other results for each slice
|
|
57
57
|
|
|
58
58
|
Raises:
|
|
59
|
-
RuntimeError: Fortran
|
|
60
|
-
ValueError:
|
|
59
|
+
RuntimeError: When Fortran module is not compiled
|
|
60
|
+
ValueError: When parameters are invalid
|
|
61
61
|
|
|
62
62
|
Example:
|
|
63
|
-
>>> from
|
|
64
|
-
>>> from
|
|
63
|
+
>>> from bstart_trb import slice_stress, RollerParams, RacewayParams
|
|
64
|
+
>>> from bstart_trb import CrownType, RacewayType
|
|
65
65
|
>>>
|
|
66
|
-
>>> #
|
|
66
|
+
>>> # Define roller parameters
|
|
67
67
|
>>> roller = RollerParams(
|
|
68
68
|
... d1=10.0, d2=10.0, length=9.6,
|
|
69
69
|
... crown_type=CrownType.LOGARITHMIC,
|
|
70
70
|
... curve_q=14100.0
|
|
71
71
|
... )
|
|
72
72
|
>>>
|
|
73
|
-
>>> #
|
|
73
|
+
>>> # Define outer ring raceway parameters (note negative diameter)
|
|
74
74
|
>>> raceway = RacewayParams(
|
|
75
75
|
... diameter=-150.0,
|
|
76
76
|
... raceway_type=RacewayType.OUTER
|
|
77
77
|
... )
|
|
78
78
|
>>>
|
|
79
|
-
>>> #
|
|
79
|
+
>>> # Calculate slice stress
|
|
80
80
|
>>> result = slice_stress(roller, raceway, load=1340.0, n_slice=30)
|
|
81
|
-
>>> print(f"
|
|
82
|
-
>>> print(f"
|
|
81
|
+
>>> print(f"Max stress: {result.max_stress:.0f} MPa")
|
|
82
|
+
>>> print(f"Stress uniformity: {result.stress_uniformity:.2%}")
|
|
83
83
|
|
|
84
84
|
Note:
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
85
|
+
- Maximum n_slice is 50
|
|
86
|
+
- Logarithmic crown (crown_type=2) achieves uniform stress when load == curve_q
|
|
87
|
+
- Outer ring raceway diameter should be negative (Hertz contact sign convention)
|
|
88
88
|
|
|
89
89
|
Theory:
|
|
90
|
-
|
|
91
|
-
1.
|
|
92
|
-
2.
|
|
93
|
-
3.
|
|
94
|
-
4.
|
|
90
|
+
This function uses the influence coefficient method to solve roller-raceway contact:
|
|
91
|
+
1. Divides roller axially into n_slice slices
|
|
92
|
+
2. Establishes elastic coupling between slices (influence coefficient matrix)
|
|
93
|
+
3. Solves linear system using Gaussian elimination
|
|
94
|
+
4. Iterates to convergence to obtain contact stress distribution
|
|
95
95
|
"""
|
|
96
96
|
if not _FORTRAN_AVAILABLE or _taper_calculate is None:
|
|
97
97
|
raise RuntimeError(
|
|
98
|
-
"Fortran
|
|
98
|
+
"Fortran core not compiled. Please run 'python build.py' first."
|
|
99
99
|
)
|
|
100
100
|
|
|
101
|
-
#
|
|
101
|
+
# Parameter validation
|
|
102
102
|
if load <= 0:
|
|
103
|
-
raise ValueError(f"
|
|
103
|
+
raise ValueError(f"Load must be positive, got: {load}")
|
|
104
104
|
if not 1 <= n_slice <= 50:
|
|
105
|
-
raise ValueError(f"
|
|
105
|
+
raise ValueError(f"n_slice must be between 1-50, got: {n_slice}")
|
|
106
106
|
|
|
107
|
-
#
|
|
107
|
+
# Determine design load
|
|
108
108
|
curve_q = roller.curve_q if roller.curve_q > 0 else load
|
|
109
109
|
|
|
110
|
-
#
|
|
110
|
+
# Call Fortran calculation (_taper_calculate is guaranteed non-None here)
|
|
111
111
|
p, a, q_slice, dc, q1, qm, ierr = _taper_calculate(
|
|
112
112
|
d1=roller.d1,
|
|
113
113
|
d2=roller.d2,
|
|
@@ -123,7 +123,7 @@ def slice_stress(
|
|
|
123
123
|
curveq=curve_q,
|
|
124
124
|
)
|
|
125
125
|
|
|
126
|
-
#
|
|
126
|
+
# Build result
|
|
127
127
|
return SliceResult(
|
|
128
128
|
n_slice=n_slice,
|
|
129
129
|
stress=np.array(p, dtype=np.float64),
|
|
@@ -143,25 +143,26 @@ def batch_slice_stress(
|
|
|
143
143
|
loads: Sequence[float],
|
|
144
144
|
n_slice: int = 30,
|
|
145
145
|
) -> list[SliceResult]:
|
|
146
|
-
"""
|
|
146
|
+
"""Batch calculate slice stress distribution for multiple loads.
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
Calculates slice stress for multiple load values, suitable when
|
|
149
|
+
load distribution is known.
|
|
149
150
|
|
|
150
151
|
Args:
|
|
151
|
-
roller:
|
|
152
|
-
raceway:
|
|
153
|
-
loads:
|
|
154
|
-
n_slice:
|
|
152
|
+
roller: Roller geometry parameters
|
|
153
|
+
raceway: Raceway parameters
|
|
154
|
+
loads: Load sequence (N), supports list[int], list[float], NDArray, etc.
|
|
155
|
+
n_slice: Number of slices, default 30
|
|
155
156
|
|
|
156
157
|
Returns:
|
|
157
|
-
list[SliceResult]:
|
|
158
|
+
list[SliceResult]: List of calculation results for each load
|
|
158
159
|
|
|
159
160
|
Example:
|
|
160
|
-
>>> #
|
|
161
|
+
>>> # Assuming known load distribution for each roller
|
|
161
162
|
>>> loads = [1340.0, 1128.3, 689.2, 324.8]
|
|
162
163
|
>>> results = batch_slice_stress(roller, raceway, loads)
|
|
163
164
|
>>> for i, result in enumerate(results):
|
|
164
|
-
... print(f"
|
|
165
|
+
... print(f"Load {loads[i]:.1f}N: Max stress {result.max_stress:.0f} MPa")
|
|
165
166
|
"""
|
|
166
167
|
results = []
|
|
167
168
|
for load in loads:
|
|
@@ -169,7 +170,7 @@ def batch_slice_stress(
|
|
|
169
170
|
result = slice_stress(roller, raceway, load, n_slice)
|
|
170
171
|
results.append(result)
|
|
171
172
|
else:
|
|
172
|
-
#
|
|
173
|
+
# Zero load, return zero result
|
|
173
174
|
results.append(SliceResult(
|
|
174
175
|
n_slice=n_slice,
|
|
175
176
|
stress=np.zeros(n_slice),
|
|
@@ -185,9 +186,9 @@ def batch_slice_stress(
|
|
|
185
186
|
|
|
186
187
|
|
|
187
188
|
def is_fortran_available() -> bool:
|
|
188
|
-
"""
|
|
189
|
+
"""Check if Fortran computational core is available.
|
|
189
190
|
|
|
190
191
|
Returns:
|
|
191
|
-
bool: True
|
|
192
|
+
bool: True if Fortran module is compiled and available
|
|
192
193
|
"""
|
|
193
194
|
return _FORTRAN_AVAILABLE
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bstart-trb
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: numpy>=2.0.0
|
|
8
|
+
Provides-Extra: demo
|
|
9
|
+
Requires-Dist: openpyxl>=3.1.5; extra == 'demo'
|
|
10
|
+
Requires-Dist: pandas>=2.0.0; extra == 'demo'
|
|
11
|
+
Requires-Dist: plotly>=5.0.0; extra == 'demo'
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# BSTART-TRB
|
|
15
|
+
|
|
16
|
+
**Cylindrical/Tapered Roller Bearing Slice Stress Calculation Module**
|
|
17
|
+
|
|
18
|
+
A high-performance Python package for calculating contact stress distribution in roller bearings using the slice method with Fortran computational core.
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- 🚀 **Fast Fortran Core**: Compiled Fortran code via f2py for optimal performance
|
|
23
|
+
- 📦 **Pre-compiled Binary**: No Fortran compiler required for installation
|
|
24
|
+
- 🎯 **Type-Safe**: Complete type hints and IDE support
|
|
25
|
+
- 🔬 **Accurate**: Uses influence coefficient method based on elastic contact theory
|
|
26
|
+
- 📊 **Flexible**: Supports various crown types (linear, circular, logarithmic)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install bstart-trb
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Note**: This package includes pre-compiled binaries for Windows (x64) + Python 3.11. Support for other platforms coming soon.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from bstart_trb import (
|
|
40
|
+
slice_stress,
|
|
41
|
+
RollerParams,
|
|
42
|
+
RacewayParams,
|
|
43
|
+
CrownType,
|
|
44
|
+
RacewayType,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Define cylindrical roller parameters
|
|
48
|
+
roller = RollerParams(
|
|
49
|
+
d1=10.0, # Small end diameter (mm)
|
|
50
|
+
d2=10.0, # Large end diameter (mm)
|
|
51
|
+
length=9.6, # Effective length (mm)
|
|
52
|
+
alfa=0.0, # Half cone angle (degrees)
|
|
53
|
+
tilt=0.0, # Tilt angle (degrees)
|
|
54
|
+
crown_type=CrownType.LOGARITHMIC,
|
|
55
|
+
curve_q=14100.0, # Design load (N)
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Define outer ring raceway parameters
|
|
59
|
+
raceway = RacewayParams(
|
|
60
|
+
diameter=-150.0, # Negative for concave surface (mm)
|
|
61
|
+
raceway_type=RacewayType.OUTER,
|
|
62
|
+
fai=0.0, # Half cone angle (degrees)
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Calculate slice stress distribution
|
|
66
|
+
result = slice_stress(roller, raceway, load=1340.86, n_slice=30)
|
|
67
|
+
|
|
68
|
+
# Access scalar results
|
|
69
|
+
print(f"Converged: {result.converged}")
|
|
70
|
+
print(f"Max stress: {result.max_stress:.0f} MPa")
|
|
71
|
+
print(f"Mean stress: {result.mean_stress:.0f} MPa")
|
|
72
|
+
print(f"Contact deflection: {result.deflection:.6f} mm")
|
|
73
|
+
print(f"Stress uniformity: {result.stress_uniformity:.2%}")
|
|
74
|
+
print(f"Contact slices: {result.contact_slices}/{result.n_slice}")
|
|
75
|
+
|
|
76
|
+
# Access array results
|
|
77
|
+
print(f"Stress distribution: {result.stress}") # MPa per slice
|
|
78
|
+
print(f"Contact half-widths: {result.half_width}") # mm per slice
|
|
79
|
+
print(f"Slice forces: {result.slice_force}") # N per slice
|
|
80
|
+
|
|
81
|
+
# Get slice positions along roller length
|
|
82
|
+
positions = result.get_slice_positions(roller.length) # mm
|
|
83
|
+
print(f"Slice positions: {positions}")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Return Value: `SliceResult`
|
|
87
|
+
|
|
88
|
+
The `slice_stress()` function returns a `SliceResult` object containing:
|
|
89
|
+
|
|
90
|
+
### Array Attributes
|
|
91
|
+
|
|
92
|
+
| Attribute | Type | Unit | Description |
|
|
93
|
+
|-----------|------|------|-------------|
|
|
94
|
+
| `stress` | `NDArray[float64]` | MPa | Contact stress at each slice center |
|
|
95
|
+
| `half_width` | `NDArray[float64]` | mm | Contact half-width at each slice |
|
|
96
|
+
| `slice_force` | `NDArray[float64]` | N | Contact force at each slice |
|
|
97
|
+
|
|
98
|
+
### Scalar Attributes
|
|
99
|
+
|
|
100
|
+
| Attribute | Type | Unit | Description |
|
|
101
|
+
|-----------|------|------|-------------|
|
|
102
|
+
| `n_slice` | `int` | - | Number of slices |
|
|
103
|
+
| `deflection` | `float` | mm | Roller deformation |
|
|
104
|
+
| `equilibrium_load` | `float` | N | Equilibrium load (should match input) |
|
|
105
|
+
| `equilibrium_moment` | `float` | N·mm | Equilibrium moment |
|
|
106
|
+
| `converged` | `bool` | - | Whether the iteration converged |
|
|
107
|
+
| `error_code` | `int` | - | 0=success, 1=solve failed, 2=invalid n_slice, 3=invalid load |
|
|
108
|
+
|
|
109
|
+
### Computed Properties
|
|
110
|
+
|
|
111
|
+
| Property | Type | Unit | Description |
|
|
112
|
+
|----------|------|------|-------------|
|
|
113
|
+
| `max_stress` | `float` | MPa | Maximum contact stress |
|
|
114
|
+
| `min_stress` | `float` | MPa | Minimum contact stress (non-zero) |
|
|
115
|
+
| `mean_stress` | `float` | MPa | Mean contact stress (contact zone only) |
|
|
116
|
+
| `contact_slices` | `int` | - | Number of slices in contact (stress > 0) |
|
|
117
|
+
| `stress_uniformity` | `float` | 0~1 | Stress uniformity (1 = perfectly uniform) |
|
|
118
|
+
|
|
119
|
+
### Methods
|
|
120
|
+
|
|
121
|
+
| Method | Returns | Description |
|
|
122
|
+
|--------|---------|-------------|
|
|
123
|
+
| `get_slice_positions(roller_length)` | `NDArray[float64]` | Center position of each slice (mm) |
|
|
124
|
+
| `get_slice_width(roller_length)` | `float` | Width of each slice (mm) |
|
|
125
|
+
| `get_slice_spacing(roller_length)` | `float` | Spacing between slice centers (mm) |
|
|
126
|
+
|
|
127
|
+
## Other Functions
|
|
128
|
+
|
|
129
|
+
### `batch_slice_stress()`
|
|
130
|
+
|
|
131
|
+
Calculate stress for multiple loads at once:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from bstart_trb import batch_slice_stress
|
|
135
|
+
|
|
136
|
+
loads = [1340.0, 1128.3, 689.2, 324.8]
|
|
137
|
+
results = batch_slice_stress(roller, raceway, loads, n_slice=30)
|
|
138
|
+
|
|
139
|
+
for i, result in enumerate(results):
|
|
140
|
+
print(f"Load {loads[i]:.1f}N: Max stress {result.max_stress:.0f} MPa")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `is_fortran_available()`
|
|
144
|
+
|
|
145
|
+
Check if Fortran core is available:
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from bstart_trb import is_fortran_available
|
|
149
|
+
|
|
150
|
+
if is_fortran_available():
|
|
151
|
+
print("Fortran core ready")
|
|
152
|
+
else:
|
|
153
|
+
print("Fortran core not compiled")
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Enum Types
|
|
157
|
+
|
|
158
|
+
### `CrownType` - Crown Modification Types
|
|
159
|
+
|
|
160
|
+
| Value | Name | Description |
|
|
161
|
+
|-------|------|-------------|
|
|
162
|
+
| 0 | `STRAIGHT` | No crown modification - high edge stress |
|
|
163
|
+
| 1 | `ARC` | Circular crown - requires arc radius |
|
|
164
|
+
| 2 | `LOGARITHMIC` | Logarithmic crown (recommended) - optimal stress distribution |
|
|
165
|
+
|
|
166
|
+
### `RacewayType` - Raceway Types
|
|
167
|
+
|
|
168
|
+
| Value | Name | Description |
|
|
169
|
+
|-------|------|-------------|
|
|
170
|
+
| 0 | `PLANE` | Flat surface contact |
|
|
171
|
+
| 1 | `INNER` | Inner ring raceway (convex surface) |
|
|
172
|
+
| 2 | `OUTER` | Outer ring raceway (concave surface) - use negative diameter |
|
|
173
|
+
|
|
174
|
+
## Key Parameters Explained
|
|
175
|
+
|
|
176
|
+
### Roller Parameters
|
|
177
|
+
|
|
178
|
+
| Parameter | Unit | Description |
|
|
179
|
+
|-----------|------|-------------|
|
|
180
|
+
| `d1` | mm | Roller small end diameter (equal to d2 for cylindrical) |
|
|
181
|
+
| `d2` | mm | Roller large end diameter |
|
|
182
|
+
| `length` | mm | Effective roller length |
|
|
183
|
+
| `alfa` | deg | Roller half cone angle (0 for cylindrical) |
|
|
184
|
+
| `tilt` | deg | Roller tilt angle (see below) |
|
|
185
|
+
| `crown_type` | - | Crown modification type (see enum) |
|
|
186
|
+
| `curve_q` | N | Design load for crown optimization (see below) |
|
|
187
|
+
|
|
188
|
+
### Raceway Parameters
|
|
189
|
+
|
|
190
|
+
| Parameter | Unit | Description |
|
|
191
|
+
|-----------|------|-------------|
|
|
192
|
+
| `diameter` | mm | Raceway diameter (**negative for outer ring**) |
|
|
193
|
+
| `raceway_type` | - | Inner/Outer raceway type |
|
|
194
|
+
| `fai` | deg | Raceway half cone angle |
|
|
195
|
+
|
|
196
|
+
### Calculation Parameters
|
|
197
|
+
|
|
198
|
+
| Parameter | Unit | Description |
|
|
199
|
+
|-----------|------|-------------|
|
|
200
|
+
| `load` | N | Applied load on roller |
|
|
201
|
+
| `n_slice` | - | Number of slices (default 30, max 50) |
|
|
202
|
+
|
|
203
|
+
### Understanding `curve_q` (Design Load)
|
|
204
|
+
|
|
205
|
+
The `curve_q` parameter determines the logarithmic crown profile. It affects stress distribution:
|
|
206
|
+
|
|
207
|
+
| Condition | Stress Distribution |
|
|
208
|
+
|-----------|---------------------|
|
|
209
|
+
| `load == curve_q` | **Uniform** - optimal crown compensation |
|
|
210
|
+
| `load < curve_q` | Center high, edge low - edge may lose contact |
|
|
211
|
+
| `load > curve_q` | Edge high, center low - edge stress concentration |
|
|
212
|
+
|
|
213
|
+
**Tip**: Set `curve_q` to your most common operating load.
|
|
214
|
+
|
|
215
|
+
### Understanding `tilt` (Tilt Angle)
|
|
216
|
+
|
|
217
|
+
Roller tilt causes asymmetric stress distribution:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
tilt = 0 (normal): tilt > 0 (tilted):
|
|
221
|
+
┌──────────────────┐ ┌──────────────────┐
|
|
222
|
+
│ uniform stress │ │ high │ low │
|
|
223
|
+
└──────────────────┘ └──────────────────┘
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Sources of tilt: shaft deflection, mounting errors, housing deformation.
|
|
227
|
+
|
|
228
|
+
### Why Outer Ring Uses Negative Diameter?
|
|
229
|
+
|
|
230
|
+
Hertz contact theory sign convention:
|
|
231
|
+
- **Positive curvature** → Convex surface (roller, inner ring)
|
|
232
|
+
- **Negative curvature** → Concave surface (outer ring)
|
|
233
|
+
|
|
234
|
+
Example: Outer ring with 150mm diameter → `diameter = -150.0`
|
|
235
|
+
|
|
236
|
+
## What is Slice Calculation?
|
|
237
|
+
|
|
238
|
+
The slice method divides the roller-raceway contact into multiple slices along the roller length to accurately calculate stress distribution. This is essential for:
|
|
239
|
+
|
|
240
|
+
- Capturing edge stress concentration effects
|
|
241
|
+
- Analyzing the impact of crown modifications
|
|
242
|
+
- Predicting bearing life more accurately
|
|
243
|
+
- Understanding load distribution along roller length
|
|
244
|
+
|
|
245
|
+
## Theory
|
|
246
|
+
|
|
247
|
+
This package implements the **influence coefficient method** based on elastic half-space contact theory:
|
|
248
|
+
|
|
249
|
+
1. Discretizes roller into slices
|
|
250
|
+
2. Calculates elastic coupling between slices (influence coefficient matrix)
|
|
251
|
+
3. Solves linear system using Gaussian elimination
|
|
252
|
+
4. Iterates to convergence for contact area and load balance
|
|
253
|
+
|
|
254
|
+
The method is more accurate than simplified Hertz formulas as it accounts for:
|
|
255
|
+
- Elastic coupling between slices
|
|
256
|
+
- Dynamic contact area determination
|
|
257
|
+
- Edge loading effects
|
|
258
|
+
- Crown modification influence
|
|
259
|
+
|
|
260
|
+
## Requirements
|
|
261
|
+
|
|
262
|
+
- Python >= 3.11
|
|
263
|
+
- NumPy >= 2.0.0
|
|
264
|
+
|
|
265
|
+
## Platform Support
|
|
266
|
+
|
|
267
|
+
| Platform | Status |
|
|
268
|
+
|----------|--------|
|
|
269
|
+
| Windows (x64) | ✅ Supported |
|
|
270
|
+
| Linux | 🚧 Coming soon |
|
|
271
|
+
| macOS | 🚧 Coming soon |
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
|
|
275
|
+
MIT License - See LICENSE file for details.
|
|
276
|
+
|
|
277
|
+
## Author
|
|
278
|
+
|
|
279
|
+
Gu Lei
|
|
280
|
+
|
|
281
|
+
## References
|
|
282
|
+
|
|
283
|
+
- Harris, T.A., Kotzalas, M.N. - *Rolling Bearing Analysis*, 5th Edition
|
|
284
|
+
- Johnson, K.L. - *Contact Mechanics*
|
|
285
|
+
- ISO/TS 16281:2008 - Rolling bearings calculation methods
|
|
286
|
+
|
|
287
|
+
## Contributing
|
|
288
|
+
|
|
289
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
bstart_trb/__init__.py,sha256=32QmnLdTE53qkVgDvDZBH2Z1v3I-4qG8JlcVlQDcbU4,1560
|
|
2
|
+
bstart_trb/_taper_slice.pyi,sha256=X5xMWlbdGl46RQmunOaFbh9BFjeqTMP0Hp7b_waJuaA,4896
|
|
3
|
+
bstart_trb/libtaper_sl.J4R3HUMRYTOGZPKAVTEOISVEHZMIJTJT.gfortran-win_amd64.dll,sha256=9fWV89mKt1_6Q8f_votoG1vlvxsy4qgDVWXQAZ0vmUA,108562
|
|
4
|
+
bstart_trb/models.py,sha256=tRpkcJE50I9jL3y03EgITJ1iMv57gRFkr1tl6OeXDWw,11503
|
|
5
|
+
bstart_trb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
bstart_trb/wrapper.py,sha256=CadOcW31MVZ8WsTwG5Ksp_ZAacf_D96XJJ4gqYb70MM,6565
|
|
7
|
+
bstart_trb/_taper_slice.cp311-win_amd64.pyd,sha256=WDAXF_NTj7DRIEA6--kX1W3TMPGQD5u8JVRt-hR_9L4,64000
|
|
8
|
+
bstart_trb-0.2.2.dist-info/METADATA,sha256=jRClXe7c3JBUEWgsMsYT9vkUTWjldlM5aLma2y1ZogQ,9502
|
|
9
|
+
bstart_trb-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
10
|
+
bstart_trb-0.2.2.dist-info/licenses/LICENSE,sha256=YCXLtJfjUPyklZ7pN5gxOeMOr5QCAvip4Sdnl_xcCu8,1084
|
|
11
|
+
bstart_trb-0.2.2.dist-info/RECORD,,
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bstart-trb
|
|
3
|
-
Version: 0.2.1
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Requires-Dist: numpy>=2.0.0
|
|
8
|
-
Provides-Extra: demo
|
|
9
|
-
Requires-Dist: openpyxl>=3.1.5; extra == 'demo'
|
|
10
|
-
Requires-Dist: pandas>=2.0.0; extra == 'demo'
|
|
11
|
-
Requires-Dist: plotly>=5.0.0; extra == 'demo'
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
|
|
14
|
-
# BSTART-TRB
|
|
15
|
-
|
|
16
|
-
**Cylindrical/Tapered Roller Bearing Slice Stress Calculation Module**
|
|
17
|
-
|
|
18
|
-
A high-performance Python package for calculating contact stress distribution in roller bearings using the slice method with Fortran computational core.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- 🚀 **Fast Fortran Core**: Compiled Fortran code via f2py for optimal performance
|
|
23
|
-
- 📦 **Pre-compiled Binary**: No Fortran compiler required for installation
|
|
24
|
-
- 🎯 **Type-Safe**: Complete type hints and IDE support
|
|
25
|
-
- 🔬 **Accurate**: Uses influence coefficient method based on elastic contact theory
|
|
26
|
-
- 📊 **Flexible**: Supports various crown types (linear, circular, logarithmic)
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
pip install bstart-trb
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Note**: This package includes pre-compiled binaries for Windows (x64). Support for other platforms coming soon.
|
|
35
|
-
|
|
36
|
-
## Quick Start
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
from bstart_trb import (
|
|
40
|
-
slice_stress,
|
|
41
|
-
RollerParams,
|
|
42
|
-
RacewayParams,
|
|
43
|
-
CrownType,
|
|
44
|
-
RacewayType,
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Define cylindrical roller parameters
|
|
48
|
-
roller = RollerParams(
|
|
49
|
-
d1=10.0, # Small end diameter (mm)
|
|
50
|
-
d2=10.0, # Large end diameter (mm)
|
|
51
|
-
length=9.6, # Effective length (mm)
|
|
52
|
-
alfa=0.0, # Half cone angle (degrees)
|
|
53
|
-
tilt=0.0, # Tilt angle (degrees)
|
|
54
|
-
crown_type=CrownType.LOGARITHMIC,
|
|
55
|
-
curve_q=14100.0, # Design load (N)
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
# Define outer ring raceway parameters
|
|
59
|
-
raceway = RacewayParams(
|
|
60
|
-
diameter=-150.0, # Negative for concave surface (mm)
|
|
61
|
-
raceway_type=RacewayType.OUTER,
|
|
62
|
-
fai=0.0, # Half cone angle (degrees)
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
# Calculate slice stress distribution
|
|
66
|
-
result = slice_stress(roller, raceway, load=1340.86, n_slice=30)
|
|
67
|
-
|
|
68
|
-
# Access results
|
|
69
|
-
print(f"Max stress: {result.max_stress:.0f} MPa")
|
|
70
|
-
print(f"Contact deflection: {result.deflection:.6f} mm")
|
|
71
|
-
print(f"Stress uniformity: {result.stress_uniformity:.2%}")
|
|
72
|
-
print(f"Contact slices: {result.contact_slices}/{result.n_slice}")
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## What is Slice Calculation?
|
|
76
|
-
|
|
77
|
-
The slice method divides the roller-raceway contact into multiple slices along the roller length to accurately calculate stress distribution. This is essential for:
|
|
78
|
-
|
|
79
|
-
- Capturing edge stress concentration effects
|
|
80
|
-
- Analyzing the impact of crown modifications
|
|
81
|
-
- Predicting bearing life more accurately
|
|
82
|
-
- Understanding load distribution along roller length
|
|
83
|
-
|
|
84
|
-
## Key Parameters
|
|
85
|
-
|
|
86
|
-
### Roller Parameters
|
|
87
|
-
|
|
88
|
-
- `d1`, `d2`: Roller diameters (mm) - equal for cylindrical rollers
|
|
89
|
-
- `length`: Effective roller length (mm)
|
|
90
|
-
- `alfa`: Half cone angle (degrees) - 0 for cylindrical rollers
|
|
91
|
-
- `tilt`: Roller tilt angle (degrees)
|
|
92
|
-
- `crown_type`: Crown modification type
|
|
93
|
-
- `STRAIGHT`: No crown modification
|
|
94
|
-
- `CIRCULAR`: Circular crown
|
|
95
|
-
- `LOGARITHMIC`: Logarithmic crown (recommended)
|
|
96
|
-
- `curve_q`: Design load (N) for optimal stress distribution
|
|
97
|
-
|
|
98
|
-
### Raceway Parameters
|
|
99
|
-
|
|
100
|
-
- `diameter`: Raceway diameter (mm) - negative for outer ring (concave)
|
|
101
|
-
- `raceway_type`: `INNER` or `OUTER`
|
|
102
|
-
- `fai`: Raceway cone angle (degrees)
|
|
103
|
-
|
|
104
|
-
### Calculation Parameters
|
|
105
|
-
|
|
106
|
-
- `load`: Applied load on roller (N)
|
|
107
|
-
- `n_slice`: Number of slices (default 30, max 50)
|
|
108
|
-
|
|
109
|
-
## Theory
|
|
110
|
-
|
|
111
|
-
This package implements the **influence coefficient method** based on elastic half-space contact theory:
|
|
112
|
-
|
|
113
|
-
1. Discretizes roller into slices
|
|
114
|
-
2. Calculates elastic coupling between slices (influence coefficient matrix)
|
|
115
|
-
3. Solves linear system using Gaussian elimination
|
|
116
|
-
4. Iterates to convergence for contact area and load balance
|
|
117
|
-
|
|
118
|
-
The method is more accurate than simplified Hertz formulas as it accounts for:
|
|
119
|
-
- Elastic coupling between slices
|
|
120
|
-
- Dynamic contact area determination
|
|
121
|
-
- Edge loading effects
|
|
122
|
-
- Crown modification influence
|
|
123
|
-
|
|
124
|
-
## Requirements
|
|
125
|
-
|
|
126
|
-
- Python >= 3.11
|
|
127
|
-
- NumPy >= 2.0.0
|
|
128
|
-
|
|
129
|
-
## Platform Support
|
|
130
|
-
|
|
131
|
-
| Platform | Status |
|
|
132
|
-
|----------|--------|
|
|
133
|
-
| Windows (x64) | ✅ Supported |
|
|
134
|
-
| Linux | 🚧 Coming soon |
|
|
135
|
-
| macOS | 🚧 Coming soon |
|
|
136
|
-
|
|
137
|
-
## License
|
|
138
|
-
|
|
139
|
-
MIT License - See LICENSE file for details.
|
|
140
|
-
|
|
141
|
-
## Author
|
|
142
|
-
|
|
143
|
-
Gu Lei
|
|
144
|
-
|
|
145
|
-
## References
|
|
146
|
-
|
|
147
|
-
- Harris, T.A., Kotzalas, M.N. - *Rolling Bearing Analysis*, 5th Edition
|
|
148
|
-
- Johnson, K.L. - *Contact Mechanics*
|
|
149
|
-
- ISO/TS 16281:2008 - Rolling bearings calculation methods
|
|
150
|
-
|
|
151
|
-
## Contributing
|
|
152
|
-
|
|
153
|
-
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
bstart_trb/__init__.py,sha256=rT8U08bYmQerx7pncsk5YBzuvB7U8NfURK1pkIWQYdU,1561
|
|
2
|
-
bstart_trb/_taper_slice.pyi,sha256=X5xMWlbdGl46RQmunOaFbh9BFjeqTMP0Hp7b_waJuaA,4896
|
|
3
|
-
bstart_trb/libtaper_sl.J4R3HUMRYTOGZPKAVTEOISVEHZMIJTJT.gfortran-win_amd64.dll,sha256=9fWV89mKt1_6Q8f_votoG1vlvxsy4qgDVWXQAZ0vmUA,108562
|
|
4
|
-
bstart_trb/models.py,sha256=pbdcbYXjcL3TwSEGulStj0Zj6-lJ4w1_DSRzcpslPcM,10599
|
|
5
|
-
bstart_trb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
bstart_trb/wrapper.py,sha256=sDJ97Ptx1YCnwUiKRD1g79YQp7ZSKeI0P_XF3HPcXWc,6354
|
|
7
|
-
bstart_trb/_taper_slice.cp311-win_amd64.pyd,sha256=WDAXF_NTj7DRIEA6--kX1W3TMPGQD5u8JVRt-hR_9L4,64000
|
|
8
|
-
bstart_trb-0.2.1.dist-info/METADATA,sha256=JkVuPTqQ_uZg27l0WUQyosT6-0vjOqD61A5YCYvZ0c4,4565
|
|
9
|
-
bstart_trb-0.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
10
|
-
bstart_trb-0.2.1.dist-info/licenses/LICENSE,sha256=YCXLtJfjUPyklZ7pN5gxOeMOr5QCAvip4Sdnl_xcCu8,1084
|
|
11
|
-
bstart_trb-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|