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

How can I update a mass source value (from an udf) each N iteration

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2021, 07:46
Default How can I update a mass source value (from an udf) each N iteration
  #1
New Member
 
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 2
azores is on a distinguished road
Hello,

I would like to update a mass source value each 100 iterations. I have an udf that call a fortran program that calculates the mass source value. So, to define the number of iterations, do I need a second udf? Or can I use DEFINE_ADJUST inside the DEFINE_SOURCE?

Thanks in advance!
azores is offline   Reply With Quote

Old   June 15, 2021, 04:20
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,723
Rep Power: 28
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
DEFINE_SOURCE macro is all you need, it is executed on each iteration/ timestep
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   June 15, 2021, 05:40
Default
  #3
New Member
 
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 2
azores is on a distinguished road
Hello Alexander,

Thanks for your reply. But if I want to update the mass source value each 100 iteration, for example, is that possible?

best regards
azores is offline   Reply With Quote

Old   June 15, 2021, 21:21
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,723
Rep Power: 28
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
yes,
DEFINE_SOURCE macro is updating source on each iteration

however, you may compute source value using other macro
DEFINE_ADJUST macro in case you are calculating before iteration
DEFINE_EXECUTE_AT_END macro in case you are calculating after iteration


for more information read ansys fluent customization manual
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   June 16, 2021, 09:20
Default
  #5
New Member
 
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 2
azores is on a distinguished road
Ok, but how can I access the source term (in cell zone condition) if I only define the macro "DEFINE_ADJUST"?

best regards
azores is offline   Reply With Quote

Reply

Tags
define_source, fluent, udf, update source

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 16:18
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 77 May 7, 2020 04:22
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57


All times are GMT -4. The time now is 05:26.