Skip to content

vahadruya/Basic_Python_Script_in_ANSA_for_Automated_Handling_of_Skewed_Elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Basic Python Script in ANSA for Automated Handling of Skewed Surface Mesh Elements

Table of Contents
  1. About the Study
  2. Background
  3. Script Approach
  4. Results
  5. Libraries Used
  6. Contact

About the Study

This study focuses on an automated removal of skewed surface mesh elements using Python scripts which utilize modules and functions available within the ANSA environment. The primary objectives of this study are -

  • To evaluate the usage of this Python scripting using the criterias of geometry distortion (accurace and reliabality) and the time taken for code completion
  • General comparison of the same with the default in-built functions within the ANSA GUI

Background

The Scope of this study involves only removal of skewed elements and not warpage, Jacobian etc criterias as they are not usually considered for an all-tria mesh, which are generally used in CFD Surface Meshes. Nevertheless, it is quite easy to extend this quality criteria of skew to the others within the Python script.

In ANSA, there are two primary classes of in-built functions used to rectify the skewed elements

  • Manual removal (using Cut, Join, Paste etc)
  • Reconstruction, Fix Quality, Remeshing etc. methods which resolve at bulk

Script Approach

The developed script focuses on an intelligent combination of the methods present in the latter class. For example, the combination can comprise a simple logic of an arrangement of the Fix Quality and Reconstruct methods in an order of ascending risk of geometry modification (the characteristics of the same two functions can be studied in the ANSA documentations), which ensures a minimal modification of the geometrical topology while maintaining a good degree of accuracy for skewed element removal.

Hence, it is to be noted that, the script is not absolute and various other methods (developed for various other combinations of the ANSA functions) can be developed for quality removal. For demonstration, the aforestated example shall be utilized.

Results

  • Three test-models were utilized for executing this script. There's a significant improvement in time, as well as removal of all skewed elements.
  • Nevertheless, there are places where the Fix Quality method performed poorly compared to Reconstruct method. No pattern could be discerned as to where all this method works worse, hence could not implement it in the script.
Metric Model 1 Model 2 Model 3
Total initial skewness 335 225 903
Total element count in model 216626 30564 2716478
Total skewness after executing script 0 0 0
Total skewness after Improve Algorithm (Expand Level 1) 1 0 20
Total time taken for running script 1.4s 0.3s 12.7s
Approx. time for manual removal of skewness 30min 20min 60min

Conclusions

  • Much faster, more efficient solutions
  • Requires an FE model input for quality execution of the script
  • Currently run only for FLUENT solver deck, and only removes skewness. Can be extended to include various other criteria.
  • One major disadvantage is the script cannot identify areas of crucial importance, and hence naturally treats all skewed elements liberally and equally. Some areas may require less or no feature distortion, and these need to be handled manually.

Libraries Used

OS OS OS OS OS

Contact

Linkedin Gmail

About

Basic scripting in Python within the ANSA environment to remove bad quality surface mesh elements from the geometry (particularly, the skewed elements)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages