CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Running a UDF only once per timestep

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2012, 07:00
Default Running a UDF only once per timestep
  #1
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Is there any possibility to tun a UDF (like DEFINE_SOURCE for example) only ONCE every timestep and not on every iteration?
flotus1 is offline   Reply With Quote

Old   July 6, 2012, 05:03
Default
  #2
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18
Daniel Tanner is on a distinguished road
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.
Daniel Tanner is offline   Reply With Quote

Old   July 6, 2012, 08:57
Default
  #3
akm
New Member
 
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16
akm is on a distinguished road
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
akm is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF using c_face_loop(c,t,i) frederic FLUENT 3 January 17, 2017 00:17
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 23:00.