CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   How can I update a mass source value (from an udf) each N iteration (https://www.cfd-online.com/Forums/fluent-udf/236751-how-can-i-update-mass-source-value-udf-each-n-iteration.html)

azores June 14, 2021 07:46

How can I update a mass source value (from an udf) each N iteration
 
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!

AlexanderZ June 15, 2021 04:20

DEFINE_SOURCE macro is all you need, it is executed on each iteration/ timestep

azores June 15, 2021 05:40

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

AlexanderZ June 15, 2021 21:21

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

azores June 16, 2021 09:20

Ok, but how can I access the source term (in cell zone condition) if I only define the macro "DEFINE_ADJUST"?

best regards


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