CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > ANSYS Meshing & Geometry

[ANSYS Meshing] Automatic Script for Named Selections of a Volute

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2023, 08:18
Post Automatic Script for Named Selections of a Volute
  #1
Senior Member
 
Daniel
Join Date: Feb 2017
Location: Germany
Posts: 147
Rep Power: 9
zacko is on a distinguished road
Hello,

I'm trying to write a python script for ANSYS Meshing.
For now, the ANSYS Scripting guide for Mechanical does only help to a certain point.

What I try to achieve:
I want to automate the naming of faces of a volute. These are: Outlet, Interface, Symmetry and Walls.

I wrote the script to name the Outlet, Interface and Symmetry Face based on the face areas. For the symmetry, since it is the biggest plane, I used the function:
Code:
SelectionOperatorType.Largest
That works fine.

All other faces, that are not selected yet, shall be placed in a selection called Walls.

I tried it with putting every face into Walls first, using a face area > 0.0 mm. And then start the naming of the other faces. But, the other faces are sadly not excluded of the Walls selection afterwards.

Is there a good option about using connections? Or any other method?

Attached an image of an exemplary volute and the named selection up until now and the code. Also, I assume there must a better way to code my named selections.

Code:
sel = Model.AddNamedSelection()
sel.ScopingMethod=GeometryDefineByType.Worksheet

b3 = 0.3
D3 = 0.73
Dd = 0.8

bool_symmetry = True

if bool_symmetry == True:
    A_interface = 0.5*(pi * D3 * b3) 
    A_discharge = 0.5*(pi/4 * Dd**2)
    

# DISCHARGE
sel.Name = "VOLUTE_OUTLET"
discharge = sel.GenerationCriteria
discharge.Add(None)
discharge[0].EntityType=SelectionType.GeoFace
discharge[0].Criterion=SelectionCriterionType.Size
discharge[0].Operator=SelectionOperatorType.RangeInclude
discharge[0].UpperBound = Quantity(A_discharge*1.01 ,"m m")
discharge[0].LowerBound = Quantity(A_discharge*0.99, "m m")
sel.Generate()


# SYMMTERY
sel_sym = Model.AddNamedSelection()
sel_sym.ScopingMethod=GeometryDefineByType.Worksheet

sel_sym.Name = "VOLUTE_SYMMETRY"
symmetry = sel_sym.GenerationCriteria
symmetry.Add(None)
symmetry[0].EntityType=SelectionType.GeoFace
symmetry[0].Criterion=SelectionCriterionType.Size
symmetry[0].Operator=SelectionOperatorType.Largest

sel_sym.Generate()


# INTERFACE
sel_itf = Model.AddNamedSelection()
sel_itf.ScopingMethod=GeometryDefineByType.Worksheet

sel_itf.Name = "VOLUTE_INTERFACE"
interface = sel_itf.GenerationCriteria
interface.Add(None)
interface[0].EntityType=SelectionType.GeoFace
interface[0].Criterion=SelectionCriterionType.Size
# I use RangeInclude, because the Equal command does not find the face (maybe rounding error?)
interface[0].Operator=SelectionOperatorType.RangeInclude
interface[0].UpperBound = Quantity(A_interface*1.01 ,"m m")
interface[0].LowerBound = Quantity(A_interface*0.99, "m m")
sel_itf.Generate()
Maybe you have better resources of ANSYS that I haven't found yet?
Thank you for your help.

Daniel
Attached Images
File Type: png Meshing_NamedSelection.PNG (116.9 KB, 2 views)
zacko is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] Use of replay script for automatic meshing for the same kind of Geometry in ICEM ruchit@15847 ANSYS Meshing & Geometry 1 June 7, 2022 20:20
[OpenFOAM] Using python script for automatic post processing of openFoam vPaquet ParaView 12 December 16, 2021 03:30
[DesignModeler] Macro / Script for automatic geometry import wasabi ANSYS Meshing & Geometry 26 August 25, 2018 19:03
[ICEM] Save Message Log automatic with Replay Script survADe ANSYS Meshing & Geometry 3 July 11, 2013 05:49
[ICEM] Automatic mesh generation script surface intersection problem stuart23 ANSYS Meshing & Geometry 0 May 13, 2011 01:10


All times are GMT -4. The time now is 09:10.