Soramuse / IFM-Calculator

An Algorithm for Interfragmentary Motion Calculation in Finite Element Analysis
GNU General Public License v3.0
1 stars 0 forks source link

Ansys23 R2 error with export file #1

Open Henry1804 opened 4 months ago

Henry1804 commented 4 months ago

Hello, I am a student of biomechanics from Brno University of Technology and I read your article where you use IFM calculator. It looks like a great method for my numerical analysis, but I have a problem with data export. I did everything as you describe, but after loading the file "Ansys_ExportACT.py" and running scrip. ansys shows me an error: image It has a problem with pathway to script "types.py" Could you tell me how to fix this or could you upload a version to git that works for Ansys 23R2? I'd be grateful, as sliding distance is not really suitable for dealing with total fragment shifts.

Thank you for your answer.

Jindrich Safran

Soramuse commented 4 months ago

Hi Jindrich,

I'm glad to receive your feedback. This prompt represents a common error encountered during debugging in Mechanical, which I also often encounter while debugging. Unfortunately, this error often fails to pinpoint the specific problem, and I am unsure why Mechanical cannot provide more information.

I have tested this script in 2022R2, 2023R2, and 2024R1, and it ran successfully. Ansys has not changed the API. Based on my experience, this type of error often occurs when there are characters in paths or data that cannot be represented in ASCII. Therefore, I strongly recommend using it in a purely English environment, including the file storage paths and the software's UI interface, as Ansys data export is related to the UI language. Using other languages often leads to errors and garbled text.

I suggest you first check if there are any non-English letters or symbols in the export environment (including export paths, Ansys language settings, and project names). If this error persists, feel free to provide me with more information for further testing. Thank you.

Henry1804 commented 4 months ago

Hi, thank you for such a quick reply. I tried again. I always use Ansys in English. I even changed the PC language to eliminate the file path error. However still the same problem. I checked all the naming conventions and the only thing I use everywhere is the underscore ( _ ) instead of spaces, which hopefully shouldn't bother anyone because of ACSII. I have applied the procedure according to the instructions. Cor. System I named "LCS" as it is also in the script, M2 and M1 in NameSelection on nouds and still the same error. I really don't know what to do. I have tried other computers and other versions of Ansys and I have same result. Maybe the error is in ansys settings of my project, but I'm really not sure what I should change or do to fix it. If you have so much experience with this would it be possible to get in touch about it? If you would have the time and inclination? :-) I would be grateful. The same problem affects my colleagues who could not get your script to run. Unfortunately for them I don't know where the error was. I just got an echo that they couldn't fix it either.

Thank you for your answare.

Jindrich

Soramuse commented 4 months ago

Hey Jindrich,

Have you tried to use 'Run Script' button but not 'Start Debugger' button? image

I've found that I encounter the same issue when I use the 'start debugger' button. You can directly try using the 'Run Script' button. If an error occurs, please take a screenshot of the output and send it to me. image

Henry1804 commented 4 months ago

Hi, thank you, that was my silly fault. I'm used to it from matlab :-) I got the error anyway. And it was like this: image BTW,I have the parameters set as you described. I hope I'm correct. I set cartesian CS and named it "LCS". image image Details of M2 same as M1 image

I don't know where could be a problem with visibility :-(

Thank you for your help.

Jindrich

Soramuse commented 4 months ago

You can manually comment out this line of code. It simply ensures that all geometries are displayed because if relevant geometries are hidden, the required results may export as empty. You can manually keep all models visible.

image

Henry1804 commented 4 months ago

Thank you for your help. The comment helped and after a while of trying I managed to get results. At the end I'd like to add a few hints that I had to deal with to get the results. 1)It is necessary to have the whole surveyed area of the model of geometry visible, otherwise the results from one or the other area are null or incomplete. 2)The Python script to create the .CSV tablea could not be run in Ansys, but I had to run it externally in VS Code and enter the full path to find the files in the 'f_path' variable. 3) It was not possible to run the application. I had to downgrade the PySide6 package to version 6.2.0 and after that it run. Otherwise the software is very user friendly and awesome. I'll do some more tests in it, but so far I got believable results from it. I will recommend its use in our faculty for better output of numerical analysis results.

Thanks again for your help and I wish you good luck fot the future.

Jindrich

Soramuse commented 4 months ago

Thank you for your feedback. I noticed the first issue you mentioned during my research process, so I added code to automatically make all geometric entities visible in the model. Unfortunately, it seems that it couldn't run in your Ansys environment. If you find a solution, feel free to contribute code to the project—I would greatly appreciate it.

When using the script Ansys_file_merge.py, it does require direct execution in a Python environment with dependencies on tkinter and pandas libraries. tkinter should prompt a file selection dialog automatically; if it doesn't, consider installing the tkinter library. I will add this clarification in the README later on.

For IFM-Cal, you can choose the pre-packaged files to avoid library version issues, which can be downloaded from the Release Page. I hope IFM-Cal can assist in your research! If you encounter any issues during use or have any suggestions for functionality, please feel free to let me know.

Soramuse commented 4 months ago

Hey Jindrich,

I've identified the reason why you were encountering issues when running the script. It seems that you might have grouped some geometries, resulting in a Group object within the Geometry that couldn't have its Visible property changed, causing errors.

I've made modifications to the code so that it now only operates on Parts. You should be able to run it as expected now. Feel free to give the new Ansys_Export_ACT.py a try.

Jun

Henry1804 commented 4 months ago

Hey Jun,

yes, you're right. For better orientation, I have my model divided into several groups. Your modification seems to be a good one. I tried it on my model and it runs without any commands and complications in the script. Thank you for your time.

I may have one more question for you. I have encountered this with the results in your software. I wanted to compare the results. I compared the results on the Sliding Distance function. Unfortunately, it gives me slightly different values and distribution (see fig.) image image

Is it possible to explain to me why this is the case? The fracture surface has over 15k nodes and the other surface has 16k nodes. I have set Mesh Accuracy above to a value of 1. I am not sure what value this coefficient should take on.

Thank you for your answare.

Jindrich

Soramuse commented 4 months ago

Hey Jindrich,

I'm glad the new script could help you out. The reason you encountered this issue is because IFM-Cal considers the overall sliding displacement of two faces in the local coordinate system (LCS). It relies on your definition of the LCS. In this software, we consider the displacement along the Z-axis of the faces in the LCS as the Gap, and the displacement in the XY plane as the Sliding distance. On the other hand, Ansys likely calculates the normal vectors for each node, essentially performing LCS calculations for each point. As a result, the outcomes differ due to the differing definitions of LCS.

In describing the spatial displacement state at the fracture end, we believe it's more reasonable to use a single LCS for the description, as using multiple LCSs can lead to confusion and deviations in assessment standards. I hope this explanation helps you.

Jun

Petr446 commented 3 months ago

Dear Jun,(@Soramuse)

I hope you are doing well. I want to kindly ask if you can please look at this issue.

https://github.com/Soramuse/IFM-Calculator/issues/2

With best regards,

Petr