Quickstart
See Installation, if you have not yet installed openTorsion. OpenTorsion can be used by creating a shaft-line finite element model.
Example: Calculating the eigenfrequencies, mode shapes and a Campbell diagram with a shaft-line finite element model of a windmill [1].
import opentorsion as ot
k1 = 3.67e8 # Turbine shaft stiffness
k2 = 5.496e9 # Rotor stiffness
J1 = 1e7 # Turbine inertia
J2 = 5770 # Rotor inner inertia
J3 = 97030 # Rotor outer inertia
# Elements are initiated and added to corresponding list
shafts, disks = [], []
disks.append(ot.Disk(0, J1))
shafts.append(ot.Shaft(0, 1, None, None, k=k1, I=0))
disks.append(ot.Disk(1, J2))
shafts.append(ot.Shaft(1, 2, None, None, k=k2, I=0))
disks.append(ot.Disk(2, J3))
# An assembly is initiated with the lists of powertrain elements
assembly = ot.Assembly(shafts, disk_elements=disks)
# Calculation of the eigenfrequencies of the powertrain
omegas_undamped, omegas_damped, damping_ratios = assembly.modal_analysis()
# Print eigenfrequencies.
# The list contains each eigenfrequency twice: e.g. eigenfrequencies = [1st, 1st, 2nd, 2nd, 3rd, 3rd, ...]
print("Eigenfrequencies: ", omegas_undamped.round(3))
# Initiate plotting tools calling Plots(assembly)
plot_tools = ot.Plots(assembly)
# Plot eigenmodes, input number of eigenmodes
plot_tools.plot_assembly()
plot_tools.plot_eigenmodes(modes=3)
plot_tools.plot_campbell(frequency_range_rpm=[0, 300], num_modes=2)
See more Example modules and Tutorials.
References