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

looping with incremental surface name

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2008, 16: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, 14: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, 16: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 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
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 12:12
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 12:05
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
[Gmsh] boundaries with gmshToFoam‏ ouafa OpenFOAM Meshing & Mesh Conversion 7 May 21, 2010 13:43
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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