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

calculate temperature gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2018, 03:11
Default calculate temperature gradient
  #1
Member
 
Join Date: Nov 2017
Posts: 54
Rep Power: 8
Saman95 is on a distinguished road
hello
I want to calculate heat flux along a surface, I write a udf code:
DEFINE_EXECUTE_AT_END(Direct)
{
int i,ID,zone[7] = { 10,9,8,7,6,5,4 };
float T_i=300.0,T_f=500.0;
float ds, A_by_es, flux,DTX=0.0,DTY=0.0;
float H_flux[7], A[ND_ND], es[ND_ND], dr0[ND_ND];
face_t f;
cell_t c0,c;
Thread *t0, *t;
Domain *d = Get_Domain(1);
FILE *fp;
fp = fopen("Data.txt", "w");
for (i = 0;i < 7;i++){
flux = 0.0;
ID = zone[i];
t = Lookup_Thread(d, ID);

begin_f_loop(f, t)
{
BOUNDARY_FACE_GEOMETRY(f, t, A, ds, es, A_by_es, dr0);
c0 = F_C0(f, t);
t0 = THREAD_T0(t);
C_T_RG(c0, t0);
DTX += C_T_RG(c0, t0)[0];
DTY+= C_T_RG(c0, t0)[1];
flux += fabs(C_T_RG(c0, t0)[0] * es[0]) + fabs(C_T_RG(c0, t0)[1] * es[1]);
}
end_f_loop(f, t)

but the answer is not like the Area weighted average in ansys fluent

can you tell me how to calculate?
Saman95 is offline   Reply With Quote

Old   March 5, 2018, 06:18
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Please see my answer to your other post, and please try not to double-post.
obscureed 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
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 17:00
CFX, temperature gradient inside particles hmdl CFX 3 January 30, 2016 04:40
Temperature gradient in FLUENT abhi084 FLUENT 0 December 4, 2015 05:27
Temperature Gradient at Wall sven OpenFOAM 7 November 1, 2010 17:25
how to calculate the temperature gradient of wall houbaolin FLUENT 0 July 28, 2008 02:51


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