CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Time dependence UDFs. Emergency (http://www.cfd-online.com/Forums/fluent-udf/85497-time-dependence-udfs-emergency.html)

phanh February 27, 2011 23:39

Time dependence UDFs. Emergency
 
Hi all,

I am using UDFs for defining variation of velocity.vs. time function at inlet boundary condition. However, variation of velocity.vs.time function is not any function regulation (eg. sin(x) function), velocity varies time data which I get from *txt file (contain time and velocity, respectively). Anybody have any idea for this problem.

Thanks in advanced

Amir February 28, 2011 05:16

Hi,
you have two choices:
1) fit a specific curve to your data
2)use profile in FLUENT. (you can provide a text file that contains velocity descrete data VS. time)

phanh February 28, 2011 07:06

Hi Amir,

Acttually, I tried to fit data by using least square method and got time function which corresponds to variation of velocity. Also, I can read this data (veloctiy.vs.time) from *txt file into Fluent. However, I haven't yet understood how to get time data for time variable in C program. Now, I think I should use "CURRENT_TIME" variable to form time variable. Is that right? However, if I use this variable for time variable, when Fluent software running, how to get velocity correspond to time step?

Actually, I haven't yet enderstand unteady problem with UDFs.

Please help me.
Thanks

Amir February 28, 2011 08:58

Hi Phanh,
if you want to fit a curve to your data, you should use a UDF and define v=v(t), here you should obtain your proper curve equation before with other softwares and use that in UDF and you can use CURRENT_TIME variable for time.
when FLUENT running, CURRENNT_TIME is passed from FLUENT to UDF and from equation v=v(t), velocity is obtained in UDF.

regards,
Amir

ComputerGuy March 1, 2011 18:31

Phanh,

Post your velocity curve function and I'll post a UDF that will work.

ComputerGuy

trantoan2008 March 3, 2011 03:48

Quote:

Originally Posted by Amir (Post 297296)
Hi Phanh,
if you want to fit a curve to your data, you should use a UDF and define v=v(t), here you should obtain your proper curve equation before with other softwares and use that in UDF and you can use CURRENT_TIME variable for time.
when FLUENT running, CURRENNT_TIME is passed from FLUENT to UDF and from equation v=v(t), velocity is obtained in UDF.

regards,
Amir

Hi Amir,

If I want to use data from text file, what kind of variable should I define?
If we use time variable to define for time data, it means that there are no relation between time variable (time data) and time solution (which I think it's called by "CURRENT_TIME"). My understanding is right, isn't it?

I hope I will receive your responding as soon as possible.
Thanks in advanced.

Phanh.

Amir March 3, 2011 04:35

Quote:

Originally Posted by trantoan2008 (Post 297741)
Hi Amir,

If I want to use data from text file, what kind of variable should I define?
If we use time variable to define for time data, it means that there are no relation between time variable (time data) and time solution (which I think it's called by "CURRENT_TIME"). My understanding is right, isn't it?

I hope I will receive your responding as soon as possible.
Thanks in advanced.

Phanh.

Hi,
if you want to use data from text file, it doesn't need to use any variable because it doesn't need to use any UDF! to obtain good result with this method you should prepare a text file with good resolution. it's better that reserve time step in both text file and FLUENT GUI.
for more information about this method you can also refer to:
(user guide FLUENT 6.3.26 -> 7.1.9 Defining Transient Boundary Conditions)

regards,

Amir


All times are GMT -4. The time now is 16:59.