ansys / pyacp

Python Client for Ansys Composite PrepPost
https://acp.docs.pyansys.com
MIT License
4 stars 1 forks source link

Bug located in `get_local_cdb_file` #571

Open kmahajan-cadfem opened 2 weeks ago

kmahajan-cadfem commented 2 weeks ago

πŸ” Before submitting the issue

🐞 Description of the bug

Loading a acph5 file and creating a cdb file from it as shown in examples is not working.

we are always getting the following error


RuntimeError: Unknown error: Saving analysis models in the format ansys:h5 is not supported.

Detailed Error Trace

πŸ“ Steps to reproduce

import ansys.acp.core as pyacp
import ansys.mapdl.core as pymapdl

acp = pyacp.launch_acp()
acp.clear()
mapdl = pymapdl.launch_mapdl()
workflow =  pyacp.ACPWorkflow.from_acph5_file(
    acp = acp,
    acph5_file_path= "ACP-Pre.acph5",   
)
model = workflow.model
modeling_groups = model.modeling_groups
model.update()

mapdl.clear()
cdb_file = workflow.get_local_cdb_file()

PyACP_test.zip

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

Ansys 2024 R2

🐍 Which Python version are you using?

3.10

πŸ“¦ Installed packages

-
greschd commented 2 weeks ago

Hi @kmahajan-cadfem,

Thanks for reporting this issue.

If I'm understanding the workflow correctly, the .acph5 you are loading was generated from a Workbench project, is that correct?

In that case, it's expected behavior - unfortunately - that the CDB export does not work [1]. There are two basic workflows supported by PyACP, which are the same as in the ACP GUI:

The reason for this is that ACP does not generate the CDB file from scratch, it simply appends the composite definitions to the existing CDB.

One way to work around this would be to generate the CDB file from Mechanical, and then load that into (Py)ACP.

If you are willing to share your overall workflow (here, or privately) we can help figure out the best way forward.

[1] We should improve the documentation to make this distinction more clear. [2] Currently, the downstream transfer of this model into Mechanical would need to happen again in Workbench, as reading / writing the requisite transfer files is not exposed as a Python function.

kmahajan-cadfem commented 2 weeks ago

@greschd, you are absolutely correct the file is generated using the UI,

Thanks for the detailed explanation, we will see if we can use the workflows that you have mentioned.

and thank you for the offer to take a look at the workflow, if necessary we will definitely have to ask for your help πŸ™