Multi-stage Cyclic Symmetry Example

This example shows how to expand the mesh and results from a multi-stage cyclic analysis.

from ansys.dpf import core as dpf
from ansys.dpf.core import examples

Create the model and display the state of the result.

cyc = examples.download_multi_stage_cyclic_result()
model = dpf.Model(cyc)
print(model)

Out:

DPF Model
------------------------------
DPF Result Info
  Analysis: modal
  Physics Type: mecanic
  Unit system: MKS: m, kg, N, s, V, A, degC
  Available results:
    U Displacement :nodal displacements
    S Stress :element nodal component stresses
    EPEL Strain :element nodal component elastic strains
    BFE Temperature :element structural nodal temperatures
  With multi_stage cyclic symmetry on 2 stages
------------------------------
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

Expand displacement results

In this example we expand displacement results, by default on all nodes and the first time step.

# Create displacement cyclic operator
UCyc = model.results.displacement()
UCyc.inputs.read_cyclic(2)

# expand the displacements and get a total deformation
nrm = dpf.Operator("norm_fc")
nrm.inputs.connect(UCyc.outputs)
fields = nrm.outputs.fields_container()

# # get the expanded mesh
mesh_provider = model.metadata.mesh_provider
mesh_provider.inputs.read_cyclic(2)
mesh = mesh_provider.outputs.mesh()

# # plot the expanded result on the expanded mesh
mesh.plot(fields)
02 cyclic multi stage

Out:

[(1.3824076534342138, 1.3824076534342138, 1.3824076534342138),
 (0.0, -4.163336342344337e-17, 0.0),
 (0.0, 0.0, 1.0)]

Expand stresses at a given time step

# define stress expansion operator and request stresses at time set = 3
SCyc = model.results.stress()
SCyc.inputs.read_cyclic(2)
SCyc.inputs.time_scoping.connect([3])

# request the results averaged on the nodes
SCyc.inputs.requested_location.connect("Nodal")


# request equivalent von mises operator and connect it to stress
# operator
eqv = dpf.Operator("eqv_fc")
eqv.inputs.connect(SCyc.outputs)

# expand the results and get stress eqv
fields = eqv.outputs.fields_container()

# plot the expanded result on the expanded mesh
mesh.plot(fields)
02 cyclic multi stage

Out:

[(1.3824076534342138, 1.3824076534342138, 1.3824076534342138),
 (0.0, -4.163336342344337e-17, 0.0),
 (0.0, 0.0, 1.0)]

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

Gallery generated by Sphinx-Gallery