|
[Sponsors] |
September 15, 2008, 16:31 |
looping with incremental surface name
|
#1 |
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? |
|
September 16, 2008, 14:54 |
Re: looping with incremental surface name
|
#2 |
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 |
|
September 16, 2008, 16:15 |
Re: looping with incremental surface name
|
#3 |
Guest
Posts: n/a
|
It works perfectly. Thank you very much CycLone
|
|
|
|
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 |