slip velocity of particle in dpm model
Client is interested to compute the slip velocity of the particles in dpm model. Say for example in any internal surface (through which particles are passing) client wants to find the value of (V_p - V_c), where V_p is the particle velocity and V_c is the continius phase velocity for the particle containing cell. Following udf can be used. In this udf, the magnitude of the slip velocity (Vc- Vp) is assigned to a dpm scalar. The DEFINE_DPM_OUTPUT is used (through report/discrete-phase/sample gui panel) to print the value of the slip velocity of particle when it encounters any given plane or any boundary zones (it does not work for any iso-surface). ------------------------------------------------------------------------------------- #include "udf.h" DEFINE_DPM_SCALAR_UPDATE(slip, c, t, initialize, p) { real x_sl,y_sl,z_sl,mag_sl; x_sl=C_U(c,t)-P_VEL(p)[0]; y_sl=C_V(c,t)-P_VEL(p)[1]; mag_sl=sqrt(pow(x_sl,2)+pow(y_sl,2)); #if RP_3D z_sl=C_W(c,t)-P_VEL(p)[2]; mag_sl=sqrt(pow(x_sl,2)+pow(y_sl,2)+pow(z_sl,2)); #endif p->user[0]=mag_sl; } DEFINE_DPM_OUTPUT(slip_vel, header, fp, p, thread, plane) { char name[100]; if (header) { if (NNULLP(thread)) fprintf(fp,"(%s %d)n",thread->head->dpm_summary.sort_file_name,11); else fprintf(fp,"(%s %d)n",plane->sort_file_name,11); fprintf(fp,"(%10s %10s %10s %10s %10s %10s %10s" " %12s %12s %12s %15st %s)n", "X","Y","Z","U","V","W","diameter","T","mass-flow", "time","slip_vel","name"); } else { sprintf(name,"%s:%d",p->injection->name,p->part_id); fprintf(fp, "((%10.6g %10.6g %10.6g %10.6g %10.6g %10.6g " "%10.6g %12.6g %12.6g %12.6g %15.6g) %s)n", p->state.pos[0], p->state.pos[1], p->state.pos[2], p->state.V[0], p->state.V[1], p->state.V[2], p->state.diam, p->state.temp, p->flow_rate, p->state.time, p->user[0], name); } |
||
![]()
|