|
[Sponsors] |
May 11, 2019, 22:20 |
Reflect Condition dpm
|
#1 |
New Member
Join Date: Apr 2019
Posts: 5
Rep Power: 7 |
Hello to everyone. I am studying the reflect condition for inert particles, I use the code that appears in the udf fluent manual
Code:
DEFINE_DPM_BC(bc_reflect,p,t,f,f_normal,dim) { real alpha; /* angle of particle path with face normal */ real vn=0.; real nor_coeff = 1.; real tan_coeff = 0.3; real normal[3]; int i, idim = dim; real NV_VEC(x); #if RP_2D /* dim is always 2 in 2D compilation. Need special treatment for 2d axisymmetric and swirl flows */ if (rp_axi_swirl) { real R = sqrt(p->state.pos[1]*p->state.pos[1] + p->state.pos[2]*p->state.pos[2]); if (R > 1.e-20) { idim = 3; normal[0] = f_normal[0]; normal[1] = (f_normal[1]*p->state.pos[1])/R; normal[2] = (f_normal[1]*p->state.pos[2])/R; } else { for (i=0; i<idim; i++) normal[i] = f_normal[i]; } } else #endif for (i=0; i<idim; i++) normal[i] = f_normal[i]; if(p->type==DPM_TYPE_INERT) { alpha = M_PI/2. - acos(MAX(-1.,MIN(1.,NV_DOT(normal,p->state.V)/ MAX(NV_MAG(p->state.V),DPM_SMALL)))); if ((NNULLP(t)) && (THREAD_TYPE(t) == THREAD_F_WALL)) F_CENTROID(x,f,t); /* calculate the normal component, rescale its magnitude by the coefficient of restitution and subtract the change */ /* Compute normal velocity. */ for(i=0; i<idim; i++) vn += p->state.V[i]*normal[i]; /* Subtract off normal velocity. */ for(i=0; i<idim; i++) p->state.V[i] -= vn*normal[i]; /* Apply tangential coefficient of restitution. */ for(i=0; i<idim; i++) p->state.V[i] *= tan_coeff; /* Add reflected normal velocity. */ for(i=0; i<idim; i++) p->state.V[i] -= nor_coeff*vn*normal[i]; /* Store new velocity in state0 of particle */ for(i=0; i<idim; i++) p->state0.V[i] = p->state.V[i]; return PATH_ACTIVE; } return PATH_ABORT; } |
|
Tags |
condition, dpm, reflect, udf reflect |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Force DPM boundary conditions on a sliding interface zone? | juliahartig | FLUENT | 0 | May 31, 2018 18:43 |
Symmetry boundary condition + DPM | sfn | Fluent Multiphase | 1 | May 31, 2018 18:16 |
updating boundary condition after one iteration and permanently | babakflame | OpenFOAM Programming & Development | 2 | June 22, 2017 23:15 |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 07:16 |
CFX fails to calculate a diffuser pipe flow | shenying0710 | CFX | 7 | March 26, 2013 05:13 |