CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

Mesh slected Areas using Python-script?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2020, 07:11
Default Mesh slected Areas using Python-script?
  #1
New Member
 
Join Date: Jul 2020
Posts: 3
Rep Power: 2
StrawHat is on a distinguished road
Dear Community,

iīm new to Ansa Scripting (Python) and need to find a way that meshes selected Areas seperatly on a whole model - in this Case for example a part from a motorengine.
after running the existing Batch mesher, there are a lot of small areas that should be finer-meshed. To Avoid, that our engineers have to spent one whole day to mesh them finer manually, we Need a script.
The idea is, that the user can select some Areas and the script is meshing them finer without changing the non-selected Areas.
It would be great if the user is able to set the Parameters by himself (ex: if there is an angle of 90 Degree, he wants 3 rows)
Unfortunetly i didnīt find a solution anywhere.
Thankīs a lot for your help in Advance!
StrawHat is offline   Reply With Quote

Old   July 8, 2020, 02:54
Default
  #2
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 56
Rep Power: 12
rmaries is on a distinguished road
Hi,
There is no need of python script for this. Batchmesher is itself capable of doing this.
In the batch mesher parameter setting use the feature handler option and set right row numbers based on your fillet radius. I remember there is a tutorial for batch meshing in ansa tutorial folder. You can refer that for further info

Best Regards
Maries
rmaries is offline   Reply With Quote

Old   July 8, 2020, 03:33
Default
  #3
New Member
 
Join Date: Jul 2020
Posts: 3
Rep Power: 2
StrawHat is on a distinguished road
Quote:
Originally Posted by rmaries View Post
Hi,
There is no need of python script for this. Batchmesher is itself capable of doing this.
In the batch mesher parameter setting use the feature handler option and set right row numbers based on your fillet radius. I remember there is a tutorial for batch meshing in ansa tutorial folder. You can refer that for further info

Best Regards
Maries

Hi Maries,

Yes we are using it Right now and most of the time it does itīs Job well but on some Areas not, thats why we Need to mesh them manually or run a script for a finer mesh on the selected Areas.
Is there a better solution?
Thanks in Advance!
StrawHat is offline   Reply With Quote

Old   July 8, 2020, 05:57
Default
  #4
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 56
Rep Power: 12
rmaries is on a distinguished road
Yes that is possible.

Code:
IsolateRadius,     BETA PYTHON development Manual
NAME:
IsolateRadius - Isolates all the faces based on a given radius limit.

SYNOPSIS:
ansa.base.IsolateRadius(radius)   Named Arguments

DESCRIPTION:
This function isolates on the screen all the faces based on a given radius limit.
Arguments

radius  float     The radius limit to isolate the faces.
This command will isolate the surfaces with required radius in screen. Collect that face and apply the required meshing parameter.
rmaries is offline   Reply With Quote

Old   July 10, 2020, 04:36
Question
  #5
New Member
 
Join Date: Jul 2020
Posts: 3
Rep Power: 2
StrawHat is on a distinguished road
Thanks for your help!

is it also possible to mesh selected Fillets ?

For now, iīm using this code:

Quote:
def get_selected_Fillet_id():
print("please select Faces")
base.SetPickMethod(base.constants.ENT_SELECTION)
collected_entities = base.PickEntities(DECK, "FILLET")
#collected_type = type(collected_entities)
for entity in collected_entities:
return entity

The result is like :
Quote:
2201 3520 <Entity: 0x000001F302B92DC0: type: 3520(3520,FILLET_ENTITY) id:2201>
<class 'list'>

The entitiy._id is equal to the id of the selected Fillet in the Feature Manager.
How can i change Values here or mesh them seperatly by using an other mesh-param-file?
StrawHat is offline   Reply With Quote

Reply

Tags
ansa meshing, ansa scripting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[OpenFOAM] Using python script for automatic post processing of openFoam vPaquet ParaView 11 June 20, 2017 07:32
[snappyHexMesh] Snappyhex mesh: poor inlet mesh Swagga5aur OpenFOAM Meshing & Mesh Conversion 1 December 3, 2016 16:59
Star CCM Overset Mesh Error (Rotating Turbine) thezack Siemens 7 October 12, 2016 11:14
[ANSYS Meshing] Export fluent mesh via script Nigirim ANSYS Meshing & Geometry 8 September 12, 2016 15:08
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 01:43.