.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "verif-manual/vm-012-combined-bending-and-torsion.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_verif-manual_vm-012-combined-bending-and-torsion.py: .. _ref_vm12_example: Combined bending and torsion ---------------------------- Problem description: - A vertical bar of length :math:`l` is subjected to the action of a horizontal force F acting at a distance d from the axis of the bar. Determine the maximum principal stress :math:`\sigma _{max}` and the maximum shear stress :math:`\tau _ {max}` in the bar. Reference: - Timoshenko, Strength of Materials, Part I, Elementary Theory and Problems, 3rd Edition, D. Van Nostrand Co., Inc., New York, NY, 1955, pg. 299, problem 2. Analysis type(s): - Static analysis ``ANTYPE=0`` Element type(s): - Elastic straight pipe element (``PIPE16``) - 3D 2 Node pipe element (``PIPE288``) .. image:: ../_static/vm12_setup.png :width: 400 :alt: VM12 Problem Sketch Material properties - :math:`E = 30 \cdot 10^6 psi` - :math:`u=0.3` Geometric properties: - :math:`l = 25 l` - :math:`d = 3 ft` - Section modulus :math:`(l/c) = 10 in^3` - Outer Diameter :math:`= 4.67017 in` - Wall Thickness :math:`= 2.33508 in` Loading: - :math:`F = 250 lb` - :math:`M = Fd = 9000 in-lb` Analysis assumptions and modeling notes: - Use consistent length units of inches. Real constants for PIPE16 and section properties for PIPE288 are used to define the pipe Outer Diameter and Wall Thickness. These values are calculated for a solid cross-section from the given section modulus. The offset load is applied as a centroidal force and a moment. .. GENERATED FROM PYTHON SOURCE LINES 72-77 .. code-block:: Python # sphinx_gallery_thumbnail_path = '_static/vm12_setup.png' from ansys.mapdl.core import launch_mapdl import pandas .. GENERATED FROM PYTHON SOURCE LINES 78-81 Start MAPDL ~~~~~~~~~~~ Start MAPDL. .. GENERATED FROM PYTHON SOURCE LINES 81-84 .. code-block:: Python mapdl = launch_mapdl(loglevel="WARNING", print_com=True) mapdl.clear() # optional as MAPDL just started .. GENERATED FROM PYTHON SOURCE LINES 85-87 Pre-processing with ET PIPE16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 87-104 .. code-block:: Python mapdl.verify("vm12") mapdl.prep7() mapdl.antype("STATIC") mapdl.et(1, "PIPE16") mapdl.r(1, 4.67017, 2.33508) # REAL CONSTANTS FOR SOLID CROSS SECTION mapdl.mp("EX", 1, 30e6) mapdl.mp("NUXY", 1, 0.3) mapdl.n(1) mapdl.n(2, "", "", 300) mapdl.e(1, 2) mapdl.d(1, "ALL") mapdl.f(2, "MZ", 9000) mapdl.f(2, "FX", -250) mapdl.finish() .. rst-class:: sphx-glr-script-out .. code-block:: none ***** ROUTINE COMPLETED ***** CP = 0.000 .. GENERATED FROM PYTHON SOURCE LINES 105-107 Solve ~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 107-118 .. code-block:: Python mapdl.slashsolu() mapdl.outpr("BASIC", 1) mapdl.solve() mapdl.finish() mapdl.post1() mapdl.etable("P_STRS", "NMISC", 86) mapdl.etable("SHR", "NMISC", 88) .. rst-class:: sphx-glr-script-out .. code-block:: none STORE SHR FROM ITEM=NMIS COMP= 88 FOR ALL SELECTED ELEMENTS .. GENERATED FROM PYTHON SOURCE LINES 119-121 Post-processing ~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 121-137 .. code-block:: Python p_stress = mapdl.get("P_STRESS", "ELEM", 1, "ETAB", "P_STRS") shear = mapdl.get("SHEAR", "ELEM", 1, "ETAB", "SHR") p_trs = shear / 2 # Fill the array with target values target_p_stress = 7527 target_p_trs = 3777 data = [ [target_p_stress, p_stress, abs(p_stress / target_p_stress)], [target_p_trs, p_trs, abs(p_trs / target_p_trs)], ] col_headers = ["TARGET", "Mechanical APDL", "RATIO"] row_headers = ["MAX PRINSTRS psi", "MAX SH STRS psi"] .. GENERATED FROM PYTHON SOURCE LINES 138-140 Verify the results. ~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 140-144 .. code-block:: Python print(pandas.DataFrame(data, row_headers, col_headers)) .. rst-class:: sphx-glr-script-out .. code-block:: none TARGET Mechanical APDL RATIO MAX PRINSTRS psi 7527 7526.938960 0.999992 MAX SH STRS psi 3777 3776.921145 0.999979 .. GENERATED FROM PYTHON SOURCE LINES 145-147 Pre-processing with ET PIPE288 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 147-170 .. code-block:: Python mapdl.clear("nostart") mapdl.prep7() mapdl.run("C*** USING PIPE288") mapdl.antype("STATIC") mapdl.et(1, "PIPE288", "", "", "", 2) mapdl.sectype(1, "PIPE") mapdl.secdata(4.67017, 2.33508) mapdl.keyopt(1, 3, 3) # CUBIC SHAPE FUNCTION mapdl.mp("EX", 1, 30e6) mapdl.mp("NUXY", 1, 0.3) mapdl.n(1) mapdl.n(2, "", "", 300) mapdl.e(1, 2) mapdl.d(1, "ALL") mapdl.f(2, "MZ", 9000) mapdl.f(2, "FX", -250) mapdl.finish() mapdl.allsel() mapdl.eplot() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /verif-manual/images/sphx_glr_vm-012-combined-bending-and-torsion_001.png :alt: vm 012 combined bending and torsion :srcset: /verif-manual/images/sphx_glr_vm-012-combined-bending-and-torsion_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/pymapdl-examples/pymapdl-examples/doc/source/verif-manual/images/sphx_glr_vm-012-combined-bending-and-torsion_001.vtksz .. GENERATED FROM PYTHON SOURCE LINES 171-173 Solve ~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 173-179 .. code-block:: Python mapdl.slashsolu() mapdl.outpr("BASIC", 1) mapdl.solve() mapdl.finish() .. rst-class:: sphx-glr-script-out .. code-block:: none FINISH SOLUTION PROCESSING *** NOTE *** CP = 0.000 TIME= 00:00:00 Distributed parallel processing has been reactivated. ***** ROUTINE COMPLETED ***** CP = 0.000 .. GENERATED FROM PYTHON SOURCE LINES 180-182 Post-processing ~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 182-214 .. code-block:: Python mapdl.post1() mapdl.set("LAST") mapdl.graphics("POWER") mapdl.eshape(1) mapdl.view(1, 1, 1, 1) mapdl.show(option="REV", fname="png") mapdl.plesol("S", 1) mapdl.show("close") p_stress = mapdl.get("P_STRESS", "PLNSOL", 0, "MAX") mapdl.show(option="REV", fname="png") mapdl.plesol("S", "INT") mapdl.show("close") shear = mapdl.get("SHEAR", "PLNSOL", 0, "MAX") p_trs = shear / 2 # Fill the array with target values target_p_stress = 7527.0 target_p_trs = 3777.0 data = [ [target_p_stress, p_stress, abs(p_stress / target_p_stress)], [target_p_trs, p_trs, abs(p_trs / target_p_trs)], ] col_headers = ["TARGET", "Mechanical APDL", "RATIO"] row_headers = ["MAX PRINSTRS psi", "MAX SH STRS psi"] .. image-sg:: /verif-manual/images/sphx_glr_vm-012-combined-bending-and-torsion_002.png :alt: vm 012 combined bending and torsion :srcset: /verif-manual/images/sphx_glr_vm-012-combined-bending-and-torsion_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 215-217 Verify the results. ~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 217-223 .. code-block:: Python print(pandas.DataFrame(data, row_headers, col_headers)) mapdl.finish() mapdl.starlist("vm12", "vrt") .. rst-class:: sphx-glr-script-out .. code-block:: none TARGET Mechanical APDL RATIO MAX PRINSTRS psi 7527.0 7526.93994 0.999992 MAX SH STRS psi 3777.0 3776.92212 0.999979 LISTING OF THE DATA ON FILE *** NOTE *** CP = 0.000 TIME= 00:00:00 Unable to open *LIST file vm12.vrt. .. GENERATED FROM PYTHON SOURCE LINES 224-225 Stop MAPDL. .. GENERATED FROM PYTHON SOURCE LINES 225-226 .. code-block:: Python mapdl.exit() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.456 seconds) .. _sphx_glr_download_verif-manual_vm-012-combined-bending-and-torsion.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: vm-012-combined-bending-and-torsion.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: vm-012-combined-bending-and-torsion.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_