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/)
-   -   execute udf after convergence (https://www.cfd-online.com/Forums/fluent-udf/95984-execute-udf-after-convergence.html)

wanghaojie January 9, 2012 13:07

execute udf after convergence
 
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.

mali28 January 23, 2012 14:20

Quote:

Originally Posted by wanghaojie (Post 338515)
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.

ComputerGuy January 23, 2012 15:11

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 (Post 338515)
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.


djing January 23, 2012 17:51

how I can use two UDF at the same time
 
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 January 24, 2012 18:01

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 (Post 340747)
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


vidyadhar April 4, 2019 22:28

Quote:

Originally Posted by ComputerGuy (Post 340713)
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

AlexanderZ April 5, 2019 02:00

use DEFINE_EXECUTE_AT_END instead of DEFINE_ADJUST

best regards


All times are GMT -4. The time now is 00:40.