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 Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2021, 08: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: 5
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, 05:20
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
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, 06:40
Default
  #3
New Member
 
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 5
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, 22:21
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
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, 10:20
Default
  #5
New Member
 
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 5
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


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


All times are GMT -4. The time now is 20:47.