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

[ANSYS Meshing] Writing a Code for meshing in ICEM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2012, 19:21
Default Writing a Code for meshing in ICEM
  #1
Senior Member
 
david
Join Date: Oct 2012
Posts: 142
Rep Power: 13
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: United Kingdom
Posts: 267
Rep Power: 25
stuart23 will become famous soon enoughstuart23 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
stuart23 is offline   Reply With Quote

Old   October 29, 2012, 18:35
Default
  #3
Senior Member
 
david
Join Date: Oct 2012
Posts: 142
Rep Power: 13
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, 19:13
Default
  #4
Senior Member
 
david
Join Date: Oct 2012
Posts: 142
Rep Power: 13
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, 21 views)

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

Old   November 26, 2012, 03:29
Default ICEM SCRIPT no curve found
  #5
Senior Member
 
david
Join Date: Oct 2012
Posts: 142
Rep Power: 13
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: United Kingdom
Posts: 267
Rep Power: 25
stuart23 will become famous soon enoughstuart23 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
stuart23 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
PEM Fuel cell module meshes. ICEM vs workbench aarvay FLUENT 24 March 2, 2020 06:50
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 23:02.