Chapter 17: Power Syntax in Ansys CFX

Programming constructs can be used within CCL for advanced usage. Rather than invent a new language, CCL takes advantage of the full range of capabilities and resources from an existing programming language, Perl. Perl statements can be embedded in between lines of simple syntax, providing capabilities such as loops, logic, and much, much more with any CCL input file.

A line of Power Syntax is identified in a CCL file by an exclamation mark (!) in the first column of a line. In between Perl lines, simple syntax lines may refer to Perl variables and lists.

A wide range of additional functionality is made available to expert users with the use of Power Syntax including:

  • Loops

  • Logic and control structures

  • Lists and arrays

  • Subroutines with argument handling (useful for defining commonly re-used plots and procedures)

  • Basic I/O processing

  • System functions

  • Many other procedures (Object programming, World Wide Web access, simple embedded graphical user interfaces).

Any of the above may be included in a CCL input file or CFD-Post session file.


Important:  You should be wary when entering certain expressions because Power Syntax uses Perl mathematical operators. For example, in CEL, is represented as 2^2, but in Perl, it would be written 2**2. If you are unsure about the validity of an operator, you should check a Perl reference guide.

There are many good reference books on Perl. Two examples are Learning Perl (ISBN 1-56592-042-2) and Programming Perl (ISBN 1-56592-149-6) from the O’Reilly series.