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.

Perform required imports#

This example uses a supplied file that you can get by importing the DPF examples package.

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_multi_stage_cyclic_result()
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.8.16/x64/lib/python3.8/site-packages/ansys/dpf/core/examples/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
     -  structural_temperature: ElementalNodal 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

Extract expanded displacement norm#

displacement_norm = simulation.displacement(
    norm=True,
    expand_cyclic=True,
)
print(displacement_norm)
displacement_norm.plot()
07 multi stage cyclic results
 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
     ...

Extract equivalent von Mises nodal stress without expansion#

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()
07 multi stage cyclic results
    results   S_VM (Pa)
    set_ids           1
base_sector           1
      stage           0           1
   node_ids
       1460  6.8763e+09  1.3425e+10
       1622  7.0456e+09  1.5608e+10
       1644  8.0643e+09  1.2895e+10
       1660  8.5795e+09  1.6837e+10
       1490  6.5577e+09  1.1323e+10
       1596  6.4393e+09  1.0031e+10
        ...

Extract equivalent von Mises nodal stress expanded on the first four sectors of the first stage#

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()
07 multi stage cyclic results
 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
     ...

Extract equivalent von Mises nodal stress expanded on the first two sectors of both stages#

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()
07 multi stage cyclic results
 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
     ...

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

Gallery generated by Sphinx-Gallery