CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF Problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2013, 08:01
Post UDF Problem
  #1
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)*/

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.

  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

Reply


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 Off
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 40 March 18, 2018 07:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


All times are GMT -4. The time now is 20:33.