.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/03-Cyclic-Examples/02-multi-stage-cyclic-results.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_examples_03-Cyclic-Examples_02-multi-stage-cyclic-results.py: .. _ref_multi-stage_cyclic_results_example: Extract multi-stage cyclic results ================================== In this script, a multi-stage modal analysis with cyclic symmetry is processed to show how to expand the mesh and results. .. GENERATED FROM PYTHON SOURCE LINES 11-15 Perform required imports ------------------------ This example uses a supplied file that you can get by importing the DPF ``examples`` package. .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: Python from ansys.dpf import post from ansys.dpf.post import examples .. GENERATED FROM PYTHON SOURCE LINES 20-26 Get ``Simulation`` object ------------------------- Get the ``Simulation`` object that allows access to the result. The ``Simulation`` object must be instantiated with the path for the result file. For example, ``"C:/Users/user/my_result.rst"`` on Windows or ``"/home/user/my_result.rst"`` on Linux. .. GENERATED FROM PYTHON SOURCE LINES 26-33 .. code-block:: Python example_path = examples.download_multi_stage_cyclic_result() simulation = post.ModalMechanicalSimulation(example_path) # print the simulation to get an overview of what's available print(simulation) .. rst-class:: sphx-glr-script-out .. code-block:: none Modal Mechanical Simulation. Data Sources ------------------------------ /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/ansys/dpf/core/examples/result_files/multistage/multistage.rst DPF Model ------------------------------ Modal analysis Unit system: MKS: m, kg, N, s, V, A, degC Physics Type: Mechanical Available results: - displacement: Nodal Displacement - stress: ElementalNodal Stress - elastic_strain: ElementalNodal Strain - element_euler_angles: ElementalNodal Element Euler Angles - structural_temperature: ElementalNodal Structural temperature ------------------------------ DPF Meshed Region: 3595 nodes 1557 elements Unit: m With solid (3D) elements ------------------------------ DPF Time/Freq Support: Number of sets: 6 Cumulative Frequency (Hz) LoadStep Substep Harmonic index 1 188.385357 1 1 0.000000 2 325.126418 1 2 0.000000 3 595.320548 1 3 0.000000 4 638.189511 1 4 0.000000 5 775.669703 1 5 0.000000 6 928.278013 1 6 0.000000 .. GENERATED FROM PYTHON SOURCE LINES 34-36 Extract expanded displacement norm ---------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 36-44 .. code-block:: Python displacement_norm = simulation.displacement( norm=True, expand_cyclic=True, ) print(displacement_norm) displacement_norm.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_001.png :alt: 02 multi stage cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none results U_N (m) set_ids 1 node_ids 1376 5.2953e-02 4971 5.2953e-02 7191 5.2953e-02 9411 5.2953e-02 11631 5.2953e-02 13851 5.2953e-02 ... ... .. GENERATED FROM PYTHON SOURCE LINES 45-47 Extract equivalent von Mises nodal stress without expansion ----------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 47-54 .. code-block:: Python stress_vm_sector_1_both_stages = simulation.stress_eqv_von_mises_nodal( expand_cyclic=False, ) print(stress_vm_sector_1_both_stages) stress_vm_sector_1_both_stages.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_002.png :alt: 02 multi stage cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none results S_VM (Pa) set_ids 1 base_sector 1 stage 1 node_ids 1460 1622 1644 1660 1490 1596 ... ... .. GENERATED FROM PYTHON SOURCE LINES 55-57 Extract equivalent von Mises nodal stress expanded on the first four sectors of the first stage ----------------------------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 57-64 .. code-block:: Python stress_vm_sectors_1_2_3_4_first_stage = simulation.stress_eqv_von_mises_nodal( expand_cyclic=[1, 2, 3, 4], ) print(stress_vm_sectors_1_2_3_4_first_stage) stress_vm_sectors_1_2_3_4_first_stage.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_003.png :alt: 02 multi stage cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none results S_VM (Pa) set_ids 1 node_ids 5071 6.2894e+09 5218 6.9084e+09 1644 8.0643e+09 1660 8.5795e+09 7291 6.2894e+09 7438 6.9084e+09 ... ... .. GENERATED FROM PYTHON SOURCE LINES 65-67 Extract equivalent von Mises nodal stress expanded on the first two sectors of both stages ------------------------------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 67-73 .. code-block:: Python stress_vm_sectors_1_2_both_stages = simulation.stress_eqv_von_mises_nodal( expand_cyclic=[[1, 2], [1, 2]], ) print(stress_vm_sectors_1_2_both_stages) stress_vm_sectors_1_2_both_stages.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_004.png :alt: 02 multi stage cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_02-multi-stage-cyclic-results_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none results S_VM (Pa) set_ids 1 node_ids 5071 6.2894e+09 5218 6.9084e+09 1644 8.0643e+09 1660 8.5795e+09 7291 6.8763e+09 7438 7.0456e+09 ... ... .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.581 seconds) .. _sphx_glr_download_examples_03-Cyclic-Examples_02-multi-stage-cyclic-results.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 02-multi-stage-cyclic-results.ipynb <02-multi-stage-cyclic-results.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 02-multi-stage-cyclic-results.py <02-multi-stage-cyclic-results.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_