|
[Sponsors] |
March 5, 2018, 04:11 |
calculate temperature gradient
|
#1 |
Member
Join Date: Nov 2017
Posts: 54
Rep Power: 9 |
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? |
|
March 5, 2018, 07:18 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Please see my answer to your other post, and please try not to double-post.
|
|
|
|
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 18:00 |
CFX, temperature gradient inside particles | hmdl | CFX | 3 | January 30, 2016 05:40 |
Temperature gradient in FLUENT | abhi084 | FLUENT | 0 | December 4, 2015 06:27 |
Temperature Gradient at Wall | sven | OpenFOAM | 7 | November 1, 2010 18:25 |
how to calculate the temperature gradient of wall | houbaolin | FLUENT | 0 | July 28, 2008 03:51 |