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

UDF for heat transfer coefficient in porous media

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2014, 07:41
Question UDF for heat transfer coefficient in porous media
  #1
Disabled
 
Join Date: Nov 2013
Posts: 16
Rep Power: 12
anon_m is on a distinguished road
Hello:
I am trying to write a udf to define the heat transfer coeff. in thermal non equilibrium (TNE) porous zone. The model is 2d-axisymmetric.

Attached is the schematic of the model. I need to calculate following variables:

1- averaged density and temperature at B-inlet.
2- averaged density at zone B.

The udf is as follows. Adding the TNE part caused an error Is it due to the udf or how I define the TNE model?

#include "udf.h"
#define Zone_ID 2

DEFINE_PROFILE(HTCfs, thread, i)
{
Domain *d = Get_Domain(1);
cell_t c;
int ncount = 0;
real volume_C_R,temp_C_R,ro_C_R,press_C_R;
real volume_C_H,temp_C_H,ro_C_H,press_C_H;
real volume_R = 0.0;
real T_R = 0.0;
real P_R = 0.0;
real ro_R = 0.0;
real volume_H = 0.0;
real T_H = 0.0;
real P_H = 0.0;
real ro_H = 0.0;
real xmin = 1.83;
real xmax = 4.27;
real xmaxH = 1.9;
real RoStar = 0.0;
real x;
real xc[ND_ND];
real Vswe = 1.06e-6;
real AReg = 0.002715;
real e = 0.66;
real freq = 50;
real dw = 0.03556e-3;
real rh = 0.25*dw*e/(1-e);
real De = 4*rh;
real kf,rof,muf;
real term1 = 0.33/De*pow(2*Vswe*freq*De/AReg/e,0.67);
real hfs_f;
real hfs=0.0;
FILE *fp;

begin_c_loop(c, thread)
{
C_CENTROID(xc,c,thread);
x = xc[0];
if ((x >= xmin) && (x <= xmax))
{
volume_C_R = C_VOLUME(c,thread);
temp_C_R = C_T(c,thread);
press_C_R = C_P(c,thread);
ro_C_R = C_R(c,thread);
volume_R += volume_C_R;
T_R += temp_C_R * volume_C_R;
P_R += press_C_R * volume_C_R;
ro_R += ro_C_R * volume_C_R;
}
if ((x >= xmin) && (x <= xmaxH))
{
/*printf("\n x= %f\n",xc[0]);*/
volume_C_H = C_VOLUME(c,thread);
temp_C_H = C_T(c,thread);
press_C_H = C_P(c,thread);
ro_C_H = C_R(c,thread);
volume_H += volume_C_H;
T_H += temp_C_H * volume_C_H;
P_H += press_C_H * volume_C_H;
ro_H += ro_C_H * volume_C_H;
}
}
end_c_loop(c, thread)
T_R /= volume_R;
P_R /= volume_R;
ro_R /= volume_R;
T_H /= volume_H;
P_H /= volume_H;
ro_H /= volume_H;
RoStar = ro_H/ro_R;

begin_c_loop(c, thread)
{
C_CENTROID(xc,c,thread);
x = xc[0];
if ((x >= xmin) && (x <= xmax))
{
kf = C_K_L(c,thread);
rof = C_R(c,thread);
muf = C_MU_L(c,thread);
volume_C_R= C_VOLUME(c,thread);
hfs_f = term1*kf *pow(rof*RoStar/muf,0.67);
hfs += hfs_f*volume_C_R;
fp = fopen("hsf.txt","a");
fprintf(fp,"%8.4e \n",hfs_f);
fclose (fp);
C_PROFILE(c, thread, i) = 1;
}
}
end_c_loop(c, thread)
hfs /= volume_R;

}
Attached Images
File Type: jpg model.jpg (69.5 KB, 23 views)

Last edited by anon_m; July 29, 2014 at 13:01.
anon_m is offline   Reply With Quote

Old   July 29, 2014, 10:32
Default
  #2
Disabled
 
Join Date: Nov 2013
Posts: 16
Rep Power: 12
anon_m is on a distinguished road
Looking forward to your suggestions. Thanks
anon_m is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porous media setup issues in Fluent Bernard Van FLUENT 29 January 26, 2017 04:09
How to model granular flow through porous media Axius FLUENT 2 August 7, 2014 10:34
UDF for heat transfer coefficient in porous media anon_m FLUENT 0 July 24, 2014 18:37
Porous Media with non-thermal Equilibrium for bio-heat transfer vyas.manutd89 FLUENT 0 May 21, 2014 01:01
Porous Media With Heat Transfer A.S. Main CFD Forum 1 January 10, 2005 03:56


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