|
[Sponsors] |
DPM Steady Local Collection Efficiency and Concentration Cells Error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 8, 2015, 13:06 |
DPM Steady Local Collection Efficiency and Concentration Cells Error
|
#1 |
New Member
Join Date: Apr 2015
Posts: 28
Rep Power: 11 |
Hello everyone !
I want to compute the local collection efficiency of constant diameter raindrop on a sphere using this formula : beta = Concentration_wall/Concentration_injection * NormalVelocity_wall/Velocity_injection At the origin I wanted to use the ratio of DPM Concentration but the results I got are wrong at the wall (for most of the impacted cells, the concentration is 0), this is my UDF function : #include "udf.h" #include "dpm.h" #include "surf.h" #include "random.h" #include "sg_mem.h" #include "para.h" real beta[100] ; real C[100] ; real C_0[100] ; real x[100]; real y[100]; real Vn[100]; real V0[100]; real x0[100] ; real y0[100] ; int i = 0 ; DEFINE_DPM_BC(dpm_report,p,t,f,f_normal,dim) { Domain *domain; //Domain is declared as a variable domain = Get_Domain(1); //Returns fluid domain pointer /*================================================= ================================================== ====================*/ /*BEGINNING OF Wall Concentration Computation for particle p trapped in the wall*/ CX_Cell_Id cwx_cell; double pwc[2], A[2], center[2]; cell_t cw; Thread *tw; pwc[0] = P_POS(p)[0]; pwc[1] = P_POS(p)[1]; x[i] = pwc[0]; y[i] = pwc[1]; DPM_Init_Oct_Tree_Search(); cwx_cell.ct.c = 0; cwx_cell.ct.t = NULL; DPM_Locate_Point(pwc,&cwx_cell,0.0,0); cw = RP_CELL(&cwx_cell); tw = RP_THREAD(&cwx_cell); DPM_End_Oct_Tree_Search(); C[i] = C_DPMS_CONCENTRATION(cw,tw) ; /* concentration particle at impact*/ /*END OF COMPUTATION OF Wall CONCENTRATION*/ /*================================================= ================================================== =====================*/ /*================================================= ================================================== ====================*/ /*BEGINNING OF Initial Concentration Computation for particle p trapped in the wall*/ CX_Cell_Id cx_cell; double pt[2], B[2], centerb[2]; Thread *ft; face_t f11; cell_t c1; Thread *t1; pt[0] = P_INIT_POS(p)[0] ; pt[1] = P_INIT_POS(p)[1] ; x0[i] = pt[0] ; y0[i] = pt[1] ; DPM_Init_Oct_Tree_Search(); cx_cell.ct.c = 0; cx_cell.ct.t = NULL; DPM_Locate_Point(pt,&cx_cell,0.0,0); c1 = RP_CELL(&cx_cell); t1 = RP_THREAD(&cx_cell); DPM_End_Oct_Tree_Search(); C_0[i] = C_DPMS_CONCENTRATION(c1,t1) ; /* concentration at the injection cell of particle p*/ /*END OF COMPUTATION OF INITIAL CONCENTRATION*/ /*================================================= ================================================== ====================*/ V0[i] = P_INIT_VEL(p)[0] ; Vn[i] = NV_DOT(P_VEL(p), f_normal)/NV_MAG(f_normal) ; beta[i] = C[i]/C_0[i] * Vn[i]/V0[i] ; i=i+1 ; return x,y,C,C_0,beta,V0,Vn,PATH_ABORT; } DEFINE_ON_DEMAND(beta_profile) { FILE *f1; f1 = fopen("1dpm_report_beta_2e_05mm_v_5m_s.txt", "a"); fprintf(f1," Stream Index, X position, Y position, Initial Concentration, Concentration at Wall, Beta, V0, Vn, x0, y0\n"); for (i = 1 ; i <= 100 ; i++) { fprintf(f1, "%d %f %f %f %f %f %f %f %f %f\n", i-1 , C_0[i-1] , C[i-1] , beta[i-1] , V0[i-1] , Vn[i-1], x0[i-1], y0[i-1] ); } fclose(f1); } |
|
|
|