Note
Click here to download the full example code
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
------------------------------
Modal analysis
Unit system: MKS: m, kg, N, s, V, A, degC
Physics Type: Mecanic
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
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)

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)

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