|
[Sponsors] |
How can I update a mass source value (from an udf) each N iteration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 14, 2021, 08:46 |
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 |
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! |
|
June 15, 2021, 05:20 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
DEFINE_SOURCE macro is all you need, it is executed on each iteration/ timestep
__________________
best regards ****************************** press LIKE if this message was helpful |
|
June 15, 2021, 06:40 |
|
#3 |
New Member
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 5 |
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 |
|
June 15, 2021, 22:21 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
June 16, 2021, 10:20 |
|
#5 |
New Member
Beatriz
Join Date: Jun 2021
Posts: 11
Rep Power: 5 |
Ok, but how can I access the source term (in cell zone condition) if I only define the macro "DEFINE_ADJUST"?
best regards |
|
Tags |
define_source, fluent, udf, update source |
|
|
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 |