找回密码
 注册
查看: 3822|回复: 7

udf编译出错

[复制链接]
发表于 2010-10-28 15:33:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
#include "udf.h"
#include "dpm.h"
#include "surf.h"

DEFINE_DPM_SPRAY_COLLIDE(man_spray_collide,tp,p)
{
  /* non-physical collision UDF that relaxes the particle */
  /* velocity and diameter in a cell to the mean over the */
  /* specified time scale t_relax */

  const real t_relax = 0.001; /* seconds */

  /* get the cell and Thread that the particle is currently in */
  cell_t c  = RP_CELL(&(tp->cCell));
  Thread *t = RP_THREAD(&(tp->cCell));

  /* Particle index for looping over all particles in the cell */
  Particle *pi;

  /* loop over all particles in the cell to find their mass */
  /* weighted mean velocity and diameter */
  int i;
  real u_mean[3]={0.}, mass_mean=0.;
  real d_orig = tp->state.diam;
  real decay = 1. - exp(-t_relax);
  begin_particle_cell_loop(pi,c,t)
    {
      mass_mean += pi->state.mass;
      for(i=0;i<3;i++)
        u_mean += pi->state.V*pi->state.mass;
    }
  end_particle_cell_loop(pi,c,t)

  /* relax particle velocity to the mean and diameter to the */
  /* initial diameter over the relaxation time scale t_relax */
  if( mass_mean > 0. )
    {
      for(i=0;i<3;i++)
        u_mean /= mass_mean;
      for(i=0;i<3;i++)
        tp->state.V += decay*( u_mean - tp->state.V );
      tp->state.diam += decay*( P_INIT_DIAM(tp) - tp->state.diam );
      /* adjust the number in the droplet parcel to conserve mass */
      tp->number_in_parcel *= CUB( d_orig/tp->state.diam );
    }
}
 楼主| 发表于 2010-10-28 15:33:59 | 显示全部楼层

回复 1# 骨头男 的帖子

udf编译时候出现系统找不到指定文件,是怎么回事?cas文件跟c文件在一个目录里面
发表于 2010-11-4 12:57:38 | 显示全部楼层
楼主你的问题解决了么,我也有一样的问题啊。。
发表于 2010-11-4 13:34:53 | 显示全部楼层

回复 2# 骨头男 的帖子

可能是VC++没装好,重新装一遍,设置好环境变量。
发表于 2010-11-4 14:59:12 | 显示全部楼层

回复 4# 浪子轻狂 的帖子

请问,环境变量不是安装的时候自动生成么?怎么自己设置啊?
发表于 2010-11-4 15:06:25 | 显示全部楼层
右键,我的电脑,高级,环境变量,里面可以设置环境变量。

不知道你所说的自动生成是什么意思?我装的是VC++6.0,安装的时候勾选环境变量就行
发表于 2010-12-6 15:56:15 | 显示全部楼层

回复 2# 骨头男 的帖子

楼主解决了吗,额也是这样怎么回事
发表于 2013-5-20 13:22:26 | 显示全部楼层
楼主,我是新手,想问一下
Particle *p;
Tracked_Particle *p;这两个到底有什么区别?
谢谢啦。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表