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

Syntax errors with Thread Types and Wall Heat Transfer calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2011, 05:55
Default Syntax errors with Thread Types and Wall Heat Transfer calculation
  #1
New Member
 
Jesus Contreras Espada
Join Date: Aug 2011
Location: Switzerland
Posts: 12
Rep Power: 15
jcespada is on a distinguished road
Hello,

I am trying to let Fluent calculate the temperature of a wall that gives a certain heat flux at the end of the calculation. First i run some iterations with a constant temperature at the wall and then I compile (interpreted) the udf and assign it to the wall temperature.

The code looks like this:
#include"udf.h"


DEFINE_PROFILE(wall_temp,t,i)
{

face_t f;
Thread *f_thread;
Domain *domain = Get_Domain(1);
real x[ND_ND];
real end_heat = 52.939E+06; /* goal heat transfer from the gas to the wall */
real alpha = 1.2; /* correction factor for the wall temperature */
real curr_heat = 0.0; /* current heat transfer from the flow to the wall */
real temper = 300.0; /* face temperature */


thread_loop_f(f_thread, domain)
{
if(THREAD_TYPE(f_thread) == THREAD_F_WALL)
{
begin_f_loop(f,f_thread)
{
curr_heat += abs(BOUNDARY_HEAT_FLUX(f,f_thread));
}
end_f_loop(f,f_thread)
}
}

begin_f_loop(f,t)
{
temper = F_T(f,t);
F_PROFILE(f,t,i) = temper * alpha;

}
end_f_loop(f,t)


if (temper >= 1000) temper = 1000; /* temperature is clipped 200K =< T =< 1000 */
if (temper <=200) temper = 200;


}
The line "if(THREAD_TYPE(f_thread) == THREAD_F_WALL)" does not work. I thought it should be quite easy to verify if a thread is a wall, but I always get the error message "structure reference not implemented". Maybe it has something to do with the installation or the version. I use Fluent 13.0.0.


The macro BOUNDARY_HEAT_FLUX(f,f_thread); gives after 1 iteration "access violation" as output and I have to restart FLUENT.

Finally abs() doesn't work either, since there is no math.h file in the src directory. Any idea how to overcome this?

I would be very thankful, if someone could help.
Thanks in advance and best regards.
J.
jcespada is offline   Reply With Quote

Old   August 22, 2011, 06:24
Default Correction
  #2
New Member
 
Jesus Contreras Espada
Join Date: Aug 2011
Location: Switzerland
Posts: 12
Rep Power: 15
jcespada is on a distinguished road
Sorry, the calculation of the correction factor is missing in the code.
There is a line looking like this between the two big loops:
alpha = curr_heat / end_heat;
jcespada is offline   Reply With Quote

Old   March 16, 2012, 03:23
Default
  #3
Member
 
Join Date: Mar 2011
Posts: 50
Rep Power: 15
cdf_user is on a distinguished road
what does this statement mean?

if(THREAD_TYPE(f_thread) == THREAD_F_WALL)
cdf_user 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
udf problem jane Fluent UDF and Scheme Programming 37 February 20, 2018 05:17
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
how to impose experimental dat as boundary conditi Rogerio Fernandes Brito FLUENT 14 November 25, 2008 06:47
heat transfer fluid-wall marco FLUENT 7 November 20, 2005 12:34
Pipe wall temperature Fred Uckfield Main CFD Forum 25 May 22, 2000 15:37


All times are GMT -4. The time now is 15:21.