|
| 1 | +""" |
| 2 | +.. _ref_cyclic_static_analysis: |
| 3 | +
|
| 4 | +Static Cyclic Analysis |
| 5 | +---------------------- |
| 6 | +
|
| 7 | +Run a static cyclic analysis of an example rotor sector using the imperial unit |
| 8 | +system at 1000 RPM. |
| 9 | +
|
| 10 | +
|
| 11 | +""" |
| 12 | +from ansys.mapdl.reader import examples |
| 13 | + |
| 14 | +from ansys.mapdl.core import launch_mapdl |
| 15 | + |
| 16 | +# launch mapdl |
| 17 | +mapdl = launch_mapdl() |
| 18 | + |
| 19 | + |
| 20 | +############################################################################### |
| 21 | +# Load in the mesh |
| 22 | +# ~~~~~~~~~~~~~~~~ |
| 23 | +# Load in the example sector and plot it. |
| 24 | +mapdl.cdread("db", examples.sector_archive_file) |
| 25 | +mapdl.eplot() |
| 26 | + |
| 27 | + |
| 28 | +############################################################################### |
| 29 | +# Make the rotor cyclic |
| 30 | +# ~~~~~~~~~~~~~~~~~~~~~ |
| 31 | +# Enter the preprocessing routine and make the mesh cyclic. |
| 32 | +mapdl.prep7() |
| 33 | +mapdl.cyclic() |
| 34 | + |
| 35 | + |
| 36 | +############################################################################### |
| 37 | +# Set material properties |
| 38 | +# ~~~~~~~~~~~~~~~~~~~~~~~ |
| 39 | +# Units are in imperial units and the material is (approximately) structural |
| 40 | +# steel. |
| 41 | +mapdl.mp("NUXY", 1, 0.31) |
| 42 | +mapdl.mp("DENS", 1, 4.1408e-04) |
| 43 | +mapdl.mp("EX", 1, 16900000) |
| 44 | + |
| 45 | + |
| 46 | +############################################################################### |
| 47 | +# Apply boundary conditions |
| 48 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 49 | +# Apply a cyclic rotation at 1000 RPM and constrain the rotor at the center. |
| 50 | +mapdl.omega(0, 0, 1000) # 1000 RPM |
| 51 | + |
| 52 | +mapdl.csys(1) # enter the cyclic coordinate system |
| 53 | +mapdl.nsel("S", "loc", "x", 0.69, 0.71) # radial between 0.69 - 0.71 |
| 54 | +mapdl.d("ALL", "ALL") # all DOF for those 8 nodes |
| 55 | +mapdl.allsel() |
| 56 | +mapdl.csys(0) # return to cartesian coordinate system |
| 57 | + |
| 58 | + |
| 59 | +############################################################################### |
| 60 | +# Run a static analysis |
| 61 | +# ~~~~~~~~~~~~~~~~~~~~~ |
| 62 | +# Run the MAPDL solver and print the output of the solution. |
| 63 | +mapdl.run("/SOLU") |
| 64 | +mapdl.antype("STATIC") |
| 65 | +output = mapdl.solve() |
| 66 | +mapdl.finish() |
| 67 | +print(output) |
| 68 | + |
| 69 | + |
| 70 | +############################################################################### |
| 71 | +# Plot the cyclic result |
| 72 | +# ~~~~~~~~~~~~~~~~~~~~~~ |
| 73 | +# Plot the result using the legacy |
| 74 | +mapdl.result.plot_nodal_displacement(0) |
| 75 | + |
| 76 | + |
| 77 | +############################################################################### |
| 78 | +# Exit MAPDL |
| 79 | +# ~~~~~~~~~~ |
| 80 | +# Finally, exit MAPDL. |
| 81 | +mapdl.exit() |
0 commit comments