CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF Problem

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

LinkBack Thread Tools Display Modes
Old   March 1, 2013, 08:01
Post UDF Problem
New Member
Join Date: Oct 2011
Posts: 1
Rep Power: 0
rahulshah is on a distinguished road
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)*/

real hg, Tin;
face_t f;

if (t <= 1.0)
for (hg=26000; hg<=30000; hg=hg+500)
Tin = 216.66 + (a*(hg-25000));
F_PROFILE(f,thread,index) = Tin;

All the doubts are related to the UDF above.

  1. 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?
  2. 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?
  3. 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.
rahulshah is offline   Reply With Quote


Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58

All times are GMT -4. The time now is 08:22.