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

Problem using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2015, 13:35
Smile Problem using UDF
  #1
New Member
 
Ali
Join Date: Mar 2014
Posts: 4
Rep Power: 12
hello77 is on a distinguished road
Hello everyone,
I'm trying to simulate the flow around a multi tubes and fins heat exchanger in starting up condition, transient, using Fluent. The input conditions for water and air are given using the UDF shown below.
When the simulation was run, the water and air inlet temperatures did not change according to the UDF. I mean they keep changing using the equations in the first interval (from 0 to 8000 sec) and did not go to the second condition even the running time was greater than 8000 sec. My experience is very limited in programming with C language and I guess there something wrong with the UDF!
I appreciate your help to solve this issue.

UDF:
#include "udf.h"

DEFINE_PROFILE(RAMP_waterIN, thread, position)
{

float t, waterIN;
face_t f;

t = RP_Get_Real("flow-time");
if (0 < t < 8000)
{ waterIN = (-0.00000000007*(t*t*t))+(0.0000005*(t*t))+(0.0052*t )+296.071;
}
else if (8000 <= t <= 10000)
{ waterIN = 333;
}



begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = waterIN;
}
end_f_loop(f, thread)

}

DEFINE_PROFILE(RAMP_airIN, thread, position)
{

float t, airIN;
face_t f;

t = RP_Get_Real("flow-time");
if (0 < t < 8000)
{ airIN = (-0.000000000006*(t*t*t))+(0.00000006*(t*t))+(0.0002 *t)+292.23;
}
else if (8000 <= t <= 10000)
{ airIN = 294.91;
}



begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = airIN;
}
end_f_loop(f, thread)

}
hello77 is offline   Reply With Quote

Old   July 24, 2015, 02:59
Default
  #2
New Member
 
Jack
Join Date: Jun 2015
Posts: 3
Rep Power: 10
kamer is on a distinguished road
Try to change
if (0 < t < 8000) to if (0<t&&t<8000),
use && as "and" in C language.
other sentences can be treated as the same.
kamer is offline   Reply With Quote

Old   July 24, 2015, 03:00
Default
  #3
New Member
 
Jack
Join Date: Jun 2015
Posts: 3
Rep Power: 10
kamer is on a distinguished road
Try to change
if (0 < t < 8000) to if (0<t&&t<8000),
use && as "and" in C language.
other sentences can be treated as the same.
kamer is offline   Reply With Quote

Old   August 3, 2015, 09:52
Default thank you
  #4
New Member
 
Ali
Join Date: Mar 2014
Posts: 4
Rep Power: 12
hello77 is on a distinguished road
Thank you kamer. its working now.
hello77 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 06:05
udf loading problem santu Fluent UDF and Scheme Programming 1 May 22, 2015 15:47
Vaporization pressure UDF property problem? lehoanganh07 Fluent UDF and Scheme Programming 1 September 13, 2014 10:59
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 00:31


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