.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "verif-manual/vm-013.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-013.py: .. _ref_vm13: Cylindrical Shell Under Pressure --------------------------------- Problem description: - A long cylindrical pressure vessel of mean diameter d and wall thickness t has closed ends and is subjected to an internal pressure P. Determine the axial stress :math:`\sigma_y` and the hoop stress :math:`\sigma_z` in the vessel at the midthickness of the wall. Reference: - S. Timoshenko, Strength of Materials, Part I, Elementary Theory and Problems, 3rd Edition, D. Van Nostrand Co., Inc., New York, NY, 1955, pg. 45, article 11. - UGURAL AND FENSTER, ADV. STRENGTH AND APPL. ELAS., 1981. Analysis type(s): - Static Analysis ``ANTYPE=0`` Element type(s): - 2-Node Finite Strain Axisymmetric Shell (SHELL208) .. image:: ../_static/vm13_setup.png :width: 400 :alt: VM13 Cylindrical Shell Problem Sketch Material properties: - :math:`E = 30 \cdot 10^6 psi` - :math:`\mu = 0.3` Geometric properties: - :math:`t = 1 in` - :math:`d = 120 in` Loading: - :math:`P = 500 psi` Analysis Assumptions and Modeling Notes: - An arbitrary axial length of 10 inches is selected. Nodal coupling is used in the radial direction. An axial force of 5654866.8 lb (:math:`(Pπd^2)/4`) is applied to simulate the closed-end effect. .. GENERATED FROM PYTHON SOURCE LINES 67-94 .. code-block:: Python # sphinx_gallery_thumbnail_path = '_static/vm13_setup.png' # Importing the `launch_mapdl` function from the `ansys.mapdl.core` module from ansys.mapdl.core import launch_mapdl import numpy as np # Launch MAPDL with specified settings mapdl = launch_mapdl(loglevel="WARNING", print_com=True, remove_temp_dir_on_exit=True) # Clear any existing database mapdl.clear() # Set the ANSYS version mapdl.com("ANSYS MEDIA REL. 2022R2 (05/13/2022) REF. VERIF. MANUAL: REL. 2022R2") # Run the FINISH command to exists normally from a processor mapdl.finish() # Run the /VERIFY command for VM13 mapdl.verify("vm13") # Set the title of the analysis mapdl.title("VM13 CYLINDRICAL SHELL UNDER PRESSURE") # Enter the model creation preprocessor mapdl.prep7(mute=True) .. GENERATED FROM PYTHON SOURCE LINES 95-98 Define element type and section properties ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use 2-Node Axisymmetric Shell element (SHELL208) and "SHELL" as section type. .. GENERATED FROM PYTHON SOURCE LINES 98-104 .. code-block:: Python mapdl.et(1, "SHELL208") # Element type SHELL208 mapdl.sectype(1, "SHELL") # Section type SHELL mapdl.secdata(1) # Define section data mapdl.secnum(1) # Assign section number .. rst-class:: sphx-glr-script-out .. code-block:: none SECTION ID NUMBER= 1 .. GENERATED FROM PYTHON SOURCE LINES 105-109 Define material ~~~~~~~~~~~~~~~ Set up the material and its type (a single material), Young's modulus of 30e6 and Poisson's ratio of 0.3 is specified. .. GENERATED FROM PYTHON SOURCE LINES 109-113 .. code-block:: Python mapdl.mp("EX", 1, 30e6) mapdl.mp("NUXY", 1, 0.3) .. rst-class:: sphx-glr-script-out .. code-block:: none MATERIAL 1 NUXY = 0.3000000 .. GENERATED FROM PYTHON SOURCE LINES 114-118 Define geometry ~~~~~~~~~~~~~~~ Set up the nodes and elements. This creates a mesh just like in the problem setup. .. GENERATED FROM PYTHON SOURCE LINES 118-125 .. code-block:: Python mapdl.n(1, 60) # Node 1, 60 degrees mapdl.n(2, 60, 10) # Node 2, 60 degrees and 10 units in Z-direction # Define element connectivity mapdl.e(1, 2) # Element 1 with nodes 1 and 2 .. rst-class:: sphx-glr-script-out .. code-block:: none 1 .. GENERATED FROM PYTHON SOURCE LINES 126-135 Define coupling and boundary conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Couple the nodes #1 and 2 in radial direction (rotation around Z-axis). Fix UY displacement for node 1. Fix ROTZ (rotation around Z-axis) for node 2. Apply a concentrated force value of 5654866.8 lb in FY direction at node 2. Internal pressure of 500 psi is applied. Then exit prep7 processor. Effectively, this sets: :math:`P = 500 psi` .. GENERATED FROM PYTHON SOURCE LINES 135-150 .. code-block:: Python mapdl.cp(1, "UX", 1, 2) # Couple radial direction (rotation around Z-axis) mapdl.d(1, "UY", "", "", "", "", "ROTZ") # Fix UY displacement for node 1 mapdl.d(2, "ROTZ") # Fix ROTZ (rotation around Z-axis) for node 2 mapdl.f(2, "FY", 5654866.8) # Apply a concentrated force FY to node 2 mapdl.sfe(1, 1, "PRES", "", 500) # Apply internal pressure of 500 psi to element 1 # Selects all entities mapdl.allsel() mapdl.eplot() # Finish the pre-processing processor mapdl.finish() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /verif-manual/images/sphx_glr_vm-013_001.png :alt: vm 013 :srcset: /verif-manual/images/sphx_glr_vm-013_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-013_001.vtksz .. rst-class:: sphx-glr-script-out .. code-block:: none ***** ROUTINE COMPLETED ***** CP = 0.000 .. GENERATED FROM PYTHON SOURCE LINES 151-154 Solve ~~~~~ Enter solution mode and solve the system. .. GENERATED FROM PYTHON SOURCE LINES 154-165 .. code-block:: Python mapdl.slashsolu() # Set the analysis type to STATIC mapdl.antype("STATIC") # Controls the solution printout mapdl.outpr("ALL", 1) # Solve the analysis mapdl.solve() # Finish the solution processor 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 166-169 Post-processing ~~~~~~~~~~~~~~~ Enter post-processing and compute stress components. .. GENERATED FROM PYTHON SOURCE LINES 169-183 .. code-block:: Python mapdl.post1() # Create element tables for stress components mapdl.etable("STRS_Y", "S", "Y") mapdl.etable("STRS_Z", "S", "Z") # Retrieve element stresses from the element tables using *Get stress_y = mapdl.get("STRSS_Y", "ELEM", 1, "ETAB", "STRS_Y") stress_z = mapdl.get("STRSS_Z", "ELEM", 1, "ETAB", "STRS_Z") # Fill the array with target values Target_values = np.array([15000, 29749]) .. GENERATED FROM PYTHON SOURCE LINES 184-186 Verify the results. ~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 186-196 .. code-block:: Python results = f""" ------------------- VM13 RESULTS COMPARISON --------------------- RESULT | TARGET | Mechanical APDL | RATIO Stress, Y (psi) {Target_values[0]:.5f} {stress_y:.5f} {abs(stress_y/Target_values[0]):.5f} Stress, Z (psi) {Target_values[1]:.5f} {stress_z:.5f} {abs(stress_z/Target_values[1]):.5f} ----------------------------------------------------------------- """ print(results) .. rst-class:: sphx-glr-script-out .. code-block:: none ------------------- VM13 RESULTS COMPARISON --------------------- RESULT | TARGET | Mechanical APDL | RATIO Stress, Y (psi) 15000.00000 15000.00000 1.00000 Stress, Z (psi) 29749.00000 30000.00000 1.00844 ----------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 197-199 Finish the post-processing processor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 199-201 .. code-block:: Python mapdl.finish() .. rst-class:: sphx-glr-script-out .. code-block:: none EXIT THE MAPDL POST1 DATABASE PROCESSOR ***** ROUTINE COMPLETED ***** CP = 0.000 .. GENERATED FROM PYTHON SOURCE LINES 202-204 Stop MAPDL. ~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 204-205 .. code-block:: Python mapdl.exit() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.550 seconds) .. _sphx_glr_download_verif-manual_vm-013.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: vm-013.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: vm-013.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_