Problem:
Currently, there is no simple way of determining important spray statistics such as mass flux, size distributions, characteristic sizes (e.g., Sauter Mean Diameter), or size/velocity correlations. The UDF below will write to a file the flow time, position, velocity, particle size, and number of particles in each parcel crossing a plane defined by the user.
Resolution:
A plane (or line in 2-D) should be defined by the user and then the UDF hooked through the Report -> Discrete Phase -> Sample panel in the GUI. The UDF will work for 2-D and 3-D cases, and the user has the option to delete the droplets from the domain at the completion of the time step in which they cross the sample plane. This can be useful if the spray downstream of the sample plane is not of interest and need not be tracked.
/************************************************************************************************/
/* Discrete_phase_sample.c */
/* */
/* Sample discrete phase size and velocity distributions within the domain. */
/* */
/* This UDF will sample the size and velocity of discrete phase particles at */
/* selected planes downstream of the injection. For 2D axisymmetric */
/* simulations it is assumed that droplets/particles are being */
/* sampled at planes (lines) corresponding to constant x. For 3D simulations */
/* the sampling planes correspond to constant z. */
/* */
/* To remove particles from the domain after they have been sampled, change */
/* the value of REMOVE_PARCELS to TRUE. In this case, particles will be */
/* deleted following the time step in which they cross the plane. */
/* This is useful when sampling a spray immediately in front of an injector and */
/* you don't wish to track then further downstream. */
/* */
/* The UDF can be hooked through the Sample Trajectories panel in the GUI */
/* (Report > DiscretePhase... > Sample). */
/* */
/* NOTE: This UDF works with unsteady simulations and steady simulations that */
/* include droplet break-up or collisions (the discrete phase must be tracked */
/* in an unsteady manner). */
/* */
/* NOTE: Updated July 2006 for Fluent 6.3 */
/* */
/************************************************************************************************/
USE THIS VERSION FOR FLUENT 6.2:
#include "udf.h"
#define REMOVE_PARTICLES FALSE
DEFINE_DPM_OUTPUT(Discrete_phase_sample,header,fp,p,t,plane)
{
#if RP_2D
real flow_time = solver_par.flow_time;
real y;
if(header)
cxprintf(fp," #Time[s] R [m] X-velocity[m/s] W-velocity[m/s] R-velocity[m/s] Drop Diameter[m] Number of Drops Temperature [K] Initial Diam [m] Injection Time [s] \n");
if(NULLP(p))
return;
if (rp_axi && (sg_swirl || rp_ke))
y = MAX(sqrt(SQR(p->state.pos[1]) + SQR(p->state.pos[2])),DPM_SMALL);
else
y = p->state.pos[1];
cxprintf(fp," %e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), y,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel, P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#else
real flow_time = solver_par.flow_time;
real r, x, y;
if(header)
cxprintf(fp," #Time[s] R [m] x-velocity[m/s] y-velocity[m/s] z-velocity[m/s] Drop Diameter[m] Number of Drops Temperature [K] Initial Diam [m] Injection Time [s] \n");
if(NULLP(p))
return;
x = p->state.pos[0];
y = p->state.pos[1];
r = sqrt(SQR(x) + SQR(y));
cxprintf(fp," %e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), r,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel,P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#endif
#if REMOVE_PARCELS
p->stream_index=-1;
#endif
}
USE THIS VERSION FOR FLUENT 6.3:
#include "udf.h"
#define REMOVE_PARTICLES FALSE
DEFINE_DPM_OUTPUT(Discrete_phase_sample,header,fp,p,t,plane)
{
#if RP_2D
real flow_time = solver_par.flow_time;
real y;
if(header)
par_fprintf_head(fp," #Time[s] R [m] X-velocity[m/s] W-velocity[m/s] R-velocity[m/s] Drop Diameter[m] Number of Drops Temperature [K] Initial Diam [m] Injection Time [s] \n");
if(NULLP(p))
return;
if (rp_axi && (sg_swirl || rp_ke))
y = MAX(sqrt(SQR(p->state.pos[1]) + SQR(p->state.pos[2])),DPM_SMALL);
else
y = p->state.pos[1];
#if PARALLEL
par_fprintf(fp,"%d %d %e %f %f %f %f %e %e %f %e %f \n",
p->injection->try_id, p->part_id, P_TIME(p), y,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel, P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#else
par_fprintf(fp,"%e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), y,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel, P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#endif /* PARALLEL */
#else
real flow_time = solver_par.flow_time;
real r, x, y;
if(header)
par_fprintf_head(fp," #Time[s] R [m] x-velocity[m/s] y-velocity[m/s] z-velocity[m/s] Drop Diameter[m] Number of Drops Temperature [K] Initial Diam [m] Injection Time [s] \n");
if(NULLP(p))
return;
x = p->state.pos[0];
y = p->state.pos[1];
r = sqrt(SQR(x) + SQR(y));
#if PARALLEL
par_fprintf(fp,"%d %d %e %f %f %f %f %e %e %f %e %f \n",
p->injection->try_id, p->part_id, P_TIME(p), r,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel,P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#else
par_fprintf(fp,"%e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), r,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel,P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#endif /* PARALLEL */
#endif
#if REMOVE_PARCELS
p->stream_index=-1;
#endif
}
udf_dpm_tongji.rar_DPM自定义_fluent udf多相流_tongji dpm_udf_dpm_tongj
版权申诉
5星 · 超过95%的资源 49 浏览量
2022-07-14
02:14:13
上传
评论 1
收藏 2KB RAR 举报
我虽横行却不霸道
- 粉丝: 72
- 资源: 1万+
最新资源
- MyBatis 动态 SQL:灵活而强大的查询构建器.pdf
- com.accordion.prettyo.apk
- 毕业设计:基于SSM的mysql-ssm软件bug管理系统(源码 + 数据库 + 说明文档)
- MTSQL8.0.35windows(64bit)-mysql-installer-community-8.0.35.0
- 人工智能引领音乐创作新时代之Suno AI
- Public-bicycle-usage-forecast-master.zip
- 通道处理过程模拟:从理论到实践.pdf
- 数据库第七次作业E-R图第一题
- 大厂面试真题Java语法基础面试专题及答案
- IMG20240428211124.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论2