|
[Sponsors] |
UDF for heat transfer coefficient in porous media |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 25, 2014, 07:41 |
UDF for heat transfer coefficient in porous media
|
#1 |
Disabled
Join Date: Nov 2013
Posts: 16
Rep Power: 12 |
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; } Last edited by anon_m; July 29, 2014 at 13:01. |
|
July 29, 2014, 10:32 |
|
#2 |
Disabled
Join Date: Nov 2013
Posts: 16
Rep Power: 12 |
Looking forward to your suggestions. Thanks
|
|
|
|
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 |