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/)
-   -   Running a UDF only once per timestep (http://www.cfd-online.com/Forums/fluent-udf/104213-running-udf-only-once-per-timestep.html)

flotus1 July 5, 2012 06:00

Running a UDF only once per timestep
 
Is there any possibility to tun a UDF (like DEFINE_SOURCE for example) only ONCE every timestep and not on every iteration?

Daniel Tanner July 6, 2012 04:03

Try this:

if ( first_iteration )
{
enter your calculations here
}

I got this from:
http://willem.engen.nl/uni/fluent/do...ips-Tricks.pdf

Let me know how it goes.

akm July 6, 2012 07:57

Either what Daniel suggested or you can use the macro EXECUTE_AT_END. Depends on your need, whether you want to execute at beginning or at the end of a time-step.

DEFINE_EXECUTE_AT_END(name)
{
...
}

DEFINE_EXECUTE_AT_END is a general-purpose macro that is executed at the end of an iteration in a steady state run, or at the end of a time step in a transient run.

https://www.sharcnet.ca/Software/Flu...udf/node22.htm


All times are GMT -4. The time now is 22:49.