CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   if statement in execute commands (https://www.cfd-online.com/Forums/fluent/228978-if-statement-execute-commands.html)

mohamadalimirzaei1994 July 22, 2020 05:27

if statement in execute commands
 
I want to check a variable each time step and do some changes to the case file if the value is higher than a specific number. to do so, I am using execute command each time step using following command:

(if (<= 3500.0 (string->number (pick-robust "/report/volume-integrals/maximum 20 231 () phase-1 viscosity-ratio no"))) (/solve/set/transient-controls/time-step-size 0.01))

but I receive the following error as I run the simulation and when the command is executed:

Error: eval: unbound variable

Error Object: /solve/set/transient-controls/time-step-siz
e



Do you know what is the problem and how I can resolve the problem?

AlexanderZ July 23, 2020 02:01

where did you get it?
Code:

pick-robust
try following command
Code:

(if (<= 3500.0 (string->number (pick-a-real "/report/volume-integrals/maximum 20 231 () phase-1 viscosity-ratio no"))) (/solve/set/transient-controls/time-step-size 0.01)())

mohamadalimirzaei1994 July 23, 2020 03:25

Quote:

Originally Posted by AlexanderZ (Post 778545)
where did you get it?
Code:

pick-robust
try following command
Code:

(if (<= 3500.0 (string->number (pick-a-real "/report/volume-integrals/maximum 20 231 () phase-1 viscosity-ratio no"))) (/solve/set/transient-controls/time-step-size 0.01)())

nothing changed. I guess the issue is with the other part (/solve/set/transient-controls/time-step-size 0.01) do you have any comment on that?

regards.

AlexanderZ July 23, 2020 04:14

Code:

(if (<= 3500.0 (string->number (pick-a-real "/report/volume-integrals/maximum 20 231 () phase-1 viscosity-ratio no"))) (ti-menu-load-string (format #f "solve set t-s 0.01"))())


All times are GMT -4. The time now is 10:25.