Dear all,
I would like to check whether the value of the variable can be incremented or not? Here is a simplified example:
variable A equal 5
....
run 10000
Variable A equal "A*2"
Many thanks, Haithem
A project by DCS Computing and CFDEMresearch
This website uses cookies to ensure you get the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies. This website uses cookies. By continuing to browse the site you are agreeing to our use of cookies. More info
paul | Thu, 06/07/2018 - 20:01
Have you tried doing it?
Have you tried doing it?
There is a commando called print that can be used to output, among other things, the output of variables. Read the documentation.
richti83 | Fri, 06/08/2018 - 08:20
should be
should be
variable A equal 5
run 10000
variable A equal $A*5
The syntax ist:
$A for parser
v_A for runtime variable
Immediate Evaluation of Variables:
______________________________________
There is a difference between referencing a variable with a leading $ sign (e.g. $x or ${abc}) versus with a leading “v_” (e.g. v_x or v_abc). The former can be used in any input script command, including a variable command. The input script parser evaluates the reference variable immediately and substitutes its value into the command. As explained in Section commands 3.2 for “Parsing rules”, you can also use un-named “immediate” variables for this purpose. An variable reference such as $((xlo+xhi)/2+sqrt(v_area)) evaluates the string between the parenthesis as an equal-style variable.
https://www.cfdem.com/media/DEM/docu/variable.html
Haith | Tue, 06/12/2018 - 11:34
Many thanks Richti83, It is
Many thanks Richti83, It is working now
BW, Haithem