# UDF Problem

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 1, 2013, 08:01 UDF Problem #1 New Member   Join Date: Oct 2011 Posts: 1 Rep Power: 0 Sponsored Links Hi everyone. I am using UDF to input various atmospheric properties for solving my transient thermal analysis. There are a few doubts that i am having regarding how FLUENT works with UDF. Hope I get my doubts cleared here. Am giving a list of doubts here. Firstly i am adding the code dat i have written: "#include "udf.h" #define gamma 1.4 #define R 218.6 /* J/kg-K */ #define g 9.8 /* m/s^2 */ #define a 3e-3 /* K/m */ /* hg = geopotential altitude (m)*/ /* a = lapse rate */ /* Tin = Temperature at inlet (K)*/ DEFINE_PROFILE(Temp_inlet,thread,index) { real hg, Tin; real t = CURRENT_TIMESTEP; face_t f; begin_f_loop(f,thread) { if (t <= 1.0) { for (hg=26000; hg<=30000; hg=hg+500) Tin = 216.66 + (a*(hg-25000)); F_PROFILE(f,thread,index) = Tin; } } end_f_loop(f,thread) } " All the doubts are related to the UDF above. As it is seen am assigning a variable to obtain the current time step from the flow. What i want to know does it get updated after each time step. Meaning does 't' change its value from 0.1 to 0.2 when fluent completes one time step and updates itself. If not then what to do to update it? It is seen when the value of 't' is compared wid d numerical value, it goes into the inner for-loop . I am implementing the UDF thinking that it always gets updated after each timestep. but from the results got, i am having doubts whether it is getting updated or not. I want to know if the UDF gets updated after each time step does FLUENT start to calculate the full flow field using the values from the previous time step as initial values and the changed input values as new input conditions. If not then wat does it do when at delta-t changes from 0.1 to 0.2? Finally I also want to know this. When the UDF is used to calculate the temperature, as it is seen the code has a for-loop. From the UDF my aim is, for every increase in time step the height should increase and only once the temperature has to be calculated and has to be given as inlet condition at d beginning of each new time step. But i feel that the for-loop is executed for also the iterations between each time step. Can somebody tell me how d UDF gets executed, i.e. is it getting executed even for the iterations or not (tell me by reading the code). Well I hope i am clear in my doubt. Hope to get replies form the persons who read it.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Rizwan Fluent UDF and Scheme Programming 39 June 29, 2017 19:04 july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56 mansha goraya FLUENT 0 October 29, 2007 01:31 akr FLUENT 3 August 22, 2007 07:14 chiseung FLUENT 4 January 10, 2002 10:58

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