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

[ANSYS Meshing] Writing a Code for meshing in ICEM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 26, 2012, 19:21
Default Writing a Code for meshing in ICEM
  #1
Member
 
david
Join Date: Oct 2012
Posts: 49
Rep Power: 3
davidwilcox is on a distinguished road
Hello,
I am just about to undertake a huge task in terms of meshing. I am meshing a city. That's a lot of curves! I was wondering if there was a way to input in a code where you tell ICEM for example, I want x number of nodes on a curve of x metres. If I can do this, it will make life a whole lot merrier. Many thanks in advance.
davidwilcox is offline   Reply With Quote

Old   October 27, 2012, 10:27
Default
  #2
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: Melbourne, Australia
Posts: 253
Rep Power: 11
stuart23 will become famous soon enough
If you want x number of nodes on ALL curves, try this:

set no_nodes 20
foreach curves [ic_geo_get_objects curve ""] {ic_set_meshing_params curve $curves emax [expr "[ic_geo_crv_length $curves] / ($no_nodes - 1)"] emin 0 ehgt 0 edev 0 hrat 0 ] }


If you just want all curves to have a max size of x meters, try this:

set max_size 0.1
foreach curves [ic_geo_get_objects curve ""] {ic_set_meshing_params curve $curves emax $max_size emin 0 ehgt 0 edev 0 hrat 0 ] }

Obviously the first line in both codes is just the variable to be set, change it to whatever you need.


Stu
__________________
http://bc247.eng.monash.edu.au
stuart23 is offline   Reply With Quote

Old   October 29, 2012, 19:35
Default
  #3
Member
 
david
Join Date: Oct 2012
Posts: 49
Rep Power: 3
davidwilcox is on a distinguished road
Thanks, Stu. I will give it a go. Hopefully it will work.
davidwilcox is offline   Reply With Quote

Old   October 29, 2012, 20:13
Default
  #4
Member
 
david
Join Date: Oct 2012
Posts: 49
Rep Power: 3
davidwilcox is on a distinguished road
Hi Stu,
I loaded your script file for a simple 3d cube inside of a cube and it didnt work. It worked only for 2 curves. Is there anything else I need to do? I've uploaded the picture of the mesh.the outer box complied with your code but the inner one does not for some reason
Attached Images
File Type: jpg 2boxes.jpg (91.9 KB, 15 views)

Last edited by davidwilcox; October 30, 2012 at 02:22.
davidwilcox is offline   Reply With Quote

Old   November 26, 2012, 03:29
Default ICEM SCRIPT no curve found
  #5
Member
 
david
Join Date: Oct 2012
Posts: 49
Rep Power: 3
davidwilcox is on a distinguished road
Hi Stu,
Thanks for your help. One more question. If let's say I have a curve named "oval", how do I put that into a command script in icem to let that curve have 20 nodes?
I have tried many ways but I always get an error saying " no curve named "oval". I am confused because I named a curve in my geometry oval but the ICEM script could not recognize it. Any suggestions?

Many thanks in advance.
davidwilcox is offline   Reply With Quote

Old   November 26, 2012, 13:59
Default
  #6
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: Melbourne, Australia
Posts: 253
Rep Power: 11
stuart23 will become famous soon enough
David,

How did you create the curve?

I use the following command to create a line:
ic_curve FAMILY_NAME CURVE_NAME {point_name_1 point_name_2}

For an oval, you might have to do a B-spline (or stretch a circle)

Using the command line implicitly creates the curve with the specified name. I am not sure how you have named your curves though. To check the names, right click on lines under geometry and click "show names"


Good Luck

Stu
__________________
http://bc247.eng.monash.edu.au
stuart23 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PEM Fuel cell module meshes. ICEM vs workbench aarvay FLUENT 11 June 25, 2013 06:06
Design Modeler to ICEM..... Joe CFX 0 January 24, 2008 03:39
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
own Code vs. commercial code Bernhard Mueck Main CFD Forum 10 February 16, 2000 10:07


All times are GMT -4. The time now is 12:03.