CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Variable definition in UDF (http://www.cfd-online.com/Forums/fluent-udf/107580-variable-definition-udf.html)

syavash October 1, 2012 17:17

Variable definition in UDF
 
Hi friends,

I am implementing a Define_execute_at_end macro in a transient simulation.
I have a variable, named "j" which has an certain initial value at first time step. But inside the macro, it's value changes and this variable is updated.
Now for second time step I need to use the updated value of "j" and the problem is here. If I define "j" as a static variable and assign an initial value to it inside the macro, how is it possible to access the updated value of "j" for the second time step? As I know the variables are all reset at each new time step unless they're already defined as "static", but how to skip that initial value for the second time step?
I appreciate any kind of help.
tnx.


All times are GMT -4. The time now is 03:24.