CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > CFX

looping with incremental surface name

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 15, 2008, 15:31
Default looping with incremental surface name
  #1
Federico
Guest
 
Posts: n/a
Hello,

I'm writing a macro for CFX Post that calculates the mass flow rate across a series of 20 planes named 'Channel 1', 'Channel 2', etc.

I have written the following loop:

! for($j=1;$j<=20;$j++){ !($flowrate)=evaluate('massFlow()@Channel $j'); !}

but I get en error message since CFX does not recognize my surface Channel $j. Does somebody know a way to solve this problem? Is it possible to have an incremental variable name in a CCL?
  Reply With Quote

Old   September 16, 2008, 13:54
Default Re: looping with incremental surface name
  #2
CycLone
Guest
 
Posts: n/a
Hi Federico,

The problem is the single quotes around the mass flow expression. Within single quotes the text is taken directly, so the value of $j does not get interpolated from PERL. You can either put it in double quotes, in which case you need to escape the brackets, @ symbol, etc., or you can refer to your expression by name and update the expression definition at each pass. I recommend the latter, which would change your script to:
! for($j=1;$j<=20;$j++){LIBRARY: CEL: EXPRESSIONS: myFlowRate = massFlow()@Channel $j END ENDEND!($flowrate)=evaluate('myFlowRate');!}-CycLone
  Reply With Quote

Old   September 16, 2008, 15:15
Default Re: looping with incremental surface name
  #3
Federico
Guest
 
Posts: n/a
It works perfectly. Thank you very much CycLone
  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
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 19 July 31, 2015 05:10
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 1 July 14, 2015 05:54
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 0 August 5, 2011 16:02
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 16:26.