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

view factor

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 1, 2013, 01:44
Default view factor
  #1
New Member
 
morteza
Join Date: Jan 2013
Posts: 8
Rep Power: 4
yoollooz is on a distinguished road
Hello,

I want to compute view factor between two boundary mesh faces .I wrote one udf file but i dont know is it true or no?

the other problem is i don know how can i build one 2D matrix with udf?
plz help me.


#include "udf.h"
#include metric.h
#include SG_mem.h
DEFINE_SOURCE(ss,c,t,dS,eqn)

{

real X=0.1;
real p_co2_s=0.09627;
real p_h2o_s=0.18753;
real p_co2=p_co2_s*(10.875)/(10.785+(9.76*X)/100.);
real p_h2o=p_h2o_s*(10.875)/(10.785+(9.76*X)/100.);
real p_total;
real k1=0.;
real k2=.89;
real k3=15.5;
real k4=240;
real K1;
real K2;
real K3;
real K4;
real ss1;
real ss2;
real ss3;
real ss4;
real A1[ND_ND];
real A2[ND_ND];
real A3[ND_ND];
real x[ND_ND];
real x1[ND_ND];
real x2[ND_ND];
real x3[ND_ND];
real s1;
real s2;
real abs_s;
real epsilon=0.85;
real rho;
real m;
real n;
real r;
real x_ik[ND_ND];
real y[ND_ND];
real p;
real r_p[ND_ND];
real r_kmax;
real x_kmax;
real y_kmax;
real z_kmax;
real abs_r_p;
int g;
face_t f1;
face_t f2;
face_t f3;
cell_t c;


// k calculation
p_total=p_co2+p_h2o;
K1=k1*p_total;
K2=k2*p_total;
K3=k3*p_total;
K4=k4*p_total;

// ss calculation
begin_f_loop(f1,t)
{
begin_f_loop(f2,t)
{

F_CENTROID(x1,f1,t);
F_AREA(A1,f1,t);

F_CENTROID(x2,f2,t);
F_AREA(A2,f2,t);

x[ND_ND]=x1[ND_ND]-x2[ND_ND];
n=C_FACE(c,t,g);
begin_f_loop(f3,t)
{

F_CENTROID(x3,f3,t);
F_AREA(A3,f3,t);
NV_VV(x_ik,=,x,-,x1);

p=NV_DOT(x_ik,A3)/NV_DOT(x,A3);

f_node_loop(f3,t,r)
{

x_kmax=x3[0]-NODE_X(node);
y_kmax=x3[1]-NODE_Y(node);
z_kmax=x3[2]-NODE_Z(node);
r_kmax=sqrt (pow(x_kmax,2)+pow(y_kmax,2)+pow(z_kmax,2));

}

NV_VS (y,=,x,*,p);
NV_VV(r_p,=,x1,+,y);
abs_r_p=NV_MAG(r_p);
if(0<p && p<1 && abs_r_p<r_kmax)
{

s1=fabs(NV_DOT(x,A1));
s2=fabs(NV_DOT(x,A2));
abs_s=NV_MAG(x);
ss1=(exp(-K1*abs_s)*s1*s2)/(M_PI*pow(abs_s,4));
ss2=(exp(-K2*abs_s)*s1*s2)/(M_PI*pow(abs_s,4));
ss3=(exp(-K3*abs_s)*s1*s2)/(M_PI*pow(abs_s,4));
ss4=(exp(-K4*abs_s)*s1*s2)/(M_PI*pow(abs_s,4));

}
else ss1=ss2=ss3=ss4=0;


}
end_f_loop(f3,t)
}
end_f_loop(f2,t)
}
end_f_loop(f1,t)
return ss1, ss2 , ss3,ss4;
}
yoollooz is offline   Reply With Quote

Reply

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
View Factor on S2S radiation model Kristofer. FLUENT 1 May 31, 2013 08:10
S2S radiation - view factor file error Tolis FLUENT 1 May 12, 2009 06:17
Axisymmetric View Factor in FIDAP romz FLUENT 0 May 8, 2006 03:57
Fluent - View Factor for s2s radiation Markus FLUENT 1 October 16, 2005 01:33
VIEW FACTOR CALCULATIONS Cedric CD-adapco 2 August 22, 2005 11:22


All times are GMT -4. The time now is 16:43.