|
[Sponsors] |
July 23, 2009, 14:45 |
Tecplot Macro - conditional - array variable
|
#1 |
New Member
Prabavathi Chidhambaram
Join Date: Jul 2009
Posts: 2
Rep Power: 0 |
Hi
I am using Tecplot 10. I am able to use conditional Tecplot macros for scalar variables. Ex: #!MC 1000 $!Macrofunction Name = "CheckControl" $!Varset |A| =2 $!Varset |B| =1 $!If |B| != 0 $!ALTERDATA EQUATION = '{CC} = ATAN({AA}/{BB})' $!Else $!ALTERDATA EQUATION = '{CC} = ATAN({AA})' $!Endif $!Endmacrofunction $!Runmacrofunction "CheckControl" I also want to use conditional Tecplot macros for array variables. For example, I want to scan the array {BB} and evaluate the array {CC}. Will you please let me know the syntax in Tecplot? Thanks Praba |
|
July 28, 2009, 20:02 |
|
#2 |
Senior Member
Scott Fowler
Join Date: May 2009
Posts: 122
Rep Power: 17 |
You should be able to use $!GETFIELDVALUE to get values from a particular zone/variable. Something like this:
$!LOOP |NUMPOINTS| $!GETFIELDVALUE |VALUE|$!ENDLOOPZONE = 1#Do something with |VALUE| You'll need to know, or calculate |NUMPOINTS|. |
|
July 29, 2009, 10:48 |
Tecplot Macro - conditional - array variable
|
#3 |
New Member
Prabavathi Chidhambaram
Join Date: Jul 2009
Posts: 2
Rep Power: 0 |
Thank you Scott!
My macro works! #!MC 1000 #$!VarSet |MFBD| = 'C:\Program Files\TEC100' $!Macrofunction Name = "Equation1" $!VarSet |NumPoints| = (|MaxI|*|MaxJ|*|MaxK|) $!VarSet |VarFp| = 42 #Fp $!VarSet |ConstantF| = 1.2776E+06 $!VarSet |ANR| = 3.0E+11 $!LOOP |NumPoints| $!GetFieldValue |Value| Zone = 1 Var = |VarFp| Index = |LOOP| # $!If |Value| > |ConstantF| $!ALTERDATA EQUATION = '{DELTA} = |ANR|/(2 * PI * SQRT(|Value|*|Value| - |ConstantF|*|ConstantF|))' $!Else $!ALTERDATA EQUATION = '{DELTA} = 1000' $!Endif $!ENDLOOP # #Cleanup # $!RemoveVar |NumPoints| $!RemoveVar |VarFp| $!RemoveVar |ConstantF| $!RemoveVar |ANR| $!RemoveVar |Value| $!Endmacrofunction $!Runmacrofunction "Equation1" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract Data from Polyline in a Macro (Tecplot) | Joe | Main CFD Forum | 0 | September 5, 2008 04:46 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
TECPLOT 10 macro problem | Matthew Morse | Tecplot | 5 | July 5, 2004 02:31 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |