udf代码——精选推荐

更新时间:2023-06-09 20:26:05 阅读: 评论:0

udf代码
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 ur.
Resolution:
A plane (or line in 2-D) should be defined by the ur and then the UDF hooked through the Report -> Discrete Pha -> Sample panel in the GUI. The UDF will work for 2-D and 3-D cas, and the ur 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 uful if the spray downstream of the sample plane is not of interest and need not be tracked.
/****************************************************************************** ******************/
/* Discrete_pha_sample.c */
/* */
/* Sample discrete pha size and velocity distributions within the domain. */
/* */
/* This UDF will sample the size and velocity of discrete pha particles at */
/* lected 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 ca, particles will be */
研究生信息平台
/
* deleted following the time step in which they cross the plane. */
/* This is uful when sampling a spray immediately in front of an injector and */
手机nfc功能怎么打开
/* you don't wish to track then further downstream. */
/* */
/* The UDF can be hooked through the Sample Trajectories panel in the GUI */
/* (Report > > Sample). */
/* */
/* NOTE: This UDF works with unsteady simulations and steady simulations that */
/* include droplet break-up or collisions (the discrete pha 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_pha_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);
el
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);
#el
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_pha_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);
el
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);
#el
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 */
#el
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);
#el
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
}

本文发布于:2023-06-09 20:26:05,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/914017.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:研究生   打开   髋关节   妈妈
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图