Reduce Cyclic Model Size by using Mesh Skin for Result and Mesh extraction#

This example displays post-processing on a mesh skin for a cyclic modal analysis. The skin mesh is rebuilt with new surface elements connecting the nodes on the external skin of the solid mesh. These surface elements types are chosen with respect to the solid elements facets having all their nodes on the skin. This feature is available for all types of Mechanical simulation supporting cyclic (or cyclic multistage) and allows you to reduce the size of the mesh and of the extracted data to improve processing performance. Since larger stress and strains are usually located on the skin of a model, computing results on the skin gives equivalent maximum values in most cases. Post-processing of elemental or elemental nodal results requires element solid to skin mapping to get from a solid element result to a facet result. The connectivity of the new surface elements built on the skin being different from the connectivity of the solid elements, small differences can be found after result averaging. To plot cyclic expanded results, the skin mesh is expanded.

Perform required imports#

This example uses a supplied file that you can get using the examples module.

from ansys.dpf import post
from ansys.dpf.post import examples

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.

example_path = examples.download_modal_cyclic()
simulation = post.ModalMechanicalSimulation(example_path)

# print the simulation to get an overview of what's available
print(simulation)
Modal Mechanical Simulation.


Data Sources
------------------------------
/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/ansys/dpf/core/examples/result_files/cyclic/modal_cyclic.rst

DPF Model
------------------------------
Modal analysis
Unit system: MKS: m, kg, N, s, V, A, degC
Physics Type: Mechanical
Available results:
     -  displacement: Nodal Displacement
     -  reaction_force: Nodal Force
     -  stress: ElementalNodal Stress
     -  elastic_strain: ElementalNodal Strain
     -  element_euler_angles: ElementalNodal Element Euler Angles
------------------------------
DPF  Meshed Region:
  928 nodes
  3836 elements
  Unit: m
  With solid (3D) elements
------------------------------
DPF  Time/Freq Support:
  Number of sets: 48
Cumulative     Frequency (Hz) LoadStep       Substep        Harmonic index
1              51369.575105   1              1              0.000000
2              114291.419744  1              2              0.000000
3              238849.856755  1              3              0.000000
4              254031.324493  1              4              0.000000
5              337729.470910  1              5              0.000000
6              348699.692284  1              6              0.000000
7              51970.152101   2              1              1.000000
8              51970.152101   2              2              -1.000000
9              126647.471593  2              3              -1.000000
10             126647.471593  2              4              1.000000
11             239807.889703  2              5              -1.000000
12             239807.889703  2              6              1.000000
13             54198.644112   3              1              2.000000
14             54198.644112   3              2              -2.000000
15             157264.852222  3              3              -2.000000
16             157264.852222  3              4              2.000000
17             242073.194077  3              5              -2.000000
18             242073.194077  3              6              2.000000
19             59105.565170   4              1              3.000000
20             59105.565170   4              2              -3.000000
21             194873.849513  4              3              -3.000000
22             194873.849513  4              4              3.000000
23             241988.808784  4              5              3.000000
24             241988.808784  4              6              -3.000000
25             67744.544169   5              1              4.000000
26             67744.544169   5              2              -4.000000
27             218600.039108  5              3              -4.000000
28             218600.039108  5              4              4.000000
29             229679.308122  5              5              4.000000
30             229679.308122  5              6              -4.000000
31             80576.477155   6              1              5.000000
32             80576.477155   6              2              -5.000000
33             192985.645574  6              3              -5.000000
34             192985.645574  6              4              5.000000
35             245990.772448  6              5              5.000000
36             245990.772448  6              6              -5.000000
37             97381.706833   7              1              6.000000
38             97381.706833   7              2              -6.000000
39             166306.784163  7              3              -6.000000
40             166306.784163  7              4              6.000000
41             259986.167834  7              5              6.000000
42             259986.167834  7              6              -6.000000
43             117422.022015  8              1              7.000000
44             117422.022015  8              2              -7.000000
45             141309.163007  8              3              -7.000000
46             141309.163007  8              4              7.000000
47             273449.890447  8              5              -7.000000
48             273449.890447  8              6              7.000000

Extract displacement data#

Extract displacement data on the skin.

displacement_skin = simulation.displacement(skin=True)
displacement_skin.plot()
04 cyclic mesh skin

Extract stress/strain data#

Extract stress or elastic strain data over the entire mesh and on the skin. Averaging, and invariants computation are done through a solid to skin connectivity mapping.

elemental_stress_skin = simulation.stress_principal_elemental(components=[1], skin=True)
elemental_stress_skin.plot()

elastic_strain_eqv_skin = simulation.elastic_strain_eqv_von_mises_nodal(skin=True)
elastic_strain_eqv_skin.plot()
  • 04 cyclic mesh skin
  • 04 cyclic mesh skin

Get stress results on the skin of the first sector with a cyclic phase#

stress_eqv_cyc_phase = simulation.stress_eqv_von_mises_nodal(
    set_ids=[5],
    expand_cyclic=[1],
    phase_angle_cyclic=45.0,
    skin=True,
)
stress_eqv_cyc_phase.plot()
04 cyclic mesh skin

Total running time of the script: (0 minutes 3.028 seconds)

Gallery generated by Sphinx-Gallery