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

[ICEM] Question about ICEM script failure

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By stuart23

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2012, 10:30
Question Question about ICEM script failure
  #1
lnk
Senior Member
 
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15
lnk is on a distinguished road
Hi everyone,

May I ask why the following script doesn't work?

'
set a 2.5
set b (sqrt(pi*$a*$a)*0.5)

ic_undo_group_begin
ic_geo_new_family GEOM
ic_boco_set_part_color GEOM
ic_empty_tetin
ic_point {} GEOM pnt.00 0,0,$b
ic_undo_group_end
'

but this works

'
set a 2.5
set b (sqrt(pi*$a*$a)*0.5)

ic_undo_group_begin
ic_geo_new_family GEOM
ic_boco_set_part_color GEOM
ic_empty_tetin
ic_point {} GEOM pnt.00 0,0,0
ic_undo_group_end
'


Best regard and many thanks,
lnk

Last edited by lnk; July 29, 2012 at 11:27.
lnk is offline   Reply With Quote

Old   July 24, 2012, 10:53
Default
  #2
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
I am not able to execute both correctly
Far is offline   Reply With Quote

Old   July 24, 2012, 11:22
Default
  #3
lnk
Senior Member
 
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15
lnk is on a distinguished road
Quote:
Originally Posted by Far View Post
I am not able to execute both correctly
If u copy it directly,

please change 'pipe_radius_fo r_round_pipe'

to 'pipe_radius_for_round_pipe' at the second line for the both case.


Bug of this website. I can't correct it at the question.
lnk is offline   Reply With Quote

Old   July 29, 2012, 10:19
Default
  #4
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 26
stuart23 will become famous soon enoughstuart23 will become famous soon enough
Hi Ink,

You need to understand that the programming language used for ICEM is LISP. LISP is different to many other common languages (c, python, fortran, java etc) in the way that functions are used. The simple 1 + 2 + 3 + 4 is lisp is actually (+ 1 2 3 4) i.e. the operator (+) goes at the start followed by the arguements (1 2 3 4).

If you do a quick google for LISP programming, I'm sure you will find some great guides. The only piece of advice I will offer is that multiply CANNOT multiply more than two values, ie 2 * 3 * 4 * 5 CANNOT be written in LISP as (MULT 2 3 4 5). The easiest way to do this is to nest the multiplications, giving: (MULT (MULT 2 3) (MULT 4 5)). Obviously the inner multiplications are equated first, then the outer one gives the final value. This is the same as (2 * 3) * (4 * 5).

Stu
lnk likes this.
stuart23 is offline   Reply With Quote

Old   July 29, 2012, 11:03
Default
  #5
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Quote:
Originally Posted by stuart23 View Post
Hi Ink,

You need to understand that the programming language used for ICEM is LISP. LISP is different to many other common languages (c, python, fortran, java etc) in the way that functions are used.

Stu
Are you sure?
Far is offline   Reply With Quote

Old   July 29, 2012, 11:15
Default
  #6
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 26
stuart23 will become famous soon enoughstuart23 will become famous soon enough
Hahaha, sorry it's late and I'm tired :-(. I was thinking Fluent. Fluent's scripting langauge is LISP, ICEM uses Tcl/Tk. In Tcl you use the expr function to evaluate maths functions.

For example:
set aft_angle [expr { (22000+(1-$steer_param)*1530)/$radius }]
stuart23 is offline   Reply With Quote

Old   July 29, 2012, 11:30
Default
  #7
lnk
Senior Member
 
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15
lnk is on a distinguished road
Quote:
Originally Posted by Far View Post
Are you sure?
Hey, Far. Do you have any idea about my question? I have fixed the question. Now you can copy the script directly.
lnk 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
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 16:26
Question about Table applicaiton. universez OpenFOAM Running, Solving & CFD 0 January 12, 2010 21:31
[ICEM] Building topology command script files Anorky ANSYS Meshing & Geometry 8 January 11, 2010 08:25
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37
awk script question awk script question Main CFD Forum 0 March 28, 2005 03:06


All times are GMT -4. The time now is 21:53.