.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/03-Cyclic-Examples/01-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_01-cyclic-results.py: .. _ref_cyclic_results_example: Extract cyclic results ====================== In this script, a 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.find_simple_cyclic() 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/file_cyclic.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 - elemental_volume: Elemental Volume - stiffness_matrix_energy: Elemental Energy-stiffness matrix - artificial_hourglass_energy: Elemental Hourglass Energy - thermal_dissipation_energy: Elemental thermal dissipation energy - kinetic_energy: Elemental Kinetic Energy - co_energy: Elemental co-energy - incremental_energy: Elemental incremental energy - element_euler_angles: ElementalNodal Element Euler Angles - structural_temperature: ElementalNodal Structural temperature ------------------------------ DPF Meshed Region: 51 nodes 4 elements Unit: m With solid (3D) elements ------------------------------ DPF Time/Freq Support: Number of sets: 30 Cumulative Frequency (Hz) LoadStep Substep Harmonic index 1 670386.325235 1 1 0.000000 2 872361.424038 1 2 0.000000 3 1142526.525324 1 3 0.000000 4 1252446.741551 1 4 0.000000 5 1257379.552140 1 5 0.000000 6 1347919.358013 1 6 0.000000 7 679667.393214 2 1 1.000000 8 679667.393214 2 2 -1.000000 9 899321.218481 2 3 -1.000000 10 899321.218481 2 4 1.000000 11 1128387.049511 2 5 1.000000 12 1128387.049511 2 6 -1.000000 13 708505.071361 3 1 -2.000000 14 708505.071361 3 2 2.000000 15 966346.820117 3 3 2.000000 16 966346.820117 3 4 -2.000000 17 1031249.070606 3 5 -2.000000 18 1031249.070606 3 6 2.000000 19 757366.624982 4 1 -3.000000 20 757366.624982 4 2 3.000000 21 926631.623058 4 3 -3.000000 22 926631.623058 4 4 3.000000 23 1035144.649248 4 5 3.000000 24 1035144.649248 4 6 -3.000000 25 807882.379030 5 1 4.000000 26 856868.410638 5 2 4.000000 27 1063247.283632 5 3 4.000000 28 1185511.741334 5 4 4.000000 29 1278969.844256 5 5 4.000000 30 1355579.879820 5 6 4.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_01-cyclic-results_001.png :alt: 01 cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_01-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 1 8.5207e+01 52 8.5207e+01 103 8.5207e+01 154 8.5207e+01 205 8.5207e+01 256 8.5207e+01 ... ... .. GENERATED FROM PYTHON SOURCE LINES 45-47 Extract equivalent von Mises nodal stress expanded on the first four sectors ---------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 47-54 .. code-block:: Python stress_vm_sectors_1_2_3_4 = simulation.stress_eqv_von_mises_nodal( expand_cyclic=[1, 2, 3, 4], ) print(stress_vm_sectors_1_2_3_4) stress_vm_sectors_1_2_3_4.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_01-cyclic-results_002.png :alt: 01 cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_01-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 node_ids 1 7.6536e+15 14 9.2247e+15 15 4.6219e+15 18 6.4123e+15 2 1.4681e+16 6 7.9359e+15 ... ... .. GENERATED FROM PYTHON SOURCE LINES 55-57 Extract equivalent von Mises nodal stress without expansion ----------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 57-63 .. code-block:: Python stress_vm_sector_1 = simulation.stress_eqv_von_mises_nodal( expand_cyclic=False, ) print(stress_vm_sector_1) stress_vm_sector_1.plot() .. image-sg:: /examples/03-Cyclic-Examples/images/sphx_glr_01-cyclic-results_003.png :alt: 01 cyclic results :srcset: /examples/03-Cyclic-Examples/images/sphx_glr_01-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 base_sector 1 node_ids 1 2.1648e+16 14 2.6092e+16 15 1.3073e+16 18 1.8137e+16 2 4.1523e+16 6 2.2446e+16 ... ... .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.286 seconds) .. _sphx_glr_download_examples_03-Cyclic-Examples_01-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: 01-cyclic-results.ipynb <01-cyclic-results.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01-cyclic-results.py <01-cyclic-results.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_