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

execute udf after convergence

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2012, 13:07
Default execute udf after convergence
  #1
Member
 
HJ
Join Date: Nov 2011
Posts: 30
Rep Power: 14
wanghaojie is on a distinguished road
Dear all,

does anyone know how to execute a udf after convergence for steady state case. I find execute_at_end can only execute after one iteration.
wanghaojie is offline   Reply With Quote

Old   January 23, 2012, 14:20
Default
  #2
Member
 
Join Date: Jun 2011
Posts: 86
Rep Power: 14
mali28 is on a distinguished road
Quote:
Originally Posted by wanghaojie View Post
Dear all,

does anyone know how to execute a udf after convergence for steady state case. I find execute_at_end can only execute after one iteration.
You can use:

DEFINE ON DEMAND()

See the Fluent manual for details.
mali28 is offline   Reply With Quote

Old   January 23, 2012, 15:11
Default
  #3
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16
ComputerGuy is on a distinguished road
Wanghaojie,

If you're only looking to execute the code once, mali28's suggestion is correct. Have a look here: http://www.cfd-online.com/Forums/flu...ed-memory.html for a UDF which will run the macro ONLY IF time> a value you specify.

However, if you're looking to run a macro at every timestep/iteration beyond a certain point, I recommend using the DEFINE_ADJUST macro, which will continue to run automatically, as opposed to only running once, per mali28's suggestion.

ComputerGuy

Quote:
Originally Posted by wanghaojie View Post
Dear all,

does anyone know how to execute a udf after convergence for steady state case. I find execute_at_end can only execute after one iteration.
ComputerGuy is offline   Reply With Quote

Old   January 23, 2012, 17:51
Smile how I can use two UDF at the same time
  #4
New Member
 
Join Date: Sep 2011
Posts: 15
Rep Power: 14
djing is on a distinguished road
I want to start an unsteady calculation in FLUENT , I use an unsteady velocity profile to the INLET, and An unsteady pressure to the outlet
the problem is that I could not run both UDF at the same time as boundary conditions of my problem
please help me as soon as possible
cordially
djing is offline   Reply With Quote

Old   January 24, 2012, 18:01
Default
  #5
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16
ComputerGuy is on a distinguished road
You should be able to define two separate define_profile functions with different names. Then, in fluent, you'll need to hook the appropriate functions to your boundaries. Let us know if you're still having problems with this. If you want the code written, write down your equations for each (velocity and pressure) with time, and I'll send you the code.

ComputerGuy

Quote:
Originally Posted by djing View Post
I want to start an unsteady calculation in FLUENT , I use an unsteady velocity profile to the INLET, and An unsteady pressure to the outlet
the problem is that I could not run both UDF at the same time as boundary conditions of my problem
please help me as soon as possible
cordially
ComputerGuy is offline   Reply With Quote

Old   April 4, 2019, 22:28
Default
  #6
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 9
vidyadhar is on a distinguished road
Quote:
Originally Posted by ComputerGuy View Post
Wanghaojie,

If you're only looking to execute the code once, mali28's suggestion is correct. Have a look here: http://www.cfd-online.com/Forums/flu...ed-memory.html for a UDF which will run the macro ONLY IF time> a value you specify.

However, if you're looking to run a macro at every timestep/iteration beyond a certain point, I recommend using the DEFINE_ADJUST macro, which will continue to run automatically, as opposed to only running once, per mali28's suggestion.

ComputerGuy

Hello ComputerGuy,


I am running a transient simulation.
Is there a way to execute DEFINE_ADJUST after achieving convergence in every timestep. I want to determine the gradient of volume fraction of secondary phase in this macro and store in a UDM to use later.

Solution is converging between 5 to 15 iterations in each time step.




Thanks & Regards,
Vidyadhar
vidyadhar is offline   Reply With Quote

Old   April 5, 2019, 02:00
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
use DEFINE_EXECUTE_AT_END instead of DEFINE_ADJUST

best regards
vidyadhar likes this.
AlexanderZ 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 16, 2017 23:17
UDF programming fullmonty FLUENT 5 June 30, 2011 02:40
execute udf in ss & transient simulation hosseinhgf FLUENT 0 December 1, 2010 08:41
UDF for a field size spring FLUENT 0 May 11, 2010 09:02
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 15:50


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