Skip to content

Commit b3654e9

Browse files
committed
Merge branch 'main' into dev/model-reduction
2 parents 1c36ce2 + 39181cc commit b3654e9

File tree

6 files changed

+4723
-283
lines changed

6 files changed

+4723
-283
lines changed

docs/user_guide/tutorial_part_4.ipynb

Lines changed: 3988 additions & 222 deletions
Large diffs are not rendered by default.

docs/user_guide/user_guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ example_26
4343
example_27
4444
example_28
4545
example_29
46+
example_30
47+
example_31
48+
example_32
4649
fluid_flow_elliptical_bearing
4750
fluid_flow_short_bearing
4851
fluid_flow_theory

ross/gear_element.py

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from ross.units import Q_
1010

1111
from ross.disk_element import DiskElement
12+
from ross.materials import steel
1213

1314

1415
__all__ = ["GearElement"]
@@ -29,18 +30,26 @@ class GearElement(DiskElement):
2930
Diametral moment of inertia.
3031
Ip : float, pint.Quantity
3132
Polar moment of inertia.
33+
width: float, pint.Quantity
34+
width of the gear (mm).
35+
n_teth: int, pint.Quantity
36+
number of teeth from the gear
3237
base_diameter : float, pint.Quantity
3338
Base diameter of the gear (m).
3439
If given pitch_diameter is not necessary.
3540
pitch_diameter : float, pint.Quantity
3641
Pitch diameter of the gear (m).
3742
If given base_diameter is not necessary.
3843
pressure_angle : float, pint.Quantity, optional
39-
The pressure angle of the gear (rad).
44+
The normal pressure angle of the gear (rad).
4045
Default is 20 deg (converted to rad).
46+
material: ross.material, optional
47+
material of the gear. Default is steel.
4148
tag : str, optional
4249
A tag to name the element.
4350
Default is None.
51+
helix_angle: float, pint.Quantity, optional
52+
value of helix angle for helical gears. Default is 0 representing spur gear.
4453
scale_factor: float or str, optional
4554
The scale factor is used to scale the gear drawing.
4655
For gears it is also possible to provide 'mass' as the scale factor.
@@ -55,9 +64,10 @@ class GearElement(DiskElement):
5564
Examples
5665
--------
5766
>>> gear = GearElement(
58-
... n=0, m=4.67, Id=0.015, Ip=0.030,
67+
... n=0, m=4.67, Id=0.015, Ip=0.030, width=0.07, n_teeth=50,
5968
... pitch_diameter=0.187,
60-
... pressure_angle=Q_(22.5, "deg")
69+
... pressure_angle=Q_(22.5, "deg"),
70+
... helix_angle=0,
6171
... )
6272
>>> gear.pressure_angle # doctest: +ELLIPSIS
6373
0.392699...
@@ -69,10 +79,14 @@ def __init__(
6979
m,
7080
Id,
7181
Ip,
82+
width,
83+
n_teeth,
7284
pitch_diameter=None,
7385
base_diameter=None,
7486
pressure_angle=None,
87+
material=steel,
7588
tag=None,
89+
helix_angle=0,
7690
scale_factor=1.0,
7791
color="Goldenrod",
7892
):
@@ -90,6 +104,18 @@ def __init__(
90104
"At least one of the following must be informed for GearElement: base_diameter or pitch_diameter"
91105
)
92106

107+
if not pitch_diameter:
108+
self.pitch_diameter = (self.base_radius * 2) / np.cos(self.pressure_angle)
109+
else:
110+
self.pitch_diameter = float(pitch_diameter)
111+
112+
self.helix_angle = float(helix_angle)
113+
self.width = float(width)
114+
115+
self.material = material
116+
117+
self.n_teeth = n_teeth
118+
93119
super().__init__(n, m, Id, Ip, tag, scale_factor, color)
94120

95121
@classmethod
@@ -100,8 +126,10 @@ def from_geometry(
100126
width,
101127
i_d,
102128
o_d,
129+
n_teeth,
103130
pressure_angle=None,
104131
tag=None,
132+
helix_angle=0,
105133
scale_factor=1.0,
106134
color="Goldenrod",
107135
):
@@ -139,12 +167,16 @@ def from_geometry(
139167
Inner diameter (the diameter of the shaft on which the gear is mounted).
140168
o_d : float, pint.Quantity
141169
Outer pitch diameter (m).
170+
n_teeth: int, pint.Quantity
171+
Number of teeth of the gear.
142172
pressure_angle : float, pint.Quantity, optional
143-
The pressure angle of the gear (rad).
173+
The normal pressure angle of the gear (rad).
144174
Default is 20 deg (converted to rad).
145175
tag : str, optional
146-
A tag to name the element
147-
Default is None
176+
A tag to name the element.
177+
Default is None.
178+
helix_angle: float, pint.Quantity, optional
179+
Value of helix angle for helical gears. Default is 0 representing spur gear.
148180
scale_factor: float, optional
149181
The scale factor is used to scale the gear drawing.
150182
Default is 1.
@@ -159,12 +191,12 @@ def from_geometry(
159191
Id : float
160192
Diametral moment of inertia.
161193
Ip : float
162-
Polar moment of inertia
194+
Polar moment of inertia.
163195
164196
Examples
165197
--------
166198
>>> from ross.materials import steel
167-
>>> gear = GearElement.from_geometry(0, steel, 0.07, 0.05, 0.28)
199+
>>> gear = GearElement.from_geometry(0, steel, 0.07, 0.05, 0.28, 50)
168200
>>> gear.base_radius # doctest: +ELLIPSIS
169201
0.131556...
170202
>>>
@@ -181,9 +213,13 @@ def from_geometry(
181213
m,
182214
Id,
183215
Ip,
216+
width=width,
217+
n_teeth=n_teeth,
184218
pitch_diameter=o_d,
185219
pressure_angle=pressure_angle,
220+
material=material,
186221
tag=tag,
222+
helix_angle=helix_angle,
187223
scale_factor=scale_factor,
188224
color=color,
189225
)

0 commit comments

Comments
 (0)