General

General

How to extract an expression value in a CFX-Pre session file and to assign this to a parameter setting which does not otherwise accept expressions, like the maximum number of iterations?

    • FAQFAQ
      Participant

      Typically the Power Syntax command getExprVal() is applied to extract values from an expression. However, this is not available in CFX-Pre session files. The better alternative is to use the command, as this can be used more generally. Please find below an example in which an expression “VarIter” is stored in a Perl variable and then applied to the solver control parameter “Maximum Number of Iterations”. This parameter does not accept expressions in CFX-Pre, so only with such a session file this parameter can be set controlled by other variables. ! ($VarIter,$units) = evaluate(“VarIter”); FLOW: Flow Analysis 1 &replace SOLVER CONTROL: CONVERGENCE CONTROL: Maximum Number of Iterations = $VarIter END # CONVERGENCE CONTROL: END # SOLVER CONTROL: END # FLOW:Flow Analysis 1 > update