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 to make a UDF to repeat itself ??? (https://www.cfd-online.com/Forums/fluent-udf/70609-how-make-udf-repeat-itself.html)

magnounibo November 30, 2009 10:13

How to make a UDF to repeat itself ???
 
Hi everybody,

I would like UDF to repeat itself adjusting a variable until it reaches a specific (under a tolerance) value.

I'm using VOF multiphase model to simulate transient vapor bubble growing in a superheated liquid, mass and energy sources are given by UDF.

At each time step, Fluent calculates mass and energy rates through my DEFINE_SOURCE UDFs. Then it put this value inside energy and continuity equations and solves them to compute fields of temperature and other variables.

This is the basis.

Then, before a new time step is computed, I would like to control that calculated temperature at the liquid-vapor interface is at the saturation temperature, if negative I want Fluent to restart mass and energy sources calculation and go on until saturation temperature at the interface is matched.

So, it's like an iterative procedure in which at each time step UDF has to be repeated until a precise value becomes under a determinate tolerance.
My problem is that I don't know how to write an UDF that does this work.

Can anybody help me???

Thank in advance

Mirco

liurengtong123 June 25, 2010 06:44

Hi, i have the same question like you ,i want to know if you know how to solve it.
Big thanks!!!!

qwerty753 June 30, 2010 05:39

I have the same problem about BC at imposed heat flux.
I want to control a parameter unitil the first time step and restart this time step if my tollerance criterium isn't satisfied.
How to write in UDF?
Thank

liurengtong123 July 2, 2010 03:33

is there someone can solve this problem ? I need your help!!!

qwerty753 July 11, 2010 05:16

Have anyone an idea?

pranab_jha July 26, 2011 16:15

Hi guys, this might be too late. But I think this problem can be solved using a UDM (user defined memory) location. You can store the value from one iteration in the UDM and then in the next time-step, you can compare the new value against the old value (stored in the UDM).


All times are GMT -4. The time now is 02:10.