ansys/pydpf-core

cyclic_strain_energy

Closed this issue · 3 comments

Before submitting the issue

  • I have checked for Compatibility issues
  • I have searched among the existing issues
  • I am using a Python virtual environment

Description of the bug

read_cyclic(2) does not seem to work with the cyclic_strain_energy operator. Results file contain energy outputs.

Using similar approach as in the example https://dpf.docs.pyansys.com/version/stable/examples/11-cyclic-symmetry/01-modal_cyclic.html#sphx-glr-examples-11-cyclic-symmetry-01-modal-cyclic-py I can plot cyclic_expanded_el_strain result or cyclic_expanded_displacement, but not the cyclic_strain_energy

Steps To Reproduce

with any cyclic modal analysis with energy outputs

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
import os
path_to_rst = 'C:\temp\pydpf\file_st2.rst'
model = dpf.Model(path_to_rst)
dataSource = dpf.DataSources(path_to_rst)

get the expanded mesh

mesh_provider = model.metadata.mesh_provider
mesh_provider.inputs.read_cyclic(2)
mesh = mesh_provider.outputs.mesh()

expanded result

#fields_ = dpf.operators.result.cyclic_strain_energy(data_sources = dataSource,read_cyclic = 1, time_scoping = [1])
fields_ = dpf.operators.result.cyclic_expanded_el_strain(data_sources = dataSource,read_cyclic = 2, time_scoping = [1])

to elemental

to_elemental = dpf.operators.averaging.to_elemental_fc(fields_container = fields_).outputs.fields_container()

plot the expanded result on the expanded mesh

mesh.plot(to_elemental[0])

#fields_ = dpf.operators.result.cyclic_expanded_displacement(data_sources = dataSource,read_cyclic = 2, time_scoping = [1])
#disp=fields_.outputs.fields_container()
#mesh.plot(disp[0])

Which Operating System are you using?

Windows

Which DPF/Ansys version are you using?

Ansys 2024 R2

Which Python version are you using?

3.12

Installed packages

dpf

@floracha, cyclic_strain_energy will only allow you to expand the energies if you have element nodal forces in your RST file even if you stored MAPDL energies. Additionally, the cyclic expansion of kinetic and strain energies is only supported for Modal Analysis results.
I suspect this is not the case in your RST file, could you please verify that?

The reason is that when doing cyclic expansion, we are performing a linear combination operation on an integrated result per harmonic, when typically you would do the opposite, first expand, then integrate. When we calculate expanded energies through DPF, we expand the displacements and ENF, then we calculate the energies. The other way around would give wrong results, that's why we do not support expansion of MAPDL energies per sector.

Hi @oparreno is this documented somewhere? Such as in the operator's description?

@PProfizi, no, this is not documented in these operators. We probably should do it.